diff options
Diffstat (limited to 'runtime/src/main.cpp')
| -rw-r--r-- | runtime/src/main.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index 4ee522b47..49917bf18 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp | |||
| @@ -140,7 +140,22 @@ int wmain(int argc, wchar_t** argv) { | |||
| 140 | std::fprintf(stderr, "error: %s has no entry point\n", main_module.name.c_str()); | 140 | std::fprintf(stderr, "error: %s has no entry point\n", main_module.name.c_str()); |
| 141 | return 1; | 141 | return 1; |
| 142 | } | 142 | } |
| 143 | std::printf("console paths: GAME: -> %ls, writes -> %ls\n", game_dir.c_str(), overlay_dir.c_str()); | 143 | const std::wstring paths = L"console paths: GAME: -> " + game_dir.native() + L", writes -> " + overlay_dir.native(); |
| 144 | const HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE); | ||
| 145 | DWORD mode; | ||
| 146 | bool printed = false; | ||
| 147 | if (GetConsoleMode(out, &mode)) { | ||
| 148 | std::fflush(stdout); | ||
| 149 | const std::wstring line = paths + L"\r\n"; | ||
| 150 | DWORD written; | ||
| 151 | printed = WriteConsoleW(out, line.data(), static_cast<DWORD>(line.size()), &written, nullptr) != FALSE; | ||
| 152 | } | ||
| 153 | if (!printed) { | ||
| 154 | const auto game = game_dir.u8string(); | ||
| 155 | const auto overlay = overlay_dir.u8string(); | ||
| 156 | std::printf("console paths: GAME: -> %s, writes -> %s\n", | ||
| 157 | reinterpret_cast<const char*>(game.c_str()), reinterpret_cast<const char*>(overlay.c_str())); | ||
| 158 | } | ||
| 144 | std::printf("running %s\n", main_module.name.c_str()); | 159 | std::printf("running %s\n", main_module.name.c_str()); |
| 145 | std::fflush(stdout); | 160 | std::fflush(stdout); |
| 146 | const int code = rt::process::run_entry(main_module.base + main_module.entry_rva); | 161 | const int code = rt::process::run_entry(main_module.base + main_module.entry_rva); |