From e689d06efdc4247f824a75128a62ece4ef825c08 Mon Sep 17 00:00:00 2001 From: Maschell Date: Mon, 29 Apr 2024 12:53:41 +0200 Subject: [PATCH] Force real prodArea in _SYSGetSystemApplicationTitleIdByProdArea --- src/function_patches.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/function_patches.cpp b/src/function_patches.cpp index b3c3d26..b489d9a 100644 --- a/src/function_patches.cpp +++ b/src/function_patches.cpp @@ -62,6 +62,16 @@ DECL_FUNCTION(int, MCP_GetSysProdSettings, int IOHandle, MCPSysProdSettings *set return result; } +DECL_FUNCTION(uint64_t, _SYSGetSystemApplicationTitleIdByProdArea, SYSTEM_APP_ID param_1, MCPRegion param_2) { + auto upid = OSGetUPID(); + if (upid != SYSAPP_PFID_WII_U_MENU && upid != SYSAPP_PFID_DOWNLOAD_GAME && upid != SYSAPP_PFID_EMANUAL) { + return real__SYSGetSystemApplicationTitleIdByProdArea(param_1, param_2); + } + + return real__SYSGetSystemApplicationTitleIdByProdArea(param_1, gRealRegionOpt.value_or(param_2)); +} + +WUPS_MUST_REPLACE_FOR_PROCESS(_SYSGetSystemApplicationTitleIdByProdArea, WUPS_LOADER_LIBRARY_SYSAPP, _SYSGetSystemApplicationTitleIdByProdArea, WUPS_FP_TARGET_PROCESS_ALL); WUPS_MUST_REPLACE(ACPGetTitleMetaXmlByDevice, WUPS_LOADER_LIBRARY_NN_ACP, ACPGetTitleMetaXmlByDevice); WUPS_MUST_REPLACE(ACPGetLaunchMetaXml, WUPS_LOADER_LIBRARY_NN_ACP, ACPGetLaunchMetaXml); WUPS_MUST_REPLACE_FOR_PROCESS(MCP_GetSysProdSettings, WUPS_LOADER_LIBRARY_COREINIT, MCP_GetSysProdSettings, WUPS_FP_TARGET_PROCESS_ALL);