From 21785d952995ebf25b0c38b151dacae1a3b4b95b Mon Sep 17 00:00:00 2001 From: shinydoofy Date: Fri, 27 Mar 2009 21:12:20 +0000 Subject: [PATCH] SDL: added --no-config --- changelog.txt | 1 + documentation/Videolog.txt | 3 ++- src/drivers/sdl/config.cpp | 3 +++ src/drivers/sdl/sdl.cpp | 18 ++++++++++++++---- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/changelog.txt b/changelog.txt index 1f92010c..937ddce4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,5 @@ ---version 2.0.4 yet to be released--- +27-mar-2009 - shinydoofy - sdl - added --no-config 23-mar-2009 - adelikat - Win32 - blocked "hotkey explosion" by rshift on some laptops 22-mar-2009 - shinydoofy - sdl - added hotkey I and --inputdisplay {0|1|2|4} for toggling input display. 22-mar-2009 - shinydoofy - sdl - added commandline options for sound channels' volumes diff --git a/documentation/Videolog.txt b/documentation/Videolog.txt index 519bb570..15c349b1 100644 --- a/documentation/Videolog.txt +++ b/documentation/Videolog.txt @@ -10,6 +10,7 @@ Here's an example: --pal 0 \ --sound 1 --soundq 1 --soundrate 48000 --mute 1 \ --nospritelim 1 \ + --no-config 1 \ --videolog "mencoder - -o myfirstencodedrun.avi \ -ovc x264 -x264encopts qp=0 \ -oac pcm \ @@ -27,6 +28,7 @@ First of all, we started fceux with "./fceux" and gave it some options: "--soundrate 48000" sets the sound rate to 48kHz. "--mute 1" mutes FCEUX while still passing the sound to mencoder. This way you can capture a movie and still listen to your music without having the NES sounds in the background. "--nospritelim" deactivates the NES's 8 sprites per scanlines limit. + "--no-config 1" is used not to destroy your settings when creating an avi movie. "--videolog" calls mencoder: "-" states that we're getting the video stream from stdin. "-o" determines the name of the produced avi file. @@ -43,5 +45,4 @@ First of all, we started fceux with "./fceux" and gave it some options: Lastly, we load our desired ROM (in this case it's "myROM.nes"). To go for faster encoding and thus less quality, change "-ovc x264 -x264encopts qp=0" to "-ovc xvid -xvidencopts bitrate=200" and "-oac pcm" to "-oac mp3lame -lameopts mode=3:preset=60" to create a 200 kbps xvid video with 60 kbps of mono mp3 audio. -One last reminder: setting all these options for FCEUX of course changes the settings you've set before (like sound quality or whether or not to scale the video image). So be sure to backup your config file first (you'll find it in ~/.fceux/) if you don't want set it all up again after encoding. Good luck! :) diff --git a/src/drivers/sdl/config.cpp b/src/drivers/sdl/config.cpp index 66529636..320299b8 100644 --- a/src/drivers/sdl/config.cpp +++ b/src/drivers/sdl/config.cpp @@ -186,6 +186,9 @@ InitConfig() // display input config->addOption("inputdisplay", "SDL.InputDisplay", 0); + // overwrite the config file? + config->addOption("no-config", "SDL.NoConfig", 0); + // video playback config->addOption("playmov", "SDL.Movie", ""); diff --git a/src/drivers/sdl/sdl.cpp b/src/drivers/sdl/sdl.cpp index 140958e2..2019eb27 100644 --- a/src/drivers/sdl/sdl.cpp +++ b/src/drivers/sdl/sdl.cpp @@ -60,6 +60,7 @@ int gametype = 0; #ifdef CREATE_AVI int mutecapture; #endif +static int noconfig; char *DriverUsage="\ --pal {0|1} Uses PAL timing.\n\ @@ -108,7 +109,8 @@ char *DriverUsage="\ --inputcfg d Configures input device d on startup.\n\ --inputdisplay{0|1|2|4}Displays game input.\n\ --playmov f Plays back a recorded movie from filename f.\n\ ---fcmconvert f Converts fcm movie file f to fm2."; +--fcmconvert f Converts fcm movie file f to fm2.\n\ +--no-config {0,1} Don't change the config file"; /* Moved network options out while netplay is broken. --net s, -n s Connects to server 's' for TCP/IP network play.\n\ @@ -274,7 +276,8 @@ DriverInitialize(FCEUGI *gi) static void DriverKill() { - g_config->save(); + if (!noconfig) + g_config->save(); #ifndef WIN32 // XXX soules - capturing all these signals seems pointless @@ -517,7 +520,10 @@ SDL_GL_LoadLibrary(0); //in case you didnt specify a rom filename // This is here so that a default fceux.cfg will be created on first // run, even without a valid ROM to play. - g_config->save(); + // Unless, of course, there's actually --no-config given + g_config->getOption("SDL.NoConfig", &noconfig); + if (!noconfig) + g_config->save(); std::string s; g_config->getOption("SDL.InputCfg", &s); @@ -611,9 +617,13 @@ SDL_GL_LoadLibrary(0); { if(fname.find(".fm2") != std::string::npos) { - FCEUI_printf("Playing back movie located at %s\n", fname.c_str()); + FCEUI_printf("Playing back movie located at %s\n", fname.c_str()); FCEUI_LoadMovie(fname.c_str(), false, false, false); } + else + { + FCEUI_printf("Sorry, I don't know how to play back %s\n", fname.c_str()); + } }