Gamer125 / genplus-gx

Automatically exported from code.google.com/p/genplus-gx
Other
0 stars 0 forks source link

Problem loading state in Sonic the Hedgehog 2 & Knuckles #139

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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.

Original issue reported on code.google.com by noddy...@hotmail.co.uk on 15 Nov 2010 at 3:13

GoogleCodeExporter commented 8 years ago
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.

Original comment by ekeeke31@gmail.com on 15 Nov 2010 at 3:27

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

Original comment by noddy...@hotmail.co.uk on 15 Nov 2010 at 3:38

GoogleCodeExporter commented 8 years ago
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)

Original comment by ekeeke31@gmail.com on 15 Nov 2010 at 4:02

GoogleCodeExporter commented 8 years ago
This goes for the combined rom too with the lock-on option off?

Original comment by noddy...@hotmail.co.uk on 15 Nov 2010 at 11:36

GoogleCodeExporter commented 8 years ago
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

Original comment by ekeeke31@gmail.com on 16 Nov 2010 at 7:39

GoogleCodeExporter commented 8 years ago
Good :-) thanks for letting me know.

Original comment by noddy...@hotmail.co.uk on 16 Nov 2010 at 8:51

GoogleCodeExporter commented 8 years ago

Original comment by ekeeke31@gmail.com on 21 Nov 2010 at 5:38

GoogleCodeExporter commented 8 years ago

Original comment by ekeeke31@gmail.com on 4 Dec 2010 at 5:24