Wii U Gamecube Adapter Reverse Engineering Cont.

Discussion in 'Wii U - Hacking & Backup Loaders' started by koalaboy13, May 5, 2015.

  1. koalaboy13
    OP

    koalaboy13 Newbie

    Newcomer
    6
    10
    Jun 23, 2014
    United States
    First a little history (skip this if you know about the Linux driver)...
    Warning: Spoilers inside!

    But... We're not done yet. Poking around at the adapter, it appears that 0x13 is not a 'secret' but rather one of several commands, 0x11 for rumble being another. By basically fuzzing the adapter, I've started to work out some of the other commands. The goal of this thread is to document what we know, and allow others to contribute new findings.

    So, without further ado, what I found:

    VID = 0x057E PID = 0x0337
    The adapter exposes two USB endpoints, one in, one out, which we already knew. Commands are written to the in endpoint (0x81) and responses, if any are read from 0x02.

    Commands:

    0x11 - Rumble​
    Send: 5 bytes [0x11, R1, R2, R3, R4]​
    Receive: none​
    To turn on rumble, set the corresponding R to 0x01, or to 0x00 to turn off​

    0x12 - Rest positions​
    Send: 1 byte [0x12]​
    Receive: 25 bytes, 1 cmd (0x22) followed by 4 sets of [JoyX, JoyY, CstickX, CstickY, Ltrigger, Rtrigger]​
    Gets resting or base positions for the analog parts of the controller (joysticks, analog triggers)​
    If polling has not been started will return all zeros except for byte 0, status?​

    0x13 - Begin Polling​
    Send: 1 byte [0x13]​
    Receive: 37 bytes, 1 cmd byte (0x21) plus 4 sets of 9 bytes:​
    [status, BtnStateH, BtnStateL, JoyX, JoyY, CX, CY, LTrigger, RTrigger]​
    The 'knock', will make the adapter begin sending updates to endpoint 0x02 every time it is read.​
    Required before rumble and rest positions will work?​

    0x14 - Suspend Polling​
    Send: 1 byte [0x14]​
    Receive: 2 bytes [0x24, WasPolling] 1 cmd byte (0x24) plus 0x01 if we were just polling, 0x00 if not​
    Stops the updates that 0x13 sends, useful if you just need a break, or are no longer interested in data​

    0x15 - Kill?​
    Send: 1 byte [0x15]​
    Receive: ERROR​
    After sending 0x15 and trying to use the device, libUSB gives an IO error, leading me to believe that 0x15​
    turns off the adapter and requires it to be unplugged and reconnected to begin working again​

    0x16 - ???​
    Send: ??? [0x16, ...]​
    Receive: ???​
    Definitely a valid command, but no idea what it does​

    0x17 - ???​
    Send: ??? [0x17, ...]​
    Receive: ???​
    Definitely a valid command, but no idea what it does​

    0x16 and 0x17 stall the polling data, just like an incomplete 0x11 packet, while 0x10, 0x18, 0x19, etc appear ignored. This makes me think 0x16 and 0x17 are other commands that require multi-byte packets. Fingers crossed for JOYBUS...​

    Some more about the status bytes and button masks is known and implemented in the drivers and in Dolphin. I will update this after I read through those and figure out the status bytes for 0x12 and 0x14. Many of the things I initially labeled 'status' appear to actually be the command bytes for the packets the adapter sends back.​

    Right now I just wanted to get the new info out there and seek any more info people have. I ran through all bytes from 0x00 to 0xFF and these were the only ones that I saw responses to, but there could still be others that don't return or require multi-byte packets. Originally I had hoped that there might be a general purpose JOYBUS mode lurking in there, but the chance of that seems slim (unless it's 0x16 and 0x17). The adapter gives no indication that a GBA link cable was inserted while polling via 0x13 either. In other words, controllers yes, GBA link no. Chime in with any more info you may have and I'll add it above.​
     
  2. Mr. Mysterio

    Mr. Mysterio Super Genius

    Member
    661
    856
    Sep 16, 2014
    United States
    Rosalina's Comet Observatory
    I wonder if support for this adapter could be added to Dolphin? That would be awesome!
     
    Margen67 likes this.
  3. TotalInsanity4

    TotalInsanity4 GBAtemp Supreme Overlord

    Member
    7,576
    7,659
    Dec 1, 2014
    United States
    Under a rock
    Hasn't it already?

    Answer: Yes it does. Said support probably isn't quite up-to-date, though, if that's what you mean
     
    Margen67 and Mr. Mysterio like this.
  4. Xuman

    Xuman GBAtemp Fan

    Member
    395
    246
    Jan 26, 2012
    United States
    Maaaaaan, if only gba-link could work. Pokemon XD on Wii U with a GBA? yes please.
     
    Margen67 and TotalInsanity4 like this.
  5. crediar

    crediar Possiblenator

    Member
    338
    1,309
    Mar 5, 2006
    This will never work and there is nothing anyone can do about it.
     
  6. Xuman

    Xuman GBAtemp Fan

    Member
    395
    246
    Jan 26, 2012
    United States
    Is it bad that hearing that made me shed a small tear? Lol ah well. Unless Nintendo makes it possible (Doubt. Max Doubt. Unless, Iunno, they release GBA on 3DS and GC on Wii U and then say that you can wireless GBA link somehow. But again, one can only hope. Doubt settings on Max output)
     
    TotalInsanity4 likes this.
  7. koalaboy13
    OP

    koalaboy13 Newbie

    Newcomer
    6
    10
    Jun 23, 2014
    United States
    Added info about two new commands I found. 0x16 and 0x17 look like multi-byte commands b/c they stall IO, like 0x11 and unlike most other 'junk' bytes. Still have no clue what they do. Anyone else got ANY good info on these?
     
    pedro702 and Margen67 like this.