Hacking USB Loader GX

  • Thread starter Thread starter blackb0x
  • Start date Start date
  • Views Views 8,069,704
  • Replies Replies 30,226
  • Likes Likes 74
Hi guys. I've missed you :(
Very happy to see the loader is still being worked on. (and surprised by some of the new "features". mainly regarding nintendont)
Anyway, I was wondering if anyone found the time to at least check my two previous requests? (which are deleted now apparently?...)
well, what I was (am) interested in is first of all, support for new (at the time) features of nintendont as "auto" image scale/size/aspect ratio whatever it was and and second, wii u widescreen option on a per game basis (for Wii titles that are poorly coded as Resident Evil 0, which SHOULD display in 4:3 instead of an stretched 16:9)
@GreyWolf @Cyan would it be possible to check those out as long as you're actively working on newer releases?
Thanks guys!
 
WiiU widescreen will not be done. At least, I don't plan to.
Nintendont video mode "auto" will be done.

There's nothing that was deleted. your posts are still there.

I had a list of "things to do soon" but I forgot where I posted that. it was in one of this thread.

new plan to do (in no order) :
change the boot process to fix HDD init.
Support wiiu gamepad/fix ahb access when launched from Wiiu Wiivc
stop removing Wii from the game list when hdd not plugged
fix emuNAND path detection (badablek)
test to remove WUPC library (now done by libogc)
Add nintendont Video width auto
Set Gamecube loader to none by default and ask user on new install (or set nintendont by default?)
set gamelist to none by default and ask user on new install (or set wii and gc by default?)
 
Last edited by Cyan,
I fixed the auto video scale setting for Nintendont. Unless Cyan left it out you should be able to set it to 0 now.

I can do the libwupc swap-out but I don't have a WUPC controller to test it with. The newer libogc just treats it as a Wii remote with a classic controller pro attached.
 
ah, that's a nice idea to set ios to 255, it should prevent the IOS reload.
be sure it's set in the meta.xml too.
I never realized meta.xml had some settings. I set the IOS to 255 and didn't find a difference. I also messed around with the moutusb option to see if I could disable USB loading, but I didn't notice a difference in startup.

maybe it's the forwarder's fault that you lose AHB access.
Possibly! I tried TeconMoon's vWii NAND Title Launcher but I ended up losing all controller support. Maybe that mode doesn't allow for Wii Remote or WUPC pass through? I will revisit this option when Gamepad support is added to USBLoaderGX.

for nintendont, the forwarder is reading nincfg? then it's sending the file settings to nintendont using arguments, and forcing few settings.
Pretty sure you are correct here.


then nintendont has not been modified, and I don't know why the forwarder doesn't have the HID issue.
I don't have HID GC adapter controller to test, but I guess other HID have the same issue. maybe I can find a controller to test with.
I happened to be charging my WUPC via the WiiU USB ports yesterday and ran into a bug that could be related. Having the WUPC and an HID controller plugged in at the same time will result in a black screen lockup when loading Nintendont via USBLoaderGX. EVEN when just running USBLoaderGX from vWii directly. Running Nintendont directly has no problems.

I should start hacking my wiiu properly (haxchi) and install channels to it.
I still haven't install haxchi, channels, nor even install cIOS to vWii :P
my wiiu is almost not hacked.

I reconnected my Wii to my TV today. I will be able to test and debug new builds.
I'll re-start development slowly.

Do it! I use SaveMii, HIDtoVPAD, Retroarch WiiU, Loadiine for VC injects, and HBLtoHBC (forwarded to USBLoaderGX) all the time.

I can do the libwupc swap-out but I don't have a WUPC controller to test it with. The newer libogc just treats it as a Wii remote with a classic controller pro attached.

I can test WUPC compatibility with the newer libogc GreyWolf. Let me know!
 
I have a WUPC too, I can test that.
I think libogc is missing the extra data (that I added in libwupc mod3) to allow L3/R3/battery
the loader is using L3+R3 to shutdown the controller manually, but maybe it's not really needed. It was more of a test for me to add missing features in the library.
but maybe it could benefit libogc to get missing buttons and data.


About the nintendont "0" value, maybe it's not very intuitive.
nothing tell the user to set it to 0 to get auto.
Maybe I'll add a setting with auto or manual, when manual is selected a new setting appear with the value to choose. it's more noob friendly, but it adds another setting to the config. (not sure if there's a limit)
edit:
in fact, there's no need of a new setting, it just read the existing value and set it to 0 or not.
 
Last edited by Cyan,
if it can be useful to anybody, here is the new USBLoader GX rev 1266, compiled with tabmod.

Binary
Sources

Please remember this is NOT an official build. If it crashes or makes your wii burn, do not bother Cyan or any official developer(s). You should only report bugs you have when using the official build(s).
I tried it quickly (with some Wii/Gamecube/Wiiware games) and it worked great.


Thank you Cyan for this new revision.
 
thanks to you for still maintaining it :)
and Greywolf made all the work for 1265.


Ouahouah asked for a version with Wii, gamecube, wii+gamecube (instead of channels)
I know it's easy to make, but I don't know if he knows how to compile or change the sources to replace channels with both Wii+gamecube.
if you make one, he will be happy ;)


edit:
I'll link to your mod on the first post, like the previous one.
 
Last edited by Cyan,
@GreyWolf,
maybe you can help me here :P

I tried to replace "exit to hbc" in sys.c with currently hardcoded titleID list of all HBC in reversed order to the HBC stub.
(simply using exit(0) should use libogc to jump to HBC stubhaxx at 0x80001800)

Except that it always try to reload to JODI
I thought it was due to my program sending the dol to HBC using JODI's protocol, but even when placed on SD card and launched from HBC (1.1.0, should be LULZ) I still get JODI from the stub.

I thought it was an easy fix, "let's just put exit(0)", but no.. there are always complications which needs debugging and spending time on a simple matter.

Maybe USBGX is writing JODI in that stub? I'll search if there's a forced ID instead of keeping the original one.
maybe it's the stub.bin which has jodi hardcoded and is written in hbc_stub location ?
USBGX should only overwrite the stub before loading a game or homebrew.

edit:
I think it's "prompts/promptwindows.c" line 729.
Is that really needed here? it's loaded in memory when the user press the Home button.
it's always loading the UBSBX stub in memory, but should replace the old titleID back if not UNEO or ULNR. why would JODI wrote back instead of real HBC titleID?
Maybe the stub addresses are different in determineStubTIDLocation()? it already changed in 1.0.7, no idea where to get the new ones. I tried to look in HBC sources, and dumping memory, but it's not helping.


Why I always start with complicated things :lol:
it should have been easy.
 
Last edited by Cyan,
This in sys.c:Sys_LoadHBC() should work. If the title doesn't exist WII_LaunchTitle() will return a non-zero value so maybe it might help to use a conditional
Code:
WII_Initialize();

   // Try launching all known HBC titles in reversed released order
   WII_LaunchTitle(HBC_LULZ);
   WII_LaunchTitle(HBC_1_0_7);
   WII_LaunchTitle(HBC_JODI);
   WII_LaunchTitle(HBC_HAXX);

Maybe make it a static array and use a while loop?

This should work:
Code:
    static u64 HBC_TITLEIDS[] =
   {
       HBC_LULZ,
       HBC_1_0_7,
       HBC_JODI,
       HBC_HAXX,
       0
   };
 
   int idx = 0;
   while (HBC_TITLEIDS[idx] && !WII_LaunchTitle(HBC_TITLEIDS[idx]))
       idx++;

You shouldn't need to mess with the stub if you're actually wanting to run the HBC.
 
Last edited by GreyWolf,
yes, I know it works, but it's hardcoded.
people had issue when using OHBC because the value was not added yet.
I added it on r1265, but I thought I would just add the HBC_HAXX stub if found

Code:
void Sys_LoadHBC(void)
{
    ExitApp();

    WII_Initialize();

    // Try to reload to HBC stubhaxx at 0x80001800 if present and not replaced with USBLoaderGX stub.
    u64 stubID = getStubDest();
    if(stubID != 0 && stubID != 0x00010001554e454fll && stubID != 0x00010001554c4e52ll) // UNEO && ULNR
    {
        gprintf("Reloading hbc stub... with titleID : 0x%x\n", stubID);
        exit(0); // jump to HBC stubhaxx at 0x80001800
    }
    else
    {
        // Try launching all known HBC titles in reversed released order
        WII_LaunchTitle(HBC_OHBC);
        WII_LaunchTitle(HBC_LULZ);
        WII_LaunchTitle(HBC_1_0_7);
        WII_LaunchTitle(HBC_JODI);
        WII_LaunchTitle(HBC_HAXX);
    }
    //Back to system menu if all fails
    SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
}

the old code worked, of course.
but I don't know why the "exit(0)" tries to load JODI titleID instead of "current HBC" titleID.

I guess I'll just keep the hardcoded values, there will not be any new HBC release.
I wanted to start slowly by coding something easy. didn't went well.
I'll do something else.
 
Last edited by Cyan,
I'm not sure unless there's a delay between requesting the launch and when the function returns. If you're not waiting for the return value before trying the next ID it could result in an unpredictable logjam.

If the WII_LaunchTitle call succeeds there should be no need to call exit() as that function triggers the ES module in the IOS to reboot to a title. Anything in memory should be wiped out.
 
Last edited by GreyWolf,
WiiU widescreen will not be done. At least, I don't plan to.
Nintendont video mode "auto" will be done.

There's nothing that was deleted. your posts are still there.)
Weird, can´t search for my posts at least...
Anyway, I'm happy to see that you're STILL thinking about looking at the HDD initializing error :D. Although, it's been working fine ever since I changed the default iOS.
Wii U Widescreen would be a MAJOR asset since there are a couple (a couple I'll admit) Wii Titles that bypass the 4:3 flag. And since the aspect ratio on a per game basis isn't working (AFAIK, not sure if you fixed it?) it would really help.

I fixed the auto video scale setting for Nintendont. Unless Cyan left it out you should be able to set it to 0 now.
So, is this on YOUR build? Or the "official" one? I have to admit I haven't payed attention to NINTENDONTs development so I'm not really up to date as to what are the new "features" is the loader up to date with them? Also, Would you mind taking a look at the 16:9/4:3 issue I'm referring to? Either Wii U widescreen or aspect ratio enforcer would work for me.

Thanks guys for the work you put into this. :yayu:
 
I haven't used the new revision yet. If the fix I gave Cyan for the video scaling is there it should show that it can be set to "0, 40-120".
 
WII_LaunchTitle() is not the problem, it works great.
I wanted to COMPLETELY replace that with exit()

because Marcan said once that "loading HBC titleID with Wii_Launchtitle() is not the proper way to exit to HBC, the proper way to exit is to load the stub at 0x80001800".
So, I thought it would be cleaner to just do what he said instead of trying to launch many titles one by one hopping the user has one of them installed.

But what if the user has another one ?
You know, when OHBC was released, a lot of users complained that USBGX didn't exit to HBC correctly, and that's normal because the sources weren't updated to "Wii_LaunchTitle(OHBC)" yet, it could not have been an issue if the loader was properly exiting to the "current HBC" whatever TitleID is installed.

you see, the problem is NOT that it doesn't work, it's that it's not how it should be done. I wanted to fix it to make it "the way it should be done".
I thought it would be an easy fix, but I spent all the afternoon on it because the stub has "JODI" titleID instead of the current HBC's titleID in it.
That is what I don't understand, why the HBC stub has an old titleID while it should contain the current TitleID. So, I checked HBC sources and found that the TitleID address is different than what USBGX lstub.cpp is using. So, either I try to understand and fix it, or either I just use the wrong method : launch successively the "Wii_LaunchTitle" one by one until the TitleID matches.


Sideskroll:
There is no real "HDD initialization fix".
All I will do is set IOS58 by default instead of 249, so of course setting it yourself to 58 works fine.
The issue with using 58 happened 5-7 years ago, when users didn't have that IOS installed yet, and HBC still used IOS6x.
forcing a reload to 58 made people complain because the loader crashed and couldn't find 58....
Now, everybody has 58 in their HBC, I can set it by default to init the HDD using the "current IOS from HBC", no need to even reload to 58 as it's already in memory.



About nintendont video width, I didn't remove your patch.
it's 0,40-120
I will change it to do something like this, which is more noob friendly and more intuitive for a GUI :

Nintendont Video width : Auto

Nintendont video width : Manual (40-120)
Nintendont video value : 40
 
Last edited by Cyan,
WiiU widescreen will not be done. At least, I don't plan to.
Nintendont video mode "auto" will be done.

There's nothing that was deleted. your posts are still there.

I had a list of "things to do soon" but I forgot where I posted that. it was in one of this thread.

new plan to do (in no order) :
change the boot process to fix HDD init.
Support wiiu gamepad/fix ahb access when launched from Wiiu Wiivc
stop removing Wii from the game list when hdd not plugged
fix emuNAND path detection (badablek)
test to remove WUPC library (now done by libogc)
Add nintendont Video width auto
Set Gamecube loader to none by default and ask user on new install (or set nintendont by default?)
set gamelist to none by default and ask user on new install (or set wii and gc by default?)

@Cyan you are amazing, thank you for all your work on USB Loader GX and for any future work you do!

I did notice the GC loading issue on a fresh install the other day. I'd prefer defaulting to Nintendont - MIOS and Devolution just aren't even worthwhile anymore unless you manually want to go install them and if you even know about those options, odds are you can find the setting to go change it from Nintendont. Just my opinion :)

I used the recent 1265 rev and it seems like caching the banners was all set although I cached them all with Wiiflow previously so can't tell 100%.

I also had a minor issue where the config file corrupted when the application was on USB. This is actually the 2nd time. Perhaps there is an issue writing/reading from USB? I've always sword by using SD card for apps/roms and USB for Wii/EmuNAND/GC solely (I think Bushing or Marcan said it? IDK it was a really long time ago). Switching to SD seems to have resolved any hang ups and all was working fine so far.
 
Last edited by VashTS, , Reason: not 1262, 1265 :)
  • Like
Reactions: Cyan
yes, I think I'll just set nintendont by default on new installs.

you said 1262, not 1265?
just to know if the issue is the new/updated FAT32 library or not.

writing to USB can be an issue of you use more than one USB at the same time.
the loader can only use one HDD at a time (the other one's content is cached), but if you have the setting on one of them, the function which control the file location on the drive will be messed up when the new HDD is mounted (the file's sector location stored in memory will not be found anymore) and would corrupt the current HDD file table if it tries to access the data at that HDD location (read or write).
this is what's happening for all files currently in use while switching the used USB Port (covers, sound player, etc.)
ALL the resources and settings must always be stored on SD card to prevent issues.


about the stub, I'll just keep the old method (reloading titleID manually). that was just me trying to do things the correct way, but as long as it works it's good I guess.
I'll work on the other things I wanted to fix.


done so far :
* Set Nintendont as default gamecube mode for new loader install.
* Always create nintendont setting file if set to "create", even if using arguments.
* Set the Nintendont scale option on 2 lines (auto with hidden second line, manual+second line with value) : oops, only half done job. I did it in global settings only
* Added the nintendont scale option to individual game settings too.
* Added parental control option to block Loader's Layout buttons (requested by OuahOuah)
I would like to add an option to disable nintendont argument to use the config file, even if set to autoboot (or find how to fix autoboot as argument + HID connected)


Edit:
Ah, greywolf, I know why Sideskroll didn't find the "0, 40~120" option.
You added it only in global setting, like I just did ahaha
I'll add it to individual setting too.
edit: Done!
 
Last edited by Cyan,
yes, I think I'll just set nintendont by default on new installs.

you said 1262, not 1265?
just to know if the issue is the new/updated FAT32 library or not.

writing to USB can be an issue of you use more than one USB at the same time.
the loader can only use one HDD at a time (the other one's content is cached), but if you have the setting on one of them, the function which control the file location on the drive will be messed up when the new HDD is mounted (the file's sector location stored in memory will not be found anymore) and would corrupt the current HDD file table if it tries to access the data at that HDD location (read or write).
this is what's happening for all files currently in use while switching the used USB Port (covers, sound player, etc.)
ALL the resources and settings must always be stored on SD card to prevent issues.


about the stub, I'll just keep the old method (reloading titleID manually). that was just me trying to do things the correct way, but as long as it works it's good I guess.
I'll work on the other things I wanted to fix.



I would like to add an option to disable nintendont argument to use the config file, even if set to autoboot (or find how to fix autoboot as argument + HID connected)


Edit:
Ah, greywolf, I know why Sidescroll didn't find the "0, 40~120" option.
You added it only in global setting, like I just did ahaha
I'll add it to individual setting too.
edit: Done!

Whoops meant 1265, edited post!
 

Site & Scene News

Popular threads in this forum