diff --git a/sys/windows/windmain.c b/sys/windows/windmain.c index 37a202378..e80d40cca 100644 --- a/sys/windows/windmain.c +++ b/sys/windows/windmain.c @@ -198,6 +198,7 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ #endif gh.hname = "NetHack"; /* used for syntax messages */ + set_emergency_io(); #ifndef MSWIN_GRAPHICS early_init(argc, argv); /* already in WinMain for MSWIN_GRAPHICS */ #endif @@ -219,7 +220,6 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ nethack_enter_consoletty(); consoletty_open(1); #endif - set_emergency_io(); #ifdef EARLY_CONFIGFILE_PASS rcfile_interface_options(); @@ -237,10 +237,6 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ choose_windows( windowtype); /* sets all the window port function pointers */ - init_nhwindows(&argc, argv); - /* if (GUILaunched || IsDebuggerPresent()) */ - getreturn_enabled = TRUE; - #if defined(CHDIR) && !defined(NOCWD_ASSUMPTIONS) /* Save current directory and make sure it gets restored when * the game is exited. @@ -252,19 +248,19 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ set_default_prefix_locations( argv[0]); /* must be re-done after initoptions_init() * which clears out gp.fqn_prefix[] */ - iflags.windowtype_deferred = TRUE; + // iflags.windowtype_deferred = TRUE; program_state.early_options = 1; early_options(&argc, &argv, &dir); program_state.early_options = 0; - initoptions(); + /* if (GUILaunched || IsDebuggerPresent()) */ + getreturn_enabled = TRUE; + initoptions(); #if defined(CHDIR) && !defined(NOCWD_ASSUMPTIONS) chdir(gf.fqn_prefix[HACKPREFIX]); #endif - - check_recordfile((char *) 0); /* did something earlier flag a need to exit without starting a game? */ if (windows_startup_state > 0) { @@ -292,7 +288,21 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ && (strstri(argv[0], "nethackw.exe") || GUILaunched)) iflags.windowtype_locked = TRUE; #endif +#ifdef WINCHAIN + commit_windowchain(); +#endif + init_nhwindows(&argc, argv); +#ifdef TTY_GRAPHICS + if WINDOWPORT(tty) { + int i; + for (i = 0; i < 20; ++i) { + nh_delay_output(); + } + + /* wait_synch(); */ + } +#endif #ifdef DLB if (!dlb_init()) { pline("%s\n%s\n%s\n%s\n\n", copyright_banner_line(1), @@ -318,9 +328,6 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ iflags.use_background_glyph = FALSE; if (WINDOWPORT(mswin)) iflags.use_background_glyph = TRUE; -#ifdef WINCHAIN - commit_windowchain(); -#endif // init_nhwindows(&argc, argv); diff --git a/win/win32/NetHackW.c b/win/win32/NetHackW.c index 56d8bb7c7..b2f76409f 100644 --- a/win/win32/NetHackW.c +++ b/win/win32/NetHackW.c @@ -211,6 +211,13 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, free(savefile); } GUILaunched = 1; + /* emergency IO */ + windowprocs.win_raw_print = mswin_raw_print; + windowprocs.win_raw_print_bold = mswin_raw_print_bold; + mswin_nh_input_init(); + windowprocs.win_nhgetch = mswin_nhgetch; + windowprocs.win_wait_synch = mswin_wait_synch; + /* let nethackw_main do the argument processing */ nethackw_main(argc, argv); /* not reached */