bsnes icon indicating copy to clipboard operation
bsnes copied to clipboard

Record all in-game saves

Open Screwtapello opened this issue 4 years ago • 2 comments

For manufacturing cost reasons, most SNES games only provide a very small number of in-game save slots, which can be quite limiting for long games like RPGs. In addition, it is possible for in-game saves to be corrupted because of bugs in the original game (hello, FF6!) or lost due to the use of features like save-states.

Save-states are plentiful, they can never be corrupted by the game or lost due to other features, but they only work with a single version of a single emulator, which is effectively a different dataloss bug.

bsnes should provide a hybrid of the two, by recording all in-game saves and allowing the player to switch back to any previous save.

It might work like this:

  • when bsnes detects the game writing to SRAM (with hysteresis, like the "Auto save memory periodically" option)), it should record:
    • the new SRAM contents
    • the current date and time
    • maybe a screenshot
  • In the Tools menu, there should be a Save Manager, similar to the current State Manager. It would allow the user to browse list of available saves, ordered by timestamp, give them more descriptive names, etc.
  • Restoring a previous save should copy the old save data into place, and reset the emulation.
  • Restoring a previous save then making a new save will just append the new snapshot to the end of the list, we don't need to track forking timelines or whatever (we could, like full-on Git branching, but most PC games that offer unlimited in-game saves don't bother, so I don't think it's worth the effort)

Screwtapello avatar Oct 30 '20 07:10 Screwtapello

Reminder that some games, for example Yoshi's Island, use SRAM as work RAM and constantly scribble over it. You'll need to, at minimum, allow user to disable it for that game, unless you want to make a SRAM backup every second.

Beyond this minimum, you could detect that SRAM is written way too often and automatically disable it, add a hotkey to manually save SRAM, and autodetect which parts of SRAM are work RAM and which are actual saves.

In theory, the last one could be done by, for example, checking which SRAM bytes are read before being written on a fresh ROM boot, or by checking which parts of SRAM are written often (work RAM) and which only rarely (saves); in practice, former may affect framerate and latter may be inaccurate, I don't know.

Only one way to find out!

Alcaro avatar Oct 30 '20 12:10 Alcaro

...unless you want to make a SRAM backup every second.

That's what I meant by "hysteresis". I assume some algorithm like "save after five seconds of inactivity, or 10 minutes of continuous activity". I believe the "Auto save memory periodically" option does something similar.

Screwtapello avatar Oct 30 '20 14:10 Screwtapello