Console is now only initialized when the emulator is started with the -D / --debug parameter.
This commit is contained in:
@@ -233,6 +233,7 @@ CreateConsole(int init)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (! init) {
|
if (! init) {
|
||||||
|
if (force_debug)
|
||||||
FreeConsole();
|
FreeConsole();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -271,6 +272,13 @@ CreateConsole(int init)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
CloseConsole(void)
|
||||||
|
{
|
||||||
|
CreateConsole(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Process the commandline, and create standard argc/argv array. */
|
/* Process the commandline, and create standard argc/argv array. */
|
||||||
static int
|
static int
|
||||||
ProcessCommandLine(wchar_t ***argw)
|
ProcessCommandLine(wchar_t ***argw)
|
||||||
@@ -362,6 +370,7 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow)
|
|||||||
set_language(0x0409);
|
set_language(0x0409);
|
||||||
|
|
||||||
/* Create console window. */
|
/* Create console window. */
|
||||||
|
if (force_debug)
|
||||||
CreateConsole(1);
|
CreateConsole(1);
|
||||||
|
|
||||||
/* Process the command line for options. */
|
/* Process the command line for options. */
|
||||||
@@ -370,6 +379,7 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow)
|
|||||||
/* Pre-initialize the system, this loads the config file. */
|
/* Pre-initialize the system, this loads the config file. */
|
||||||
if (! pc_init(argc, argw)) {
|
if (! pc_init(argc, argw)) {
|
||||||
/* Detach from console. */
|
/* Detach from console. */
|
||||||
|
if (force_debug)
|
||||||
CreateConsole(0);
|
CreateConsole(0);
|
||||||
|
|
||||||
if (source_hwnd)
|
if (source_hwnd)
|
||||||
@@ -380,9 +390,8 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow)
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Cleanup: we may no longer need the console. */
|
if (force_debug)
|
||||||
if (! force_debug)
|
atexit(CloseConsole);
|
||||||
CreateConsole(0);
|
|
||||||
|
|
||||||
/* Handle our GUI. */
|
/* Handle our GUI. */
|
||||||
i = ui_init(nCmdShow);
|
i = ui_init(nCmdShow);
|
||||||
|
|||||||
Reference in New Issue
Block a user