don't overwrite the orderly shutdown SaveRAM files, keep a separate autosave channel

This commit is contained in:
shanehoman 2017-08-18 17:15:48 -07:00
parent acd194128e
commit fce06a7b5b
1 changed files with 4 additions and 2 deletions

View File

@ -1607,11 +1607,13 @@ namespace BizHawk.Client.EmuHawk
}
}
public void FlushSaveRAM()
public void FlushSaveRAM(bool autosave = false)
{
if (Emulator.HasSaveRam())
{
var path = PathManager.SaveRamPath(Global.Game);
if (autosave)
path=path.Insert(path.Length-8, ".autosave"); //becomes path\name.autosave.SaveRAM
var f = new FileInfo(path);
if (f.Directory != null && !f.Directory.Exists)
{
@ -2915,7 +2917,7 @@ namespace BizHawk.Client.EmuHawk
_flushSaveRamIn -= 1;
if (_flushSaveRamIn <= 0)
{
FlushSaveRAM();
FlushSaveRAM(true);
_flushSaveRamIn = Global.Config.FlushSaveRamFrames;
}
}