diff --git a/changelog.txt b/changelog.txt index b863d628..a83cc8f4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,4 @@ +13-june-2010 - adelikat - Win32 - avi capture commandline argument and related parameters 12-june-2010 - adelikat - Save Turbo frame skip amount to config so that it can be customized by user 12-june-2010 - adelikat - Lua - fix speed.mode() so that normal turns off turbo 12-june-2010 - CaH4e3 - Fix Young Indiana Jones Chronicals diff --git a/src/drivers/win/args.cpp b/src/drivers/win/args.cpp index 99c68999..ce6a3899 100644 --- a/src/drivers/win/args.cpp +++ b/src/drivers/win/args.cpp @@ -29,6 +29,7 @@ char* ConfigToLoad = 0; //Loads a specific .cfg file (loads before any other co char* LuaToLoad = 0; //Loads a specific lua file char* PaletteToLoad = 0; //Loads a specific palette file char* AviToLoad = 0; //Starts an avi capture at startup + extern bool turbo; // TODO: Parsing arguments needs to be improved a lot. A LOT. @@ -61,6 +62,7 @@ char *ParseArgies(int argc, char *argv[]) {"-pause",0,&PauseAfterLoad,0}, {"-cfg",0,&ConfigToLoad,0x4001}, {"-avi",0,&AviToLoad,0x4001}, + {"-avicapture",0,&AVICapture,0}, {0, 0, 0, 0}, }; diff --git a/src/drivers/win/args.h b/src/drivers/win/args.h index a5717e10..40ff263c 100644 --- a/src/drivers/win/args.h +++ b/src/drivers/win/args.h @@ -7,4 +7,5 @@ extern char* AviToLoad; //Contains the filename of the Avi to be captured speci extern bool replayReadOnlySetting; extern int replayStopFrameSetting; extern int PauseAfterLoad; +extern int AVICapture; //This initiates AVI capture mode with a frame number, on that frame number the AVI will stop, FCEUX will close, and a special return value will be set char *ParseArgies(int argc, char *argv[]); diff --git a/src/drivers/win/aviout.cpp b/src/drivers/win/aviout.cpp index 1c6c9c71..6da63b26 100644 --- a/src/drivers/win/aviout.cpp +++ b/src/drivers/win/aviout.cpp @@ -15,7 +15,8 @@ extern PALETTEENTRY *color_palette; #define VIDEO_WIDTH 256 //adelikat: TODO - perhaps put this in AVIFile -bool disableMovieMessages = false; +bool disableMovieMessages = false; +int AVICapture; //This initiates AVI capture mode with a frame number, on that frame number the AVI will stop, FCEUX will close, and a special return value will be set. The intent is for this to be used in commandline static struct AVIFile { diff --git a/src/drivers/win/main.cpp b/src/drivers/win/main.cpp index 4e8b7476..6e893043 100644 --- a/src/drivers/win/main.cpp +++ b/src/drivers/win/main.cpp @@ -135,6 +135,8 @@ int soundNoisevol = 256; //Sound channel Noise - volume control int soundPCMvol = 256; //Sound channel PCM - volume control //------------------------------------------------- +int KillFCEUXonFrame = 0; //TODO: clean up, this is used in fceux, move it over there? + double saspectw = 1, saspecth = 1; double winsizemulx = 1, winsizemuly = 1; int genie = 0; @@ -799,6 +801,15 @@ int main(int argc,char *argv[]) free(LuaToLoad); LuaToLoad = NULL; } + + //Initiates AVI capture mode, will set up proper settings, and close FCUEX once capturing is finished + if(AVICapture && AviToLoad) //Must be used in conjunction with AviToLoad + { + //We want to disable flags that will pause the emulator + PauseAfterLoad = 0; + pauseAfterPlayback = 0; + KillFCEUXonFrame = AVICapture; + } if(AviToLoad) { @@ -861,7 +872,7 @@ doloopy: FCEUI_Kill(); delete debugSystem; - + return(0); } diff --git a/src/fceu.cpp b/src/fceu.cpp index 8df7a4b5..36795cac 100644 --- a/src/fceu.cpp +++ b/src/fceu.cpp @@ -692,6 +692,9 @@ void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int ski RamChange(); UpdateLogWindow(); //FCEUI_AviVideoUpdate(XBuf); + extern int KillFCEUXonFrame; + if (FCEUMOV_GetFrame() >= KillFCEUXonFrame) + DoFCEUExit(); #endif timestampbase += timestamp;