If frame advance is held, advance one frame, then delay 60 ticks, then keep pressing frame advance while held. Also, removed some code I forgot to delete in a previous commit.
This commit is contained in:
parent
f5ccba7918
commit
1ca4fb7ec9
|
@ -19,7 +19,7 @@ namespace BizHawk.MultiClient
|
||||||
private string CurrentlyOpenRom;
|
private string CurrentlyOpenRom;
|
||||||
private int SaveSlot = 0; //Saveslot sytem
|
private int SaveSlot = 0; //Saveslot sytem
|
||||||
private bool wasPaused = false; //For handling automatic pausing when entering the menu
|
private bool wasPaused = false; //For handling automatic pausing when entering the menu
|
||||||
|
private int FrameAdvanceDelay = 0;
|
||||||
private bool EmulatorPaused = false;
|
private bool EmulatorPaused = false;
|
||||||
RamWatch RamWatch1 = new RamWatch();
|
RamWatch RamWatch1 = new RamWatch();
|
||||||
RamSearch RamSearch1 = new RamSearch();
|
RamSearch RamSearch1 = new RamSearch();
|
||||||
|
@ -344,21 +344,45 @@ namespace BizHawk.MultiClient
|
||||||
[System.Security.SuppressUnmanagedCodeSecurity, DllImport("User32.dll", CharSet = CharSet.Auto)]
|
[System.Security.SuppressUnmanagedCodeSecurity, DllImport("User32.dll", CharSet = CharSet.Auto)]
|
||||||
public static extern bool PeekMessage(out Message msg, IntPtr hWnd, UInt32 msgFilterMin, UInt32 msgFilterMax, UInt32 flags);
|
public static extern bool PeekMessage(out Message msg, IntPtr hWnd, UInt32 msgFilterMin, UInt32 msgFilterMax, UInt32 flags);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handles the display of information like frame counter, lag counter, and input
|
|
||||||
/// </summary>
|
|
||||||
private void DisplayInfo()
|
|
||||||
{
|
|
||||||
//Global.RenderPanel.AddMessage(Global.Emulator.Frame.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void GameTick()
|
public void GameTick()
|
||||||
{
|
{
|
||||||
DisplayInfo();
|
|
||||||
Input.Update();
|
Input.Update();
|
||||||
if (ActiveForm != null)
|
if (ActiveForm != null)
|
||||||
ScreenSaver.ResetTimerPeriodically();
|
ScreenSaver.ResetTimerPeriodically();
|
||||||
|
|
||||||
|
if (EmulatorPaused == false)
|
||||||
|
{
|
||||||
|
CaptureRewindState();
|
||||||
|
Global.Emulator.FrameAdvance(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Global.ClientControls.IsPressed("Frame Advance"))
|
||||||
|
FrameAdvanceDelay = 60;
|
||||||
|
|
||||||
|
|
||||||
|
if (Global.ClientControls["Frame Advance"] && FrameAdvanceDelay > 0)
|
||||||
|
{
|
||||||
|
if (FrameAdvanceDelay == 60)
|
||||||
|
{
|
||||||
|
if (EmulatorPaused == false)
|
||||||
|
EmulatorPaused = true;
|
||||||
|
Global.Emulator.FrameAdvance(true);
|
||||||
|
FrameAdvanceDelay--;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (FrameAdvanceDelay > 0)
|
||||||
|
FrameAdvanceDelay--;
|
||||||
|
if (FrameAdvanceDelay < 0)
|
||||||
|
FrameAdvanceDelay = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Global.ClientControls["Frame Advance"] && FrameAdvanceDelay == 0)
|
||||||
|
{
|
||||||
|
Global.Emulator.FrameAdvance(true);
|
||||||
|
}
|
||||||
|
|
||||||
if (/*Global.Config.RewindEnabled && */Global.ClientControls["Rewind"])
|
if (/*Global.Config.RewindEnabled && */Global.ClientControls["Rewind"])
|
||||||
{
|
{
|
||||||
Rewind(Global.ClientControls["Fast Forward"] ? 3 : 1);
|
Rewind(Global.ClientControls["Fast Forward"] ? 3 : 1);
|
||||||
|
@ -473,20 +497,6 @@ namespace BizHawk.MultiClient
|
||||||
ToggleFullscreen();
|
ToggleFullscreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EmulatorPaused == false)
|
|
||||||
{
|
|
||||||
CaptureRewindState();
|
|
||||||
Global.Emulator.FrameAdvance(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Global.ClientControls["Frame Advance"])
|
|
||||||
{
|
|
||||||
if (EmulatorPaused == false)
|
|
||||||
EmulatorPaused = true;
|
|
||||||
Global.Emulator.FrameAdvance(true);
|
|
||||||
Global.ClientControls.UnpressButton("Frame Advance");
|
|
||||||
}
|
|
||||||
|
|
||||||
Global.Sound.UpdateSound(Global.Emulator.SoundProvider);
|
Global.Sound.UpdateSound(Global.Emulator.SoundProvider);
|
||||||
Render();
|
Render();
|
||||||
//RamWatch1.UpdateValues(); //TODO: This should update only once per frame
|
//RamWatch1.UpdateValues(); //TODO: This should update only once per frame
|
||||||
|
|
Loading…
Reference in New Issue