• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

Dolphin Controller Code?

Dolla Pills

Smash Ace
Joined
Mar 9, 2015
Messages
894
Location
Connecticut
So recently I've been working on something for fun in Java and I wanted to add in support for the Wii U adapter. I'm using the usb4java LibUsb wrapper and have been following the source code for Dolphin (which uses LibUsb). I'm able to access the device/endpoints fine and don't get any errors when trying to use the interruptTransfer method, yet when I try to read data I don't get anything (just a ByteBuffer full of 0's).

Does anyone have experience with usb4java or understand the Dolphin source code that would be willing to help me? I can post my code too but just wanted to see if anyone was available to help since I'm inexperienced and kinda frustrated at this point.


EDIT:
I have it reading some stuff now after reversing the endpoints, but it takes me about two to three times of running the program to update the values. Anyone know why?

EDIT 2:
I think it was just an oddity of only scanning input once before ending the program, when I put it in my main loop it was fine. So it turns out I don't need help after all but if anyone ever wants this code for whatever reason hit me up.
 
Last edited:

Dolla Pills

Smash Ace
Joined
Mar 9, 2015
Messages
894
Location
Connecticut
what is that something your working on?
Just a dumb smash related game lol. Maybe I'll share it here if I ever finish it but I'll be back at school on Wednesday so I'm gonna be too busy to work on it most likely, and it's incredibly far from done
 

Dolla Pills

Smash Ace
Joined
Mar 9, 2015
Messages
894
Location
Connecticut
Just an update cause something was bothering me, but I wrote a C++ plugin that reads data from the Wii U adapter which can be used in the Unity game engine. Not sure if anyone would ever look for something like this but I have it if you want it
 

SinsOfApathy

Smash Journeyman
Joined
Feb 24, 2015
Messages
474
NNID
Psion312
Not entirely related, but I was wondering if you've tried sending data over the controller port that wasn't GC->controller commands.

Considering it for a future project where I'd be using my split controller cable to send some arbitrary data.
 

Dolla Pills

Smash Ace
Joined
Mar 9, 2015
Messages
894
Location
Connecticut
I'm not sure what you mean exactly, do you mean you want to be able to record your inputs on the computer while playing on a GameCube/ Wii with your controller splitter?
 
Last edited:

SinsOfApathy

Smash Journeyman
Joined
Feb 24, 2015
Messages
474
NNID
Psion312
I'm not sure what you mean exactly, do you mean you want to be able to record your inputs on the computer while playing on a GameCube/ Wii with your controller splitter?
No, my intention for one project is to splice two male cables together, so that I can send inputs over the adapter to a Wii/GC. My current method is just wiring a male cable to a Raspberry Pi to let the RPi do the data send/recv.

My secondary project would be the same interface, except I'd like to use just the controller cable as a serial send/recv cable to the RPi via GC Adapter. That way I could have a male cable operating for serial send/recv instead of my current TCP connection (which would be more robust on networks I don't personally control).
 
Last edited:

Dolla Pills

Smash Ace
Joined
Mar 9, 2015
Messages
894
Location
Connecticut
No, my intention for one project is to splice two male cables together, so that I can send inputs over the adapter to a Wii/GC. My current method is just wiring a male cable to a Raspberry Pi to let the RPi do the data send/recv.

My secondary project would be the same interface, except I'd like to use just the controller cable as a serial send/recv cable to the RPi via GC Adapter. That way I could have a male cable operating for serial send/recv instead of my current TCP connection (which would be more robust on networks I don't personally control).
I still don't think I understand exactly.

Do you intend to connect the adapter to a Raspberry Pi and use that to send out split signals to the GC?
 

artifice

Smash Ace
Joined
Feb 12, 2007
Messages
567
Location
Spokane, WA
Just an update cause something was bothering me, but I wrote a C++ plugin that reads data from the Wii U adapter which can be used in the Unity game engine. Not sure if anyone would ever look for something like this but I have it if you want it
Does this also work with the Mayflash adapter in WiiU-mode? (Unity's input manager can detect the PC-mode, but not WiiU mode)

But either-way would love a link to your plugin regardless
 

Dolla Pills

Smash Ace
Joined
Mar 9, 2015
Messages
894
Location
Connecticut
Yeah it works for Wii U mode with the WUP-28 driver or whatever the Netplay driver is. The thing is though all it's doing right now is reading / interpreting data from the adapter, I haven't written any scripts to use it as input or anything yet

Oh yeah, and I haven't done any support for rumble yet either which would need me to rework the C++ code and rebuild the DLL. It probably wouldn't be too hard but it's not on my priority list at the moment
 
Last edited:

artifice

Smash Ace
Joined
Feb 12, 2007
Messages
567
Location
Spokane, WA
I wasn't really expecting a plugin that would work 'out of the box'. I can't guarantee anything with out seeing exactly what you have... but I should be able to build some sort of 'input manager' with your dll, I has experience in such things.

May save you some time if you end up using any of my code (will send back to you).
 

Dolla Pills

Smash Ace
Joined
Mar 9, 2015
Messages
894
Location
Connecticut
Okay I'll try to send it to you in a private message or something later, I'll specify the methods too. The only thing is I don't have any way to log errors through encountered in the DLL (haven't had a problem but it's not tested with other people's stuff)
 

SinsOfApathy

Smash Journeyman
Joined
Feb 24, 2015
Messages
474
NNID
Psion312
I still don't think I understand exactly.

Do you intend to connect the adapter to a Raspberry Pi and use that to send out split signals to the GC?
No. The cable will not be split to a Gamecube.

I'm asking if I sent a command that wasn't data request, etc. would it still send via the adapter? Like is the adapter just a glorified serial port?
 
Last edited:

Dolla Pills

Smash Ace
Joined
Mar 9, 2015
Messages
894
Location
Connecticut
No. The cable will not be split to a Gamecube.

I'm asking if I sent a command that wasn't data request, etc. would it still send via the adapter? Like is the adapter just a glorified serial port?
Ohh I'm not entirely sure. I'm fairly certain you can send whatever data you want but I have nothing to test it on

EDIT:
On second thought you'd probably have to reprogram the driver on the adapter so that it can interpret whatever data you feed it, otherwise I'm not sure you could directly send undefined data to a port
 
Last edited:
Top Bottom