fix a crashing bug when resetting or powering on with a movie loaded

This commit is contained in:
zeromus 2008-06-11 04:54:33 +00:00
parent a4647ef3e2
commit a1773fc087
1 changed files with 9 additions and 2 deletions

View File

@ -512,7 +512,12 @@ void FCEUI_LoadMovie(char *fname, bool _read_only, int _pauseframe)
assert(fname); assert(fname);
FCEUI_StopMovie(); //mbg 6/10/08 - we used to call StopMovie here, but that cleared curMovieFilename and gave us crashes...
if(movieMode == MOVIEMODE_PLAY)
StopPlayback();
else if(movieMode == MOVIEMODE_RECORD)
StopRecording();
//--------------
currMovieData = MovieData(); currMovieData = MovieData();
@ -526,7 +531,7 @@ void FCEUI_LoadMovie(char *fname, bool _read_only, int _pauseframe)
// fully reload the game to reinitialize everything before playing any movie // fully reload the game to reinitialize everything before playing any movie
// to try fixing nondeterministic playback of some games // to try fixing nondeterministic playback of some games
{ {
poweron(false); poweron(true);
} }
//todo - if reset flag is set, will the poweron flag be set? //todo - if reset flag is set, will the poweron flag be set?
@ -539,6 +544,8 @@ void FCEUI_LoadMovie(char *fname, bool _read_only, int _pauseframe)
} }
//TODO - handle reset flag //TODO - handle reset flag
//ResetNES();
//if there is no savestate, we won't have this crucial piece of information at the start of the movie. //if there is no savestate, we won't have this crucial piece of information at the start of the movie.
//so, we have to include it with the movie //so, we have to include it with the movie