Fix channel view on vWii with Priiloader

This commit is contained in:
Jacoby6000 2024-07-24 13:42:50 -05:00
parent e25c4e9643
commit b5e2c025ad
2 changed files with 9 additions and 1 deletions

1
.gitignore vendored
View File

@ -11,3 +11,4 @@ usbloader_gx/
/source/svnrev.c
/usbloader_gx.zip
/wiiload
/output

View File

@ -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;