From d54b7388b96dab6d4385e0f17f46d20dd83ae2c1 Mon Sep 17 00:00:00 2001 From: zeromus Date: Tue, 20 Dec 2016 09:11:33 +0000 Subject: [PATCH] sdl: world's biggest hack: add --movielength int_num_frames for automated dumping with a good process exit. how was this missing? --- trunk/src/drivers/sdl/config.cpp | 1 + trunk/src/drivers/sdl/sdl.cpp | 3 +++ trunk/src/fceu.cpp | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/trunk/src/drivers/sdl/config.cpp b/trunk/src/drivers/sdl/config.cpp index eb832649..3c5b04df 100644 --- a/trunk/src/drivers/sdl/config.cpp +++ b/trunk/src/drivers/sdl/config.cpp @@ -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); diff --git a/trunk/src/drivers/sdl/sdl.cpp b/trunk/src/drivers/sdl/sdl.cpp index 8994556a..7a1aa7ee 100644 --- a/trunk/src/drivers/sdl/sdl.cpp +++ b/trunk/src/drivers/sdl/sdl.cpp @@ -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; diff --git a/trunk/src/fceu.cpp b/trunk/src/fceu.cpp index b94c149e..47668a9e 100644 --- a/trunk/src/fceu.cpp +++ b/trunk/src/fceu.cpp @@ -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;