Problem loading state in Sonic the Hedgehog 2 & Knuckles

Issue #139 resolved
Former user created an issue

Original [issue 139](https://code.google.com/p/genplus-gx/issues/detail?id=139) created by noddykev@hotmail.co.uk on 2010-11-15T15:13:29.000Z:

What steps will reproduce the problem? 1. Load Sonic Sonic the Hedgehog 2 2. Apply Sonic & Knuckles lock-on. 3. Save a save state then try loading it.

What is the expected output? For the save state to load the in-game saved area.

What do you see instead? Game resets back to title screen.

What version of the emulator are you using (official, SVN revision,...)? genplus-gx-1.4.0

Please provide any additional information below (Video settings, Console region,...) GameCube, Not sure if it makes any difference but I used the prototype sk2 chip Sonic & Knuckles (S2K chip) (Prototype 0618 - Jun 18, 1994, 9.07) as it's latest version I could find, I don't know how you extract it from the final retail game. I haven't tried it with a combined rom with the crc32 of 2AC1E7C6 or the 0524 prototype though.

Comments (8)

  1. Former user Account Deleted
    • changed status to open

    Comment # 1 originally posted by ekeeke31 on 2010-11-15T15:27:51.000Z:

    I will look at it, I was sure to have verified savestates with lock-on emulation but I might have forgotten something when reseting the memory mapping.

    I don't think the version of S2K chip would make any difference, if Sonic 2 & Knuckles played fine until you try to save/load a state.

    On a side note, the S2K chip is part of the Sonic & Knuckles cartridge but you can't "extract" it from the common Sonic & Knuckles ROM dump, it should have been dumped separately (there are actually two ROM chips in the cartridge).

    I am not sure what is the "combined" ROM you are talking about but if it is the manually assembled Sonic 2 & Knuckles ROM (S2+SK+S2K), make sure you disable lock-on emulation when you load it.

  2. Former user Account Deleted

    Comment # 2 originally posted by noddykev@hotmail.co.uk on 2010-11-15T15:38:35.000Z:

    S3&K lock-on save states work fine, I haven't tried the S1&K Blue Sphere lock-on though.

  3. Former user Account Deleted

    Comment # 3 originally posted by ekeeke31 on 2010-11-15T16:02:51.000Z:

    Yes, I know what is happening.

    Internal S2K chip shares some memory range ($300000-$3fffff) with the locked cartridge.

    When S&K detects Sonic 2 is locked, it enables S2K chip in this memory range (Sonic 2 is only 1MB and don't use this range usually) then start running Sonic 2 which can read extra data from that range. However, on reset, S2K chip is disabled by default (Sonic 3 for example, is 2MB and uses data in this area). This is what happen with the real cartridge and this is what the emulator is doing.

    What happen is that when I load a saved state, I always reset the hardware in its default state first, which results in disabling the S2K chip. It is never enabled again because this information is not saved in the state file and when the remaining state part is loaded, something goes wrong and the game resets.

    A solution would be not to reset this part of hardware and leave S2K chip enabled when loading a state, but you would still have issues when reloading or resetting the game manually then load the state file.

    Another solution would be to expand the savestate format to include informations about the cartridge state but it's not easy to do (this would also be useful with some games that use extra hardware, like Super Street Fighter 2, Virtua Racing and some unlicensed games with strange protection and memory banking hardware)

  4. Former user Account Deleted

    Comment # 4 originally posted by noddykev@hotmail.co.uk on 2010-11-15T23:36:11.000Z:

    This goes for the combined rom too with the lock-on option off?

  5. Former user Account Deleted

    Comment # 5 originally posted by ekeeke31 on 2010-11-16T07:39:12.000Z:

    no, this is only when lock-on emulation is enabled. the combined rom works by recreating the memory mapping artificially so every ROM "parts" are always activated

  6. Former user Account Deleted

    Comment # 6 originally posted by noddykev@hotmail.co.uk on 2010-11-16T08:51:57.000Z:

    Good :-) thanks for letting me know.

  7. Log in to comment