diff --git a/BizHawk.Client.Common/config/Config.cs b/BizHawk.Client.Common/config/Config.cs index 72b4e759ab..ff61d5d2e8 100644 --- a/BizHawk.Client.Common/config/Config.cs +++ b/BizHawk.Client.Common/config/Config.cs @@ -113,9 +113,6 @@ namespace BizHawk.Client.Common public bool InputConfigAutoTab = true; public bool ShowLogWindow = false; public bool BackupSavestates = true; - public bool BackupSaveram = true; - private int _flushSaveRAMFrames = 5 * 60 * 60; - private bool _autosaveSaveRAM = false; public bool SaveScreenshotWithStates = true; public int BigScreenshotSize = 128 * 1024; public bool NoLowResLargeScreenshotWithStates = false; @@ -136,8 +133,21 @@ namespace BizHawk.Client.Common public string Update_IgnoreVersion = ""; public bool CDLAutoSave = true, CDLAutoStart = true; - public int FlushSaveRamFrames { get { return _flushSaveRAMFrames; } set { _flushSaveRAMFrames = value; } } - public bool AutosaveSaveRAM { get { return _autosaveSaveRAM; } set { _autosaveSaveRAM = value; } } + /// + /// Makes a .bak file before any saveram-writing operation (could be extended to make timestamped backups) + /// + public bool BackupSaveram = true; + + /// + /// Whether to make AutoSave files at periodic intervals + /// + public bool AutosaveSaveRAM; + + /// + /// Intervals at which to make AutoSave files + /// + public int FlushSaveRamFrames; + //check CurrentDomain_AssemblyResolve if you change the defaults or name of this key public bool UseNLua = true; // Whether or not to use a good, reliable, memory-leak-free lua interface that is slower than the original luainterface diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 8097da0c6c..930474edc4 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -1415,8 +1415,8 @@ namespace BizHawk.Client.EmuHawk public PresentationPanel PresentationPanel { get; } - private int _flushSaveRamIn; - public int FlushSaveRamIn { get { return _flushSaveRamIn; } set { _flushSaveRamIn = value; } } + //countdown for saveram autoflushing + public int AutoFlushSaveRamIn { get; set; } #endregion #region Private methods @@ -1608,7 +1608,7 @@ namespace BizHawk.Client.EmuHawk } Emulator.AsSaveRam().StoreSaveRam(sram); - _flushSaveRamIn = Global.Config.FlushSaveRamFrames; + AutoFlushSaveRamIn = Global.Config.FlushSaveRamFrames; } catch (IOException) { @@ -1625,7 +1625,7 @@ namespace BizHawk.Client.EmuHawk if (autosave) { path = PathManager.AutoSaveRamPath(Global.Game); - _flushSaveRamIn = Global.Config.FlushSaveRamFrames; + AutoFlushSaveRamIn = Global.Config.FlushSaveRamFrames; } else { @@ -2939,7 +2939,7 @@ namespace BizHawk.Client.EmuHawk if (Global.Config.AutosaveSaveRAM) { - if (FlushSaveRamIn-- <= 0) + if (AutoFlushSaveRamIn-- <= 0) { FlushSaveRAM(true); } diff --git a/BizHawk.Client.EmuHawk/config/GuiOptions.cs b/BizHawk.Client.EmuHawk/config/GuiOptions.cs index ce1ada362c..d5106c9d24 100644 --- a/BizHawk.Client.EmuHawk/config/GuiOptions.cs +++ b/BizHawk.Client.EmuHawk/config/GuiOptions.cs @@ -89,8 +89,8 @@ namespace BizHawk.Client.EmuHawk Global.Config.BackupSaveram = BackupSRamCheckbox.Checked; Global.Config.AutosaveSaveRAM = AutosaveSRAMCheckbox.Checked; Global.Config.FlushSaveRamFrames = AutosaveSaveRAMSeconds * 60; - if (GlobalWin.MainForm.FlushSaveRamIn > Global.Config.FlushSaveRamFrames) - GlobalWin.MainForm.FlushSaveRamIn = Global.Config.FlushSaveRamFrames; + if (GlobalWin.MainForm.AutoFlushSaveRamIn > Global.Config.FlushSaveRamFrames) + GlobalWin.MainForm.AutoFlushSaveRamIn = Global.Config.FlushSaveRamFrames; Global.Config.SkipLagFrame = FrameAdvSkipLagCheckbox.Checked; Global.Config.WIN32_CONSOLE = LogWindowAsConsoleCheckbox.Checked; Global.Config.RunLuaDuringTurbo = LuaDuringTurboCheckbox.Checked;