Skip to content

Fix replay rewind/load state bug #16710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 18, 2024

Conversation

JoeOsborn
Copy link
Contributor

Currently, doing these actions will cause issues with replays (desync):

  1. Start recording a replay in any game and core (e.g. Super Mario Bros on FCEUX)
  2. Make a savestate
  3. Hold right for 5 seconds
  4. Load your savestate
  5. Hold left for 1 second
  6. Stop recording

On playback, you'll see 1 second of holding left followed by 4 seconds of holding right, because while we seek to the replay state as of the loaded state we don't truncate the file. This patch adds intfstream_truncate and uses it while recording to fix record-and-replay.

Will return 0 for non-file streams.  I didn't want to mess around with
memory_stream (which could in theory have a truncate impl that sets
size) because there were globals and stuff and I got nervous (also
truncate might *grow* a file if the new length is longer than the old
one and then I'd have to think about realloc, etc).
@LibretroAdmin LibretroAdmin merged commit e51a316 into libretro:master Jun 18, 2024
27 checks passed
@QixuanZhao
Copy link

Is this released?

@JoeOsborn
Copy link
Contributor Author

I believe the last release was June 4 so probably not?

@QixuanZhao
Copy link

Looking forward😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants