Closed thelamer closed 2 years ago
Currently you can already export the sram by turning on advanced mode in settings.js. That will reveal a dropdown during play where you can export the save file:
Saving it to indexedb is possible as well but would require either periodically auto saving it or detecting when there is a change to the save and then doing the save then.
Ahh I see neil_export_sra
.
Before I go and fork is it possible to integrate logic to pass a game name to keep SRAM isolated per rom?
Should probably be done on load and module start honestly not be function specific.
Yeah the JavaScript code stores the filename as "this.rom_name" in script.js. Though it's not necessary, you could also pass the rom name to the Module if you need. The best place I think you could do it is in script.js in WriteConfigFile(). That is a function that is used to pass a bunch of parameters to the Module on load. The C++ code then reads out the config file in mymain.cpp in "readConfig()". Hope that helps.
Outside of just save states would it be possible to implement "cmd_savefiles" as a callable function to dump sram like you have with Retroarch Emscripten builds?