More Windows command line options
This commit is contained in:
parent
f22a4735b8
commit
2fed26a75a
|
@ -24,6 +24,7 @@
|
||||||
#include "../common/args.h"
|
#include "../common/args.h"
|
||||||
|
|
||||||
char* MovieToLoad = 0;
|
char* MovieToLoad = 0;
|
||||||
|
char* StateToLoad = 0;
|
||||||
|
|
||||||
// TODO: Parsing arguments needs to be improved a lot. A LOT.
|
// 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},
|
{"-clipsides",0,&eoptions,0x8000|EO_CLIPSIDES},
|
||||||
{"-nothrottle",0,&eoptions,0x8000|EO_NOTHROTTLE},
|
{"-nothrottle",0,&eoptions,0x8000|EO_NOTHROTTLE},
|
||||||
{"-playmovie",0,&MovieToLoad,0x4001},
|
{"-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},
|
{0, 0, 0, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,5 @@
|
||||||
extern char* MovieToLoad;
|
extern char* MovieToLoad;
|
||||||
|
extern char* StateToLoad;
|
||||||
|
extern int replayReadOnlySetting;
|
||||||
|
extern int replayStopFrameSetting;
|
||||||
char *ParseArgies(int argc, char *argv[]);
|
char *ParseArgies(int argc, char *argv[]);
|
||||||
|
|
|
@ -36,13 +36,8 @@
|
||||||
extern CFGSTRUCT NetplayConfig[];
|
extern CFGSTRUCT NetplayConfig[];
|
||||||
extern CFGSTRUCT InputConfig[];
|
extern CFGSTRUCT InputConfig[];
|
||||||
extern CFGSTRUCT HotkeyConfig[];
|
extern CFGSTRUCT HotkeyConfig[];
|
||||||
extern int autoHoldKey, autoHoldClearKey;
|
|
||||||
extern int frame_display;
|
|
||||||
extern int input_display;
|
|
||||||
extern char *BasicBotDir;
|
extern char *BasicBotDir;
|
||||||
extern int allowUDLR;
|
extern int autoHoldKey, autoHoldClearKey;
|
||||||
extern int pauseAfterPlayback;
|
|
||||||
extern int EnableBackgroundInput;
|
|
||||||
|
|
||||||
//window positions:
|
//window positions:
|
||||||
extern int ChtPosX,ChtPosY;
|
extern int ChtPosX,ChtPosY;
|
||||||
|
|
|
@ -627,6 +627,11 @@ int main(int argc,char *argv[])
|
||||||
|
|
||||||
fullscreen = !!fullscreen;
|
fullscreen = !!fullscreen;
|
||||||
soundo = !!soundo;
|
soundo = !!soundo;
|
||||||
|
frame_display = !!frame_display;
|
||||||
|
input_display = !!input_display;
|
||||||
|
allowUDLR = !!allowUDLR;
|
||||||
|
pauseAfterPlayback = !!pauseAfterPlayback;
|
||||||
|
EnableBackgroundInput = !!EnableBackgroundInput;
|
||||||
|
|
||||||
FCEUI_SetSoundVolume(soundvolume);
|
FCEUI_SetSoundVolume(soundvolume);
|
||||||
FCEUI_SetSoundQuality(soundquality);
|
FCEUI_SetSoundQuality(soundquality);
|
||||||
|
@ -683,10 +688,16 @@ int main(int argc,char *argv[])
|
||||||
|
|
||||||
if(GameInfo && MovieToLoad)
|
if(GameInfo && MovieToLoad)
|
||||||
{
|
{
|
||||||
FCEUI_LoadMovie(MovieToLoad, 1, 0);
|
FCEUI_LoadMovie(MovieToLoad, replayReadOnlySetting, replayStopFrameSetting);
|
||||||
free(MovieToLoad);
|
free(MovieToLoad);
|
||||||
MovieToLoad = NULL;
|
MovieToLoad = NULL;
|
||||||
}
|
}
|
||||||
|
if(GameInfo && StateToLoad)
|
||||||
|
{
|
||||||
|
FCEUI_LoadState(StateToLoad);
|
||||||
|
free(StateToLoad);
|
||||||
|
StateToLoad = NULL;
|
||||||
|
}
|
||||||
if (MemWatchLoadOnStart) CreateMemWatch();
|
if (MemWatchLoadOnStart) CreateMemWatch();
|
||||||
|
|
||||||
UpdateCheckedMenuItems();
|
UpdateCheckedMenuItems();
|
||||||
|
|
|
@ -32,6 +32,11 @@ extern int genie;
|
||||||
// Flag that indicates whether PAL Emulation is enabled or not.
|
// Flag that indicates whether PAL Emulation is enabled or not.
|
||||||
extern int pal_emulation;
|
extern int pal_emulation;
|
||||||
extern int status_icon;
|
extern int status_icon;
|
||||||
|
extern int frame_display;
|
||||||
|
extern int input_display;
|
||||||
|
extern int allowUDLR;
|
||||||
|
extern int pauseAfterPlayback;
|
||||||
|
extern int EnableBackgroundInput;
|
||||||
|
|
||||||
extern int vmod;
|
extern int vmod;
|
||||||
static char *gfsdir=0;
|
static char *gfsdir=0;
|
||||||
|
|
|
@ -8,10 +8,9 @@ bool autoInfo1003 = true; //This is a hacky variable that checks when dialog 100
|
||||||
|
|
||||||
extern FCEUGI *GameInfo;
|
extern FCEUGI *GameInfo;
|
||||||
|
|
||||||
//retains the state of the readonly checkbox
|
//retains the state of the readonly checkbox and stopframe value
|
||||||
static bool ReplayDialogReadOnlyStatus;
|
bool replayReadOnlySetting;
|
||||||
//retains the state of the stopframe value
|
int replayStopFrameSetting = 0;
|
||||||
static int ReplayDialogStopFrame = 0;
|
|
||||||
|
|
||||||
void RefreshThrottleFPS();
|
void RefreshThrottleFPS();
|
||||||
|
|
||||||
|
@ -105,7 +104,7 @@ void UpdateReplayDialog(HWND hwndDlg)
|
||||||
|
|
||||||
// remember the previous setting for the read-only checkbox
|
// remember the previous setting for the read-only checkbox
|
||||||
if(IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CHECK_READONLY)))
|
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)
|
if(fn)
|
||||||
{
|
{
|
||||||
|
@ -132,7 +131,7 @@ void UpdateReplayDialog(HWND hwndDlg)
|
||||||
SetWindowTextA(GetDlgItem(hwndDlg,IDC_LABEL_UNDOCOUNT), tmp); // rerecord
|
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
|
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"));
|
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:
|
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);
|
SendDlgItemMessage(hwndDlg, IDC_CHECK_STOPMOVIE,BM_SETCHECK, BST_UNCHECKED, 0);
|
||||||
|
|
||||||
char* findGlob[2] = {FCEU_MakeFName(FCEUMKF_MOVIEGLOB, 0, 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
|
// TODO: warn the user when they open a movie made with a different ROM
|
||||||
char* fn=GetReplayPath(hwndDlg);
|
char* fn=GetReplayPath(hwndDlg);
|
||||||
//char TempArray[16]; //mbg merge 7/17/06 removed
|
//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};
|
char offset1Str[32]={0};
|
||||||
|
|
||||||
SendDlgItemMessage(hwndDlg, IDC_EDIT_STOPFRAME, WM_GETTEXT, (WPARAM)32, (LPARAM)offset1Str);
|
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);
|
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.
|
/// Show movie replay dialog and replay the movie if necessary.
|
||||||
void FCEUD_MovieReplayFrom(void)
|
void FCEUD_MovieReplayFrom(void)
|
||||||
{
|
{
|
||||||
ReplayDialogReadOnlyStatus = FCEUI_GetMovieToggleReadOnly();
|
replayReadOnlySetting = FCEUI_GetMovieToggleReadOnly();
|
||||||
|
|
||||||
char* fn = (char*)DialogBox(fceu_hInstance, "IDD_REPLAYINP", hAppWnd, ReplayDialogProc);
|
char* fn = (char*)DialogBox(fceu_hInstance, "IDD_REPLAYINP", hAppWnd, ReplayDialogProc);
|
||||||
|
|
||||||
if(fn)
|
if(fn)
|
||||||
{
|
{
|
||||||
FCEUI_LoadMovie(fn, ReplayDialogReadOnlyStatus, ReplayDialogStopFrame);
|
FCEUI_LoadMovie(fn, replayReadOnlySetting, replayStopFrameSetting);
|
||||||
|
|
||||||
free(fn);
|
free(fn);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue