News for hackers. Stuff that matters.
Re:Detecting a PS2 Emulator: When 1*X does not equal X by TillE on Saturday June 08, 2024 @01:24PM (#40619000)
Interesting example of the kind of thing it's probably not worth caring about in software emulation. Emulating the bug would be considerably slower.

Some day replicating the PS2 on an FPGA will be feasible, and then figuring out how this worked will be a fun project for someone.

Re:Detecting a PS2 Emulator: When 1*X does not equal X by fobes on Saturday June 08, 2024 @03:43PM (#40619782)
Fixing this bug would be part of fixing a bunch of other floating point bugs, more specifically rounding and clamping.

Yes, software floating point would be slower, but the general solution would probably follow the PS4s PS2 emulator. Where each game can have whitelisted sections of code for the software floating point path.

Re:Detecting a PS2 Emulator: When 1*X does not equal X by b3orn on Saturday June 08, 2024 @04:02PM (#40619876)
Why would you want to emulate an old crappy MIPS CPU using a relatively expensive FPGA? The whole idea of emulating old consoles is to be independent of the hardware so you can play your old games on your computer or phone.
Re:Detecting a PS2 Emulator: When 1*X does not equal X by fragmede on Saturday June 08, 2024 @04:45PM (#40620079)
For you, maybe. For others, having thing that does what this other thing did, with no regard to cost, is a fun adventure, in and of itself.
Re:Detecting a PS2 Emulator: When 1*X does not equal X by Agingcoder on Saturday June 08, 2024 @05:30PM (#40620295)
I second that. I wrote a nes emulator twenty years ago because it was fun, and not for any practical purpose. I had no idea what I was doing, but I remember being in awe of the nes after reading the detailed hw spec ( found on zophars domain, doc by yoshi if memory serves me well ). I promptly decided to write an emulator in whatever language I was learning at that time.

The result was terrible, but I had tremendous fun!

Re:Detecting a PS2 Emulator: When 1*X does not equal X by b3orn on Saturday June 08, 2024 @05:20PM (#40620244)
In that case I'm sure current FPGAs are already capable of emulating the MIPS CPU of a PS2.
Re:Detecting a PS2 Emulator: When 1*X does not equal X by aeyes on Saturday June 08, 2024 @05:43PM (#40620366)
The CPU yes but you want to emulate every piece of hardware in the console. The audio chips, the GPU, they way video memory works and so on.
Re:Detecting a PS2 Emulator: When 1*X does not equal X by crote on Saturday June 08, 2024 @05:22PM (#40620253)
Because the implementation on your computer or phone behaves slightly differently from actual hardware, sometimes to the point of being unplayable. If you can't get your hands on a genuine working console, cycle-accurate FPGA implementation is the next best thing.
Re:Detecting a PS2 Emulator: When 1*X does not equal X by 7thpower on Saturday June 08, 2024 @05:40PM (#40620352)
Often the games I’m excited to play run like shit and have timing issues that are difficult to measure but feel wrong and diminish the nostalgia.

Free time is scarce, so I’ll gladly pay a couple hundred to not have to spend time fiddling with settings only to ultimately capitulate.

Re:Detecting a PS2 Emulator: When 1*X does not equal X by saagarjha on Saturday June 08, 2024 @01:28PM (#40619022)
Depends on whether the bug breaks games or not.
Re:Detecting a PS2 Emulator: When 1*X does not equal X by jonhohle on Saturday June 08, 2024 @03:17PM (#40619626)
FPGA implementations are often implemented based on code or documentation from software emulation projects. An FPGA version of a PS2 has no guarantee of not implementing the same or similar bug.
Re:Detecting a PS2 Emulator: When 1*X does not equal X by crote on Saturday June 08, 2024 @05:17PM (#40620227)
The point here is that it is actually viable to reimplement such bugs without incurring significant performance penalties.

A software emulator has to be able to execute a single PS2 instruction in the same amount of wall time as it'd take on the original hardware. With a regular multiplication that's fairly easy: x86 also has multiplication, so you can do a 1:1 translation and be fairly certain it's within your time budget. With a bugged multiplication you need to do a regular x86 multiplication, and wrap that in a few dozen other instructions to add the buggy behaviour to it. There's a pretty decent chance it's simply too expensive!

When you're writing an FPGA emulator you are able to recreate the buggy multiplication directly in hardware. There's no additional wrapping needed, so (beyond figuring out intended behaviour) it's not any more costly than emulating a non-buggy multiplication. It's far easier to do a cycle-accurate emulation because you have direct control over the transistors!

Re:Detecting a PS2 Emulator: When 1*X does not equal X by gamepsys on Saturday June 08, 2024 @06:00PM (#40620452)
> There's a pretty decent chance it's simply too expensive!

I doubt the 24 year old, 300Mhz RISC, 32MB Ram, PS2 instruction set is too expensive to do a cycle perfect replication.

Re:Detecting a PS2 Emulator: When 1*X does not equal X by trealira on Saturday June 08, 2024 @06:09PM (#40620501)
Higan is a cycle-perfect SNES emulator, and it's very single-core CPU-intensive. This is what the FAQ [0] says:

Full-speed emulation for the Super Famicom base unit requires an Intel Core 2 Duo (or AMD equivalent), full-speed for games with the SuperFX chip requires an Intel Ivy Bridge (or equivalent), full-speed for the wireframe animations in Mega Man X2 requires an even faster computer. Low-power CPUs like ARM chips, or Intel Atom and Celeron CPUS generally aren’t fast enough to emulate the Super Famicom with higan, although other emulated consoles may work.

Work can't be split across cores (according to the FAQ) because that would compromise the accuracy of the timing.

It may be that the PS2 has similar problems while being more powerful than the SNES.

[0]: https://higan.readthedocs.io/en/v104b/faq/

Re:Detecting a PS2 Emulator: When 1*X does not equal X by redox99 on Saturday June 08, 2024 @08:20PM (#40621033)
Idk about PS2, but N64 (a generation older, much slower) still doesn't have a cycle perfect emulator that runs in real time.

Remember that you can't just perfectly emulate the CPU, you must also perfectly emulate the GPU, since they share the memory bus so one can slow the other.

Re:Detecting a PS2 Emulator: When 1*X does not equal X by rawbot on Sunday June 09, 2024 @01:27PM (#40626004)
> since they share the memory bus so one can slow the other.

You can look more into this in this video by Kaze Emanuar, famous N64 romhacker.

https://www.youtube.com/watch?v=xwls5SpNn1s&t=427s

Re:Detecting a PS2 Emulator: When 1*X does not equal X by xcv123 on Sunday June 09, 2024 @12:12AM (#40621979)
Cycle-accurate PS2 emulation means emulating the state of the CPU, GPU, other interacting processors, and their various interconnecting busses at clock cycle granularity and possibly at sub-cycle granularity where the processors are running asynchronously. For cycle-accurate PS2 emulation you probably need a terahertz CPU.
Re:Detecting a PS2 Emulator: When 1*X does not equal X by fobes on Sunday June 09, 2024 @10:38AM (#40624723)
The IOP (PS1 processor used for I/O), SPU2 (sound processor), IPU (mpeg decoding), EE (main CPU), VU0, VU1, DMA controller and finally the GS (GPU) run asynchronously. It's naive for others to think perfect cycle accuracy for this machine might be possible with any hardware that exists today. PCSX2 is lucky to have VU1 on it's own thread. It still doesn't work perfectly IIRC, VU0 -> VU1 access is a little sketchy with it enabled.
Re:Detecting a PS2 Emulator: When 1*X does not equal X by anthk on Sunday June 09, 2024 @08:34AM (#40624011)
You must be young. A PS2 can run a modernish Linux with WindowMaker and decode MP3's, maybe FLAC and Opus and some MP3+XVid/DivX videos. Not so far from a cycle accurate emulation of a low end Windows 98 era PC. A PS2 with Linux can comment on this page for instance. With TLS et all, if you use Dillo as the web browser as it uses MbedTLS. The TLS handshake might ast a few seconds but that's it.

Try running that on a cycle accurate emulator without bringing an i7 to its knees.

A similar PC would be a Pentium II-III at 450-500 MHZ with 64MB of RAM running Damn Small Linux or NetBSD with a small Window Maker setup. Bear in mind that you could run a non-accurate SNES emulation in that machine, with sound outputted at 8000 HZ and with no filters, enough for most common games such as Chrono Trigger and Super Mario World with lots of hacks fixing the imprecise timing under ZSNES.