Skip to content

Commit a53eb52

Browse files
committed
Added support for the PDP REALMz Wireless Controller for Switch
1 parent b3af72f commit a53eb52

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

src/joystick/SDL_joystick.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ static Uint32 initial_blacklist_devices[] = {
439439
MAKE_VIDPID(0x04d9, 0x8009), // OBINLB USB-HID Keyboard (Anne Pro II)
440440
MAKE_VIDPID(0x04d9, 0xa292), // OBINLB USB-HID Keyboard (Anne Pro II)
441441
MAKE_VIDPID(0x04d9, 0xa293), // OBINLB USB-HID Keyboard (Anne Pro II)
442+
MAKE_VIDPID(0x0e6f, 0x018a), // PDP REALMz Wireless Controller for Switch, USB charging
442443
MAKE_VIDPID(0x1532, 0x0266), // Razer Huntsman V2 Analog, non-functional DInput device
443444
MAKE_VIDPID(0x1532, 0x0282), // Razer Huntsman Mini Analog, non-functional DInput device
444445
MAKE_VIDPID(0x26ce, 0x01a2), // ASRock LED Controller

src/joystick/controller_list.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,7 @@ static const ControllerDescription_t arrControllers[] = {
574574
{ 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
575575
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0187 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PDP Rockcandy Wired Controller
576576
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0188 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PDP Afterglow Wired Deluxe+ Audio Controller
577+
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x018c ), k_eControllerType_SwitchProController, "PDP REALMz Wireless Controller" }, // PDP REALMz Wireless Controller for Switch
577578
{ MAKE_CONTROLLER_ID( 0x0f0d, 0x00aa ), k_eControllerType_SwitchInputOnlyController, NULL }, // HORI Real Arcade Pro V Hayabusa in Switch Mode
578579
{ MAKE_CONTROLLER_ID( 0x20d6, 0xa711 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PowerA Wired Controller Plus/PowerA Wired Controller Nintendo GameCube Style
579580
{ MAKE_CONTROLLER_ID( 0x20d6, 0xa712 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PowerA Nintendo Switch Fusion Fight Pad

src/joystick/hidapi/SDL_hidapi_switch.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
#ifdef SDL_JOYSTICK_HIDAPI_SWITCH
3535

3636
// Define this if you want to log all packets from the controller
37-
// #define DEBUG_SWITCH_PROTOCOL
37+
#if 0
38+
#define DEBUG_SWITCH_PROTOCOL
39+
#endif
3840

3941
// Define this to get log output for rumble logic
4042
// #define DEBUG_RUMBLE
@@ -957,7 +959,7 @@ static bool LoadStickCalibration(SDL_DriverSwitch_Context *ctx)
957959
if (user_reply && user_reply->stickUserCalibration.rgucRightMagic[0] == 0xB2 && user_reply->stickUserCalibration.rgucRightMagic[1] == 0xA1) {
958960
userParamsReadSuccessCount += 1;
959961
pRightStickCal = user_reply->stickUserCalibration.rgucRightCalibration;
960-
}
962+
}
961963

962964
// Only read the factory calibration info if we failed to receive the correct magic bytes
963965
if (userParamsReadSuccessCount < 2) {
@@ -1583,7 +1585,8 @@ static bool HIDAPI_DriverSwitch_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joys
15831585
ctx->m_eControllerType != k_eSwitchDeviceInfoControllerType_NESRight &&
15841586
ctx->m_eControllerType != k_eSwitchDeviceInfoControllerType_SNES &&
15851587
ctx->m_eControllerType != k_eSwitchDeviceInfoControllerType_N64 &&
1586-
ctx->m_eControllerType != k_eSwitchDeviceInfoControllerType_SEGA_Genesis) {
1588+
ctx->m_eControllerType != k_eSwitchDeviceInfoControllerType_SEGA_Genesis &&
1589+
!(device->vendor_id == USB_VENDOR_PDP && device->product_id == USB_PRODUCT_PDP_REALMZ_WIRELESS)) {
15871590
if (LoadIMUCalibration(ctx)) {
15881591
ctx->m_bSensorsSupported = true;
15891592
}

src/joystick/usb_ids.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
#define USB_PRODUCT_NVIDIA_SHIELD_CONTROLLER_V103 0x7210
108108
#define USB_PRODUCT_NVIDIA_SHIELD_CONTROLLER_V104 0x7214
109109
#define USB_PRODUCT_PDP_ROCK_CANDY 0x0246
110+
#define USB_PRODUCT_PDP_REALMZ_WIRELESS 0x018c
110111
#define USB_PRODUCT_POWERA_MINI 0x541a
111112
#define USB_PRODUCT_RAZER_ATROX 0x0a00
112113
#define USB_PRODUCT_RAZER_KITSUNE 0x1012

0 commit comments

Comments
 (0)