Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[Vita] Pokemon LeafGreen not saving (intermittent) #340
Version: yesterday nightly build (2016-08-11).
Hint: I cannot test this now, but maybe opening configs ( /_\ button) makes difference.
Unfortunately, It didn't.
Using the provided buid I started a new game, saved, waited a few seconds and left the emulator. After restarting, the game I just saved wasn't there.
I am going to test more, and provide you more feedback. For now, this problem can be bypassed using saved states at least.
I really appreciate your work. Thanks!
I've figured out what's going on:
Pokémon games on the GBA have two savedata blocks, and it swaps off on which one it writes to. It also keeps track of how many times you've saved, and the savegame that says "we've saved the most times" is the one that's loaded next time.
So what happens if you take a savestate, save three times, load the savestate, and save once? Well the save file has two games, one with N saves and one with N+2. However, the N+2 one is older, from before reloading the savestate and saving again. So it loads the wrong one.
The way to fix this would be load back in the savedata when loading a savestate, and only flush it if a savegame is written out.