diff --git a/trunk/src/drivers/win/args.cpp b/trunk/src/drivers/win/args.cpp index 838ef508..28b494df 100644 --- a/trunk/src/drivers/win/args.cpp +++ b/trunk/src/drivers/win/args.cpp @@ -29,6 +29,8 @@ 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 +char* DumpInput = 0; //Dumps all polled input to a binary file. Probably only useful with -playmovie. This is a rickety system, only useful in limited cases. +char* PlayInput = 0; //Replays all polled input from a binary file. Useful without playmovie. This is a rickety system, only useful in limited cases. extern bool turbo; @@ -65,6 +67,8 @@ char *ParseArgies(int argc, char *argv[]) {"-cfg",0,&ConfigToLoad,0x4001}, {"-avi",0,&AviToLoad,0x4001}, {"-avicapture",0,&AVICapture,0}, + {"-dumpinput",0,&DumpInput,0x4001}, + {"-playinput",0,&PlayInput,0x4001}, {0, 0, 0, 0}, }; diff --git a/trunk/src/drivers/win/args.h b/trunk/src/drivers/win/args.h index 40ff263c..3ee5d057 100644 --- a/trunk/src/drivers/win/args.h +++ b/trunk/src/drivers/win/args.h @@ -4,6 +4,8 @@ extern char* ConfigToLoad; //Contains the filename of the config file specified extern char* LuaToLoad; //Contains the filename of the lua script specified in the command line arguments extern char* PaletteToLoad; //Contains the filename of the palette file specified in the command line arguments extern char* AviToLoad; //Contains the filename of the Avi to be captured specified in the command line arguments +extern char* DumpInput; +extern char* PlayInput; extern bool replayReadOnlySetting; extern int replayStopFrameSetting; extern int PauseAfterLoad; diff --git a/trunk/src/drivers/win/main.cpp b/trunk/src/drivers/win/main.cpp index bcc1140d..8a6649c8 100644 --- a/trunk/src/drivers/win/main.cpp +++ b/trunk/src/drivers/win/main.cpp @@ -636,6 +636,15 @@ int main(int argc,char *argv[]) // Parse the commandline arguments t = ParseArgies(argc, argv); + if(PlayInput) + PlayInputFile = fopen(PlayInput, "rb"); + if(DumpInput) + DumpInputFile = fopen(DumpInput, "wb"); + + extern int disableBatteryLoading; + if(PlayInput || DumpInput) + disableBatteryLoading = 1; + int saved_pal_setting = !!pal_emulation; if (ConfigToLoad) diff --git a/trunk/src/input.cpp b/trunk/src/input.cpp index 2d0065ab..0ba35410 100644 --- a/trunk/src/input.cpp +++ b/trunk/src/input.cpp @@ -107,6 +107,9 @@ static bool FSAttached = false; JOYPORT joyports[2] = { JOYPORT(0), JOYPORT(1) }; FCPORT portFC; +FILE* DumpInputFile; +FILE* PlayInputFile; + static DECLFR(JPRead) { lagFlag = 0; @@ -139,6 +142,12 @@ static DECLFR(JPRead) } } + if(PlayInputFile) + ret = fgetc(PlayInputFile); + + if(DumpInputFile) + fputc(ret,DumpInputFile); + ret|=X.DB&0xC0; return(ret); diff --git a/trunk/src/input.h b/trunk/src/input.h index e5500575..a4ba1624 100644 --- a/trunk/src/input.h +++ b/trunk/src/input.h @@ -8,6 +8,10 @@ void LagCounterToggle(void); +extern FILE* PlayInputFile; +extern FILE* DumpInputFile; + + class MovieRecord; //MBG TODO - COMBINE THESE INPUTC AND INPUTCFC