From 8243a3e80190ae1eaffb21679c3c1182bebe282e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 25 Nov 2019 15:02:50 -0800 Subject: [PATCH] Added support for the Hyperkin X91 --- src/hidapi/libusb/hid.c | 9 +++++---- src/joystick/SDL_gamecontrollerdb.h | 1 + src/joystick/controller_type.h | 4 ++++ src/joystick/hidapi/SDL_hidapijoystick.c | 1 + 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/hidapi/libusb/hid.c b/src/hidapi/libusb/hid.c index 2a82bafecf9e2..180e3aeb1619f 100644 --- a/src/hidapi/libusb/hid.c +++ b/src/hidapi/libusb/hid.c @@ -491,7 +491,7 @@ static int is_xbox360(unsigned short vendor_id, const struct libusb_interface_de 0x06a3, /* Saitek */ 0x0738, /* Mad Catz */ 0x07ff, /* Mad Catz */ - 0x0e6f, /* Unknown */ + 0x0e6f, /* PDP */ 0x0f0d, /* Hori */ 0x11c9, /* Nacon */ 0x12ab, /* Unknown */ @@ -526,10 +526,11 @@ static int is_xboxone(unsigned short vendor_id, const struct libusb_interface_de static const int SUPPORTED_VENDORS[] = { 0x045e, /* Microsoft */ 0x0738, /* Mad Catz */ - 0x0e6f, /* Unknown */ + 0x0e6f, /* PDP */ 0x0f0d, /* Hori */ 0x1532, /* Razer Wildcat */ 0x24c6, /* PowerA */ + 0x2e24, /* Hyperkin */ }; if (intf_desc->bInterfaceNumber == 0 && @@ -1433,7 +1434,7 @@ static struct lang_map_entry lang_map[] = { LANG("Lithuanian", "lt", 0x0427), LANG("F.Y.R.O. Macedonia", "mk", 0x042F), LANG("Malay - Malaysia", "ms_my", 0x043E), - LANG("Malay – Brunei", "ms_bn", 0x083E), + LANG("Malay ??? Brunei", "ms_bn", 0x083E), LANG("Maltese", "mt", 0x043A), LANG("Marathi", "mr", 0x044E), LANG("Norwegian - Bokml", "no_no", 0x0414), @@ -1484,7 +1485,7 @@ static struct lang_map_entry lang_map[] = { LANG("Ukrainian", "uk", 0x0422), LANG("Urdu", "ur", 0x0420), LANG("Uzbek - Cyrillic", "uz_uz", 0x0843), - LANG("Uzbek – Latin", "uz_uz", 0x0443), + LANG("Uzbek ??? Latin", "uz_uz", 0x0443), LANG("Vietnamese", "vi", 0x042A), LANG("Xhosa", "xh", 0x0434), LANG("Yiddish", "yi", 0x043D), diff --git a/src/joystick/SDL_gamecontrollerdb.h b/src/joystick/SDL_gamecontrollerdb.h index 34d324080c0a6..b9af64357100b 100644 --- a/src/joystick/SDL_gamecontrollerdb.h +++ b/src/joystick/SDL_gamecontrollerdb.h @@ -422,6 +422,7 @@ static const char *s_ControllerMappings [] = "030000000d0f00005e00000011010000,Hori Fighting Commander 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", "03000000ad1b000001f5000033050000,Hori Pad EX Turbo 2,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", "030000008f0e00001330000010010000,HuiJia SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b9,x:b3,y:b0,", + "03000000242e00008816000001010000,Hyperkin X91,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", "03000000d80400008200000003000000,IMS PCU#0 Gamepad Interface,a:b1,b:b0,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,start:b5,x:b3,y:b2,", "03000000fd0500000030000000010000,InterAct GoPad I-73000 (Fighting Game Layout),a:b3,b:b4,back:b6,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,start:b7,x:b0,y:b1,", "030000006e0500000320000010010000,JC-U3613M - DirectInput Mode,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,", diff --git a/src/joystick/controller_type.h b/src/joystick/controller_type.h index 9fc08ddd50c76..18d60e06a256c 100644 --- a/src/joystick/controller_type.h +++ b/src/joystick/controller_type.h @@ -224,6 +224,9 @@ static const ControllerDescription_t arrControllers[] = { { MAKE_CONTROLLER_ID( 0x0e6f, 0x021f ), k_eControllerType_XBox360Controller }, // Rock Candy Gamepad for Xbox 360 { MAKE_CONTROLLER_ID( 0x0e6f, 0x0246 ), k_eControllerType_XBoxOneController }, // Rock Candy Gamepad for Xbox One 2015 { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a0 ), k_eControllerType_XBox360Controller }, // Counterfeit 360Controller + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02ab ), k_eControllerType_XBoxOneController }, // PDP Controller for Xbox One + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a4 ), k_eControllerType_XBoxOneController }, // PDP Wired Controller for Xbox One - Stealth Series + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a6 ), k_eControllerType_XBoxOneController }, // PDP Wired Controller for Xbox One - Camo Series { MAKE_CONTROLLER_ID( 0x0e6f, 0x0301 ), k_eControllerType_XBox360Controller }, // Logic3 Controller { MAKE_CONTROLLER_ID( 0x0e6f, 0x0346 ), k_eControllerType_XBoxOneController }, // Rock Candy Gamepad for Xbox One 2016 { MAKE_CONTROLLER_ID( 0x0e6f, 0x0401 ), k_eControllerType_XBox360Controller }, // Logic3 Controller @@ -324,6 +327,7 @@ static const ControllerDescription_t arrControllers[] = { { MAKE_CONTROLLER_ID( 0x24c6, 0xfafc ), k_eControllerType_XBox360Controller }, // Afterglow Gamepad 1 { MAKE_CONTROLLER_ID( 0x24c6, 0xfafe ), k_eControllerType_XBox360Controller }, // Rock Candy Gamepad for Xbox 360 { MAKE_CONTROLLER_ID( 0x24c6, 0xfafd ), k_eControllerType_XBox360Controller }, // Afterglow Gamepad 3 + { MAKE_CONTROLLER_ID( 0x2e24, 0x1688 ), k_eControllerType_XBoxOneController }, // Hyperkin X91 //{ MAKE_CONTROLLER_ID( 0x0955, 0x7210 ), k_eControllerType_XBox360Controller }, // Nvidia Shield local controller { MAKE_CONTROLLER_ID( 0x0e6f, 0x0205 ), k_eControllerType_XBoxOneController }, // Victrix Pro FS Xbox One Edition diff --git a/src/joystick/hidapi/SDL_hidapijoystick.c b/src/joystick/hidapi/SDL_hidapijoystick.c index 1ee95a6f90f46..22c7e77e0647f 100644 --- a/src/joystick/hidapi/SDL_hidapijoystick.c +++ b/src/joystick/hidapi/SDL_hidapijoystick.c @@ -557,6 +557,7 @@ HIDAPI_XboxControllerName(Uint16 vendor_id, Uint16 product_id) { MAKE_VIDPID(0x24c6, 0x5b03), "Thrustmaster Ferrari 458 Racing Wheel" }, { MAKE_VIDPID(0x24c6, 0x5d04), "Razer Sabertooth" }, { MAKE_VIDPID(0x24c6, 0xfafe), "Rock Candy Gamepad for Xbox 360" }, + { MAKE_VIDPID(0x2e24, 0x1688), "Hyperkin X91" }, }; int i; Uint32 vidpid = MAKE_VIDPID(vendor_id, product_id);