diff --git a/src/BizHawk.Client.Common/config/Config.cs b/src/BizHawk.Client.Common/config/Config.cs index d5fd7cd5700..f46027eab2e 100644 --- a/src/BizHawk.Client.Common/config/Config.cs +++ b/src/BizHawk.Client.Common/config/Config.cs @@ -188,12 +188,12 @@ public void SetWindowScaleFor(string sysID, int windowScale) /// /// Whether to make AutoSave files at periodic intervals /// - public bool AutosaveSaveRAM { get; set; } + public bool AutosaveSaveRAM { get; set; } = true; /// /// Intervals at which to make AutoSave files /// - public int FlushSaveRamFrames { get; set; } + public int FlushSaveRamFrames { get; set; } = 5/*min*/ * 60/*s/min*/ * 60/*fr/s*/; public bool TurboSeek { get; set; } diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index 2fd399af341..d30db3638a5 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -769,6 +769,8 @@ _argParser.SocketAddress is var (socketIP, socketPort) } } } + //TODO should we be calling `OnRomChanged` from this ctor? it handles this and a bunch of other things also done here + _trackingAutoSaveRAM = Config.AutosaveSaveRAM && MovieSession.Movie is null; if (_argParser.startFullscreen || Config.StartFullscreen) { @@ -1760,6 +1762,8 @@ public bool RunLibretroCoreChooser() public int AutoFlushSaveRamIn { get; set; } private bool AutoFlushSaveRamFailed; + private bool _trackingAutoSaveRAM; + private void SetStatusBar() { if (!_inFullscreen) @@ -3011,7 +3015,7 @@ private void StepRunLoop_Core(bool force = false) RA?.OnFrameAdvance(); - if (Config.AutosaveSaveRAM) + if (_trackingAutoSaveRAM) { AutoFlushSaveRamIn--; if (AutoFlushSaveRamIn <= 0) @@ -3897,6 +3901,7 @@ private void OnRomChanged() UpdateCoreStatusBarButton(); UpdateDumpInfo(); SetMainformMovieInfo(); + _trackingAutoSaveRAM = Config.AutosaveSaveRAM && MovieSession.Movie is null; RA?.Restart(); }