[RELEASE] Ultimate Wii U Nintendont forwarder (or... something...?)

V10lator

Well-Known Member
OP
Member
Joined
Apr 21, 2019
Messages
2,635
Trophies
1
Age
36
XP
5,494
Country
Germany
So, uhm, I don't really know how to describe this... Like... Do you know that chainloader that gets into every GCN inject? I worked on this! Not only on it but also the loader this chainloader loads...

So this loader it loads I reduced 50% in size... While still beeing as accurate as you know it! Wait, you don't know it? Damn...

The main loader I changed to allow to have a nincfg.bin per inject... Wait... What? You don't know what this means?

Mhkay... So let's f*ck all this... ... ...I worked the last week day and night to give you a nintendont loader which:
- Is 100% crash save
- Is fast as lightning
- Loads the nincfg.bin from the root of the SD card as a fallback only

For the last thing this means the loader tries to load from:
1) SD:/nintendont/configs/[GAMEID].bin
2) Embedded into the inject itself (to the ones working on Teconmoon, UWUVCI and stuff: It searches for a nincfg.bin beside the game.iso/disc2.iso inside of the NFS)
3) (Fallback) SD:/nincfg.bin

You as a user might still just scratch your head... Sorry about that but let's see what devs make from this?


Devs: Here you go: https://github.com/V10lator/nintendont-autoboot-forwarder/actions/runs/6595301167#artifacts
On a side note: The nintendont-autoboot-forwarder was GPLv2 no matter what the license file told! It used (and uses) (a lot of) GPLv2 codes, so...


BTW: I'm releasing this as-is as I tried to implement it into injectors but I can't even manage to run UWUVCI and Teconmoon's Injectors source code is such a mess... The nincfg.bin config creation menu (Form2.cs) needs a complete rewrite but... Well, I gave up on this rewrite, let's see what @piratesephiroth makes from this... 😅

BTW²: Yes, all nincfg.bin loading paths have been tested and confirmed by me. You don't want to know what frankenstein-teconmoon injector builds I have on my HDD... There's also an unreleased nincfg.bin creating/editing homebrew made by me which helped a lot in testing this nintendont loader (this homebrew is a quick&dirty hacked PoC at best so dont ask for it, please).

BTW³: Don't know about UWUVCI but I also found a big bummer in teconmoon's injector while doing my magic:
277088625-690f7565-e054-496f-b4de-be68993db167.png

(upper image is after my fix, lower image is what teconmoon's injector gives you today - PR pending)
 

V10lator

Well-Known Member
OP
Member
Joined
Apr 21, 2019
Messages
2,635
Trophies
1
Age
36
XP
5,494
Country
Germany
@Ysecond Originally wanted to avoid to go too much into technical details but let me try to explain:
Whenever you do a gamecube inject the injector creates a Wii disc image containing the gamecube iso(s) and a small Wii homebrew. This small Wii homebrew then loads the nintendont dol file (sd:/apps/nintndont/boot.dol) as well as the config (sd:/nincfg.bin) into hardcoded memory adresses. It then patches the nincfg.bin in RAM to set autobooting and telling Nintendont where to find the gamecube .iso file(s). Lastly it loads another homebrew into memory and triggers a vWii reboot which then loads this other homebrew. The other homebrew then reads the Nintendont .dol file header, sets the memory up for it and jumps into Nintendonts entry point, so handles execution over to it.

Now you might have noticed that the injectors have a "Force 4:3" option? Whenever you select this it doesn't pack the homebrew as described above but a version of it which don't only patch the nincfg.bin for autobooting but also removed the force widescreen and Wii U widescreen options.

At some point in time I asked myself what if we want more options in the injectors? So I decided to add a "force interlaced" option to teconmoon's injector. This resulted into needing 4 different wii homebrews:
  • One which just autoboots
  • One which autoboots + removes force 4:3
  • One which autoboots + removes force progressive
  • One which autoboots + removes force 4:3 + removes force progressive
Me wanted to add even more options to teconmoon's injector but just one more option would have meaned to need 8 different binaries. This would have gotten a real mess pretty fast. Anyway, by that time I knew these Wii homebrews source codes good enough so I thought what if this Wii homebrew would load the nincfg.bin on a per-inject basis instead of patching the nincfg.bin on the fly? The result of this is what this topic is about: It allows the injectors to add a nincfg.bin into the Wii disc image (beside the gamecube .iso file(s)). Not only that but in case a user wants to change the config after injecting he can put a nincfg.bin onto the SD card, named after the inject (sd:/nintendont/configs([GAMEID].bin, so for example for animal crossing PAL this would be sd:/nintendont/configs/GAFP.bin) - if this file is present it will get loaded instead.

Now I realise that end-users are able to test at least the last feature: In teconmoon's injector there's an option to specify a custom .dol file, this .dol file is the Wii homebrew I talked about, so you can give it my version there, then create the nintendont/configs folder on the SD card and go ahead.
If you load a game but there is no [GAMEID.bin] file inside of sd:/nintendont/configs it will just fallback to load the sd:/nincfg.bin file.

Also I optimized the codes, added error handling, fixed compiling issues with modern toolchains and so on. ;)

On a side note / to devs: The new nintendont loader patches the nincfg.bin file for autobooting if loaded from SD only. When loaded from within the wii disc image (NFS) you are responsible to set the file up correctly. This means:
  • CheatPath[0] should be 0x00 (so CheatPath should be a empty, null terminated string)
  • GamePath should be di (NULL terminated!)
  • The Config mask should have NIN_CFG_AUTO_BOOT enabled
  • The Config mask should have NIN_CFG_USB disabled
It has been done this way to still allow the injectors to create none-autoboot injects.

//EDIT: For reference here's how the nintendont loader patches the nincfg.bin on the fly when loaded from SD: https://github.com/V10lator/nintendont-autoboot-forwarder/blob/master/source/main.c#L179-L182

//EDIT²: Also for reference here are the source codes for that PoC homebrew I talked about earlier: https://github.com/V10lator/Nincfg/tree/master - Note that it hardcodes to SD:\nincfg.bin when loading/saving and that the options setting still isn't 100% how Nintendont expects it to be. Also to create configs to inject them into the Wii disc image it needs this patch:
Code:
diff --git a/src/main.c b/src/main.c
index 22aa656..e40a8db 100644
--- a/src/main.c
+++ b/src/main.c
@@ -246,6 +246,10 @@ void mainLoop()
     OSBlockSet(cfg->GamePath, 0, sizeof(char) * 255);
     cfg->GameID = 0;
  
+    // HACK: Enable Autoboot
+    cfg->Config |= NIN_CFG_AUTO_BOOT;
+    strcpy(cfg->GamePath, "di");
+
     // Make sure widescreen is enabled correctly
     if(cfg->Config & (NIN_CFG_FORCE_WIDE | NIN_CFG_WIIU_WIDE))
         cfg->Config |= NIN_CFG_FORCE_WIDE | NIN_CFG_WIIU_WIDE;
Also it crashes on exit from time to time and yea, codes are a mess... It wasn't meaned to get released, instead it was just for me to get a feeling of how Nintendont expects the options to be.
 
Last edited by V10lator,

MikaDubbz

Well-Known Member
Member
Joined
Dec 12, 2017
Messages
3,849
Trophies
1
Age
36
XP
7,308
Country
United States
Very nice, my 500GB Wii U SD card was essentially completely full, thanks in no small part to my 100 or so Gamecube games. This should give me a ton of extra space... for more Gamecube games lol.
 

T4kUM1X

Member
Newcomer
Joined
Aug 17, 2017
Messages
9
Trophies
0
Age
25
XP
277
Country
Portugal
This is incredible and impressive work!! :grog: Having the possibility to test easily different configurations is SOOO helpful. And when a good configuration is found, we can then just inject it and not depend anymore on the sd card! I am just wondering now... is there any way to try this right now? From my understanding we can test already the optimized nintendont loader with the custom dol setting, but what about the reduced inject sizes?

(Thank you a whole lot, this is really impressive to me) :D
 

V10lator

Well-Known Member
OP
Member
Joined
Apr 21, 2019
Messages
2,635
Trophies
1
Age
36
XP
5,494
Country
Germany
not depend anymore on the sd card!
You still need Nintendont on your SD card.

what about the reduced inject sizes?
Not sure how UWUVCI does this (they might pack the game in nkit format already) but for Teconmoons Injector there's this PR: https://github.com/piratesephiroth/TeconmoonWiiVCInjector/pull/36 - so you either need to compile it for yourself or wait until it got merged and a new version released.
The issue was btw that Teconmoon's Injector converted nkit to iso while creating the inject. As Nintendont supports nkit the PR changes this to do it the other way around: Directly pack nkit but convert normal isos to nkit first.
 
  • Like
Reactions: T4kUM1X

T4kUM1X

Member
Newcomer
Joined
Aug 17, 2017
Messages
9
Trophies
0
Age
25
XP
277
Country
Portugal
You still need Nintendont on your SD card.


Not sure how UWUVCI does this (they might pack the game in nkit format already) but for Teconmoons Injector there's this PR: https://github.com/piratesephiroth/TeconmoonWiiVCInjector/pull/36 - so you either need to compile it for yourself or wait until it got merged and a new version released.
The issue was btw that Teconmoon's Injector converted nkit to iso while creating the inject. As Nintendont supports nkit the PR changes this to do it the other way around: Directly pack nkit but convert normal isos to nkit first.

Oh, sorry! I misinterpreted it. Thanks for your reply btw! I will have to wait then for the PR to get merged, in the meantime I am gonna try to test with UWUVCI and check if there's any difference (since I am not really an expert compiler) xD

Thank you very much once again! :)
 

ghostserverd

Member
Newcomer
Joined
Feb 22, 2022
Messages
18
Trophies
0
Age
34
Location
NA
XP
237
Country
United States
This is awesome. Looks like it obviates the changes I made to update nintendont-autoboot-forwarder to support newer versions of nincfg. This is a much better mechanism for loading the nincfg. Amazing work.

Would it be enough as an initial test of this to use teconmoon's injector with a build of this as a custom forwarder (since you can select the forwarder when you build a new inject). I might give that a shot. It wouldn't have the size reduction improvements from your open PR with @piratesephiroth, but it would have the improved nincfg loading at least.

Or @NicoAICP any chance you'd update UWUVCI-Tools so UWUVIC 3.Z will use this forwarder for now until V4 is available?
 

V10lator

Well-Known Member
OP
Member
Joined
Apr 21, 2019
Messages
2,635
Trophies
1
Age
36
XP
5,494
Country
Germany
Would it be enough as an initial test of this to use teconmoon's injector with a build of this as a custom forwarder (since you can select the forwarder when you build a new inject).
Yes. You can't embed the nincfg with this setup but you can still test the per game config on the SD card.
 

luk234

Member
Newcomer
Joined
Feb 9, 2024
Messages
7
Trophies
0
Age
29
XP
65
Country
Chile
Thanks a lot for this! I couldn't figure out how to compile it myself, so I just forked it and let the action do its job :P

I tried it with Melee (GALE01), this game has an issue with nintendont's widescreen patches, which makes it crash during the menu. Using this forwarder with TeconMoon's injector, I was able to redirect the nincfg file as described in the OP and forced it to load my own settings (ocarina enabled, widescreen disabled). I then made a gct file with a widescreen code I got off Youtube . Now I'm able to play widescreen melee with no crashes!

Hope to see this added officially to the other loaders.
 
  • Like
Reactions: V10lator

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: Lol rappers still promoting crypto