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

3ds savestates #851

Closed
Remobit opened this Issue Aug 8, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@Remobit

Remobit commented Aug 8, 2017

(mGBA-build-2017-08-06-3ds-4786, tested only with gbc games, as I'm away from a New 3DS currently)
Loading a savestate causes tha save file (.sav) to be overwritten by the save file present during creation of the savestate.
+a small request if it's not too much trouble. Could we get the rtc running off a separate file? Loading a savestate sets the clock back to when it was taken (again, tested only with gbc games).

@endrift

This comment has been minimized.

Show comment
Hide comment
@endrift

endrift Aug 8, 2017

Member

The former isn't fixable for very specific reasons:

Some GB/C games use the save RAM as an additional work RAM buffer since it can be fairly sizable compared to the built-in RAM on the Game Boy. As a result, not bundling or loading with a savestate leads to bugs like #834.

My solution is to only write the reloaded save data back to the file if it gets written to again. This solves issues wherein games DON'T use them as a work buffer, but leads to the side effect where games that do do it will get the save file written back to disk after loading a savestate and playing the game more.

Moreover, not writing back anything after loading a savestate would break saving after loading a savestate entirely. There is unfortunately no middle ground that will work in all cases without overwriting savedata (unless you build a gigantic database of regions used as work buffers in various games, but that is a humongous amount of effort) so I settled with one that works all of the time but overwrites savedata in a minority of cases. I can try to make it possible to override this per game but it will be very difficult, so it's not a priority right now.

As for the RTC issue that sounds like an actual bug. I'll look into it hopefully soon.

Member

endrift commented Aug 8, 2017

The former isn't fixable for very specific reasons:

Some GB/C games use the save RAM as an additional work RAM buffer since it can be fairly sizable compared to the built-in RAM on the Game Boy. As a result, not bundling or loading with a savestate leads to bugs like #834.

My solution is to only write the reloaded save data back to the file if it gets written to again. This solves issues wherein games DON'T use them as a work buffer, but leads to the side effect where games that do do it will get the save file written back to disk after loading a savestate and playing the game more.

Moreover, not writing back anything after loading a savestate would break saving after loading a savestate entirely. There is unfortunately no middle ground that will work in all cases without overwriting savedata (unless you build a gigantic database of regions used as work buffers in various games, but that is a humongous amount of effort) so I settled with one that works all of the time but overwrites savedata in a minority of cases. I can try to make it possible to override this per game but it will be very difficult, so it's not a priority right now.

As for the RTC issue that sounds like an actual bug. I'll look into it hopefully soon.

@Remobit

This comment has been minimized.

Show comment
Hide comment
@Remobit

Remobit Aug 8, 2017

Sure, I just assumed it was a bug so reported it. It will be no problem to get used to this system, cheers.

Remobit commented Aug 8, 2017

Sure, I just assumed it was a bug so reported it. It will be no problem to get used to this system, cheers.

@Remobit Remobit closed this Aug 8, 2017

@endrift

This comment has been minimized.

Show comment
Hide comment
@endrift

endrift Aug 12, 2017

Member

PS, RTC issue has now been fixed too

Member

endrift commented Aug 12, 2017

PS, RTC issue has now been fixed too

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