diff options
Diffstat (limited to 'src/yuzu_cmd/yuzu.cpp')
-rw-r--r-- | src/yuzu_cmd/yuzu.cpp | 63 |
1 files changed, 42 insertions, 21 deletions
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index 91133569d..7b6d49c63 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp @@ -42,6 +42,8 @@ #include <windows.h> #include <shellapi.h> + +#include "common/windows/timer_resolution.h" #endif #undef _UNICODE @@ -62,13 +64,15 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; static void PrintHelp(const char* argv0) { std::cout << "Usage: " << argv0 << " [options] <filename>\n" - "-m, --multiplayer=nick:password@address:port" - " Nickname, password, address and port for multiplayer\n" + "-c, --config Load the specified configuration file\n" "-f, --fullscreen Start in fullscreen mode\n" + "-g, --game File path of the game to load\n" "-h, --help Display this help and exit\n" - "-v, --version Output version information and exit\n" + "-m, --multiplayer=nick:password@address:port" + " Nickname, password, address and port for multiplayer\n" "-p, --program Pass following string as arguments to executable\n" - "-c, --config Load the specified configuration file\n"; + "-u, --user Select a specific user profile from 0 to 7\n" + "-v, --version Output version information and exit\n"; } static void PrintVersion() { @@ -199,6 +203,7 @@ int main(int argc, char** argv) { std::string filepath; std::optional<std::string> config_path; std::string program_args; + std::optional<int> selected_user; bool use_multiplayer = false; bool fullscreen = false; @@ -209,20 +214,37 @@ int main(int argc, char** argv) { static struct option long_options[] = { // clang-format off - {"multiplayer", required_argument, 0, 'm'}, + {"config", required_argument, 0, 'c'}, {"fullscreen", no_argument, 0, 'f'}, {"help", no_argument, 0, 'h'}, - {"version", no_argument, 0, 'v'}, + {"game", required_argument, 0, 'g'}, + {"multiplayer", required_argument, 0, 'm'}, {"program", optional_argument, 0, 'p'}, - {"config", required_argument, 0, 'c'}, + {"user", required_argument, 0, 'u'}, + {"version", no_argument, 0, 'v'}, {0, 0, 0, 0}, // clang-format on }; while (optind < argc) { - int arg = getopt_long(argc, argv, "g:fhvp::c:", long_options, &option_index); + int arg = getopt_long(argc, argv, "g:fhvp::c:u:", long_options, &option_index); if (arg != -1) { switch (static_cast<char>(arg)) { + case 'c': + config_path = optarg; + break; + case 'f': + fullscreen = true; + LOG_INFO(Frontend, "Starting in fullscreen mode..."); + break; + case 'h': + PrintHelp(argv[0]); + return 0; + case 'g': { + const std::string str_arg(optarg); + filepath = str_arg; + break; + } case 'm': { use_multiplayer = true; const std::string str_arg(optarg); @@ -255,23 +277,16 @@ int main(int argc, char** argv) { } break; } - case 'f': - fullscreen = true; - LOG_INFO(Frontend, "Starting in fullscreen mode..."); - break; - case 'h': - PrintHelp(argv[0]); - return 0; - case 'v': - PrintVersion(); - return 0; case 'p': program_args = argv[optind]; ++optind; break; - case 'c': - config_path = optarg; + case 'u': + selected_user = atoi(optarg); break; + case 'v': + PrintVersion(); + return 0; } } else { #ifdef _WIN32 @@ -295,8 +310,14 @@ int main(int argc, char** argv) { Settings::values.program_args = program_args; } + if (selected_user.has_value()) { + Settings::values.current_user = std::clamp(*selected_user, 0, 7); + } + #ifdef _WIN32 LocalFree(argv_w); + + Common::Windows::SetCurrentTimerResolutionToMaximum(); #endif MicroProfileOnThreadCreate("EmuThread"); @@ -388,7 +409,7 @@ int main(int argc, char** argv) { if (Settings::values.use_disk_shader_cache.GetValue()) { system.Renderer().ReadRasterizer()->LoadDiskResources( - system.GetCurrentProcessProgramID(), std::stop_token{}, + system.GetApplicationProcessProgramID(), std::stop_token{}, [](VideoCore::LoadCallbackStage, size_t value, size_t total) {}); } |