From fb1240c262c6efafadac4349f5676c65fc88e16e Mon Sep 17 00:00:00 2001 From: adelikat Date: Mon, 17 May 2010 15:51:11 +0000 Subject: [PATCH] Fixed the timeline checking function. The mistake was assuming that FCEUX didn't save the entire movie in a savestate. Now that I know it does, the fix was rather simple. --- src/movie.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/movie.cpp b/src/movie.cpp index 660b64ed..c72f7276 100644 --- a/src/movie.cpp +++ b/src/movie.cpp @@ -1213,12 +1213,17 @@ bool CheckTimelines(MovieData& stateMovie, MovieData& currMovie, int& error) { bool isInTimeline = true; int length; - if (stateMovie.getNumRecords() > currMovie.getNumRecords()) - length = currMovie.getNumRecords(); + + //First check, make sure we are checking is for a post-movie savestate, we just want to adjust the length for now, we will handle this situation later in another function + if (currFrameCounter <= stateMovie.getNumRecords()) + length = currFrameCounter; else - length = stateMovie.getNumRecords(); //Whichever one is smaller - //length logic - after this function we will check and handle statemovies that are bigger than the curent movie - //all we want to know at this time is if their timelines match for the data we do have + length = stateMovie.getNumRecords(); + + //Now that we know the length of the records of the savestate we plan to load, let's match the length against the movie + //If length < currMovie records then this is a "future" event from the current movie, againt we will handle this situation later, we just want to find the right number of frames to compare + if (length > currMovie.getNumRecords()) + length = currMovie.getNumRecords(); for (int x = 0; x < length; x++) {