Closed dacin21 closed 3 years ago
Thanks for the detailed repro, and I agree, the code is broken and you've found the broken line. I'll need to think a bit on how to fix it properly.
Please retest on 1c3eb45
https://github.com/TASVideos/BizHawk/commit/1c3eb451b295a20405edcb706a5e0b438a26d241 fixes this for me. Rewinds are now properly captured and the buffer is full right around the 50'000 frames mark.
Great. I'll push this to master as soon as I clean up the code some more.
Summary
If delta compression is enabled and the max buffer size and desired frame length are configured in a way that the RewindFrequency is not 1, i.e. that some frames are not captured in the rewind buffer, then the rewinder refuses to store any frames after the first 2.
I think this might be caused by the following lines
https://github.com/TASVideos/BizHawk/blob/09afbdd6eb0cce9b56f00c7ab8bf5e381d5f9826/src/BizHawk.Client.Common/rewind/ZeldaWinder.cs#L109-L110
If the if statement is entered, then
_masterFrame
won't change, so the if statement will be entered again next time. In other words, as soon as one frame is not captured, no future frames will ever be captured.Repro
Note that this only happens with delta compression and only happens if the rewind buffer doesn't just capture every frame. In particular, the "Desired frame length" has to be set to a large enough value.
Host env.