BizHawk icon indicating copy to clipboard operation
BizHawk copied to clipboard

Add auto save state on close

Open peteyus opened this issue 2 years ago • 4 comments

  • Add configuration for auto-saving state on exit
  • Update MainForm to auto save on close game if configured
  • Fix config serialization test.

#1861

peteyus avatar Apr 16 '22 03:04 peteyus

Bump?

YoshiRulz avatar Aug 12 '22 16:08 YoshiRulz

Saw this, more or less agreed with it... and promptly lost it all in the shuffle of summer craziness with kids. I'll get back to this in the next week or two and apply the changes requested.

peteyus avatar Aug 12 '22 19:08 peteyus

I'm also not sure if the autosave call belongs in CloseGame. I believe that runs every time a rom is reloaded or unloaded, including when EmuHawk is closed. Autoload only happens on startup.

My thinking is that for autosave, it should happen any time the ROM changes. I'm not sure how it worked in FCEUX, although for my use case only doing it on shutdown works. Open to whichever here, calling it on CloseGame felt the safest (save early and often) but we could definitely make it happen on shutdown instead to reduce the number of times this happens.

peteyus avatar Aug 12 '22 19:08 peteyus

I'm also not sure if the autosave call belongs in CloseGame. I believe that runs every time a rom is reloaded or unloaded, including when EmuHawk is closed. Autoload only happens on startup.

My thinking is that for autosave, it should happen any time the ROM changes. I'm not sure how it worked in FCEUX, although for my use case only doing it on shutdown works. Open to whichever here, calling it on CloseGame felt the safest (save early and often) but we could definitely make it happen on shutdown instead to reduce the number of times this happens.

I'm going to do it on CloseGame, it looks like the autoload code is executed during LoadRomInternal as well, so it runs any time the ROM is loaded (not just if it's passed as a command line argument). I think Autosave should have the same logic.

peteyus avatar Aug 14 '22 22:08 peteyus