diff --git a/trunk/src/drivers/win/taseditor/greenzone.cpp b/trunk/src/drivers/win/taseditor/greenzone.cpp index a65a4b37..ee42adaf 100644 --- a/trunk/src/drivers/win/taseditor/greenzone.cpp +++ b/trunk/src/drivers/win/taseditor/greenzone.cpp @@ -574,7 +574,7 @@ void GREENZONE::invalidate(int after) if (greenzoneSize > after + 1) { greenzoneSize = after + 1; - currMovieData.rerecordCount++; + FCEUMOV_IncrementRerecordCount(); } } // redraw Piano Roll even if Greenzone didn't change @@ -594,7 +594,7 @@ void GREENZONE::invalidateAndUpdatePlayback(int after) if (greenzoneSize > after + 1 || currFrameCounter > after) { greenzoneSize = after + 1; - currMovieData.rerecordCount++; + FCEUMOV_IncrementRerecordCount(); // either set Playback cursor to be inside the Greenzone or run seeking to restore Playback cursor position if (currFrameCounter >= greenzoneSize) { diff --git a/trunk/src/movie.cpp b/trunk/src/movie.cpp index 49229381..b29b9235 100644 --- a/trunk/src/movie.cpp +++ b/trunk/src/movie.cpp @@ -1353,9 +1353,9 @@ bool FCEUMOV_ReadState(EMUFILE* is, uint32 size) // Finally, this is a savestate file for this movie movieMode = MOVIEMODE_PLAY; } - } - else //Read + write + } else { + //Read+Write mode if (currFrameCounter > (int)tempMovieData.records.size()) { //This is a post movie savestate, handle it differently @@ -1364,20 +1364,15 @@ bool FCEUMOV_ReadState(EMUFILE* is, uint32 size) openRecordingMovie(curMovieFilename); currMovieData.dump(osRecordingMovie, false/*currMovieData.binaryFlag*/); FinishPlayback(); - } - else + } else { //truncate before we copy, just to save some time, unless the user selects a full copy option if (!fullSaveStateLoads) - tempMovieData.truncateAt(currFrameCounter); //we can only assume this here since we have checked that the frame counter is not greater than the movie data + //we can only assume this here since we have checked that the frame counter is not greater than the movie data + tempMovieData.truncateAt(currFrameCounter); + currMovieData = tempMovieData; -#ifdef _S9XLUA_H - if(!FCEU_LuaRerecordCountSkip()) - currRerecordCount++; -#else - currRerecordCount++; -#endif - currMovieData.rerecordCount = currRerecordCount; + FCEUMOV_IncrementRerecordCount(); openRecordingMovie(curMovieFilename); currMovieData.dump(osRecordingMovie, false/*currMovieData.binaryFlag*/); movieMode = MOVIEMODE_RECORD; @@ -1404,6 +1399,17 @@ bool FCEUMOV_PostLoad(void) return load_successful; } +void FCEUMOV_IncrementRerecordCount() +{ +#ifdef _S9XLUA_H + if(!FCEU_LuaRerecordCountSkip()) + currRerecordCount++; +#else + currRerecordCount++; +#endif + currMovieData.rerecordCount = currRerecordCount; +} + void FCEUI_MovieToggleFrameDisplay(void) { frame_display=!frame_display; diff --git a/trunk/src/movie.h b/trunk/src/movie.h index a7ab8987..1ec4ff31 100644 --- a/trunk/src/movie.h +++ b/trunk/src/movie.h @@ -88,6 +88,7 @@ int FCEUMOV_WriteState(EMUFILE* os); bool FCEUMOV_ReadState(EMUFILE* is, uint32 size); void FCEUMOV_PreLoad(); bool FCEUMOV_PostLoad(); +void FCEUMOV_IncrementRerecordCount(); bool FCEUMOV_FromPoweron();