More Windows command line options

This commit is contained in:
jeblanchard 2008-05-29 17:29:00 +00:00
parent f22a4735b8
commit 2fed26a75a
6 changed files with 40 additions and 18 deletions

View File

@ -24,6 +24,7 @@
#include "../common/args.h"
char* MovieToLoad = 0;
char* StateToLoad = 0;
// TODO: Parsing arguments needs to be improved a lot. A LOT.
@ -42,6 +43,14 @@ char *ParseArgies(int argc, char *argv[])
{"-clipsides",0,&eoptions,0x8000|EO_CLIPSIDES},
{"-nothrottle",0,&eoptions,0x8000|EO_NOTHROTTLE},
{"-playmovie",0,&MovieToLoad,0x4001},
{"-loadstate",0,&StateToLoad,0x4001},
{"-readonly",0,&replayReadOnlySetting,0},
{"-stopframe",0,&replayStopFrameSetting,0},
{"-framedisplay",0,&frame_display,0},
{"-inputdisplay",0,&input_display,0},
{"-allowUDLR",0,&allowUDLR,0},
{"-stopmovie",0,&pauseAfterPlayback,0},
{"-bginput",0,&EnableBackgroundInput,0},
{0, 0, 0, 0},
};

View File

@ -1,2 +1,5 @@
extern char* MovieToLoad;
extern char* StateToLoad;
extern int replayReadOnlySetting;
extern int replayStopFrameSetting;
char *ParseArgies(int argc, char *argv[]);

View File

@ -36,13 +36,8 @@
extern CFGSTRUCT NetplayConfig[];
extern CFGSTRUCT InputConfig[];
extern CFGSTRUCT HotkeyConfig[];
extern int autoHoldKey, autoHoldClearKey;
extern int frame_display;
extern int input_display;
extern char *BasicBotDir;
extern int allowUDLR;
extern int pauseAfterPlayback;
extern int EnableBackgroundInput;
extern int autoHoldKey, autoHoldClearKey;
//window positions:
extern int ChtPosX,ChtPosY;

View File

@ -627,6 +627,11 @@ int main(int argc,char *argv[])
fullscreen = !!fullscreen;
soundo = !!soundo;
frame_display = !!frame_display;
input_display = !!input_display;
allowUDLR = !!allowUDLR;
pauseAfterPlayback = !!pauseAfterPlayback;
EnableBackgroundInput = !!EnableBackgroundInput;
FCEUI_SetSoundVolume(soundvolume);
FCEUI_SetSoundQuality(soundquality);
@ -683,10 +688,16 @@ int main(int argc,char *argv[])
if(GameInfo && MovieToLoad)
{
FCEUI_LoadMovie(MovieToLoad, 1, 0);
FCEUI_LoadMovie(MovieToLoad, replayReadOnlySetting, replayStopFrameSetting);
free(MovieToLoad);
MovieToLoad = NULL;
}
if(GameInfo && StateToLoad)
{
FCEUI_LoadState(StateToLoad);
free(StateToLoad);
StateToLoad = NULL;
}
if (MemWatchLoadOnStart) CreateMemWatch();
UpdateCheckedMenuItems();

View File

@ -32,6 +32,11 @@ extern int genie;
// Flag that indicates whether PAL Emulation is enabled or not.
extern int pal_emulation;
extern int status_icon;
extern int frame_display;
extern int input_display;
extern int allowUDLR;
extern int pauseAfterPlayback;
extern int EnableBackgroundInput;
extern int vmod;
static char *gfsdir=0;

View File

@ -8,10 +8,9 @@ bool autoInfo1003 = true; //This is a hacky variable that checks when dialog 100
extern FCEUGI *GameInfo;
//retains the state of the readonly checkbox
static bool ReplayDialogReadOnlyStatus;
//retains the state of the stopframe value
static int ReplayDialogStopFrame = 0;
//retains the state of the readonly checkbox and stopframe value
bool replayReadOnlySetting;
int replayStopFrameSetting = 0;
void RefreshThrottleFPS();
@ -105,7 +104,7 @@ void UpdateReplayDialog(HWND hwndDlg)
// remember the previous setting for the read-only checkbox
if(IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CHECK_READONLY)))
ReplayDialogReadOnlyStatus = (SendDlgItemMessage(hwndDlg, IDC_CHECK_READONLY, BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0;
replayReadOnlySetting = (SendDlgItemMessage(hwndDlg, IDC_CHECK_READONLY, BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0;
if(fn)
{
@ -132,7 +131,7 @@ void UpdateReplayDialog(HWND hwndDlg)
SetWindowTextA(GetDlgItem(hwndDlg,IDC_LABEL_UNDOCOUNT), tmp); // rerecord
EnableWindow(GetDlgItem(hwndDlg,IDC_CHECK_READONLY),(info.read_only)? FALSE : TRUE); // disable read-only checkbox if the file access is read-only
SendDlgItemMessage(hwndDlg,IDC_CHECK_READONLY,BM_SETCHECK,info.read_only ? BST_CHECKED : (ReplayDialogReadOnlyStatus ? BST_CHECKED : BST_UNCHECKED), 0);
SendDlgItemMessage(hwndDlg,IDC_CHECK_READONLY,BM_SETCHECK,info.read_only ? BST_CHECKED : (replayReadOnlySetting ? BST_CHECKED : BST_UNCHECKED), 0);
SetWindowText(GetDlgItem(hwndDlg,IDC_LABEL_RECORDEDFROM),info.poweron ? "Power-On" : (info.reset?"Soft-Reset":"Savestate"));
@ -253,7 +252,7 @@ BOOL CALLBACK ReplayDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
{
case WM_INITDIALOG:
{
SendDlgItemMessage(hwndDlg, IDC_CHECK_READONLY, BM_SETCHECK, ReplayDialogReadOnlyStatus?BST_CHECKED:BST_UNCHECKED, 0);
SendDlgItemMessage(hwndDlg, IDC_CHECK_READONLY, BM_SETCHECK, replayReadOnlySetting?BST_CHECKED:BST_UNCHECKED, 0);
SendDlgItemMessage(hwndDlg, IDC_CHECK_STOPMOVIE,BM_SETCHECK, BST_UNCHECKED, 0);
char* findGlob[2] = {FCEU_MakeFName(FCEUMKF_MOVIEGLOB, 0, 0),
@ -476,12 +475,12 @@ BOOL CALLBACK ReplayDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
// TODO: warn the user when they open a movie made with a different ROM
char* fn=GetReplayPath(hwndDlg);
//char TempArray[16]; //mbg merge 7/17/06 removed
ReplayDialogReadOnlyStatus = (SendDlgItemMessage(hwndDlg, IDC_CHECK_READONLY, BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0;
replayReadOnlySetting = (SendDlgItemMessage(hwndDlg, IDC_CHECK_READONLY, BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0;
char offset1Str[32]={0};
SendDlgItemMessage(hwndDlg, IDC_EDIT_STOPFRAME, WM_GETTEXT, (WPARAM)32, (LPARAM)offset1Str);
ReplayDialogStopFrame = (SendDlgItemMessage(hwndDlg, IDC_CHECK_STOPMOVIE, BM_GETCHECK,0,0) == BST_CHECKED)? strtol(offset1Str,0,10):0;
replayStopFrameSetting = (SendDlgItemMessage(hwndDlg, IDC_CHECK_STOPMOVIE, BM_GETCHECK,0,0) == BST_CHECKED)? strtol(offset1Str,0,10):0;
EndDialog(hwndDlg, (INT_PTR)fn);
}
@ -520,13 +519,13 @@ BOOL CALLBACK ReplayDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
/// Show movie replay dialog and replay the movie if necessary.
void FCEUD_MovieReplayFrom(void)
{
ReplayDialogReadOnlyStatus = FCEUI_GetMovieToggleReadOnly();
replayReadOnlySetting = FCEUI_GetMovieToggleReadOnly();
char* fn = (char*)DialogBox(fceu_hInstance, "IDD_REPLAYINP", hAppWnd, ReplayDialogProc);
if(fn)
{
FCEUI_LoadMovie(fn, ReplayDialogReadOnlyStatus, ReplayDialogStopFrame);
FCEUI_LoadMovie(fn, replayReadOnlySetting, replayStopFrameSetting);
free(fn);