experimental "Frame Inch" designed to make quick presses of frame advance always do something (concerning #2303).

This commit is contained in:
zeromus 2020-08-15 23:13:17 -04:00
parent 732afe6a9e
commit bea796fb2d
3 changed files with 24 additions and 1 deletions

View File

@ -145,6 +145,7 @@ namespace BizHawk.Client.Common
Bind("General", "Screen Client to Clipboard", "Ctrl+Shift+C"),
Bind("General", "Toggle Skip Lag Frame"),
Bind("General", "Toggle Key Priority"),
Bind("General", "Frame Inch"),
Bind("Save States", "Save State 0", "Shift+F10"),
Bind("Save States", "Save State 1", "Shift+F1"),

View File

@ -19,6 +19,10 @@ namespace BizHawk.Client.EmuHawk
case "Pause":
TogglePause();
break;
case "Frame Inch":
//special! allow this key to get handled as Frame Advance, too
FrameInch = true;
return false;
case "Toggle Throttle":
_unthrottled ^= true;
ThrottleMessage();

View File

@ -771,6 +771,7 @@ namespace BizHawk.Client.EmuHawk
public LoadRomArgs CurrentlyOpenRomArgs { get; private set; }
public bool PauseAvi { get; set; }
public bool PressFrameAdvance { get; set; }
public bool FrameInch { get; set; }
public bool HoldFrameAdvance { get; set; } // necessary for tastudio > button
public bool PressRewind { get; set; } // necessary for tastudio < button
public bool FastForward { get; set; }
@ -2802,8 +2803,25 @@ namespace BizHawk.Client.EmuHawk
runFrame = true;
}
if (InputManager.ClientControls["Frame Advance"] || PressFrameAdvance || HoldFrameAdvance)
bool oldFrameAdvanceCondition = InputManager.ClientControls["Frame Advance"] || PressFrameAdvance || HoldFrameAdvance;
if (FrameInch)
{
FrameInch = false;
if (EmulatorPaused || oldFrameAdvanceCondition)
{
oldFrameAdvanceCondition = true;
}
else
{
PauseEmulator();
oldFrameAdvanceCondition = false;
}
}
if (oldFrameAdvanceCondition || FrameInch)
{
FrameInch = false;
_runloopFrameAdvance = true;
// handle the initial trigger of a frame advance