Implemented read+write logic for handling a "post movie" savestate. Also fixed a slight error where rerecordcount wouldn't increment if _S9XLUA_H is not defined.
This commit is contained in:
parent
7e48d40dfc
commit
a1a74c6e9c
|
@ -1342,29 +1342,32 @@ bool FCEUMOV_ReadState(std::istream* is, uint32 size)
|
||||||
}
|
}
|
||||||
else //Read + write
|
else //Read + write
|
||||||
{
|
{
|
||||||
//truncate before we copy, just to save some time
|
if (currFrameCounter > (int)tempMovieData.records.size())
|
||||||
tempMovieData.truncateAt(currFrameCounter);
|
{
|
||||||
currMovieData = tempMovieData;
|
//This is a post movie savestate, handle it differently
|
||||||
|
//Recplae movie contents but then switch to movie finished mode
|
||||||
#ifdef _S9XLUA_H
|
currMovieData = tempMovieData;
|
||||||
if(!FCEU_LuaRerecordCountSkip())
|
openRecordingMovie(curMovieFilename);
|
||||||
|
currMovieData.dump(osRecordingMovie, false/*currMovieData.binaryFlag*/);
|
||||||
|
FinishPlayback();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//truncate before we copy, just to save some time
|
||||||
|
tempMovieData.truncateAt(currFrameCounter); //we can only assume this here since we have checked that the frame counter is not greater than the movie data
|
||||||
|
currMovieData = tempMovieData;
|
||||||
|
#ifdef _S9XLUA_H
|
||||||
|
if(!FCEU_LuaRerecordCountSkip())
|
||||||
|
currRerecordCount++;
|
||||||
|
#else
|
||||||
currRerecordCount++;
|
currRerecordCount++;
|
||||||
#endif
|
#endif
|
||||||
|
currMovieData.rerecordCount = currRerecordCount;
|
||||||
currMovieData.rerecordCount = currRerecordCount;
|
openRecordingMovie(curMovieFilename);
|
||||||
|
currMovieData.dump(osRecordingMovie, false/*currMovieData.binaryFlag*/);
|
||||||
|
movieMode = MOVIEMODE_RECORD;
|
||||||
|
|
||||||
openRecordingMovie(curMovieFilename);
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
is->seekg((uint32)curr);
|
|
||||||
char *str = new char[size];
|
|
||||||
is->read(str, size);
|
|
||||||
osRecordingMovie->write(str,size);
|
|
||||||
delete[] str;
|
|
||||||
*/
|
|
||||||
|
|
||||||
currMovieData.dump(osRecordingMovie, false/*currMovieData.binaryFlag*/);
|
|
||||||
movieMode = MOVIEMODE_RECORD;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue