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

Comments

Projects
None yet
2 participants
@fqborges

fqborges commented Aug 12, 2016

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 this to the 0.5.0 milestone Aug 12, 2016

@endrift

This comment has been minimized.

Show comment
Hide comment
@endrift

endrift Aug 14, 2016

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@fqborges

fqborges Aug 15, 2016

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!

fqborges commented Aug 15, 2016

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

This comment has been minimized.

Show comment
Hide comment
@endrift

endrift Aug 15, 2016

Member

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?

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

This comment has been minimized.

Show comment
Hide comment
@fqborges

fqborges Aug 15, 2016

I did tear off the livearea page.

fqborges commented Aug 15, 2016

I did tear off the livearea page.

@endrift

This comment has been minimized.

Show comment
Hide comment
@endrift

endrift Sep 15, 2016

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@endrift

endrift Sep 18, 2016

Member

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.

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 os:Vita label Sep 18, 2016

@endrift

This comment has been minimized.

Show comment
Hide comment
@endrift

endrift Jan 24, 2017

Member

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

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 Jan 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment