Skip to content

Movies: Fixed missing input recording/playback for the first frame after power cycle#90

Merged
Fiskbit merged 4 commits intomasterfrom
SourMovieFixes
May 11, 2026
Merged

Movies: Fixed missing input recording/playback for the first frame after power cycle#90
Fiskbit merged 4 commits intomasterfrom
SourMovieFixes

Conversation

@SourMesen
Copy link
Copy Markdown
Collaborator

@SourMesen SourMesen commented May 8, 2026

This didn't cause any obvious issues for movies, because it would only matter if a significant button was pressed during the first frame.

The movie recording/playback was initialized too late (after the first frame's input was initialized), causing it to be skipped entirely. Using the new "AfterInitConsole" notification, which is triggered slightly earlier, instead of "GameLoaded" allows the first frame's input to be recorded/played properly.

Additionally, when exporting a movie from the history viewer, the first frame's input was actually saved in the .mmo file (unlike when recording from movies until now), and the 30th frame input was not exported correctly, which prevented all subsequent inputs from being off by 1 frame, but could still cause desyncs if any inputs occurred in the first ~30 frames.

An issue with save ram not working as intended when recording movies was also fixed. Starting a recording "from power cycle", creating save data in the data and then power cycling the game would cause the save data to be lost, which was not the intended behavior.

This also fixes a rare emulator crash in RewindManager that could occur when you power cycle while letting go of the rewind button at the same time (that I triggered by rewinding while the movie was playing a frame that had a power cycle input)

…ter power cycle

This didn't cause any obvious issues, because it would only matter if a significant button was pressed during the first frame. But when exporting a movie from the history viewer, the first frame's input was actually part of the .mmo file, causing every input to be offset by 1 frame when the movie was played back (which caused desyncs). The movie recording/playback was initialized too late, after the first frame's input was initialized, causing it to be skipped entirely. Using the new "AfterInitConsole" notification, which is triggered slightly earlier, instead of "GameLoaded" allows the first frame's input to be recorded/played properly

This also fixes a rare emulator crash that could occur when you power cycle while letting go of the rewind button at the same time (that I triggered by rewinding while the movie was playing a frame that had a power cycle input)
@NovaSquirrel
Copy link
Copy Markdown
Collaborator

I seem to be getting consistent desyncs with https://incube8games.com/products/indestructotank-gb that don't happen on the master branch, with both the history viewer and regular movie recorder. I can share the ROM privately and movie files if that would help. I think it's specifically a problem with movie playback because I played a movie recorded from this branch with an older version and it's not desyncing there.

Did seem fine with Super Mario World but that game is probably a lot more tolerant of desyncs.

Copy link
Copy Markdown
Collaborator

@NovaSquirrel NovaSquirrel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've verified that the desync issues I was running into have been fixed

@Fiskbit Fiskbit merged commit 893c0d4 into master May 11, 2026
19 checks passed
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