Closed Bitwolfies closed 1 year ago
If they don't work out of the box, I can help you get them set up.
If they don't work out of the box, I can help you get them set up.
Thanks, once they arrive ill let you know, any chance the mic will work out of the box or is that gonna require some extra legwork?
Usually controller microphones show up as audio devices to the OS.
Hey @slouken, controllers are here! My results:
They show up as "HVC Controller (1) and (2)" respectively.
Deck does recognize them as sideways Switch Controllers, and A and B work as expected, though Steam shows option to "combine them" like joycons, dunno if the NES ones do that.
Mic is not working.
If there's any dumps you need, say to give them a more friendly name. let me know!
Take a look at SDL_hidapi_switch.c, and look for code dealing with k_eSwitchDeviceInfoControllerType_NESLeft
and k_eSwitchDeviceInfoControllerType_NESRight
. These controllers need to be handled the same way.
Can you tell me what ctx->m_eControllerType
is inside of BReadDeviceInfo()
, for each of them? Can you also link to a picture of the exact model you have?
Take a look at SDL_hidapi_switch.c, and look for code dealing with
k_eSwitchDeviceInfoControllerType_NESLeft
andk_eSwitchDeviceInfoControllerType_NESRight
. These controllers need to be handled the same way.Can you tell me what
ctx->m_eControllerType
is inside ofBReadDeviceInfo()
, for each of them? Can you also link to a picture of the exact model you have?
No problems doing either, but I do need a bit of guidance, if you tell me which command to gather the BReadDeviceInfo, Ive got no problems sending it over.
"Right" controller, faded text is M9WF200 "Left" is M9WF100. Left also goes by HAC-035
Can you apply this patch to SDL, and then build and run the testgamepad test program? If you're having trouble with that, go ahead and send me e-mail at slouken@libsdl.org and we can schedule a Zoom call to walk through the process.
diff --git a/src/joystick/hidapi/SDL_hidapi_switch.c b/src/joystick/hidapi/SDL_hidapi_switch.c
index 438c9c62c..9a184f492 100644
--- a/src/joystick/hidapi/SDL_hidapi_switch.c
+++ b/src/joystick/hidapi/SDL_hidapi_switch.c
@@ -591,6 +591,7 @@ static SDL_bool BReadDeviceInfo(SDL_DriverSwitch_Context *ctx)
if (WriteSubcommand(ctx, k_eSwitchSubcommandIDs_RequestDeviceInfo, NULL, 0, &reply)) {
// Byte 2: Controller ID (1=LJC, 2=RJC, 3=Pro)
ctx->m_eControllerType = CalculateControllerType(ctx, (ESwitchDeviceInfoControllerType)reply->deviceInfo.ucDeviceType);
+SDL_Log("CONTROLLER TYPE: %d\n", ctx->m_eControllerType);
// Bytes 4-9: MAC address (big-endian)
SDL_memcpy(ctx->m_rgucMACAddress, reply->deviceInfo.rgucMACAddress, sizeof(ctx->m_rgucMACAddress));
Unless I did something wrong, its not happy with the patch.
Remove the +
at the beginning of the line
Woof, that was embarrassing. Regardless its built now, though I have no idea where the testgamepad program is. For building I just followed the first set of instructions found here. https://wiki.libsdl.org/SDL2/Installation
It's in the test directory. It's easier to build with Visual Studio or if you're using CMake you can pass -DSDL_TESTS=ON
to build the tests as well.
Alright, built with cmake with the test flag passed. how should I run it and what data do you need?
If you're not running in Visual Studio you may need to get DebugView to see the debug output, but just run testgamepad, then connect the left controller, disconnect it, then connect the right controller, and copy the debug output here.
Thanks!
Right, though I'm on Linux so I'll just have to find where the program got stashed, thanks!
Oh, if you're on Linux it's easier, just cd $(dirname $(find . -name testgamepad)) && ./testgamepad
INFO: Nintendo Switch Joy-Con 0: HVC Controller (2), /dev/hidraw4 (guid 030096757e0500000720000000006808, VID 0x057e, PID 0x2007, player index = 0)
INFO: Nintendo Switch Joy-Con 0: HVC Controller (1), /dev/hidraw4 (guid 030096857e0500000720000000006807, VID 0x057e, PID 0x2007, player index = 0)
Inputs are:
Controller 1: Dpad, Start/select, A, B, ZL, ZR Controller 2: Dpad, A, B, Zl, ZR, Mic, Volume slider.
Can you update code and see if they're recognized properly? This change should have what you need: https://github.com/libsdl-org/SDL/commit/baa9c57581490bd9cdefabb213e7cb6d0c30b296
(Side note, could you also tell me the uninstall command for this build of sdl? Thanks!)
If you haven't done make install
, it isn't installed, you can just delete the SDL directory. If you have done make install
, then make uninstall
should take care of uninstalling it.
Can you please let me know if this change works properly for you? If so, I'll merge it into the SDL used by Steam.
Sorry for leaving you hanging, got hit with a nasty fever, I'll compile as soon as I can. Thanks for all your patience.
Seems to be fine, let me know when it hits steam beta so I can test it out on my deck as well.
Thanks! I hope you feel better soon!
Support for the NES variant was added a long time ago, but it's unclear if the Famicom variant is supported. One of the two controllers in the pack has a microphone which is a fairly large difference. Just wondering if its supported since I have a set on the way and once arrived can contribute any info needed to get them in if they're not already. Thanks!