Emulation glitches can persist after state load / reset / power-on
Hi,
I came across a quite odd bug. There's one game that after making it crash (by manually modyfing RAM), the game glitches out after loading a savestate, resetting the game or doing a power-on. Everything returns to normal after reloading the ROM. I don't think this is normal, I'd expect loading a savestate or doing a power-on to produce a deterministic result.
Here's a short video showcasing the bug. Brief summary:
From 00:00 to 00:32 I show that the 4 test savestates all work fine when loaded before RAM modification.
At 00:35 the game crashes after manually writing value 55 to address 0xEB. Other values might work too. This RAM location stores the console region detected by the game on startup (possible values are 00 for NTSC, 01 for PAL).
From 00:46 to 01:29, I show the glitches that can happen after the crash. All 4 stavestates now exhibit some weird bugs, even though they were working a while ago.
At 01:30, I do a power-on to show that the issue still persists (game crashes at 01:42).
Then, the ROM is reloaded and everything returns to normal.
https://user-images.githubusercontent.com/7974859/127330402-9d42eef2-7fe9-48d9-9109-b932ae518f0e.mp4
The test was done on FCEUX 2.4.0 (it happens on 2.3.0 too, possibly on other versions as well). The game in question is "The Fantastic Adventures of Dizzy" (European revision) - the emulator in the video was set to NTSC mode, but it doesn't matter as far as this bug is concerned. For your convenience I have attached the relevant ROM and savestates used in the video. Just FYI, crashing the game in some places might not produce this bug - hence why I'm attaching the savestates.
I think #424 should fix this.
I'm sure this was fixed just fine...