sdl: world's biggest hack: add --movielength int_num_frames for automated dumping with a good process exit. how was this missing?

This commit is contained in:
zeromus 2016-12-20 09:11:33 +00:00
parent 2958f2e5df
commit d54b7388b9
3 changed files with 8 additions and 0 deletions

View File

@ -222,6 +222,7 @@ InitConfig()
// video playback
config->addOption("playmov", "SDL.Movie", "");
config->addOption("subtitles", "SDL.SubtitleDisplay", 1);
config->addOption("movielength", "SDL.MovieLength", 0);
config->addOption("fourscore", "SDL.FourScore", 0);

View File

@ -525,6 +525,7 @@ void FCEUD_TraceInstruction() {
int noGui = 1;
#endif
int KillFCEUXonFrame = 0;
/**
* The main loop for the SDL.
@ -894,6 +895,8 @@ int main(int argc, char *argv[])
{
FCEUI_printf("Sorry, I don't know how to play back %s\n", s.c_str());
}
g_config->getOption("SDL.MovieLength",&KillFCEUXonFrame);
printf("KillFCEUXonFrame %d\n",KillFCEUXonFrame);
}
int periodic_saves;

View File

@ -739,6 +739,10 @@ void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int ski
extern int KillFCEUXonFrame;
if (KillFCEUXonFrame && (FCEUMOV_GetFrame() >= KillFCEUXonFrame))
DoFCEUExit();
#else
extern int KillFCEUXonFrame;
if (KillFCEUXonFrame && (FCEUMOV_GetFrame() >= KillFCEUXonFrame))
exit(0);
#endif
timestampbase += timestamp;