diff --git a/src/drivers/common/configSys.cpp b/src/drivers/common/configSys.cpp index 5db88655..fd36291c 100644 --- a/src/drivers/common/configSys.cpp +++ b/src/drivers/common/configSys.cpp @@ -569,6 +569,11 @@ Config::parse(int argc, * * Lines beginning with # are ignored. */ +char* Config::getConfigDirectory() +{ + return strdup(_dir.c_str()); +} + int Config::_load() { diff --git a/src/drivers/common/configSys.h b/src/drivers/common/configSys.h index d5a8a159..dc275b1d 100644 --- a/src/drivers/common/configSys.h +++ b/src/drivers/common/configSys.h @@ -75,6 +75,13 @@ public: * set the variables accordingly. */ int parse(int, char **); + + /** + * Returns the directory of the configuration files. + * + */ + + char* getConfigDirectory(); /** * Save all of the current configuration options to the diff --git a/src/drivers/sdl/config.h b/src/drivers/sdl/config.h index b337272d..6ce85dea 100644 --- a/src/drivers/sdl/config.h +++ b/src/drivers/sdl/config.h @@ -2,3 +2,5 @@ Config *InitConfig(void); void UpdateEMUCore(Config *); + + diff --git a/src/drivers/sdl/input.cpp b/src/drivers/sdl/input.cpp index ef70c1b5..91056b5c 100644 --- a/src/drivers/sdl/input.cpp +++ b/src/drivers/sdl/input.cpp @@ -24,7 +24,7 @@ #include "dface.h" #include "input.h" #include "config.h" - + #include "sdl-video.h" @@ -91,6 +91,9 @@ static uint32 MahjongData = 0; static uint32 FTrainerData = 0; static uint8 TopRiderData = 0; static uint8 BWorldData[1+13+1]; + +int movie_slot = 1; + static void UpdateFKB(void); static void UpdateGamepad(void); @@ -140,7 +143,9 @@ _keyonly(int a) #define keyonly(__a) _keyonly(MKK(__a)) -static int g_fkbEnabled = 0; +static int g_fkbEnabled = 0; + + /** * Parse keyboard commands and execute accordingly. @@ -216,8 +221,16 @@ KeyboardCommands() g_config->getOption("SDL.Hotkeys.SaveState", &key); if(_keyonly(key)) { - if(is_shift) { - FCEUI_SaveMovie(NULL,MOVIE_FLAG_NONE); + if(is_shift) { + char* fname = g_config->getConfigDirectory(); + char fnum[2]; + strcat(fname, "/fcm/"); + sprintf(fnum, "%d", movie_slot); + strcat(fname, fnum); + strcat(fname, ".fcm"); + + FCEUI_printf("Recording movie to %s\n", fname); + FCEUI_SaveMovie(fname, MOVIE_FLAG_NONE); } else { FCEUI_SaveState(NULL); } @@ -226,9 +239,16 @@ KeyboardCommands() g_config->getOption("SDL.Hotkeys.LoadState", &key); // f7 to load state, Shift-f7 to load movie if(_keyonly(key)) { - if(is_shift) { - //mbg merge 7/23/06 loadmovie takes another arg now - FCEUI_LoadMovie(NULL, false, false, false); + if(is_shift) { + char* fname = g_config->getConfigDirectory(); + char fnum[2]; + strcat(fname, "/fcm/"); + sprintf(fnum, "%d", movie_slot); + strcat(fname, fnum); + strcat(fname, ".fcm"); + + FCEUI_printf("Playing back movie located at %s\n", fname); + FCEUI_LoadMovie(fname , false, false, false); } else { FCEUI_LoadState(NULL); } @@ -332,11 +352,11 @@ do { \ } \ FCEUI_DispMessage("Barcode: %s", bbuf); \ } else { \ - /*if(is_shift) { \ - FCEUI_SelectMovie(x,1); \ - } else */{ \ + if(is_shift) { \ + movie_slot = x; \ + } else { \ FCEUI_SelectState(x,1); \ - } \ + } \ } \ } while(0)