tidy autoflushing stuff

This commit is contained in:
zeromus 2017-08-23 10:32:17 -04:00
parent a7cbdd7dab
commit 1250b72bce
3 changed files with 22 additions and 12 deletions

View File

@ -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; } }
/// <summary>
/// Makes a .bak file before any saveram-writing operation (could be extended to make timestamped backups)
/// </summary>
public bool BackupSaveram = true;
/// <summary>
/// Whether to make AutoSave files at periodic intervals
/// </summary>
public bool AutosaveSaveRAM;
/// <summary>
/// Intervals at which to make AutoSave files
/// </summary>
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

View File

@ -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);
}

View File

@ -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;