Use a unified name list for Xbox 360 and Xbox One controllers for drivers that can handle both
authorSam Lantinga <slouken@libsdl.org>
Wed, 15 Aug 2018 23:14:43 -0700
changeset 121178cbdc9b8b055
parent 12116 b65fb56dcf88
child 12118 2b80f9635ee5
Use a unified name list for Xbox 360 and Xbox One controllers for drivers that can handle both
src/joystick/hidapi/SDL_hidapi_xbox360.c
src/joystick/hidapi/SDL_hidapi_xboxone.c
src/joystick/hidapi/SDL_hidapijoystick.c
src/joystick/hidapi/SDL_hidapijoystick_c.h
     1.1 --- a/src/joystick/hidapi/SDL_hidapi_xbox360.c	Wed Aug 15 19:53:36 2018 -0700
     1.2 +++ b/src/joystick/hidapi/SDL_hidapi_xbox360.c	Wed Aug 15 23:14:43 2018 -0700
     1.3 @@ -36,132 +36,6 @@
     1.4  
     1.5  #define USB_PACKET_LENGTH   64
     1.6  
     1.7 -typedef struct
     1.8 -{
     1.9 -    Uint16 vendor_id;
    1.10 -    Uint16 product_id;
    1.11 -    const char *name;
    1.12 -} SDL_DriverXbox360_DeviceName;
    1.13 -
    1.14 -static const SDL_DriverXbox360_DeviceName xbox360_devicenames[] = {
    1.15 -    { 0x0079, 0x18d4, "GPD Win 2 X-Box Controller" },
    1.16 -    { 0x044f, 0xb326, "Thrustmaster Gamepad GP XID" },
    1.17 -    { 0x045e, 0x028e, "Microsoft X-Box 360 pad" },
    1.18 -    { 0x045e, 0x028f, "Microsoft X-Box 360 pad v2" },
    1.19 -    { 0x045e, 0x0291, "Xbox 360 Wireless Receiver (XBOX)" },
    1.20 -    { 0x045e, 0x0719, "Xbox 360 Wireless Receiver" },
    1.21 -    { 0x046d, 0xc21d, "Logitech Gamepad F310" },
    1.22 -    { 0x046d, 0xc21e, "Logitech Gamepad F510" },
    1.23 -    { 0x046d, 0xc21f, "Logitech Gamepad F710" },
    1.24 -    { 0x046d, 0xc242, "Logitech Chillstream Controller" },
    1.25 -    { 0x046d, 0xcaa3, "Logitech DriveFx Racing Wheel" },
    1.26 -    { 0x056e, 0x2004, "Elecom JC-U3613M" },
    1.27 -    { 0x06a3, 0xf51a, "Saitek P3600" },
    1.28 -    { 0x0738, 0x4716, "Mad Catz Wired Xbox 360 Controller" },
    1.29 -    { 0x0738, 0x4718, "Mad Catz Street Fighter IV FightStick SE" },
    1.30 -    { 0x0738, 0x4726, "Mad Catz Xbox 360 Controller" },
    1.31 -    { 0x0738, 0x4728, "Mad Catz Street Fighter IV FightPad" },
    1.32 -    { 0x0738, 0x4736, "Mad Catz MicroCon Gamepad" },
    1.33 -    { 0x0738, 0x4738, "Mad Catz Wired Xbox 360 Controller (SFIV)" },
    1.34 -    { 0x0738, 0x4740, "Mad Catz Beat Pad" },
    1.35 -    { 0x0738, 0x4758, "Mad Catz Arcade Game Stick" },
    1.36 -    { 0x0738, 0x9871, "Mad Catz Portable Drum" },
    1.37 -    { 0x0738, 0xb726, "Mad Catz Xbox controller - MW2" },
    1.38 -    { 0x0738, 0xb738, "Mad Catz MVC2TE Stick 2" },
    1.39 -    { 0x0738, 0xbeef, "Mad Catz JOYTECH NEO SE Advanced GamePad" },
    1.40 -    { 0x0738, 0xcb02, "Saitek Cyborg Rumble Pad - PC/Xbox 360" },
    1.41 -    { 0x0738, 0xcb03, "Saitek P3200 Rumble Pad - PC/Xbox 360" },
    1.42 -    { 0x0738, 0xcb29, "Saitek Aviator Stick AV8R02" },
    1.43 -    { 0x0738, 0xf738, "Super SFIV FightStick TE S" },
    1.44 -    { 0x07ff, 0xffff, "Mad Catz GamePad" },
    1.45 -    { 0x0e6f, 0x0105, "HSM3 Xbox360 dancepad" },
    1.46 -    { 0x0e6f, 0x0113, "Afterglow AX.1 Gamepad for Xbox 360" },
    1.47 -    { 0x0e6f, 0x011f, "Rock Candy Gamepad Wired Controller" },
    1.48 -    { 0x0e6f, 0x0131, "PDP EA Sports Controller" },
    1.49 -    { 0x0e6f, 0x0133, "Xbox 360 Wired Controller" },
    1.50 -    { 0x0e6f, 0x0201, "Pelican PL-3601 'TSZ' Wired Xbox 360 Controller" },
    1.51 -    { 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360" },
    1.52 -    { 0x0e6f, 0x021f, "Rock Candy Gamepad for Xbox 360" },
    1.53 -    { 0x0e6f, 0x0301, "Logic3 Controller" },
    1.54 -    { 0x0e6f, 0x0401, "Logic3 Controller" },
    1.55 -    { 0x0e6f, 0x0413, "Afterglow AX.1 Gamepad for Xbox 360" },
    1.56 -    { 0x0e6f, 0x0501, "PDP Xbox 360 Controller" },
    1.57 -    { 0x0e6f, 0xf900, "PDP Afterglow AX.1" },
    1.58 -    { 0x0f0d, 0x000a, "Hori Co. DOA4 FightStick" },
    1.59 -    { 0x0f0d, 0x000c, "Hori PadEX Turbo" },
    1.60 -    { 0x0f0d, 0x000d, "Hori Fighting Stick EX2" },
    1.61 -    { 0x0f0d, 0x0016, "Hori Real Arcade Pro.EX" },
    1.62 -    { 0x0f0d, 0x001b, "Hori Real Arcade Pro VX" },
    1.63 -    { 0x11c9, 0x55f0, "Nacon GC-100XF" },
    1.64 -    { 0x12ab, 0x0004, "Honey Bee Xbox360 dancepad" },
    1.65 -    { 0x12ab, 0x0301, "PDP AFTERGLOW AX.1" },
    1.66 -    { 0x12ab, 0x0303, "Mortal Kombat Klassic FightStick" },
    1.67 -    { 0x1430, 0x4748, "RedOctane Guitar Hero X-plorer" },
    1.68 -    { 0x1430, 0xf801, "RedOctane Controller" },
    1.69 -    { 0x146b, 0x0601, "BigBen Interactive XBOX 360 Controller" },
    1.70 -    { 0x1532, 0x0037, "Razer Sabertooth" },
    1.71 -    { 0x15e4, 0x3f00, "Power A Mini Pro Elite" },
    1.72 -    { 0x15e4, 0x3f0a, "Xbox Airflo wired controller" },
    1.73 -    { 0x15e4, 0x3f10, "Batarang Xbox 360 controller" },
    1.74 -    { 0x162e, 0xbeef, "Joytech Neo-Se Take2" },
    1.75 -    { 0x1689, 0xfd00, "Razer Onza Tournament Edition" },
    1.76 -    { 0x1689, 0xfd01, "Razer Onza Classic Edition" },
    1.77 -    { 0x1689, 0xfe00, "Razer Sabertooth" },
    1.78 -    { 0x1bad, 0x0002, "Harmonix Rock Band Guitar" },
    1.79 -    { 0x1bad, 0x0003, "Harmonix Rock Band Drumkit" },
    1.80 -    { 0x1bad, 0x0130, "Ion Drum Rocker" },
    1.81 -    { 0x1bad, 0xf016, "Mad Catz Xbox 360 Controller" },
    1.82 -    { 0x1bad, 0xf018, "Mad Catz Street Fighter IV SE Fighting Stick" },
    1.83 -    { 0x1bad, 0xf019, "Mad Catz Brawlstick for Xbox 360" },
    1.84 -    { 0x1bad, 0xf021, "Mad Cats Ghost Recon FS GamePad" },
    1.85 -    { 0x1bad, 0xf023, "MLG Pro Circuit Controller (Xbox)" },
    1.86 -    { 0x1bad, 0xf025, "Mad Catz Call Of Duty" },
    1.87 -    { 0x1bad, 0xf027, "Mad Catz FPS Pro" },
    1.88 -    { 0x1bad, 0xf028, "Street Fighter IV FightPad" },
    1.89 -    { 0x1bad, 0xf02e, "Mad Catz Fightpad" },
    1.90 -    { 0x1bad, 0xf030, "Mad Catz Xbox 360 MC2 MicroCon Racing Wheel" },
    1.91 -    { 0x1bad, 0xf036, "Mad Catz MicroCon GamePad Pro" },
    1.92 -    { 0x1bad, 0xf038, "Street Fighter IV FightStick TE" },
    1.93 -    { 0x1bad, 0xf039, "Mad Catz MvC2 TE" },
    1.94 -    { 0x1bad, 0xf03a, "Mad Catz SFxT Fightstick Pro" },
    1.95 -    { 0x1bad, 0xf03d, "Street Fighter IV Arcade Stick TE - Chun Li" },
    1.96 -    { 0x1bad, 0xf03e, "Mad Catz MLG FightStick TE" },
    1.97 -    { 0x1bad, 0xf03f, "Mad Catz FightStick SoulCaliber" },
    1.98 -    { 0x1bad, 0xf042, "Mad Catz FightStick TES+" },
    1.99 -    { 0x1bad, 0xf080, "Mad Catz FightStick TE2" },
   1.100 -    { 0x1bad, 0xf501, "HoriPad EX2 Turbo" },
   1.101 -    { 0x1bad, 0xf502, "Hori Real Arcade Pro.VX SA" },
   1.102 -    { 0x1bad, 0xf503, "Hori Fighting Stick VX" },
   1.103 -    { 0x1bad, 0xf504, "Hori Real Arcade Pro. EX" },
   1.104 -    { 0x1bad, 0xf505, "Hori Fighting Stick EX2B" },
   1.105 -    { 0x1bad, 0xf506, "Hori Real Arcade Pro.EX Premium VLX" },
   1.106 -    { 0x1bad, 0xf900, "Harmonix Xbox 360 Controller" },
   1.107 -    { 0x1bad, 0xf901, "Gamestop Xbox 360 Controller" },
   1.108 -    { 0x1bad, 0xf903, "Tron Xbox 360 controller" },
   1.109 -    { 0x1bad, 0xf904, "PDP Versus Fighting Pad" },
   1.110 -    { 0x1bad, 0xf906, "MortalKombat FightStick" },
   1.111 -    { 0x1bad, 0xfa01, "MadCatz GamePad" },
   1.112 -    { 0x1bad, 0xfd00, "Razer Onza TE" },
   1.113 -    { 0x1bad, 0xfd01, "Razer Onza" },
   1.114 -    { 0x24c6, 0x5000, "Razer Atrox Arcade Stick" },
   1.115 -    { 0x24c6, 0x5300, "PowerA MINI PROEX Controller" },
   1.116 -    { 0x24c6, 0x5303, "Xbox Airflo wired controller" },
   1.117 -    { 0x24c6, 0x530a, "Xbox 360 Pro EX Controller" },
   1.118 -    { 0x24c6, 0x531a, "PowerA Pro Ex" },
   1.119 -    { 0x24c6, 0x5397, "FUS1ON Tournament Controller" },
   1.120 -    { 0x24c6, 0x5500, "Hori XBOX 360 EX 2 with Turbo" },
   1.121 -    { 0x24c6, 0x5501, "Hori Real Arcade Pro VX-SA" },
   1.122 -    { 0x24c6, 0x5502, "Hori Fighting Stick VX Alt" },
   1.123 -    { 0x24c6, 0x5503, "Hori Fighting Edge" },
   1.124 -    { 0x24c6, 0x5506, "Hori SOULCALIBUR V Stick" },
   1.125 -    { 0x24c6, 0x550d, "Hori GEM Xbox controller" },
   1.126 -    { 0x24c6, 0x550e, "Hori Real Arcade Pro V Kai 360" },
   1.127 -    { 0x24c6, 0x5b00, "ThrustMaster Ferrari 458 Racing Wheel" },
   1.128 -    { 0x24c6, 0x5b02, "Thrustmaster, Inc. GPX Controller" },
   1.129 -    { 0x24c6, 0x5b03, "Thrustmaster Ferrari 458 Racing Wheel" },
   1.130 -    { 0x24c6, 0x5d04, "Razer Sabertooth" },
   1.131 -    { 0x24c6, 0xfafe, "Rock Candy Gamepad for Xbox 360" },
   1.132 -};
   1.133  
   1.134  typedef struct {
   1.135      Uint8 last_state[USB_PACKET_LENGTH];
   1.136 @@ -172,7 +46,7 @@
   1.137  static SDL_bool
   1.138  HIDAPI_DriverXbox360_IsSupportedDevice(Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, Uint16 usage_page, Uint16 usage)
   1.139  {
   1.140 -#ifdef __MACOSX__
   1.141 +#if defined(__MACOSX__) || defined(__WIN32__)
   1.142  	if (vendor_id == 0x045e && product_id == 0x028e && version == 1) {
   1.143  		/* This is the Steam Virtual Gamepad, which isn't supported by this driver */
   1.144  		return SDL_FALSE;
   1.145 @@ -186,15 +60,7 @@
   1.146  static const char *
   1.147  HIDAPI_DriverXbox360_GetDeviceName(Uint16 vendor_id, Uint16 product_id)
   1.148  {
   1.149 -    int i;
   1.150 -
   1.151 -    for (i = 0; i < SDL_arraysize(xbox360_devicenames); ++i) {
   1.152 -        const SDL_DriverXbox360_DeviceName *entry = &xbox360_devicenames[i];
   1.153 -        if (vendor_id == entry->vendor_id && product_id == entry->product_id) {
   1.154 -            return entry->name;
   1.155 -        }
   1.156 -    }
   1.157 -    return NULL;
   1.158 +    return HIDAPI_XboxControllerName(vendor_id, product_id);
   1.159  }
   1.160  
   1.161  static SDL_bool SetSlotLED(hid_device *dev, Uint8 slot)
   1.162 @@ -261,13 +127,13 @@
   1.163      return 0;
   1.164  }
   1.165  
   1.166 -#if 0
   1.167 +#ifdef __WIN32__
   1.168   /* This is the packet format for Xbox 360 and Xbox One controllers on Windows,
   1.169      however with this interface there is no rumble support, no guide button,
   1.170      and the left and right triggers are tied together as a single axis.
   1.171    */
   1.172  static void
   1.173 -HIDAPI_DriverXboxOne_HandleStatePacket(SDL_Joystick *joystick, hid_device *dev, SDL_DriverXbox360_Context *ctx, Uint8 *data, int size )
   1.174 +HIDAPI_DriverXbox360_HandleStatePacket(SDL_Joystick *joystick, hid_device *dev, SDL_DriverXbox360_Context *ctx, Uint8 *data, int size)
   1.175  {
   1.176      Sint16 axis;
   1.177  
   1.178 @@ -352,7 +218,7 @@
   1.179  
   1.180      SDL_memcpy(ctx->last_state, data, SDL_min(size, sizeof(ctx->last_state)));
   1.181  }
   1.182 -#endif /* 0 */
   1.183 +#else
   1.184  
   1.185  static void
   1.186  HIDAPI_DriverXbox360_HandleStatePacket(SDL_Joystick *joystick, hid_device *dev, SDL_DriverXbox360_Context *ctx, Uint8 *data, int size)
   1.187 @@ -406,6 +272,7 @@
   1.188  
   1.189      SDL_memcpy(ctx->last_state, data, SDL_min(size, sizeof(ctx->last_state)));
   1.190  }
   1.191 +#endif /* __WIN32__ */
   1.192  
   1.193  static SDL_bool
   1.194  HIDAPI_DriverXbox360_Update(SDL_Joystick *joystick, hid_device *dev, void *context)
   1.195 @@ -415,6 +282,9 @@
   1.196      int size;
   1.197  
   1.198      while ((size = hid_read_timeout(dev, data, sizeof(data), 0)) > 0) {
   1.199 +#ifdef __WIN32__
   1.200 +        HIDAPI_DriverXbox360_HandleStatePacket(joystick, dev, ctx, data, size);
   1.201 +#else
   1.202          switch (data[0]) {
   1.203          case 0x00:
   1.204              HIDAPI_DriverXbox360_HandleStatePacket(joystick, dev, ctx, data, size);
   1.205 @@ -425,6 +295,7 @@
   1.206  #endif
   1.207              break;
   1.208          }
   1.209 +#endif /* __WIN32__ */
   1.210      }
   1.211  
   1.212      if (ctx->rumble_expiration) {
     2.1 --- a/src/joystick/hidapi/SDL_hidapi_xboxone.c	Wed Aug 15 19:53:36 2018 -0700
     2.2 +++ b/src/joystick/hidapi/SDL_hidapi_xboxone.c	Wed Aug 15 23:14:43 2018 -0700
     2.3 @@ -36,46 +36,6 @@
     2.4  
     2.5  #define USB_PACKET_LENGTH   64
     2.6  
     2.7 -typedef struct
     2.8 -{
     2.9 -    Uint16 vendor_id;
    2.10 -    Uint16 product_id;
    2.11 -    const char *name;
    2.12 -} SDL_DriverXboxOne_DeviceName;
    2.13 -
    2.14 -static const SDL_DriverXboxOne_DeviceName xboxone_devicenames[] = {
    2.15 -    { 0x045e, 0x02d1, "Microsoft X-Box One pad" },
    2.16 -    { 0x045e, 0x02dd, "Microsoft X-Box One pad (Firmware 2015)" },
    2.17 -    { 0x045e, 0x02e3, "Microsoft X-Box One Elite pad" },
    2.18 -    { 0x045e, 0x02ea, "Microsoft X-Box One S pad" },
    2.19 -    { 0x045e, 0x02ff, "Microsoft X-Box One pad" },
    2.20 -    { 0x0738, 0x4a01, "Mad Catz FightStick TE 2" },
    2.21 -    { 0x0e6f, 0x0139, "Afterglow Prismatic Wired Controller" },
    2.22 -    { 0x0e6f, 0x013a, "PDP Xbox One Controller" },
    2.23 -    { 0x0e6f, 0x0146, "Rock Candy Wired Controller for Xbox One" },
    2.24 -    { 0x0e6f, 0x0147, "PDP Marvel Xbox One Controller" },
    2.25 -    { 0x0e6f, 0x015c, "PDP Xbox One Arcade Stick" },
    2.26 -    { 0x0e6f, 0x0161, "PDP Xbox One Controller" },
    2.27 -    { 0x0e6f, 0x0162, "PDP Xbox One Controller" },
    2.28 -    { 0x0e6f, 0x0163, "PDP Xbox One Controller" },
    2.29 -    { 0x0e6f, 0x0164, "PDP Battlefield One" },
    2.30 -    { 0x0e6f, 0x0165, "PDP Titanfall 2" },
    2.31 -    { 0x0e6f, 0x0246, "Rock Candy Gamepad for Xbox One 2015" },
    2.32 -    { 0x0e6f, 0x02ab, "PDP Controller for Xbox One" },
    2.33 -    { 0x0e6f, 0x02a4, "PDP Wired Controller for Xbox One - Stealth Series" },
    2.34 -    { 0x0e6f, 0x0346, "Rock Candy Gamepad for Xbox One 2016" },
    2.35 -    { 0x0f0d, 0x0063, "Hori Real Arcade Pro Hayabusa (USA) Xbox One" },
    2.36 -    { 0x0f0d, 0x0067, "HORIPAD ONE" },
    2.37 -    { 0x0f0d, 0x0078, "Hori Real Arcade Pro V Kai Xbox One" },
    2.38 -    { 0x1532, 0x0a00, "Razer Atrox Arcade Stick" },
    2.39 -    { 0x1532, 0x0a03, "Razer Wildcat" },
    2.40 -    { 0x24c6, 0x541a, "PowerA Xbox One Mini Wired Controller" },
    2.41 -    { 0x24c6, 0x542a, "Xbox ONE spectra" },
    2.42 -    { 0x24c6, 0x543a, "PowerA Xbox One wired controller" },
    2.43 -    { 0x24c6, 0x551a, "PowerA FUSION Pro Controller" },
    2.44 -    { 0x24c6, 0x561a, "PowerA FUSION Controller" },
    2.45 -};
    2.46 -
    2.47  /*
    2.48   * This packet is required for all Xbox One pads with 2015
    2.49   * or later firmware installed (or present from the factory).
    2.50 @@ -179,15 +139,7 @@
    2.51  static const char *
    2.52  HIDAPI_DriverXboxOne_GetDeviceName(Uint16 vendor_id, Uint16 product_id)
    2.53  {
    2.54 -    int i;
    2.55 -
    2.56 -    for (i = 0; i < SDL_arraysize(xboxone_devicenames); ++i) {
    2.57 -        const SDL_DriverXboxOne_DeviceName *entry = &xboxone_devicenames[i];
    2.58 -        if (vendor_id == entry->vendor_id && product_id == entry->product_id) {
    2.59 -            return entry->name;
    2.60 -        }
    2.61 -    }
    2.62 -    return NULL;
    2.63 +    return HIDAPI_XboxControllerName(vendor_id, product_id);
    2.64  }
    2.65  
    2.66  static SDL_bool
     3.1 --- a/src/joystick/hidapi/SDL_hidapijoystick.c	Wed Aug 15 19:53:36 2018 -0700
     3.2 +++ b/src/joystick/hidapi/SDL_hidapijoystick.c	Wed Aug 15 23:14:43 2018 -0700
     3.3 @@ -378,6 +378,173 @@
     3.4  }
     3.5  
     3.6  
     3.7 +const char *
     3.8 +HIDAPI_XboxControllerName(Uint16 vendor_id, Uint16 product_id)
     3.9 +{
    3.10 +    static struct
    3.11 +    {
    3.12 +        Uint32 vidpid;
    3.13 +        const char *name;
    3.14 +    } names[] = {
    3.15 +        { MAKE_VIDPID(0x0079, 0x18d4), "GPD Win 2 X-Box Controller" },
    3.16 +        { MAKE_VIDPID(0x044f, 0xb326), "Thrustmaster Gamepad GP XID" },
    3.17 +        { MAKE_VIDPID(0x045e, 0x028e), "Microsoft X-Box 360 pad" },
    3.18 +        { MAKE_VIDPID(0x045e, 0x028f), "Microsoft X-Box 360 pad v2" },
    3.19 +        { MAKE_VIDPID(0x045e, 0x0291), "Xbox 360 Wireless Receiver (XBOX)" },
    3.20 +        { MAKE_VIDPID(0x045e, 0x02d1), "Microsoft X-Box One pad" },
    3.21 +        { MAKE_VIDPID(0x045e, 0x02dd), "Microsoft X-Box One pad (Firmware 2015)" },
    3.22 +        { MAKE_VIDPID(0x045e, 0x02e3), "Microsoft X-Box One Elite pad" },
    3.23 +        { MAKE_VIDPID(0x045e, 0x02ea), "Microsoft X-Box One S pad" },
    3.24 +        { MAKE_VIDPID(0x045e, 0x02ff), "Microsoft X-Box One pad" },
    3.25 +        { MAKE_VIDPID(0x045e, 0x0719), "Xbox 360 Wireless Receiver" },
    3.26 +        { MAKE_VIDPID(0x046d, 0xc21d), "Logitech Gamepad F310" },
    3.27 +        { MAKE_VIDPID(0x046d, 0xc21e), "Logitech Gamepad F510" },
    3.28 +        { MAKE_VIDPID(0x046d, 0xc21f), "Logitech Gamepad F710" },
    3.29 +        { MAKE_VIDPID(0x046d, 0xc242), "Logitech Chillstream Controller" },
    3.30 +        { MAKE_VIDPID(0x046d, 0xcaa3), "Logitech DriveFx Racing Wheel" },
    3.31 +        { MAKE_VIDPID(0x056e, 0x2004), "Elecom JC-U3613M" },
    3.32 +        { MAKE_VIDPID(0x06a3, 0xf51a), "Saitek P3600" },
    3.33 +        { MAKE_VIDPID(0x0738, 0x4716), "Mad Catz Wired Xbox 360 Controller" },
    3.34 +        { MAKE_VIDPID(0x0738, 0x4718), "Mad Catz Street Fighter IV FightStick SE" },
    3.35 +        { MAKE_VIDPID(0x0738, 0x4726), "Mad Catz Xbox 360 Controller" },
    3.36 +        { MAKE_VIDPID(0x0738, 0x4728), "Mad Catz Street Fighter IV FightPad" },
    3.37 +        { MAKE_VIDPID(0x0738, 0x4736), "Mad Catz MicroCon Gamepad" },
    3.38 +        { MAKE_VIDPID(0x0738, 0x4738), "Mad Catz Wired Xbox 360 Controller (SFIV)" },
    3.39 +        { MAKE_VIDPID(0x0738, 0x4740), "Mad Catz Beat Pad" },
    3.40 +        { MAKE_VIDPID(0x0738, 0x4758), "Mad Catz Arcade Game Stick" },
    3.41 +        { MAKE_VIDPID(0x0738, 0x4a01), "Mad Catz FightStick TE 2" },
    3.42 +        { MAKE_VIDPID(0x0738, 0x9871), "Mad Catz Portable Drum" },
    3.43 +        { MAKE_VIDPID(0x0738, 0xb726), "Mad Catz Xbox controller - MW2" },
    3.44 +        { MAKE_VIDPID(0x0738, 0xb738), "Mad Catz MVC2TE Stick 2" },
    3.45 +        { MAKE_VIDPID(0x0738, 0xbeef), "Mad Catz JOYTECH NEO SE Advanced GamePad" },
    3.46 +        { MAKE_VIDPID(0x0738, 0xcb02), "Saitek Cyborg Rumble Pad - PC/Xbox 360" },
    3.47 +        { MAKE_VIDPID(0x0738, 0xcb03), "Saitek P3200 Rumble Pad - PC/Xbox 360" },
    3.48 +        { MAKE_VIDPID(0x0738, 0xcb29), "Saitek Aviator Stick AV8R02" },
    3.49 +        { MAKE_VIDPID(0x0738, 0xf738), "Super SFIV FightStick TE S" },
    3.50 +        { MAKE_VIDPID(0x07ff, 0xffff), "Mad Catz GamePad" },
    3.51 +        { MAKE_VIDPID(0x0e6f, 0x0105), "HSM3 Xbox360 dancepad" },
    3.52 +        { MAKE_VIDPID(0x0e6f, 0x0113), "Afterglow AX.1 Gamepad for Xbox 360" },
    3.53 +        { MAKE_VIDPID(0x0e6f, 0x011f), "Rock Candy Gamepad Wired Controller" },
    3.54 +        { MAKE_VIDPID(0x0e6f, 0x0131), "PDP EA Sports Controller" },
    3.55 +        { MAKE_VIDPID(0x0e6f, 0x0133), "Xbox 360 Wired Controller" },
    3.56 +        { MAKE_VIDPID(0x0e6f, 0x0139), "Afterglow Prismatic Wired Controller" },
    3.57 +        { MAKE_VIDPID(0x0e6f, 0x013a), "PDP Xbox One Controller" },
    3.58 +        { MAKE_VIDPID(0x0e6f, 0x0146), "Rock Candy Wired Controller for Xbox One" },
    3.59 +        { MAKE_VIDPID(0x0e6f, 0x0147), "PDP Marvel Xbox One Controller" },
    3.60 +        { MAKE_VIDPID(0x0e6f, 0x015c), "PDP Xbox One Arcade Stick" },
    3.61 +        { MAKE_VIDPID(0x0e6f, 0x0161), "PDP Xbox One Controller" },
    3.62 +        { MAKE_VIDPID(0x0e6f, 0x0162), "PDP Xbox One Controller" },
    3.63 +        { MAKE_VIDPID(0x0e6f, 0x0163), "PDP Xbox One Controller" },
    3.64 +        { MAKE_VIDPID(0x0e6f, 0x0164), "PDP Battlefield One" },
    3.65 +        { MAKE_VIDPID(0x0e6f, 0x0165), "PDP Titanfall 2" },
    3.66 +        { MAKE_VIDPID(0x0e6f, 0x0201), "Pelican PL-3601 'TSZ' Wired Xbox 360 Controller" },
    3.67 +        { MAKE_VIDPID(0x0e6f, 0x0213), "Afterglow Gamepad for Xbox 360" },
    3.68 +        { MAKE_VIDPID(0x0e6f, 0x021f), "Rock Candy Gamepad for Xbox 360" },
    3.69 +        { MAKE_VIDPID(0x0e6f, 0x0246), "Rock Candy Gamepad for Xbox One 2015" },
    3.70 +        { MAKE_VIDPID(0x0e6f, 0x02a4), "PDP Wired Controller for Xbox One - Stealth Series" },
    3.71 +        { MAKE_VIDPID(0x0e6f, 0x02ab), "PDP Controller for Xbox One" },
    3.72 +        { MAKE_VIDPID(0x0e6f, 0x0301), "Logic3 Controller" },
    3.73 +        { MAKE_VIDPID(0x0e6f, 0x0346), "Rock Candy Gamepad for Xbox One 2016" },
    3.74 +        { MAKE_VIDPID(0x0e6f, 0x0401), "Logic3 Controller" },
    3.75 +        { MAKE_VIDPID(0x0e6f, 0x0413), "Afterglow AX.1 Gamepad for Xbox 360" },
    3.76 +        { MAKE_VIDPID(0x0e6f, 0x0501), "PDP Xbox 360 Controller" },
    3.77 +        { MAKE_VIDPID(0x0e6f, 0xf900), "PDP Afterglow AX.1" },
    3.78 +        { MAKE_VIDPID(0x0f0d, 0x000a), "Hori Co. DOA4 FightStick" },
    3.79 +        { MAKE_VIDPID(0x0f0d, 0x000c), "Hori PadEX Turbo" },
    3.80 +        { MAKE_VIDPID(0x0f0d, 0x000d), "Hori Fighting Stick EX2" },
    3.81 +        { MAKE_VIDPID(0x0f0d, 0x0016), "Hori Real Arcade Pro.EX" },
    3.82 +        { MAKE_VIDPID(0x0f0d, 0x001b), "Hori Real Arcade Pro VX" },
    3.83 +        { MAKE_VIDPID(0x0f0d, 0x0063), "Hori Real Arcade Pro Hayabusa (USA) Xbox One" },
    3.84 +        { MAKE_VIDPID(0x0f0d, 0x0067), "HORIPAD ONE" },
    3.85 +        { MAKE_VIDPID(0x0f0d, 0x0078), "Hori Real Arcade Pro V Kai Xbox One" },
    3.86 +        { MAKE_VIDPID(0x11c9, 0x55f0), "Nacon GC-100XF" },
    3.87 +        { MAKE_VIDPID(0x12ab, 0x0004), "Honey Bee Xbox360 dancepad" },
    3.88 +        { MAKE_VIDPID(0x12ab, 0x0301), "PDP AFTERGLOW AX.1" },
    3.89 +        { MAKE_VIDPID(0x12ab, 0x0303), "Mortal Kombat Klassic FightStick" },
    3.90 +        { MAKE_VIDPID(0x1430, 0x4748), "RedOctane Guitar Hero X-plorer" },
    3.91 +        { MAKE_VIDPID(0x1430, 0xf801), "RedOctane Controller" },
    3.92 +        { MAKE_VIDPID(0x146b, 0x0601), "BigBen Interactive XBOX 360 Controller" },
    3.93 +        { MAKE_VIDPID(0x1532, 0x0037), "Razer Sabertooth" },
    3.94 +        { MAKE_VIDPID(0x1532, 0x0a00), "Razer Atrox Arcade Stick" },
    3.95 +        { MAKE_VIDPID(0x1532, 0x0a03), "Razer Wildcat" },
    3.96 +        { MAKE_VIDPID(0x15e4, 0x3f00), "Power A Mini Pro Elite" },
    3.97 +        { MAKE_VIDPID(0x15e4, 0x3f0a), "Xbox Airflo wired controller" },
    3.98 +        { MAKE_VIDPID(0x15e4, 0x3f10), "Batarang Xbox 360 controller" },
    3.99 +        { MAKE_VIDPID(0x162e, 0xbeef), "Joytech Neo-Se Take2" },
   3.100 +        { MAKE_VIDPID(0x1689, 0xfd00), "Razer Onza Tournament Edition" },
   3.101 +        { MAKE_VIDPID(0x1689, 0xfd01), "Razer Onza Classic Edition" },
   3.102 +        { MAKE_VIDPID(0x1689, 0xfe00), "Razer Sabertooth" },
   3.103 +        { MAKE_VIDPID(0x1bad, 0x0002), "Harmonix Rock Band Guitar" },
   3.104 +        { MAKE_VIDPID(0x1bad, 0x0003), "Harmonix Rock Band Drumkit" },
   3.105 +        { MAKE_VIDPID(0x1bad, 0x0130), "Ion Drum Rocker" },
   3.106 +        { MAKE_VIDPID(0x1bad, 0xf016), "Mad Catz Xbox 360 Controller" },
   3.107 +        { MAKE_VIDPID(0x1bad, 0xf018), "Mad Catz Street Fighter IV SE Fighting Stick" },
   3.108 +        { MAKE_VIDPID(0x1bad, 0xf019), "Mad Catz Brawlstick for Xbox 360" },
   3.109 +        { MAKE_VIDPID(0x1bad, 0xf021), "Mad Cats Ghost Recon FS GamePad" },
   3.110 +        { MAKE_VIDPID(0x1bad, 0xf023), "MLG Pro Circuit Controller (Xbox)" },
   3.111 +        { MAKE_VIDPID(0x1bad, 0xf025), "Mad Catz Call Of Duty" },
   3.112 +        { MAKE_VIDPID(0x1bad, 0xf027), "Mad Catz FPS Pro" },
   3.113 +        { MAKE_VIDPID(0x1bad, 0xf028), "Street Fighter IV FightPad" },
   3.114 +        { MAKE_VIDPID(0x1bad, 0xf02e), "Mad Catz Fightpad" },
   3.115 +        { MAKE_VIDPID(0x1bad, 0xf030), "Mad Catz Xbox 360 MC2 MicroCon Racing Wheel" },
   3.116 +        { MAKE_VIDPID(0x1bad, 0xf036), "Mad Catz MicroCon GamePad Pro" },
   3.117 +        { MAKE_VIDPID(0x1bad, 0xf038), "Street Fighter IV FightStick TE" },
   3.118 +        { MAKE_VIDPID(0x1bad, 0xf039), "Mad Catz MvC2 TE" },
   3.119 +        { MAKE_VIDPID(0x1bad, 0xf03a), "Mad Catz SFxT Fightstick Pro" },
   3.120 +        { MAKE_VIDPID(0x1bad, 0xf03d), "Street Fighter IV Arcade Stick TE - Chun Li" },
   3.121 +        { MAKE_VIDPID(0x1bad, 0xf03e), "Mad Catz MLG FightStick TE" },
   3.122 +        { MAKE_VIDPID(0x1bad, 0xf03f), "Mad Catz FightStick SoulCaliber" },
   3.123 +        { MAKE_VIDPID(0x1bad, 0xf042), "Mad Catz FightStick TES+" },
   3.124 +        { MAKE_VIDPID(0x1bad, 0xf080), "Mad Catz FightStick TE2" },
   3.125 +        { MAKE_VIDPID(0x1bad, 0xf501), "HoriPad EX2 Turbo" },
   3.126 +        { MAKE_VIDPID(0x1bad, 0xf502), "Hori Real Arcade Pro.VX SA" },
   3.127 +        { MAKE_VIDPID(0x1bad, 0xf503), "Hori Fighting Stick VX" },
   3.128 +        { MAKE_VIDPID(0x1bad, 0xf504), "Hori Real Arcade Pro. EX" },
   3.129 +        { MAKE_VIDPID(0x1bad, 0xf505), "Hori Fighting Stick EX2B" },
   3.130 +        { MAKE_VIDPID(0x1bad, 0xf506), "Hori Real Arcade Pro.EX Premium VLX" },
   3.131 +        { MAKE_VIDPID(0x1bad, 0xf900), "Harmonix Xbox 360 Controller" },
   3.132 +        { MAKE_VIDPID(0x1bad, 0xf901), "Gamestop Xbox 360 Controller" },
   3.133 +        { MAKE_VIDPID(0x1bad, 0xf903), "Tron Xbox 360 controller" },
   3.134 +        { MAKE_VIDPID(0x1bad, 0xf904), "PDP Versus Fighting Pad" },
   3.135 +        { MAKE_VIDPID(0x1bad, 0xf906), "MortalKombat FightStick" },
   3.136 +        { MAKE_VIDPID(0x1bad, 0xfa01), "MadCatz GamePad" },
   3.137 +        { MAKE_VIDPID(0x1bad, 0xfd00), "Razer Onza TE" },
   3.138 +        { MAKE_VIDPID(0x1bad, 0xfd01), "Razer Onza" },
   3.139 +        { MAKE_VIDPID(0x24c6, 0x5000), "Razer Atrox Arcade Stick" },
   3.140 +        { MAKE_VIDPID(0x24c6, 0x5300), "PowerA MINI PROEX Controller" },
   3.141 +        { MAKE_VIDPID(0x24c6, 0x5303), "Xbox Airflo wired controller" },
   3.142 +        { MAKE_VIDPID(0x24c6, 0x530a), "Xbox 360 Pro EX Controller" },
   3.143 +        { MAKE_VIDPID(0x24c6, 0x531a), "PowerA Pro Ex" },
   3.144 +        { MAKE_VIDPID(0x24c6, 0x5397), "FUS1ON Tournament Controller" },
   3.145 +        { MAKE_VIDPID(0x24c6, 0x541a), "PowerA Xbox One Mini Wired Controller" },
   3.146 +        { MAKE_VIDPID(0x24c6, 0x542a), "Xbox ONE spectra" },
   3.147 +        { MAKE_VIDPID(0x24c6, 0x543a), "PowerA Xbox One wired controller" },
   3.148 +        { MAKE_VIDPID(0x24c6, 0x5500), "Hori XBOX 360 EX 2 with Turbo" },
   3.149 +        { MAKE_VIDPID(0x24c6, 0x5501), "Hori Real Arcade Pro VX-SA" },
   3.150 +        { MAKE_VIDPID(0x24c6, 0x5502), "Hori Fighting Stick VX Alt" },
   3.151 +        { MAKE_VIDPID(0x24c6, 0x5503), "Hori Fighting Edge" },
   3.152 +        { MAKE_VIDPID(0x24c6, 0x5506), "Hori SOULCALIBUR V Stick" },
   3.153 +        { MAKE_VIDPID(0x24c6, 0x550d), "Hori GEM Xbox controller" },
   3.154 +        { MAKE_VIDPID(0x24c6, 0x550e), "Hori Real Arcade Pro V Kai 360" },
   3.155 +        { MAKE_VIDPID(0x24c6, 0x551a), "PowerA FUSION Pro Controller" },
   3.156 +        { MAKE_VIDPID(0x24c6, 0x561a), "PowerA FUSION Controller" },
   3.157 +        { MAKE_VIDPID(0x24c6, 0x5b00), "ThrustMaster Ferrari 458 Racing Wheel" },
   3.158 +        { MAKE_VIDPID(0x24c6, 0x5b02), "Thrustmaster, Inc. GPX Controller" },
   3.159 +        { MAKE_VIDPID(0x24c6, 0x5b03), "Thrustmaster Ferrari 458 Racing Wheel" },
   3.160 +        { MAKE_VIDPID(0x24c6, 0x5d04), "Razer Sabertooth" },
   3.161 +        { MAKE_VIDPID(0x24c6, 0xfafe), "Rock Candy Gamepad for Xbox 360" },
   3.162 +    };
   3.163 +    int i;
   3.164 +    Uint32 vidpid = MAKE_VIDPID(vendor_id, product_id);
   3.165 +
   3.166 +    for (i = 0; i < SDL_arraysize(names); ++i) {
   3.167 +        if (vidpid == names[i].vidpid) {
   3.168 +            return names[i].name;
   3.169 +        }
   3.170 +    }
   3.171 +    return NULL;
   3.172 +}
   3.173 +
   3.174  static SDL_bool
   3.175  HIDAPI_IsDeviceSupported(Uint16 vendor_id, Uint16 product_id, Uint16 version)
   3.176  {
     4.1 --- a/src/joystick/hidapi/SDL_hidapijoystick_c.h	Wed Aug 15 19:53:36 2018 -0700
     4.2 +++ b/src/joystick/hidapi/SDL_hidapijoystick_c.h	Wed Aug 15 23:14:43 2018 -0700
     4.3 @@ -33,7 +33,7 @@
     4.4  
     4.5  #ifdef __WINDOWS__
     4.6  /* On Windows, Xbox controllers are handled by the XInput driver */
     4.7 -#undef SDL_JOYSTICK_HIDAPI_XBOX360
     4.8 +//#undef SDL_JOYSTICK_HIDAPI_XBOX360
     4.9  #undef SDL_JOYSTICK_HIDAPI_XBOXONE
    4.10  #endif
    4.11  
    4.12 @@ -65,6 +65,9 @@
    4.13  /* Return true if a HID device is present and supported as a joystick */
    4.14  extern SDL_bool HIDAPI_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 version);
    4.15  
    4.16 +/* Return the name of an Xbox 360 or Xbox One controller */
    4.17 +extern const char *HIDAPI_XboxControllerName(Uint16 vendor_id, Uint16 product_id);
    4.18 +
    4.19  #endif /* SDL_JOYSTICK_HIDAPI_H */
    4.20  
    4.21  /* vi: set ts=4 sw=4 expandtab: */