--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);
|
||||
extern int config_override;
|
||||
|
||||
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 config_override = 0;
|
||||
|
||||
int clockrate;
|
||||
int insc=0;
|
||||
float mips,flops;
|
||||
|
|
@ -216,7 +218,7 @@ void getpath()
|
|||
void initpc(int argc, char *argv[])
|
||||
{
|
||||
//char *p;
|
||||
char *config_file = NULL;
|
||||
// char *config_file = NULL;
|
||||
int c;
|
||||
// allegro_init();
|
||||
|
||||
|
|
@ -237,14 +239,15 @@ void initpc(int argc, char *argv[])
|
|||
{
|
||||
if ((c+1) == argc)
|
||||
break;
|
||||
config_file = argv[c+1];
|
||||
strncpy(config_file_default, argv[c+1], 256);
|
||||
config_override = 1;
|
||||
c++;
|
||||
}
|
||||
}
|
||||
|
||||
// append_filename(config_file_default, pcempath, "pcem.cfg", 511);
|
||||
|
||||
loadconfig(config_file);
|
||||
loadconfig(NULL);
|
||||
pclog("Config loaded\n");
|
||||
// if (config_file)
|
||||
// saveconfig();
|
||||
|
|
|
|||
14
src/win.c
14
src/win.c
|
|
@ -576,8 +576,11 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
|
|||
{
|
||||
quited = 0;
|
||||
|
||||
if (!config_selection_open(NULL, 0))
|
||||
break;
|
||||
if (!config_override)
|
||||
{
|
||||
if (!config_selection_open(NULL, 0))
|
||||
break;
|
||||
}
|
||||
|
||||
ghMutex = CreateMutex(NULL, FALSE, NULL);
|
||||
menu = LoadMenu(hThisInstance, TEXT("MainMenu"));
|
||||
|
|
@ -618,6 +621,8 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
|
|||
|
||||
ghwnd = hwnd;
|
||||
|
||||
loadconfig(NULL);
|
||||
|
||||
if (vid_resize)
|
||||
SetWindowLong(hwnd, GWL_STYLE, WS_OVERLAPPEDWINDOW|WS_VISIBLE);
|
||||
else
|
||||
|
|
@ -642,8 +647,6 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
|
|||
CheckMenuItem(menu, IDM_BPB_DISABLE, bpb_disable ? MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(menu, IDM_VID_DISC, vid_disc_indicator ? MF_CHECKED : MF_UNCHECKED);
|
||||
|
||||
loadconfig(NULL);
|
||||
|
||||
if (!loadbios())
|
||||
{
|
||||
if (romset != -1)
|
||||
|
|
@ -757,6 +760,9 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
|
|||
|
||||
DestroyWindow(hwnd);
|
||||
CloseHandle(ghMutex);
|
||||
|
||||
if (config_override)
|
||||
break;
|
||||
}
|
||||
|
||||
closepc();
|
||||
|
|
|
|||
Loading…
Reference in a new issue