upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/src/main.cpp')
-rw-r--r--runtime/src/main.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp
index c0248e819..9ceccf53a 100644
--- a/runtime/src/main.cpp
+++ b/runtime/src/main.cpp
@@ -49,11 +49,11 @@ int usage() {
49int wmain(int argc, wchar_t** argv) { 49int wmain(int argc, wchar_t** argv) {
50 std::filesystem::path image, game_dir; 50 std::filesystem::path image, game_dir;
51 bool dry_run = false, init = false, run = false, trace_d3d12 = false; 51 bool dry_run = false, init = false, run = false, trace_d3d12 = false;
52 std::vector<std::string> game_args; 52 std::vector<std::wstring> game_args; // wide: path::string() throws on a character the code page lacks (RT-84)
53 for (int i = 1; i < argc; ++i) { 53 for (int i = 1; i < argc; ++i) {
54 std::wstring a = argv[i]; 54 std::wstring a = argv[i];
55 if (a == L"--") { 55 if (a == L"--") {
56 for (++i; i < argc; ++i) game_args.push_back(std::filesystem::path(argv[i]).string()); 56 for (++i; i < argc; ++i) game_args.push_back(argv[i]);
57 break; 57 break;
58 } 58 }
59 if (a == L"--dry-run") dry_run = true; 59 if (a == L"--dry-run") dry_run = true;
@@ -104,7 +104,7 @@ int wmain(int argc, wchar_t** argv) {
104 std::fprintf(stderr, "error: %s has no entry point\n", main_module.name.c_str()); 104 std::fprintf(stderr, "error: %s has no entry point\n", main_module.name.c_str());
105 return 1; 105 return 1;
106 } 106 }
107 rt::process::set_command_line(image.filename().string(), game_args); 107 rt::process::set_command_line(image.filename().wstring(), game_args);
108 std::printf("running %s\n", main_module.name.c_str()); 108 std::printf("running %s\n", main_module.name.c_str());
109 std::fflush(stdout); 109 std::fflush(stdout);
110 const int code = rt::process::run_entry(main_module.base + main_module.entry_rva); 110 const int code = rt::process::run_entry(main_module.base + main_module.entry_rva);