Closed Lokathor closed 3 years ago
The WinUSB driver is what the GameCube driver was tested against on Windows. The problem is that you need to build SDL2 with libusb support, which is not done by default (probably the correct decision since it would mean requiring an extra DLL in all Windows packages and build setups). You can make a libusb-compatible build using MinGW, on Fedora dnf builddep mingw64-SDL2; dnf install mingw64-libusbx
should produce an environment that these scripts can use. I don't remember if it's needed but passing --enable-hidapi-libusb
should be passed to the configure line. As for Visual Studio builds, I have no idea what it'd take to make a build there, so you're on your own for that...
Ah. Hmm, I'm not super familiar with how the libraries map between the windows and unix versions.
You're saying that even though HIDAPI is on by default with Windows, this would require an additional dependency besides what's available in the Win32 api from the OS?
That's correct - the GameCube adapter claims to be a HID but it doesn't read/write correctly by default. What SDL and Dolphin do is take the device and access the hardware directly, effectively bypassing the default HID driver. This is why Zadig is needed on Windows, with the default Windows driver we can't access it the way we want to but with WinUSB we can. Linux is in roughly the same boat, though in that case all we have to do is add a udev rule to get device access.
So can SDL get the ability to support the Zadig driver like Dolphin does?
It already has the ability. You have to compile SDL yourself with libusb support:
https://github.com/libsdl-org/SDL/issues/4199#issuecomment-800831414
Default support is unlikely unless someone integrates it into the Visual Studio project without requiring an extra download.
ah, right, okay. I wasn't initially clear about if libusb was a unix only library or if it was also a windows library separate from win32. Okay.
So is there something that needs to change, or can we close here?
Nothing for us to do, so we should be okay.
I have a Nintendo Wii U Gamecube Controller USB adapter hooked up to my Windows 10 PC, and I'm using an official Gamecube controller. I've installed the Zadig driver to make it work with the Dolphin emulator (as described here), and the adapter+controller setup does work just fine with Dolphin.
However, this set up does not get detected and used by the SDL2 Joystick and/or Controller APIs.
Because the use of the Zadig driver is the "official" way to make Dolphin work, which is probably the primary use of a gamecube controller hooked to a computer, my request is for the Zadig driver to be supported by SDL2.