Fix for state gap when frame advancing and painting input (#2563)
* Fix for state gap when frame advancing and painting input * simplify
This commit is contained in:
parent
39c0011d09
commit
72e8fa031e
|
@ -78,6 +78,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
void PauseEmulator();
|
||||
|
||||
bool BlockFrameAdvance { get; set; }
|
||||
|
||||
/// <remarks>only referenced from <see cref="TAStudio"/></remarks>
|
||||
void RelinquishControl(IControlMainform master);
|
||||
|
||||
|
|
|
@ -768,6 +768,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
public bool BlockFrameAdvance { get; set; }
|
||||
|
||||
public event Action<bool> OnPauseChanged;
|
||||
|
||||
public string CurrentlyOpenRom { get; private set; } // todo - delete me and use only args instead
|
||||
|
@ -2916,7 +2918,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
float atten = 0;
|
||||
|
||||
if (runFrame || force)
|
||||
// BlockFrameAdvance (true when input it being editted in TAStudio) supercedes all other frame advance conditions
|
||||
if ((runFrame || force) && !BlockFrameAdvance)
|
||||
{
|
||||
var isFastForwarding = InputManager.ClientControls["Fast Forward"] || IsTurboing || InvisibleEmulation;
|
||||
var isFastForwardingOrRewinding = isFastForwarding || isRewinding || _unthrottled;
|
||||
|
|
|
@ -619,6 +619,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
_playbackInterrupted = !MainForm.EmulatorPaused;
|
||||
MainForm.PauseEmulator();
|
||||
|
||||
// Pausing the emulator is insufficient to actually stop frame advancing as the frame advance hotkey can
|
||||
// still take effect. This can lead to desyncs by simultaneously changing input and frame advancing.
|
||||
// So we want to block all frame advance operations while the user is changing input in the piano roll
|
||||
MainForm.BlockFrameAdvance = true;
|
||||
|
||||
if (ControllerType.BoolButtons.Contains(buttonName))
|
||||
{
|
||||
_patternPaint = false;
|
||||
|
@ -810,6 +815,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
CurrentTasMovie.ChangeLog?.EndBatch();
|
||||
}
|
||||
|
||||
MainForm.BlockFrameAdvance = false;
|
||||
}
|
||||
|
||||
private void TasView_MouseUp(object sender, MouseEventArgs e)
|
||||
|
|
Loading…
Reference in New Issue