4 ms·
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 r
by TillE 2y ago
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.
- saagarjha 2y agoDepends on whether the bug breaks games or not.
- jonhohle 2y agoFPGA 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.
- crote 2y agoThe 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!
- gamepsys 2y ago> 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.
- trealira 2y agoHigan 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/ https://higan.readthedocs.io/en/v104b/faq/
- redox99 2y agoIdk 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.
- rawbot 2y ago> 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 https://www.youtube.com/watch?v=xwls5SpNn1s&t=427s
- xcv123 2y agoYou would probably need a terahertz CPU for cycle-accurate PS2 emulation. 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 if the processors are running asynchronously.
- fobes 2y agoThe 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.
- fobes 2y agoFixing 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.
- b3orn 2y agoWhy 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.
- fragmede 2y agoFor 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.
- b3orn 2y agoIn that case I'm sure current FPGAs are already capable of emulating the MIPS CPU of a PS2.
- aeyes 2y agoThe 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.
- Agingcoder 2y agoI 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!
- crote 2y agoBecause 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.
- 7thpower 2y ago