static void change_state(MovieState new_state) { if(new_state==Movie.State) return; if(Movie.State==MOVIE_STATE_RECORD) { flush_movie(); } if(new_state==MOVIE_STATE_NONE) { // truncate movie to MaxSample length if Settings.MovieTruncate is true truncate_movie(); fclose(Movie.File); Movie.File=NULL; if(S9xMovieActive()) { restore_previous_settings(); } } Movie.State=new_state; }
void S9xMovieShutdown () { // even if movie is not active, we need to do this in case of ports that output these settings to .cfg file on exit if(delayedPrevRestore) { // ok to restore these now (because emulation is shutting down and snes9x is exiting) Settings.PAL = prevPal; Settings.ShutdownMaster = prevCPUShutdown; delayedPrevRestore = false; } if(S9xMovieActive()) S9xMovieStop (TRUE); }