Movies: Fixed missing input recording/playback for the first frame after power cycle#90
Merged
Movies: Fixed missing input recording/playback for the first frame after power cycle#90
Conversation
…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)
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. |
… and when exporting movies from the history viewer)
NovaSquirrel
approved these changes
May 9, 2026
Collaborator
NovaSquirrel
left a comment
There was a problem hiding this comment.
I've verified that the desync issues I was running into have been fixed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)