jsgroth / jgenesis

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

Radical Rex (USA) Sega CD crashes out during the intro #100

Open benderscruffy opened 1 week ago

jsgroth commented 1 week ago

The crash occurs because of an address error exception on the sub CPU. If I disable 68000 address error emulation then the game is playable but all sprites are missing in the intro and the main menu, exact same bug as this (which it looks like was only recently fixed in GPGX and PicoDrive): https://github.com/ekeeke/Genesis-Plus-GX/issues/290

There are a few CDD behaviors described in that thread that I don't currently emulate, but Radical Rex seemingly only depends on one of them: If a game issues a Read command to the CD drive while it's already playing/reading, it needs to read at least one more sector from the previous location before it starts seeking to the new location.

jsgroth commented 1 week ago

I changed the CDD to always read one more sector if it is playing and a command changes the state to something else, which fixes both the address error and the missing sprites: rex

While this game is booting, immediately after the drive reads the sector at 00:03:48 the game issues a Read command for 00:02:61. It depends on the drive reading the sector at 00:03:49 before it starts seeking to 00:02:61.