Homebrew Need help with vWii gc adapter for project M

JacobM

Well-Known Member
Member
Joined
Jun 16, 2017
Messages
242
Trophies
0
XP
600
Country
United States
If I add GPF support (almost certain if it will be a common format), you won't need to convert it.
If it's not going to be wide spread, and it's only for one game, then converting to gameconfig.txt is probably better.
I posted a gameconfig.txt here, not sure if it works of if I did something wrong.

I had to leave home for a conference but I'll be back later today to do more testing.

I hexedited the changes directly into main.dol but ended up with the same black screen issue as @Peninsula

I also tried to use the gameconfig.txt file in VBI mode but also resulted in a black screen. I placed it in /code/, /txtcodes/, and at the root. I also removed the /r (CR) from each line using Notepad++ but I ran out of time before I could test it.

Peninsula and I both would like to see it eventually ported to Bomberman Blast & CrupleZone and I would like to get this ported to MKWii. Unless we figure out how to directly patch ISOs, GPF support in USB Loader GX would be the next best thing.

Thank you both for your hard work!
 
Last edited by JacobM,

Peninsula

Well-Known Member
Member
Joined
May 7, 2014
Messages
184
Trophies
0
XP
1,809
Country
United States
If I add GPF support (almost certain if it will be a common format), you won't need to convert it.
If it's not going to be wide spread, and it's only for one game, then converting to gameconfig.txt is probably better.
I posted a gameconfig.txt here, not sure if it works of if I did something wrong.
Thanks for looking into this Cyan!

I just tried your gameconfig.txt on my Wii and Wii U with no luck via USB Loader GX. Also no luck using the gameconfig.txt with the Project M launcher app.

However, your gameconfig.txt DID work when I tried running it through Gecko OS without the gpf patch file. So, it looks like I'm either having an issue with USB Loader GX or my USB drive.
 

Peninsula

Well-Known Member
Member
Joined
May 7, 2014
Messages
184
Trophies
0
XP
1,809
Country
United States
@Cyan So I've tried it out but looks like the game just boots normally with no changes. I put the file you posted in /code/ on my SD with no changes. Don't know if this the game is hooked at all. Set ocarina to Off and the hooktype to VBI as instructed.

Again unsure if it's not being hooked, an issue with the patch, or with my setup...

@Peninsula did yours black screen in usbloader? Or did it just boot normally with no changes like me?
Booted normally with no changes.
 

JacobM

Well-Known Member
Member
Joined
Jun 16, 2017
Messages
242
Trophies
0
XP
600
Country
United States
According to the directorys listed in the configuration file txtcodes have a different default directory than gct codes. Could you guys try changing the default directory to /code/
 

wilm0x42

Active Member
Newcomer
Joined
Mar 10, 2018
Messages
28
Trophies
0
Age
22
XP
139
Country
United States
That feel when people find your hack after a year of silent development. XD

Okay so the GPF:
First of all, my slightly convoluted build process outputs (somewhat) fully documented a riivolution XML into wii-gc-adapter-inject/build/wii-gc-adapter.xml
The really large patch is all of the actual code, extracted from wii-gc-adapter-inject.elf
All the other single-word patches are
* Nop's
* Overwriting variables in memory
* Redirecting various calls to controller-related functions to their counterparts in source/wii-u-gc-adapter.c

Aside from taking over basically the entire serial interface, it also write a branch to _start()
(This branch is in the function USB_LOG iirc)

Since it all boils down to trivial memory writes, it shouldn't be difficult to convert this to a GCT code or whatever.
But, as I mention in the smashboards thread (can't link 'cause I just joined), such a code would be annoyingly long. IDK if this is a problem or not. ¯\_(ツ)_/¯


I should mention that the riivolution XML doesn't actually work...
The reason I generate it is because I use that file to load the hack into the game
using a custom dolphin build. That's how the majority of development went.
I can elaborate further if I didn't explain that well enough. ;)

Any other questions?
 

JacobM

Well-Known Member
Member
Joined
Jun 16, 2017
Messages
242
Trophies
0
XP
600
Country
United States
Any other questions?

Thank you for taking the time to develop this and for sharing some insight on the interworkings.

Is directly patching this code to the ISO possible? We've tried replacing the addresses in the GPF file to those that exist in the main.dol but have had no success.

Also, it might be useful to recommend WiiLauncher as an alternate to Gecko OS since many WiiU owners use Wii Remotes with Motion Plus inside controllers which are not compatible with Gecko OS 1.9.
 

wilm0x42

Active Member
Newcomer
Joined
Mar 10, 2018
Messages
28
Trophies
0
Age
22
XP
139
Country
United States
The single-word patches shouldn't have any problem being applied to main.dol (Unless the serial interface code is loaded dynamically, which I doubt is the case)
I'd guess that the problem is the main code blob; wii-gc-adapter-inject.bin is placed at 0x800044c0.
I think this area in memory might actually belong to the apploader, rather than main.dol.
I'm not too familiar with ISO hacking, but you should be able to inject the code into the appropriate part of apploader.img.

The latest version of Gecko OS, 1.9.3.1 works just fine with my Wii Motion Plus Inside remote, if I'm not mistaken...
I'll investigate this further, when I have a chance.

Edit: according to YAGCD, the apploader is actually loaded to 0x81200000, so I guess I was probably wrong...
Looking into this further.
 
Last edited by wilm0x42,

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,649
Country
France
However, your gameconfig.txt DID work when I tried running it through Gecko OS without the gpf patch file. So, it looks like I'm either having an issue with USB Loader GX or my USB drive.
thanks for testing that. it means the conversion is done right.
so, if it doesn't work with USBLoaderGX maybe the patch is not applied at the right time? I'll have to look into GeckoOS sources to see when that function is called. But USBGX only put the dol in memory and apply patches to it before launching it, it doesn't load the apploader (or maybe I don't know about it). So if geckoOS do something to other files maybe that's why it doesn't work.

also, it's /codes/ and not /code/ (sorry I forgot the S in the other thread)
use the folder where you put the .gct, or just put the gameconfig.txt on root.
 
Last edited by Cyan,
  • Like
Reactions: Peninsula

Peninsula

Well-Known Member
Member
Joined
May 7, 2014
Messages
184
Trophies
0
XP
1,809
Country
United States
That feel when people find your hack after a year of silent development. XD

Okay so the GPF:
First of all, my slightly convoluted build process outputs (somewhat) fully documented a riivolution XML into wii-gc-adapter-inject/build/wii-gc-adapter.xml
The really large patch is all of the actual code, extracted from wii-gc-adapter-inject.elf
All the other single-word patches are
* Nop's
* Overwriting variables in memory
* Redirecting various calls to controller-related functions to their counterparts in source/wii-u-gc-adapter.c

Aside from taking over basically the entire serial interface, it also write a branch to _start()
(This branch is in the function USB_LOG iirc)

Since it all boils down to trivial memory writes, it shouldn't be difficult to convert this to a GCT code or whatever.
But, as I mention in the smashboards thread (can't link 'cause I just joined), such a code would be annoyingly long. IDK if this is a problem or not. ¯\_(ツ)_/¯


I should mention that the riivolution XML doesn't actually work...
The reason I generate it is because I use that file to load the hack into the game
using a custom dolphin build. That's how the majority of development went.
I can elaborate further if I didn't explain that well enough. ;)

Any other questions?
Hey it's the guy! Thanks again for making this tool.

Are there any other games you wanted to add GC controller support to once you release a v1.0 that you're happy with?

Would a modified version of your tool be able to work with a wiiware game? I've missed being able to 8 player Bomberman Blast with gc controllers and wiimotes. You can't use gecko with channels, correct?
 

wilm0x42

Active Member
Newcomer
Joined
Mar 10, 2018
Messages
28
Trophies
0
Age
22
XP
139
Country
United States
Hey it's the guy! Thanks again for making this tool.

Are there any other games you wanted to add GC controller support to once you release a v1.0 that you're happy with?

Would a modified version of your tool be able to work with a wiiware game? I've missed being able to 8 player Bomberman Blast with gc controllers and wiimotes. You can't use gecko with channels, correct?
Months of hacking well-spent. :)

My ideal goal is to create an auto patcher to work with any game, possibly using the Brainslug patching engine.
No idea how well that'll work out, though! :P
Other than that, I'd probably attempt other games based on popular demand.

I haven't been able to test it myself, but I think there's a "rebooter" feature of Gecko OS that might allow you to apply patches to wiiware games.
I could be completely wrong on this, though, so IDK.
However, I'm certain that there are SOME methods besides gecko of applying patches to wiiware.
If I can find a good tool for that, I might give Bomberman a shot.
(Of course, I'll have to buy it real quick before the wii shop dies ;))


@Cyan I could add gameconfig.txt output to the repo. Do you think this would be a good idea?
I looked into making a GCT version of the code, but it seems this won't work, because the patches, in their current state,
need to be applied before the game's hardware init begins.
 
  • Like
Reactions: Peninsula

JacobM

Well-Known Member
Member
Joined
Jun 16, 2017
Messages
242
Trophies
0
XP
600
Country
United States
Ok so yeah the /code was a typo. Here's two results

1) Placing the txt on root of SD card, game boots fine, behaviour as if no patch was applied
2) Placing the txt in SD:/codes/ game starts to boot, shows wiimote menu, online interacts, then endless loop of the brawl "Now Loading..." screen with the spinning 4. It's still animated, but it never loads, the wiimote disconnects and it requires a hard shutdown by pulling the plug. Holding the power button on the wiiu doesn't shut it down at that point.

Don't know if this'll help @Cyan and @wilm0x42

Is the adapter supposed to work on the front ports too, or only the back ones?

Getting the same results as you. The gameconfig.txt is being loaded somehow, but the game slows to a crawl. I'm getting the same results with the crlf and the lf files. I have yet to make it past "Now Loading..." but I am trying the different hooktypes right now.
 

Peninsula

Well-Known Member
Member
Joined
May 7, 2014
Messages
184
Trophies
0
XP
1,809
Country
United States
Months of hacking well-spent. :)

My ideal goal is to create an auto patcher to work with any game, possibly using the Brainslug patching engine.
No idea how well that'll work out, though! :P
Other than that, I'd probably attempt other games based on popular demand.

I haven't been able to test it myself, but I think there's a "rebooter" feature of Gecko OS that might allow you to apply patches to wiiware games.
I could be completely wrong on this, though, so IDK.
However, I'm certain that there are SOME methods besides gecko of applying patches to wiiware.
If I can find a good tool for that, I might give Bomberman a shot.
(Of course, I'll have to buy it real quick before the wii shop dies ;))


@Cyan I could add gameconfig.txt output to the repo. Do you think this would be a good idea?
I looked into making a GCT version of the code, but it seems this won't work, because the patches, in their current state,
need to be applied before the game's hardware init begins.

Awesome! Looking forward to all that. Just PM me if you need some extra Wii eshop points for Bomberman research.
 

wilm0x42

Active Member
Newcomer
Joined
Mar 10, 2018
Messages
28
Trophies
0
Age
22
XP
139
Country
United States
Yeah just tried it again. Think it only loads when in SD:/codes/ fyi

Anyways game loading past the loading screen and wiimote stayed connected to the system. Reached the press any button screen and then no button input was taken by the wiimote. Pressing the buttons on the gc adapter did nothing either. Pulling the gamecube adapter out of the console caused the game to white screen lol.

Does this support this adapter @wilm0x42 :s Nintendont supports it fine so I just assumed it would be similar here but maybe that's not the case

It should work just fine, as long as it's set to Wii U mode.
The back USB ports are much more likely to work.
But, if the homebrew channel recognizes a flashdrive in the front ports, then the adapter should work there as well.

The crashes that you and @JacobM are describing don't sound like anything I've seen before.
I'll look into the way gameconfig.txt patches are applied.

JacobM, what exactly do you mean by "slows to a crawl?" Are you testing this with vanilla Brawl?
 

JacobM

Well-Known Member
Member
Joined
Jun 16, 2017
Messages
242
Trophies
0
XP
600
Country
United States
I am using the official WiiU adapter plugged into back bottom USB port. Wii storage in back top USB port.

The results below aren't always consistent, but here are the most common results I encountered.

Hooktypes:
VBI - Loads normally as if no Gamecube controllers are connected. When the adapter is plugged in, the game has a chance of freezing on the press start screen (white blank screen)
Kpad Read - Loads and acts like normal (Wii Remotes only)
Joypad - Stuck on Loading screen
GXDraw - Stuck on Loading screen
GXFlush - Stuck on Loading screen
OSSleepThread - Stuck on Loading screen
AXNextFrame - Stuck on Loading screen

My ideal goal is to create an auto patcher to work with any game, possibly using the Brainslug patching engine.
No idea how well that'll work out, though! :P
Other than that, I'd probably attempt other games based on popular demand.

Nice! @Chadderz has been working on a brainslug implementation of the Wii U GCN Adapter for Mario Kart Wii for the past half year or so.

JacobM, what exactly do you mean by "slows to a crawl?" Are you testing this with vanilla Brawl?

Vanilla Brawl (WBFS format) ripped from my disk. I am referring to the game hanging on the "Now Loading..." screen just like cruplezone described.
 
Last edited by JacobM,

wilm0x42

Active Member
Newcomer
Joined
Mar 10, 2018
Messages
28
Trophies
0
Age
22
XP
139
Country
United States
Just tested the gameconfig.txt with physical disk in Gecko OS 1.9.3.1, default hooktype. Worked flawlessly.
Seems to be a problem with the loader you're using. USB Loader GX, is it?
I'll install that real quick, and see how it behaves.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    SylverReZ @ SylverReZ: @OctoAori20, Cool. Same here.