mgba-emu / mgba

mGBA Game Boy Advance Emulator
https://mgba.io/
Mozilla Public License 2.0
5.72k stars 790 forks source link

Interrupt loop in Star Ocean Blue Sphere #1988

Open animaone opened 3 years ago

animaone commented 3 years ago

I think this may be emulator-specific, since I tested this in other emulators and this bug doesn't happens

It is an infinite loop happening specifically in the GBC Star Ocean Blue Sphere ROM The rom md5sum is 820e0a19275fabc03fe619c42db47179

the loop at offset 00003b25 is the following:

loop:
        halt
        nop
        cp (hl)
        jr z,loop

If you jump around the game menu, opening various sub-menus, eventually this loop will lock in an infinite loop, and the game will appear to be frozen

I have attached a save state triggering this bug exactly where it is happening: rom.ss1.zip

The emulator versions tested where 0.7-1 and 0.8.4, but I think it may be related to all versions, and may have something to do with game-specific bug-compatible issues

This bug happens in a lot of locations related to interrupt handling/waiting, for example, in 00:0282 also. It is an intermittent/random bug

other example: at location 00:0282

loop:
    halt 
    nop 
    cp [hl]
    jr z, loop

the savestate: rom.ss2.zip

animaone commented 3 years ago

This bug may be related to the debugger handling of interrupts being different?