(SMS/GG) Graphic corruption after loading a state twice
Status: Beta
Brought to you by:
ljsebald
Loading a save state again after you've first loaded it once can corrupt the graphics in SMS/GG games. Does not appear to be an issue in the ColecoVision/SG-1000 module.
Tested with Fantasy Zone (World) (Rev 2).sms (MD5 = fed8690ee5fb895c09caa8e2b879ebd6), running a Debug build of trunk r251 in Xcode 6.4, OS X 10.10.4
Steps to reproduce:
1. Load game, Fantasy Zone (World) (Rev 2).sms
2. Load save state in slot 1 (use attached file: Fantasy Zone (World) (Rev 2).sms.1.cestate)
3. Load save state in slot 1 again
Result:
Graphics will be corrupt: http://i.imgur.com/CWSGq3P.png
Attached is the save state file where you can reproduce the problem.
Using trunk r256-
Have another test case that is slightly different to replicate but more or less the same issue, the difference being you don't have to load the state twice (at least, not from how i've experienced it):
Graphics should corrupt like this: http://i.imgur.com/NrxutGY.png
Attached the state file just in case but I think you can easily replicate this.
Fixed in r262.
Memory pages weren't correctly reorganized if the paging registers were changed by the save state, which caused this issue. I've also cleaned up a few potential issues in VDP state loading too, while I was at it.