A few days ago I realized that bsnes does not write changes to a game's srm file until the game has been unloaded. If possible, I would like to recompile bsnes so that it writes changes to the file shortly after a game saves. I'm unsure of whether there is a technical reason for this behaviour, or if it's just a design preference.
After looking through the source a bit I found the function which saves the file; now I would like to modify the code which interprets the snes save call to include this, but I'm not sure how to find it.
Is it possible to do this, and if so, can someone point me in the right direction?
Question about saving.
Not a good idea to save on # of RAM writes, hard to say when a transmission finishes. I'd recommend doing it every few minutes or so.
src/ui_qt/main.cpp:Application::main:
Since it's requested, I'll add it in a future release.
src/ui_qt/main.cpp:Application::main:
Code: Select all
...
while(terminate == false) {
...
//add this
static time_t delta = time(0);
if((int)(time(0) - delta) > 180) { //save every 3 minutes
//call Cartridge::save_ram()-like function
//eg as in Cartridge::unload_normal()
//won't work here since these functions are private
//if(cart.ram) save_file(get_filename(cart.filename, "srm", snes.config.path.save), cart.ram, cart.ram_size);
delta = time(0);
}
supressScreenSaver();
}