--config command line option now bypasses configuration manager.
This commit is contained in:
parent
172e88ed8b
commit
aad1179e47
3 changed files with 17 additions and 7 deletions
|
|
@ -533,6 +533,7 @@ extern uint64_t timer_freq;
|
||||||
|
|
||||||
|
|
||||||
void loadconfig(char *fn);
|
void loadconfig(char *fn);
|
||||||
|
extern int config_override;
|
||||||
|
|
||||||
extern int infocus;
|
extern int infocus;
|
||||||
|
|
||||||
|
|
|
||||||
9
src/pc.c
9
src/pc.c
|
|
@ -57,6 +57,8 @@ int vid_resize, vid_api;
|
||||||
|
|
||||||
int cycles_lost = 0;
|
int cycles_lost = 0;
|
||||||
|
|
||||||
|
int config_override = 0;
|
||||||
|
|
||||||
int clockrate;
|
int clockrate;
|
||||||
int insc=0;
|
int insc=0;
|
||||||
float mips,flops;
|
float mips,flops;
|
||||||
|
|
@ -216,7 +218,7 @@ void getpath()
|
||||||
void initpc(int argc, char *argv[])
|
void initpc(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
//char *p;
|
//char *p;
|
||||||
char *config_file = NULL;
|
// char *config_file = NULL;
|
||||||
int c;
|
int c;
|
||||||
// allegro_init();
|
// allegro_init();
|
||||||
|
|
||||||
|
|
@ -237,14 +239,15 @@ void initpc(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
if ((c+1) == argc)
|
if ((c+1) == argc)
|
||||||
break;
|
break;
|
||||||
config_file = argv[c+1];
|
strncpy(config_file_default, argv[c+1], 256);
|
||||||
|
config_override = 1;
|
||||||
c++;
|
c++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// append_filename(config_file_default, pcempath, "pcem.cfg", 511);
|
// append_filename(config_file_default, pcempath, "pcem.cfg", 511);
|
||||||
|
|
||||||
loadconfig(config_file);
|
loadconfig(NULL);
|
||||||
pclog("Config loaded\n");
|
pclog("Config loaded\n");
|
||||||
// if (config_file)
|
// if (config_file)
|
||||||
// saveconfig();
|
// saveconfig();
|
||||||
|
|
|
||||||
14
src/win.c
14
src/win.c
|
|
@ -576,8 +576,11 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
|
||||||
{
|
{
|
||||||
quited = 0;
|
quited = 0;
|
||||||
|
|
||||||
if (!config_selection_open(NULL, 0))
|
if (!config_override)
|
||||||
break;
|
{
|
||||||
|
if (!config_selection_open(NULL, 0))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
ghMutex = CreateMutex(NULL, FALSE, NULL);
|
ghMutex = CreateMutex(NULL, FALSE, NULL);
|
||||||
menu = LoadMenu(hThisInstance, TEXT("MainMenu"));
|
menu = LoadMenu(hThisInstance, TEXT("MainMenu"));
|
||||||
|
|
@ -618,6 +621,8 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
|
||||||
|
|
||||||
ghwnd = hwnd;
|
ghwnd = hwnd;
|
||||||
|
|
||||||
|
loadconfig(NULL);
|
||||||
|
|
||||||
if (vid_resize)
|
if (vid_resize)
|
||||||
SetWindowLong(hwnd, GWL_STYLE, WS_OVERLAPPEDWINDOW|WS_VISIBLE);
|
SetWindowLong(hwnd, GWL_STYLE, WS_OVERLAPPEDWINDOW|WS_VISIBLE);
|
||||||
else
|
else
|
||||||
|
|
@ -642,8 +647,6 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
|
||||||
CheckMenuItem(menu, IDM_BPB_DISABLE, bpb_disable ? MF_CHECKED : MF_UNCHECKED);
|
CheckMenuItem(menu, IDM_BPB_DISABLE, bpb_disable ? MF_CHECKED : MF_UNCHECKED);
|
||||||
CheckMenuItem(menu, IDM_VID_DISC, vid_disc_indicator ? MF_CHECKED : MF_UNCHECKED);
|
CheckMenuItem(menu, IDM_VID_DISC, vid_disc_indicator ? MF_CHECKED : MF_UNCHECKED);
|
||||||
|
|
||||||
loadconfig(NULL);
|
|
||||||
|
|
||||||
if (!loadbios())
|
if (!loadbios())
|
||||||
{
|
{
|
||||||
if (romset != -1)
|
if (romset != -1)
|
||||||
|
|
@ -757,6 +760,9 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
|
||||||
|
|
||||||
DestroyWindow(hwnd);
|
DestroyWindow(hwnd);
|
||||||
CloseHandle(ghMutex);
|
CloseHandle(ghMutex);
|
||||||
|
|
||||||
|
if (config_override)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
closepc();
|
closepc();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue