jsgroth / jgenesis

Sega Genesis / Sega CD / SNES / Master System / Game Gear emulator
MIT License
91 stars 4 forks source link

32X #92

Closed jsgroth closed 5 months ago

jsgroth commented 5 months ago

Adds support for the Sega 32X.

There's not much to the 32X hardware-wise:

Every released 32X game should be playable except for the 6 FMV games that require the Sega CD + 32X combo. Doom 32X Resurrection is also playable, though the features that require Sega CD don't currently work.

Performance is frankly rather poor - full-speed 32X emulation requires a CPU with good single-core performance. There is definitely room for improvement since the SH-2s are currently emulated using a pure interpreter implementation, which is not great given that each one of them individually runs an order of magnitude faster than the 68000 after taking cycles-per-instruction into account.

Timing is semi-accurate. SH-2 memory access timings are emulated (BC Racers runs way too fast without emulating them), but bus contention stalls are not emulated and neither are 68000 memory access timings. SH-2 instruction execution is batched instead of running them in lockstep because lockstep execution would make performance even worse.

Dishonorable mentions to WWF Raw and Brutal Unleashed: Above the Claw for being the trickiest games to get working correctly. WWF Raw depends on emulating SH-2 CPU cache because it writes to cartridge ROM addresses and expects to be able to read back the written values from CPU cache. Brutal Unleashed has some very sloppy code for communicating between the two SH-2s that can cause the game to freeze if 32X communication port accesses are not closely synchronized.