mirror of
https://github.com/encounter/SDL.git
synced 2025-12-14 23:56:19 +00:00
The new Wii Remote shares the same VID/PID as the Wii U Pro controller
This commit is contained in:
@@ -177,10 +177,9 @@ HIDAPI_DriverWii_IsEnabled(void)
|
|||||||
static SDL_bool
|
static SDL_bool
|
||||||
HIDAPI_DriverWii_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol)
|
HIDAPI_DriverWii_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol)
|
||||||
{
|
{
|
||||||
if (vendor_id == USB_VENDOR_NINTENDO && product_id == USB_PRODUCT_NINTENDO_WII_PRO) {
|
if (vendor_id == USB_VENDOR_NINTENDO &&
|
||||||
return SDL_TRUE;
|
(product_id == USB_PRODUCT_NINTENDO_WII_REMOTE ||
|
||||||
}
|
product_id == USB_PRODUCT_NINTENDO_WII_REMOTE2)) {
|
||||||
if (vendor_id == USB_VENDOR_NINTENDO && product_id == USB_PRODUCT_NINTENDO_WII_REMOTE) {
|
|
||||||
return SDL_TRUE;
|
return SDL_TRUE;
|
||||||
}
|
}
|
||||||
return SDL_FALSE;
|
return SDL_FALSE;
|
||||||
@@ -752,11 +751,7 @@ HIDAPI_DriverWii_InitDevice(SDL_HIDAPI_Device *device)
|
|||||||
if (device->vendor_id == USB_VENDOR_NINTENDO) {
|
if (device->vendor_id == USB_VENDOR_NINTENDO) {
|
||||||
EWiiExtensionControllerType eExtensionControllerType;
|
EWiiExtensionControllerType eExtensionControllerType;
|
||||||
|
|
||||||
if (device->product_id == USB_PRODUCT_NINTENDO_WII_PRO) {
|
eExtensionControllerType = ReadExtensionControllerType(device);
|
||||||
eExtensionControllerType = k_eWiiExtensionControllerType_WiiUPro;
|
|
||||||
} else {
|
|
||||||
eExtensionControllerType = ReadExtensionControllerType(device);
|
|
||||||
}
|
|
||||||
device->guid.data[15] = eExtensionControllerType;
|
device->guid.data[15] = eExtensionControllerType;
|
||||||
UpdateDeviceIdentity(device);
|
UpdateDeviceIdentity(device);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,8 +57,8 @@
|
|||||||
#define USB_PRODUCT_NINTENDO_SWITCH_JOYCON_PAIR 0x2008 /* Used by joycond */
|
#define USB_PRODUCT_NINTENDO_SWITCH_JOYCON_PAIR 0x2008 /* Used by joycond */
|
||||||
#define USB_PRODUCT_NINTENDO_SWITCH_JOYCON_RIGHT 0x2007
|
#define USB_PRODUCT_NINTENDO_SWITCH_JOYCON_RIGHT 0x2007
|
||||||
#define USB_PRODUCT_NINTENDO_SWITCH_PRO 0x2009
|
#define USB_PRODUCT_NINTENDO_SWITCH_PRO 0x2009
|
||||||
#define USB_PRODUCT_NINTENDO_WII_PRO 0x0330
|
|
||||||
#define USB_PRODUCT_NINTENDO_WII_REMOTE 0x0306
|
#define USB_PRODUCT_NINTENDO_WII_REMOTE 0x0306
|
||||||
|
#define USB_PRODUCT_NINTENDO_WII_REMOTE2 0x0330
|
||||||
#define USB_PRODUCT_NVIDIA_SHIELD_CONTROLLER 0x7214
|
#define USB_PRODUCT_NVIDIA_SHIELD_CONTROLLER 0x7214
|
||||||
#define USB_PRODUCT_RAZER_PANTHERA 0x0401
|
#define USB_PRODUCT_RAZER_PANTHERA 0x0401
|
||||||
#define USB_PRODUCT_RAZER_PANTHERA_EVO 0x1008
|
#define USB_PRODUCT_RAZER_PANTHERA_EVO 0x1008
|
||||||
|
|||||||
Reference in New Issue
Block a user