From d7228d45209630cb226dad71426f483d3bf290b0 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sat, 9 Jan 2021 21:23:48 +0100 Subject: [PATCH] Keep /vol/content mounted if loading into a .rpx --- src/RPXLoading.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/RPXLoading.cpp b/src/RPXLoading.cpp index 3e43b5f..4dfe100 100644 --- a/src/RPXLoading.cpp +++ b/src/RPXLoading.cpp @@ -21,7 +21,9 @@ bool loadRPXFromSDOnNextLaunch(const std::string &path) { std::string completePath = "/vol/external01/" + path; int res = getRPXInfoForPath(completePath, &info); + bool isBundle = false; if (res >= 0) { + isBundle = true; request.filesize = ((uint32_t * ) & info.length)[1]; request.fileoffset = ((uint32_t * ) & info.offset)[1]; } else { @@ -41,9 +43,20 @@ bool loadRPXFromSDOnNextLaunch(const std::string &path) { IOS_Close(mcpFd); } - gTryToReplaceOnNextLaunch = true; - memset(gLoadedBundlePath,0, sizeof(gLoadedBundlePath)); - strncpy(gLoadedBundlePath, completePath.c_str(), completePath.length()); + if(isBundle){ + gTryToReplaceOnNextLaunch = true; + memset(gLoadedBundlePath,0, sizeof(gLoadedBundlePath)); + strncpy(gLoadedBundlePath, completePath.c_str(), completePath.length()); + }else { + if (!gIsMounted) { + gTryToReplaceOnNextLaunch = false; + memset(gLoadedBundlePath, 0, sizeof(gLoadedBundlePath)); + } else { + // keep the old /vol/content mounted, this way you can reload just the rpx via wiiload + gTryToReplaceOnNextLaunch = true; + } + } + return true; }