From 9a721036b903c00c6c1059d68792e77d03aadca4 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 26 Jul 2014 12:47:09 +0000 Subject: [PATCH] Move the Pause frame from tastudio's responsibility to mainform.cs, in preparation for it being used by other features --- BizHawk.Client.EmuHawk/MainForm.cs | 2 ++ .../tools/TAStudio/TAStudio.IToolForm.cs | 10 ++++++---- BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs | 8 +++----- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 056d55d3ab..293c38d95b 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -554,6 +554,8 @@ namespace BizHawk.Client.EmuHawk public bool UpdateFrame = false; public bool EmulatorPaused { get; private set; } + public int? PauseOnFrame { get; set; } // If set, upon completion of this frame, the client wil pause + // TODO: SystemInfo should be able to do this // Because we don't have enough places where we list SystemID's public Dictionary SupportedPlatforms diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs index 7a8aebd07d..d92b44970b 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs @@ -24,10 +24,11 @@ namespace BizHawk.Client.EmuHawk TasView.ensureVisible(Global.Emulator.Frame); } - if (StopFrame.HasValue && Global.Emulator.Frame == StopFrame.Value) + if (GlobalWin.MainForm.PauseOnFrame.HasValue && + Global.Emulator.Frame == GlobalWin.MainForm.PauseOnFrame.Value) { GlobalWin.MainForm.PauseEmulator(); - StopFrame = null; + GlobalWin.MainForm.PauseOnFrame = null; } } @@ -35,10 +36,11 @@ namespace BizHawk.Client.EmuHawk { // TODO: think more about this - if (StopFrame.HasValue && Global.Emulator.Frame == StopFrame.Value) + if (GlobalWin.MainForm.PauseOnFrame.HasValue && + Global.Emulator.Frame == GlobalWin.MainForm.PauseOnFrame.Value) { GlobalWin.MainForm.PauseEmulator(); - StopFrame = null; + GlobalWin.MainForm.PauseOnFrame = null; } } diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index bfedb53ef7..85ed37c4e7 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -25,8 +25,6 @@ namespace BizHawk.Client.EmuHawk private bool _originalRewindStatus; // The client rewind status before TAStudio was engaged (used to restore when disengaged) private MovieEndAction _originalEndAction; // The movie end behavior selected by the user (that is overridden by TAStudio) - private int? StopFrame = null; // This is the frame Tastudio - private Dictionary GenerateColumnNames() { var lg = Global.MovieSession.LogGeneratorInstance(); @@ -331,7 +329,7 @@ namespace BizHawk.Client.EmuHawk _tas.SwitchToPlay(); Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(_tas[_tas.LastEmulatedFrame].State.ToArray()))); GlobalWin.MainForm.UnpauseEmulator(); - StopFrame = frame; + GlobalWin.MainForm.PauseOnFrame = frame; // TODO: if turbo seek, ramp up the speed } } @@ -352,7 +350,7 @@ namespace BizHawk.Client.EmuHawk _tas.SwitchToPlay(); Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(_tas[_tas.LastEmulatedFrame].State.ToArray()))); GlobalWin.MainForm.UnpauseEmulator(); - StopFrame = frame; + GlobalWin.MainForm.PauseOnFrame = frame; // TODO: if turbo seek, ramp up the speed } } @@ -363,7 +361,7 @@ namespace BizHawk.Client.EmuHawk _tas.SwitchToPlay(); // TODO: stop copy/pasting this logic Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(_tas[_tas.LastEmulatedFrame].State.ToArray()))); GlobalWin.MainForm.UnpauseEmulator(); - StopFrame = frame; + GlobalWin.MainForm.PauseOnFrame = frame; // TODO: if turbo seek, ramp up the speed } }