Found a(nother) bug in both the "original" and Christian's release of Generator: soft reset not working properly.
Let me explain myself: in the original Sega Genesis, a press of the Reset button (as opposed to switching off and on) did not erase all the current game data from memory; to mention an example I remember well, in the first Sonic The Hedgehog game, if you did the level select code and then resetted the game, you would only have had to press A+Start at the title screen to redo it.
This is not the case with Generator.
A call to the Soft Reset from the Emulation menu does not have this effect; instead, it appears to work as if the console were switched off and back on. The level select code I described has to be fully redone after a reset, instead of just pressing A+Start.
I seem to remember there were later Sonic games whose level select codes required resetting the game - I don't suppose that can be done with Generator either.
Any idea of why is this happening? Is there a true "soft reset" hidden somewhere in the emulator? If not, will it ever be implemented?
gen_softreset() calls only cpu68k_reset(). This clears the complete RAM:
memset(cpu68k_ram, 0, 0x10000);
I think that's indeed wrong. A soft reset would never cause the RAM to be cleared in any
machine. Does it help if you move this line into the conditional block? The hard reset will not work probably then because the RAM won't be cleared then either.
I just see that the key handling is also wrong in one place (in my patched version),
so that Control+R always causes a hard reset whether you hold shift or not.
ui-gtk.c should read like this instead:
case SDLK_r:
if (event.key.keysym.mod & KMOD_CTRL) {
if (event.key.keysym.mod & KMOD_SHIFT)
ui_gtk_hardreset();
else
ui_gtk_softreset();
}
break;
and ui-sdl.c:
case SDLK_r:
if (event.key.keysym.mod & KMOD_CTRL) {
if (event.key.keysym.mod & KMOD_SHIFT)
ui_sdl_hardreset();
else
ui_sdl_softreset();
}
break;
I know there are also some cheats for Sonic games that require inserting the cartridges one after another to unlock levels or similar. It would be interesting to see whether these worked if the memory wasn't reset on loading a ROM either.