add -dumpinput and -playinput functions for windows port which is a minimally baked option to use poll-based input to replay a movie, so you can test playthroughs on a romhack whose lag has changed

This commit is contained in:
zeromus 2015-11-15 21:26:52 +00:00
parent 4eb00bdca6
commit 0597f73fe3
5 changed files with 28 additions and 0 deletions

View File

@ -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},
};

View File

@ -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;

View File

@ -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)

View File

@ -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);

View File

@ -8,6 +8,10 @@
void LagCounterToggle(void);
extern FILE* PlayInputFile;
extern FILE* DumpInputFile;
class MovieRecord;
//MBG TODO - COMBINE THESE INPUTC AND INPUTCFC