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

Store Savegames in Local Storage #6

Open
Malax opened this issue Oct 26, 2018 · 3 comments
Open

Store Savegames in Local Storage #6

Malax opened this issue Oct 26, 2018 · 3 comments

Comments

@Malax
Copy link
Owner

Malax commented Oct 26, 2018

No description provided.

@zacck-zz
Copy link

zacck-zz commented Feb 3, 2019

@Malax can we work on this, i just did something with ports, perhaps let me know what needs to be done then we can make a plan?

@Malax
Copy link
Owner Author

Malax commented Feb 3, 2019

Hey @zacck!

Usually, savegames are implemented by writing them to RAM inside the cartridge that is then backed by a battery so it will retain the values for the next play session. The Cartridge module has support for RAM inside cartridges already.

We need to figure out:

  1. When to persist the state of the cartridge RAM, as we cannot do this every frame, or even worse, cycle. Cartridge RAM can and should be disabled by games (which is also already supported), that might be one way of figuring out good timing. However, I have not yet looked into the actual frequency games enable/disable cartridge RAM
  2. How to fingerprint cartridges/ROMs so we know which persisted RAM state we should load from local storage. Hashing the actual ROM files comes to mind. Other emulators store a file with the same name as the ROM file (and replace the .gb extension with .sav). As we have no access to the file system, this is not feasible for Elmboy. Just using the filename seems dangerous as well.

I think it would be nice to allow savegames of other emulators to be used with Elmboy as well. I haven't looked into this yet, but I imagine it being not too hard to implement.

If you want to tackle this, feel free to use this issue (or Elm Slack) to discuss any uncertainties or problems. 👍

@zacck-zz
Copy link

zacck-zz commented Feb 4, 2019

spelunking! will get back to you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants