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

Support for loading vWii System Menu #11188

Merged
merged 2 commits into from Oct 22, 2022

Conversation

GaryOderNichts
Copy link
Contributor

This PR adds support for loading the encrypted Ancast images which are used in the vWii mode of the Wii U.
This allows booting the Wii System Menu from extracted vWii NAND dumps.

Some things which should probably be discussed before merge:

  • Should the Ancast verification + decryption be moved out of the DolReader? If so where?
  • The option in the menu bar will be called Load Wii System Menu v4.3E (vWii). Is this fine?
    The vWii never had actual versions, and there are 3 different revisions of the vWii System Menu (v512, v544, v608). All of them show v4.3 if you patch the menu to open settings.

Source/Core/Core/Boot/DolReader.cpp Outdated Show resolved Hide resolved
Source/Core/Core/Boot/DolReader.cpp Outdated Show resolved Hide resolved
Source/Core/DolphinQt/MenuBar.cpp Outdated Show resolved Hide resolved
@Pokechu22
Copy link
Contributor

Most keys are stored in IOSC.cpp. I'm not sure whether it makes sense to store the Ancast keys there or not, though.

Relatedly, is loading the vWii system menu useful if the vWii common key is not available? I feel like that would be necessary for things to work.

Regarding the menu version, wiibrew lists vWii 1.0.0 for 512 (which is also apparently different from non-vwii 512?), vWii 4.0.0 for 544, and vWii 5.2.0 for 608. I'm not sure if it's useful to list those explicitly though.

Source/Core/Core/Boot/AncastTypes.h Outdated Show resolved Hide resolved
Source/Core/Core/Boot/AncastTypes.h Outdated Show resolved Hide resolved
Source/Core/Core/Boot/DolReader.cpp Outdated Show resolved Hide resolved
Source/Core/Core/Boot/AncastTypes.h Outdated Show resolved Hide resolved
Source/Core/Core/Boot/DolReader.cpp Outdated Show resolved Hide resolved
Source/Core/Core/Boot/DolReader.cpp Outdated Show resolved Hide resolved
Source/Core/Core/Boot/DolReader.cpp Outdated Show resolved Hide resolved
Source/Core/Core/Boot/DolReader.cpp Outdated Show resolved Hide resolved
Source/Core/Core/IOS/ES/Formats.h Show resolved Hide resolved
Source/Core/Core/IOS/IOS.cpp Outdated Show resolved Hide resolved
@GaryOderNichts
Copy link
Contributor Author

Most keys are stored in IOSC.cpp. I'm not sure whether it makes sense to store the Ancast keys there or not, though.

Doesn't seem to make much sense to me, as they're usually on the PPC chip and not related to IOSC at all.

Relatedly, is loading the vWii system menu useful if the vWii common key is not available? I feel like that would be necessary for things to work.

The vWii uses the normal Wii common key, to achieve backwards compatibility with existing channels.
Launching channels from the vWii system menu and returning to the menu works as expected.

Regarding the menu version, wiibrew lists vWii 1.0.0 for 512 (which is also apparently different from non-vwii 512?), vWii 4.0.0 for 544, and vWii 5.2.0 for 608. I'm not sure if it's useful to list those explicitly though.

Maybe something like Load vWii System Menu 5.2.0E for vWii?

@Pokechu22
Copy link
Contributor

The vWii uses the normal Wii common key, to achieve backwards compatibility with existing channels.
Launching channels from the vWii system menu and returning to the menu works as expected.

There is an additional key used for the Wii Menu Electronic Manual according to issue 11650. I think it may also be used by Wii System Transfer (but see also issue 11985) and Wii U Menu (which I don't think will ever work right).

Maybe something like Load vWii System Menu 5.2.0E for vWii?

I think that would work, yeah.

@GaryOderNichts
Copy link
Contributor Author

There is an additional key used for the Wii Menu Electronic Manual according to issue 11650. I think it may also be used by Wii System Transfer (but see also issue 11985) and Wii U Menu (which I don't think will ever work right).

Oh yeah you're right, most of the Wii U specific channels are encrypted with the vWii common key (common key slot 2).
Not sure what the best way of handling this would be. All vWii titles are usually installed from the Wii U side with a system update and the vWii common key is not available while in vWii mode. I don't think IOSC even has a handle for it.
Might be worth resolving this with another PR.

Relatedly, is loading the vWii system menu useful if the vWii common key is not available? I feel like that would be necessary for things to work.

It's still useful without the vWii common key, since already installed channels will work fine. Also installing non-vWii wads should work fine.

@Pokechu22
Copy link
Contributor

I do see some messages about vWii titles being updated on the old Wiimpersonator logs (example). I vaguely recall things working correctly if I added the vWii common key to IOSC, but I don't think I ever submitted a PR for that and I'm not sure why.

@Zopolis4
Copy link
Contributor

Should there be something in the UI somewhere clarifying that a bunch of channels will be broken? Dolphin is still just a Wii emulator, after all, and thus has no support for any of the Wii U elements of the vWii.

@GaryOderNichts
Copy link
Contributor Author

Should there be something in the UI somewhere clarifying that a bunch of channels will be broken? Dolphin is still just a Wii emulator, after all, and thus has no support for any of the Wii U elements of the vWii.

What sort of Wii U elements do you mean?
vWii is the Wii-compatible mode of the Wii U, meaning most channels will work just fine in dolphin.

When extracting a vWii NAND dump to be used with dolphin it wasn't possible to boot the vWii System Menu though, as it's an Ancast image.
This resulted in people installing the normal Wii System Menu on top of their vWii NAND.

@JosJuice
Copy link
Member

Should there be something in the UI somewhere clarifying that a bunch of channels will be broken? Dolphin is still just a Wii emulator, after all, and thus has no support for any of the Wii U elements of the vWii.

I think we can keep that out of the scope of this PR. The channels that use the vWii common key were already broken before, and aside from those (which we could probably support), the only channel remaining is the one that launches the Wii U Menu, which I think is fairly obvious that we don't support.

@GaryOderNichts
Copy link
Contributor Author

I think we can keep that out of the scope of this PR. The channels that use the vWii common key were already broken before, and aside from those (which we could probably support), the only channel remaining is the one that launches the Wii U Menu, which I think is fairly obvious that we don't support.

As long as those channels are already installed in the NAND dump / they come pre-installed anyways, they won't need the common key. Channels like the Wii Manual channel boot fine once installed.
But yeah, support for installing WADs which use the vWii common key should be part of another PR.

@GaryOderNichts
Copy link
Contributor Author

Updated the text to show vWii System Menu and the Wii U version this System Menu was part of (e.g. Load vWii System Menu 5.2.0E).
Also Android builds now and I confirmed that the build is working.

Source/Core/Core/Boot/AncastTypes.h Outdated Show resolved Hide resolved
Source/Core/Core/Boot/AncastTypes.h Outdated Show resolved Hide resolved
@JosJuice
Copy link
Member

JosJuice commented Oct 22, 2022

Please squash your cleanup commits into the first (and second?) one.

@JMC47 JMC47 merged commit 804e421 into dolphin-emu:master Oct 22, 2022
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
7 participants