jsgroth / jgenesis

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

Turrican (USA, Europe) (Unl).md nothing but a black screen #126

Closed benderscruffy closed 1 month ago

jsgroth commented 4 months ago

This was broken by the fix for #120 where I made the unused bits in the Z80 BUSACK register all read 1 instead of 0. That breaks Turrican because it has a bug where it's testing the wrong bit in the register:

lea ($A11100), a0
move.w #0x0100, (a0)     ; set Z80 BUSREQ

loop:
  move.w (a0), d0        ; read Z80 BUSACK
  btst #9, d0            ; bugged instruction, should be `btst #8, d0`
  bne loop

I can fix this without breaking Danny Sullivan's Indy Heat by actually emulating open bus for this register instead of making the unused bits always read 1, although the open bus emulation won't be completely accurate because my 68000 core doesn't emulate instruction prefetch (which would matter for something like Amiga, but no Genesis/Mega Drive games depend on prefetch as far as I know).