Fix Wii U adapter clone not working in Wii U mode
I have a clone adapter with USB id 0079:1846 when configured in PC mode. It was not working in Wii U mode in Nintendont on a Wii. Adding this control transfer during initialisation make it work. I think it is harmless for other adapters but I cannot be sure as original adapters are very hard to find at a decent price.
Does this have an influence on genuine adapters? Did you test?
I did not test with a genuine adapter as I do not have one.
After checking dolphin emulator source code (which supports my adapter in Wii U mode out of the box) , it seems that it does more or less the same here: https://github.com/dolphin-emu/dolphin/blob/f412e2488c24fc81a784c198ba9610e54cdd1d9a/Source/Core/InputCommon/GCAdapter.cpp#L598. It just sends a 1 value instead of 0 in my pull request, I will test with 1 and update it if it works.
Dolphin does not have any issue with genuine adapters, so I guess it will be the same with Nintendont.
I can provide a compiled version if you want to try.
The compiled version is available here: https://github.com/zardam/Nintendont/releases/download/v0/loader.dol if anyone wants to test.
Dolphin does not have any issue with genuine adapters, so I guess it will be the same with Nintendont.
https://github.com/dolphin-emu/dolphin/blob/f412e2488c24fc81a784c198ba9610e54cdd1d9a/Source/Core/InputCommon/GCAdapter.cpp#L596C1-L597C66
"However it returns LIBUSB_ERROR_PIPE with Mayflash adapters."
Hmm, can we make this call conditional, i.e. not for the Mayflash adapters?
I dont think it is needed to make this call conditional:
- My adapter in Wii mode works fine on a Switch, that means that the Switch is sending this control transfer.
- Mayflash adapters also work so they should just ignore this control transfer.
- Dolphin source says that Mayflash adapters reports an error for this transfer, and the result is ignored (only a warning logged). I do not see reports that Mayflash adapters are not working with Dolphin.
I really think that this control transfer is harmless, and it may be difficult to differentiate the adapters. Mine USB descriptor is pretty generic, no brand or model specified.