After completing every zone with all emeralds, I went on to play The Final Fight stage. Unfortunately I falied and got a Game Over. I tried to play the stage again, but all I got was the Try Again screen (hence I collected every emerald in the game). I had the possibility to play again this stage after I softreset the game. Can anyone tell me what's going on?
If anyone wants to try out this bug then here's the password with all emeralds and Final Fight unlocked: D L B 4 X H : 8 N V /
FIXED!
OK, I've figured out the problem - the Game Over animation code uses a lot of memory, and so it trashes a load of in-game variables, which didn't used to be a problem as they were re-initialized on Game Over. But now it doesn't restart but keeps your progress, so they aren't reinitialized, meaning they are in whatever state the Game Over animation code left them in - not good.
I'll just go figure out a fix now, but thanks!
I entered the password, got a game over, and replicated this bug with no issue. I proceeded to explore the other effects of this bug by going into Diamond Dust 1, and found that I couldn't transform into Super Sonic either. Seems like the game just clears out the emeralds you have when you game over, and map collectibles are stored separately? I will test the special stages next, but my emulator crashed when I was typing this.
EDIT: Special stages just give you an extra life as usual. When exiting back into the level, you still can't transform into Super Sonic. Going back to Final Fight still gives you the Try Again screen after completing a different level.
Hypothesis/Conjecture (As in, this is my guess and can very well be wrong.): The emerald list and the map emeralds are two separate things. The latter gets saved in the password, and is accessed/modified by the special stages. The former is purely in RAM and is the old way of tracking the emeralds, but is used by Final Fight and Super Sonic for checking what you have. To me, it seems that the map emeralds update the emerald list when loading a game and obtaining an emerald from a special stage. Otherwise, it does not update. The solution would be to remove the part of the game over script that clears the emerald list, or add more conditions where the map emeralds update the emerald list.