From b5e2c025ad1ce24570219071d4852d59ed3507ea Mon Sep 17 00:00:00 2001 From: Jacoby6000 Date: Wed, 24 Jul 2024 13:42:50 -0500 Subject: [PATCH] Fix channel view on vWii with Priiloader --- .gitignore | 1 + source/SystemMenu/SystemMenuResources.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 24350756..aabac247 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ usbloader_gx/ /source/svnrev.c /usbloader_gx.zip /wiiload +/output diff --git a/source/SystemMenu/SystemMenuResources.cpp b/source/SystemMenu/SystemMenuResources.cpp index ee6052e8..b64a1be4 100644 --- a/source/SystemMenu/SystemMenuResources.cpp +++ b/source/SystemMenu/SystemMenuResources.cpp @@ -56,9 +56,16 @@ bool SystemMenuResources::Init() // determine resource cid u16 idx = 0xffff; tmd_content *contents = TMD_CONTENTS( p_tmd ); + + // Priiloader moves some system resources that we rely on from index 1 to index 9. + // In doing this it creates a 10th index (9) to contain the moved resources. + // If priiloader is installed, we need to look for content at index 9 instead of index 1. + bool hasVWiiPriiloader = p_tmd->num_contents == 10; + u16 targetIndex = hasVWiiPriiloader ? 9 : 1; + for( u16 i = 0; i < p_tmd->num_contents; i++ ) { - if( contents[ i ].index == 1 ) + if( contents[ i ].index == targetIndex ) { idx = i; break;