From b64d7b217f43933e06acf2e2f4a1d47c50978bfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 6 Jan 2026 20:38:06 +0100 Subject: [PATCH] Add a --root= command line argument to override what host0: is mounted to. Fixes #20191 --- Core/Config.h | 2 ++ Core/HLE/sceMpeg.cpp | 2 +- UI/EmuScreen.cpp | 2 +- UI/NativeApp.cpp | 5 +++++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Core/Config.h b/Core/Config.h index 33fe8d45d6..b4c7d405f5 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -662,6 +662,8 @@ public: Path internalDataDirectory; Path appCacheDirectory; + Path mountRoot; // Actually, mount as host0. keeping consistent with headless args. + void Load(const char *iniFileName = nullptr, const char *controllerIniFilename = nullptr); bool Save(const char *saveReason); void Reload(); diff --git a/Core/HLE/sceMpeg.cpp b/Core/HLE/sceMpeg.cpp index 5d01e0f655..30a42df40f 100644 --- a/Core/HLE/sceMpeg.cpp +++ b/Core/HLE/sceMpeg.cpp @@ -451,7 +451,7 @@ static u32 sceMpegRingbufferConstruct(u32 ringbufferAddr, u32 numPackets, u32 da if (ring->semaID != 0) { // I'm starting to think this is just padding or something. // It's not written by this function. - WARN_LOG(Log::Mpeg, "Detected semaID %d", ring->semaID); + WARN_LOG(Log::Mpeg, "Detected 'semaID' (might not be) %d (%08x)", ring->semaID, ring->semaID); } ring->mpeg = 0; // This isn't in ver 0104, but it is in 0105. diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index ba74075b78..9b20938092 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -306,7 +306,7 @@ void EmuScreen::ProcessGameBoot(const Path &filename) { coreParam.enableSound = g_Config.bEnableSound; coreParam.fileToStart = filename; coreParam.mountIso.clear(); - coreParam.mountRoot.clear(); + coreParam.mountRoot = g_Config.mountRoot; coreParam.startBreak = !g_Config.bAutoRun; coreParam.headLess = false; diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 7afce4ebe7..ff8064c997 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -530,6 +530,8 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch forceLogLevel = true; }; + // TODO: Need a much better command line argument parser. + for (int i = 1; i < argc; i++) { if (argv[i][0] == '-') { #if defined(__APPLE__) @@ -581,6 +583,9 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch g_Config.iForceFullScreen = 1; System_ToggleFullscreenState("1"); } + if (!strncmp(argv[i], "--root=", strlen("--root=")) && strlen(argv[i]) > strlen("--root=")) { + g_Config.mountRoot = Path(argv[i] + strlen("--root=")); + } if (!strcmp(argv[i], "--windowed")) { g_Config.iForceFullScreen = 0; System_ToggleFullscreenState("0");