diff --git a/src/drivers/sdl/config.cpp b/src/drivers/sdl/config.cpp index 267f5ae2..68ee2f6b 100644 --- a/src/drivers/sdl/config.cpp +++ b/src/drivers/sdl/config.cpp @@ -180,6 +180,9 @@ InitConfig() // Allow for input configuration config->addOption('i', "inputcfg", "SDL.InputCfg", InputCfg); + + // video playback + config->addOption('z', "play", "SDL.Movie", ""); // GamePad 0 - 3 for(unsigned int i = 0; i < GAMEPAD_NUM_DEVICES; i++) { diff --git a/src/drivers/sdl/sdl.cpp b/src/drivers/sdl/sdl.cpp index 761a38ff..3fd5c122 100644 --- a/src/drivers/sdl/sdl.cpp +++ b/src/drivers/sdl/sdl.cpp @@ -18,6 +18,7 @@ #include "../common/cheat.h" #include "../../fceu.h" +#include "../../movie.h" #include "input.h" #include "dface.h" @@ -28,6 +29,7 @@ #include "../common/configSys.h" + #ifdef WIN32 #include #endif @@ -90,7 +92,8 @@ char *DriverUsage= --user s, -u s Sets the nickname to use in network play.\n\ --pass s, -w s Sets password to use for connecting to the server.\n\ --netkey s, -k s Uses key 's' to create a unique session for the game loaded.\n\ ---players x, -l x Sets the number of local players.\n"; +--players x, -l x Sets the number of local players.\n\ +--play f Plays back a recorded movie from filename f.\n"; // global configuration object @@ -510,6 +513,15 @@ main(int argc, SDL_Quit(); return -1; } + + // movie playback + std::string fname; + g_config->getOption("SDL.Movie", &fname); + if (fname != "") + { + FCEUI_LoadMovie((char*)fname.c_str(), false, false, false); + g_config->setOption("SDL.Movie", ""); + } // loop playing the game while(GameInfo) {