diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index 79853012..5a6c7624 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -900,3 +900,6 @@ ConsoleWindow=0 ;Console window position and size data. Do not modify ConsoleWindowData= + +;Set the code page for the console window (Default is your system code page) +ConsoleCodePage=0 diff --git a/sfall/Logging.cpp b/sfall/Logging.cpp index b69aa2af..d1a9e445 100644 --- a/sfall/Logging.cpp +++ b/sfall/Logging.cpp @@ -133,6 +133,9 @@ void ConsoleWindow::init() { dlog_f("Failed to allocate console: 0x%x\n", DL_MAIN, GetLastError()); return; } + int cp = IniReader::GetIntDefaultConfig("Debugging", "ConsoleCodePage", 0); + if (cp > 0) SetConsoleOutputCP(cp); + freopen("CONOUT$", "w", stdout); // this allows to print to console via std::cout if (_mode & ConsoleSource::GAME) { diff --git a/sfall/Modules/LoadGameHook.cpp b/sfall/Modules/LoadGameHook.cpp index 9b8e4c87..d5800725 100644 --- a/sfall/Modules/LoadGameHook.cpp +++ b/sfall/Modules/LoadGameHook.cpp @@ -375,7 +375,6 @@ static void __stdcall NewGame_Before() { } static void __stdcall NewGame_After() { - dlogr("New Game started.", DL_MAIN); // OnAfterNewGame if (HeroAppearance::appModEnabled) { SetNewCharAppearanceGlobals(); @@ -383,6 +382,7 @@ static void __stdcall NewGame_After() { } RunOnAfterGameStarted(); gameLoaded = true; + dlogr("New Game started.", DL_MAIN); } static void __declspec(naked) main_load_new_hook() {