Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Vita] Pokemon LeafGreen not saving (intermittent) #340

Closed
fqborges opened this issue Aug 12, 2016 · 7 comments
Closed

[Vita] Pokemon LeafGreen not saving (intermittent) #340

fqborges opened this issue Aug 12, 2016 · 7 comments
Labels
severity:bug Severe issues affecting multiple games
Milestone

Comments

@fqborges
Copy link

Symptoms:

  • Played a while, saved and quit mgba, game is saved.
  • Played a while, saved and quit mgba, game is not saved.
  • Played a while, saved and quit game (not mgba) to check, game is saved.
  • Played a while, saved multiple times and quit game. Checked again, and game is not saved.

Version: yesterday nightly build (2016-08-11).

Hint: I cannot test this now, but maybe opening configs ( /_\ button) makes difference.

@endrift endrift added severity:bug Severe issues affecting multiple games system:Vita Affects running on the Vita labels Aug 12, 2016
@endrift endrift added this to the 0.5.0 milestone Aug 12, 2016
@endrift
Copy link
Member

endrift commented Aug 14, 2016

Can you let me know if this build fixes the issue? http://endrift.com/files/mgba-savesync.vpk

@fqborges
Copy link
Author

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!

@endrift
Copy link
Member

endrift commented Aug 15, 2016

How did you leave the emulator? Did you exit the game and go down through the menu, or did you tear off the livearea page?

@fqborges
Copy link
Author

I did tear off the livearea page.

@endrift
Copy link
Member

endrift commented Sep 15, 2016

This may be fixed in the upcoming nightly. I've had trouble reproducing the issue properly, so let me know.

@endrift endrift modified the milestones: 0.6.0, 0.5.0 Sep 18, 2016
@endrift
Copy link
Member

endrift commented Sep 18, 2016

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.

@endrift endrift removed the system:Vita Affects running on the Vita label Sep 18, 2016
@endrift
Copy link
Member

endrift commented Jan 24, 2017

This was partially fixed with some savestate tweaks in 0.5.0, but the remainder is covered by #441.

@endrift endrift closed this as completed Jan 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity:bug Severe issues affecting multiple games
Projects
None yet
Development

No branches or pull requests

2 participants