Explorar o código

Use the correct protocol for the PDP Afterglow Wave controller

Third party wireless controllers use the full Switch Pro protocol over Bluetooth and third party wired controllers use the input-only protocol.

The PDP Afterglow Wave Controller for Switch uses the same VID/PID for both wired and wireless variants, so we need to look at the connection type to determine what protocol to use.
Sam Lantinga hai 2 días
pai
achega
c0efc5862c
Modificáronse 2 ficheiros con 7 adicións e 3 borrados
  1. 1 1
      src/joystick/controller_list.h
  2. 6 2
      src/joystick/hidapi/SDL_hidapi_switch.c

+ 1 - 1
src/joystick/controller_list.h

@@ -621,7 +621,7 @@ static const ControllerDescription_t arrControllers[] = {
 	{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0186 ), k_eControllerType_SwitchProController, NULL },        // PDP Afterglow Wireless Switch Controller - working gyro. USB is for charging only. Many later "Wireless" line devices w/ gyro also use this vid/pid
 	{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0187 ), k_eControllerType_SwitchInputOnlyController, NULL },  // PDP Rockcandy Wired Controller
 	{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0188 ), k_eControllerType_SwitchInputOnlyController, NULL },  // PDP Afterglow Wired Deluxe+ Audio Controller
-	{ MAKE_CONTROLLER_ID( 0x0e6f, 0x018b ), k_eControllerType_SwitchProController, NULL },  // PDP Afterglow Wave Wireless Controller for Switch
+	{ MAKE_CONTROLLER_ID( 0x0e6f, 0x018b ), k_eControllerType_SwitchInputOnlyController, NULL },  // PDP Afterglow Wave Wired/Wireless Controller for Switch
 	{ MAKE_CONTROLLER_ID( 0x0e6f, 0x018c ), k_eControllerType_SwitchProController, "PDP REALMz Wireless Controller" },  // PDP REALMz Wireless Controller for Switch
 	{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0193 ), k_eControllerType_Switch2ProController, NULL },  // Turtle Beach Afterglow Wireless RGB Gaming Controller for Nintendo Switch 2 and the Turtle Beach Rematch Wireless RGB Gaming Controller for Nintendo Switch 2
 	{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0196 ), k_eControllerType_Switch2InputOnlyController, NULL },  // Turtle Beach Rematch Wired Controller for Nintendo Switch 2

+ 6 - 2
src/joystick/hidapi/SDL_hidapi_switch.c

@@ -1575,9 +1575,13 @@ static bool HIDAPI_DriverSwitch_InitDevice(SDL_HIDAPI_Device *device)
     ctx->m_bSyncWrite = true;
 
     // Find out whether or not we can send output reports
+    // Third party controllers use the full Switch Pro wireless protocol over Bluetooth
+    if (!device->is_bluetooth) {
+        ctx->m_bInputOnly = SDL_IsJoystickNintendoSwitchProInputOnly(device->vendor_id, device->product_id) ||
+                            SDL_IsJoystickNintendoSwitch2ProInputOnly(device->vendor_id, device->product_id);
+    }
     ctx->m_bSwitch2 = SDL_IsJoystickNintendoSwitch2Pro(device->vendor_id, device->product_id);
-    ctx->m_bInputOnly = SDL_IsJoystickNintendoSwitchProInputOnly(device->vendor_id, device->product_id) ||
-                        SDL_IsJoystickNintendoSwitch2ProInputOnly(device->vendor_id, device->product_id);
+
     if (!ctx->m_bInputOnly) {
         // Initialize rumble data, important for reading device info on the MOBAPAD M073
         SetNeutralRumble(device, &ctx->m_RumblePacket.rumbleData[0]);