Move the Pause frame from tastudio's responsibility to mainform.cs, in preparation for it being used by other features
This commit is contained in:
parent
7ac1d58a51
commit
9a721036b9
|
@ -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<string, string> SupportedPlatforms
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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<string, string> 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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue