From d28b4b30685e2fe0e628365f6cfce4ecd8a06a2e Mon Sep 17 00:00:00 2001 From: Maschell Date: Tue, 13 Apr 2021 20:14:50 +0200 Subject: [PATCH] Fix displaying the name/icon of an application --- src/RPXLoading.cpp | 6 +++--- src/globals.h | 1 + src/main.cpp | 5 +++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/RPXLoading.cpp b/src/RPXLoading.cpp index 3145e9e..ea423df 100644 --- a/src/RPXLoading.cpp +++ b/src/RPXLoading.cpp @@ -198,11 +198,11 @@ bool RL_LoadFromSDOnNextLaunch(const char *bundle_path) { DCFlushRange(&gReplacementInfo, sizeof(gReplacementInfo)); if (!success) { - gReplacementInfo.rpxReplacementInfo.isRPXReplaced = false; + gReplacementInfo.rpxReplacementInfo.willRPXBeReplaced = false; DEBUG_FUNCTION_LINE("Failed to load %s on next restart", request.path); return false; } else { - gReplacementInfo.rpxReplacementInfo.isRPXReplaced = true; + gReplacementInfo.rpxReplacementInfo.willRPXBeReplaced = true; } DEBUG_FUNCTION_LINE("Launch %s on next restart [size: %08X offset: %08X]", request.path, request.filesize, request.fileoffset); @@ -216,7 +216,7 @@ bool RL_LoadFromSDOnNextLaunch(const char *bundle_path) { gReplacementInfo.contentReplacementInfo.mode = CONTENTREDIRECT_FROM_WUHB_BUNDLE; } else { DEBUG_FUNCTION_LINE("Loaded file is no bundle"); - gReplacementInfo.rpxReplacementInfo.isRPXReplaced = true; + gReplacementInfo.rpxReplacementInfo.willRPXBeReplaced = true; if (gReplacementInfo.contentReplacementInfo.mode == CONTENTREDIRECT_FROM_WUHB_BUNDLE && gReplacementInfo.contentReplacementInfo.bundleMountInformation.isMounted) { diff --git a/src/globals.h b/src/globals.h index 0673922..5a1c6b1 100644 --- a/src/globals.h +++ b/src/globals.h @@ -14,6 +14,7 @@ typedef struct BundleMountInformation_t { } BundleMountInformation; typedef struct RPXReplacementInfo_t { + bool willRPXBeReplaced; bool isRPXReplaced; MetaInformation metaInformation; char iconCache[65580]; diff --git a/src/main.cpp b/src/main.cpp index f3c7682..1805d46 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -43,6 +43,7 @@ WUMS_APPLICATION_ENDS() { DCFlushRange(&gReplacementInfo, sizeof(gReplacementInfo)); } } + gReplacementInfo.rpxReplacementInfo.isRPXReplaced = false; } WUMS_APPLICATION_STARTS() { @@ -50,6 +51,10 @@ WUMS_APPLICATION_STARTS() { if (upid != 2 && upid != 15) { return; } + if (gReplacementInfo.rpxReplacementInfo.willRPXBeReplaced) { + gReplacementInfo.rpxReplacementInfo.willRPXBeReplaced = false; + gReplacementInfo.rpxReplacementInfo.isRPXReplaced = true; + } WHBLogUdpInit(); if (gReplacementInfo.contentReplacementInfo.mode == CONTENTREDIRECT_FROM_PATH) { return;