diff --git a/src/BizHawk.Client.Common/rewind/ZeldaWinder.cs b/src/BizHawk.Client.Common/rewind/ZeldaWinder.cs
index 3e4dc401b4..56f194fdd7 100644
--- a/src/BizHawk.Client.Common/rewind/ZeldaWinder.cs
+++ b/src/BizHawk.Client.Common/rewind/ZeldaWinder.cs
@@ -106,7 +106,7 @@ namespace BizHawk.Client.Common
_count++;
return;
}
- if (!_buffer.WillCapture(_masterFrame))
+ if (!_buffer.WouldCapture(frame - _masterFrame))
return;
{
@@ -189,7 +189,7 @@ namespace BizHawk.Client.Common
_masterLength = (int)sss.Position;
_masterFrame = frame;
_count++;
- });
+ }, force: true);
});
}
}
diff --git a/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs b/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs
index 710e2cd2d2..e7780e13e3 100644
--- a/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs
+++ b/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs
@@ -148,31 +148,35 @@ namespace BizHawk.Client.Common
_backingStoreType == settings.BackingStore;
}
- private bool ShouldCapture(int frame)
+ private bool ShouldCaptureForFrameDiff(int frameDiff)
{
if (Count == 0)
{
return true;
}
-
- var frameDiff = frame - _states[HeadStateIndex].Frame;
if (frameDiff < 1)
+ {
// non-linear time is from a combination of other state changing mechanisms and the rewinder
// not much we can say here, so just take a state
return true;
+ }
+ return frameDiff >= ComputeIdealRewindInterval();
+ }
- return frameDiff >= ComputeIdealRewindInterval();
+ private bool ShouldCapture(int frame)
+ {
+ var frameDiff = frame - _states[HeadStateIndex].Frame;
+ return ShouldCaptureForFrameDiff(frameDiff);
}
///
- /// Predict whether Capture() will capture a state. Useful if expensive work needs to happen before
- /// Capture() is called.
+ /// Predict whether Capture() would capture a state, assuming a particular frame delta.
///
- /// The same frame number to be passed to capture
- /// Whether capture will happen, assuming Capture() is passed the same frame and force = false
- public bool WillCapture(int frame)
+ /// The assumed frame delta. Normally this will be equal to `nextStateFrame - GetState(Count - 1).Frame`.
+ /// Whether Capture(nextStateFrame) would actually capture, assuming the frameDelta matched.
+ public bool WouldCapture(int frameDelta)
{
- return ShouldCapture(frame);
+ return ShouldCaptureForFrameDiff(frameDelta);
}
///