Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vWii Channel view fix #43

Open
wants to merge 1 commit into
base: enhanced
Choose a base branch
from

Conversation

Jacoby6000
Copy link

@Jacoby6000 Jacoby6000 commented Jul 24, 2024

This fixes isssues with the vWii channel view.

We determine if priiloader + vWii is in use by checking the number of entries in the tmd. If its 10, we're on vWii with priiloader and need to use index 9 for the system resources.

Assuming @wiidev doesn't come back any time soon, I've created a release of this content in my fork. I plan to merge some of the pending PRs here in to my releases over time, assuming the authors are ok with it.

Edit: Cleaned up this branch

Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
@eku
Copy link

eku commented Jul 24, 2024

Are other loaders on the vWii also affected and if not, what is ULGX doing wrong that others are doing right?

@Jacoby6000
Copy link
Author

Are other loaders on the vWii also affected and if not, what is ULGX doing wrong that others are doing right?

I don't think any other usb loaders reference system menu assets for anything. The problem here is unique to usbloader gx because it's using the system theme in order to replicate the system menu appearance

// 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;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we find a way to find out the offset on pattern matching, i.e. without any reference to the PriiLoader?
The current solution is fragile for future changes.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking the best solution would be to create a list of valid content Ids which represent the system menu resources we're looking for.

For example, here's the relevant tmd which contains an entry for the system menu resources on a regular wii

Content ID   Index  Type   Size                 SHA1 Hash
----------   -----  -----  ----                 ----------
150          0      0x0001 64                   529573fc8c6aa431c0a03c5c97bce9bd9af6ae7a
151          1      0x0001 6505767              ab8f9acdf2d0066c9d2dbc740cffc70804735797
9            2      0x8001 4559887              f5dd17b3200dd4d6be2b25b577c99e5f941b7324
10           3      0x8001 2669044              32b339cbbb507d502779259a7866995d030b1d88
11           4      0x8001 686468               5f1bb7b02794b14e88b72269a3376d23051dad1d
12           5      0x8001 3649020              4fad97fd4a288c47e0587f3bbd292379f8709eb9
89           6      0x8001 272512               293d734260ac99f4d3de75310a7d273466f6be08
90           7      0x8001 53216                534d2952fe2f664370d8364b9a0a0d1f55a05931
152          8      0x0001 3867904              26116613f624061ba99c8d1a299aaa6efa85670d

Content ID 151 contains what we need, and we could just look for that rather than a specific index.

I didn't go with this approach because I couldn't find the TMD for the wii mini or vWii. If somebody can provide me with the content ID for vWii, and wii mini I can go with that approach.

The existing solution referencing a specific index rather than content ID is also brittle, and in fact is why it broke 😅

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'd also need them per region so, some list of content Ids, 1 per wii type (vWii, wii mini, wii) per region (EU, JP, US, etc;)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, how about asking for help on gbatemp? The probability of obtaining the information is probably greater than in a PR.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I probably will. You were just asking for a way to do this without using the index, and I was just elaborating.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eku
Copy link

eku commented Sep 30, 2024

@Jacoby6000 Would you like to push the topic further?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants