From a81b20d9d563954fe6535f40cb8bb7b77f031742 Mon Sep 17 00:00:00 2001 From: AKuHAK <621640+AKuHAK@users.noreply.github.com> Date: Sat, 23 Dec 2023 22:32:26 +0200 Subject: [PATCH] QT: Add ability to pass launch arguments with CLI option -gameargs --- pcsx2-qt/QtHost.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pcsx2-qt/QtHost.cpp b/pcsx2-qt/QtHost.cpp index 18e4c13d54..3dbd31ad76 100644 --- a/pcsx2-qt/QtHost.cpp +++ b/pcsx2-qt/QtHost.cpp @@ -1239,7 +1239,7 @@ bool QtHost::InitializeConfig() } VMManager::SetDefaultSettings(*s_base_settings_interface, true, true, true, true, true); - + // Don't save if we're running the setup wizard. We want to run it next time if they don't finish it. if (!s_run_setup_wizard) SaveSettings(); @@ -1528,6 +1528,7 @@ void QtHost::PrintCommandLineHelp(const std::string_view& progname) std::fprintf(stderr, " -batch: Enables batch mode (exits after shutting down).\n"); std::fprintf(stderr, " -nogui: Hides main window while running (implies batch mode).\n"); std::fprintf(stderr, " -elf : Overrides the boot ELF with the specified filename.\n"); + std::fprintf(stderr, " -gameargs : passes the specified quoted space-delimited string of launch arguments.\n"); std::fprintf(stderr, " -disc : Uses the specified host DVD drive as a source.\n"); std::fprintf(stderr, " -logfile : Writes the application log to path instead of emulog.txt.\n"); std::fprintf(stderr, " -bios: Starts the BIOS (System Menu/OSDSYS).\n"); @@ -1622,6 +1623,11 @@ bool QtHost::ParseCommandLineOptions(const QStringList& args, std::shared_ptrelf_override = (++it)->toStdString(); continue; } + else if (CHECK_ARG_PARAM(QStringLiteral("-gameargs"))) + { + EmuConfig.CurrentGameArgs = (++it)->toStdString(); + continue; + } else if (CHECK_ARG_PARAM(QStringLiteral("-disc"))) { AutoBoot(autoboot)->source_type = CDVD_SourceType::Disc; @@ -1724,7 +1730,7 @@ bool QtHost::ParseCommandLineOptions(const QStringList& args, std::shared_ptr