mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-13 14:58:14 +00:00
Add support for Pro3
Add support for Pro3
This commit is contained in:
@@ -145,6 +145,7 @@ static bool HIDAPI_Driver8BitDo_IsSupportedDevice(SDL_HIDAPI_Device *device, con
|
|||||||
case USB_PRODUCT_8BITDO_SN30_PRO_BT:
|
case USB_PRODUCT_8BITDO_SN30_PRO_BT:
|
||||||
case USB_PRODUCT_8BITDO_PRO_2:
|
case USB_PRODUCT_8BITDO_PRO_2:
|
||||||
case USB_PRODUCT_8BITDO_PRO_2_BT:
|
case USB_PRODUCT_8BITDO_PRO_2_BT:
|
||||||
|
case USB_PRODUCT_8BITDO_PRO_3:
|
||||||
case USB_PRODUCT_8BITDO_ULTIMATE2_WIRELESS:
|
case USB_PRODUCT_8BITDO_ULTIMATE2_WIRELESS:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
@@ -219,6 +220,8 @@ static bool HIDAPI_Driver8BitDo_InitDevice(SDL_HIDAPI_Device *device)
|
|||||||
HIDAPI_SetDeviceName(device, "8BitDo SN30 Pro");
|
HIDAPI_SetDeviceName(device, "8BitDo SN30 Pro");
|
||||||
} else if (device->product_id == USB_PRODUCT_8BITDO_PRO_2 || device->product_id == USB_PRODUCT_8BITDO_PRO_2_BT) {
|
} else if (device->product_id == USB_PRODUCT_8BITDO_PRO_2 || device->product_id == USB_PRODUCT_8BITDO_PRO_2_BT) {
|
||||||
HIDAPI_SetDeviceName(device, "8BitDo Pro 2");
|
HIDAPI_SetDeviceName(device, "8BitDo Pro 2");
|
||||||
|
} else if (device->product_id == USB_PRODUCT_8BITDO_PRO_3) {
|
||||||
|
HIDAPI_SetDeviceName(device, "8BitDo Pro 3");
|
||||||
}
|
}
|
||||||
|
|
||||||
return HIDAPI_JoystickConnected(device, NULL);
|
return HIDAPI_JoystickConnected(device, NULL);
|
||||||
@@ -253,6 +256,7 @@ static Uint64 HIDAPI_Driver8BitDo_GetIMURateForProductID(SDL_HIDAPI_Device *devi
|
|||||||
// This firmware appears to update at 100 Hz over USB
|
// This firmware appears to update at 100 Hz over USB
|
||||||
return 100;
|
return 100;
|
||||||
}
|
}
|
||||||
|
case USB_PRODUCT_8BITDO_PRO_3:
|
||||||
case USB_PRODUCT_8BITDO_PRO_2:
|
case USB_PRODUCT_8BITDO_PRO_2:
|
||||||
case USB_PRODUCT_8BITDO_PRO_2_BT: // Note, labeled as "BT" but appears this way when wired.
|
case USB_PRODUCT_8BITDO_PRO_2_BT: // Note, labeled as "BT" but appears this way when wired.
|
||||||
if (device->is_bluetooth) {
|
if (device->is_bluetooth) {
|
||||||
@@ -287,6 +291,7 @@ static bool HIDAPI_Driver8BitDo_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joys
|
|||||||
// Initialize the joystick capabilities
|
// Initialize the joystick capabilities
|
||||||
if (device->product_id == USB_PRODUCT_8BITDO_PRO_2 ||
|
if (device->product_id == USB_PRODUCT_8BITDO_PRO_2 ||
|
||||||
device->product_id == USB_PRODUCT_8BITDO_PRO_2_BT ||
|
device->product_id == USB_PRODUCT_8BITDO_PRO_2_BT ||
|
||||||
|
device->product_id == USB_PRODUCT_8BITDO_PRO_3 ||
|
||||||
device->product_id == USB_PRODUCT_8BITDO_ULTIMATE2_WIRELESS) {
|
device->product_id == USB_PRODUCT_8BITDO_ULTIMATE2_WIRELESS) {
|
||||||
// This controller has additional buttons
|
// This controller has additional buttons
|
||||||
joystick->nbuttons = SDL_GAMEPAD_NUM_8BITDO_BUTTONS;
|
joystick->nbuttons = SDL_GAMEPAD_NUM_8BITDO_BUTTONS;
|
||||||
|
@@ -60,7 +60,8 @@
|
|||||||
#define USB_VENDOR_VALVE 0x28de
|
#define USB_VENDOR_VALVE 0x28de
|
||||||
#define USB_VENDOR_ZEROPLUS 0x0c12
|
#define USB_VENDOR_ZEROPLUS 0x0c12
|
||||||
|
|
||||||
#define USB_PRODUCT_8BITDO_ULTIMATE2_WIRELESS 0x6012
|
#define USB_PRODUCT_8BITDO_ULTIMATE2_WIRELESS 0x6012 // mode switch to BT
|
||||||
|
#define USB_PRODUCT_8BITDO_PRO_3 0x6009 // mode switch to D
|
||||||
#define USB_PRODUCT_8BITDO_SF30_PRO 0x6000 // B + START
|
#define USB_PRODUCT_8BITDO_SF30_PRO 0x6000 // B + START
|
||||||
#define USB_PRODUCT_8BITDO_SF30_PRO_BT 0x6100 // B + START
|
#define USB_PRODUCT_8BITDO_SF30_PRO_BT 0x6100 // B + START
|
||||||
#define USB_PRODUCT_8BITDO_SN30_PRO 0x6001 // B + START
|
#define USB_PRODUCT_8BITDO_SN30_PRO 0x6001 // B + START
|
||||||
|
Reference in New Issue
Block a user