ZwinderStateManager: Use the gap buffer for forced capture to avoid crowding the "current" buffer and thus reducing it's actual span of covered frames. (#2569)

also remove a redundant conditional
This commit is contained in:
SuuperW 2021-01-15 14:54:47 -06:00 committed by GitHub
parent 961e7f2808
commit 6c5447f5da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 10 deletions

View File

@ -192,10 +192,8 @@ namespace BizHawk.Client.Common
LagLog[Emulator.Frame] = _inputPollable.IsLagFrame;
if (!TasStateManager.HasState(Emulator.Frame))
{
TasStateManager.Capture(Emulator.Frame, Emulator.AsStatable(), Emulator.Frame == LastEditedFrame - 1);
}
// We will forbibly capture a state for the last edited frame (requested by #916 for case of "platforms with analog stick")
TasStateManager.Capture(Emulator.Frame, Emulator.AsStatable(), Emulator.Frame == LastEditedFrame - 1);
}

View File

@ -291,13 +291,10 @@ namespace BizHawk.Client.Common
// We do not want to consider reserved states for a notion of Last
// reserved states can include future states in the case of branch states
if (frame <= LastRing)
if ((frame <= LastRing && NeedsGap(frame)) || force)
{
if (NeedsGap(frame))
{
CaptureGap(frame, source);
}
// We use the gap buffer for forced capture to avoid crowding the "current" buffer and thus reducing it's actual span of covered frames.
CaptureGap(frame, source);
return;
}