Add option for auto-savestates

This commit is contained in:
beirich 2011-10-15 23:17:15 +00:00
parent dcf7846d3f
commit a95957dcf6
4 changed files with 1891 additions and 1865 deletions

View File

@ -127,6 +127,7 @@
public bool InputConfigAutoTab = true; public bool InputConfigAutoTab = true;
public bool ShowLogWindow = false; public bool ShowLogWindow = false;
public bool BackupSavestates = true; public bool BackupSavestates = true;
public bool AutoSavestates = false;
public bool SaveScreenshotWithStates = true; public bool SaveScreenshotWithStates = true;
public int AutofireOn = 1; public int AutofireOn = 1;
public int AutofireOff = 1; public int AutofireOff = 1;

File diff suppressed because it is too large Load Diff

View File

@ -1139,6 +1139,7 @@ namespace BizHawk.MultiClient
singleInstanceModeToolStripMenuItem.Checked = Global.Config.SingleInstanceMode; singleInstanceModeToolStripMenuItem.Checked = Global.Config.SingleInstanceMode;
enableContextMenuToolStripMenuItem.Checked = Global.Config.ShowContextMenu; enableContextMenuToolStripMenuItem.Checked = Global.Config.ShowContextMenu;
backupSavestatesToolStripMenuItem.Checked = Global.Config.BackupSavestates; backupSavestatesToolStripMenuItem.Checked = Global.Config.BackupSavestates;
autoSavestatesToolStripMenuItem.Checked = Global.Config.AutoSavestates;
saveScreenshotWithSavestatesToolStripMenuItem.Checked = Global.Config.SaveScreenshotWithStates; saveScreenshotWithSavestatesToolStripMenuItem.Checked = Global.Config.SaveScreenshotWithStates;
logWindowAsConsoleToolStripMenuItem.Checked = Global.Config.WIN32_CONSOLE; logWindowAsConsoleToolStripMenuItem.Checked = Global.Config.WIN32_CONSOLE;
showMenuInFullScreenToolStripMenuItem.Checked = Global.Config.ShowMenuInFullscreen; showMenuInFullScreenToolStripMenuItem.Checked = Global.Config.ShowMenuInFullscreen;
@ -1357,6 +1358,11 @@ namespace BizHawk.MultiClient
Global.Config.BackupSavestates ^= true; Global.Config.BackupSavestates ^= true;
} }
void autoSavestatesToolStripMenuItem_Click(object sender, EventArgs e)
{
Global.Config.AutoSavestates ^= true;
}
void screenshotWithSavestatesToolStripMenuItem_Click(object sender, EventArgs e) void screenshotWithSavestatesToolStripMenuItem_Click(object sender, EventArgs e)
{ {
Global.Config.SaveScreenshotWithStates ^= true; Global.Config.SaveScreenshotWithStates ^= true;

View File

@ -1114,6 +1114,8 @@ namespace BizHawk.MultiClient
Global.Config.RecentRoms.Add(file.CanonicalFullPath); Global.Config.RecentRoms.Add(file.CanonicalFullPath);
if (File.Exists(PathManager.SaveRamPath(game))) if (File.Exists(PathManager.SaveRamPath(game)))
LoadSaveRam(); LoadSaveRam();
if (Global.Config.AutoSavestates)
LoadState("Auto");
////setup the throttle based on platform's specifications ////setup the throttle based on platform's specifications
////(one day later for some systems we will need to modify it at runtime as the display mode changes) ////(one day later for some systems we will need to modify it at runtime as the display mode changes)
@ -1209,6 +1211,8 @@ namespace BizHawk.MultiClient
private void CloseGame() private void CloseGame()
{ {
if (Global.Config.AutoSavestates && Global.Emulator is NullEmulator == false)
SaveState("Auto");
if (Global.Emulator.SaveRamModified) if (Global.Emulator.SaveRamModified)
SaveRam(); SaveRam();
Global.Emulator.Dispose(); Global.Emulator.Dispose();
@ -1363,8 +1367,13 @@ namespace BizHawk.MultiClient
break; break;
case "Hard Reset": case "Hard Reset":
{
bool autoSaveState = Global.Config.AutoSavestates;
Global.Config.AutoSavestates = false;
LoadRom(CurrentlyOpenRom); LoadRom(CurrentlyOpenRom);
Global.Config.AutoSavestates = autoSaveState;
break; break;
}
case "Screenshot": case "Screenshot":
TakeScreenshot(); TakeScreenshot();
@ -2320,7 +2329,7 @@ namespace BizHawk.MultiClient
if (Global.Emulator.ControllerDefinition.BoolButtons.Contains("Reset")) if (Global.Emulator.ControllerDefinition.BoolButtons.Contains("Reset"))
{ {
Global.ClickyVirtualPadController.Click("Reset"); Global.ClickyVirtualPadController.Click("Reset");
if (Global.MovieSession.Movie.Mode == MOVIEMODE.INACTIVE) if (Global.MovieSession.Movie.Mode == MOVIEMODE.INACTIVE && Global.Emulator is NES)
Global.Emulator.ResetFrameCounter(); Global.Emulator.ResetFrameCounter();
} }
} }