src/joystick/hidapi/SDL_hidapi_xbox360.c
changeset 12088 399cc39583cc
child 12111 6c1ae9f1effb
equal deleted inserted replaced
12087:cb546477e34f 12088:399cc39583cc
       
     1 /*
       
     2   Simple DirectMedia Layer
       
     3   Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
       
     4 
       
     5   This software is provided 'as-is', without any express or implied
       
     6   warranty.  In no event will the authors be held liable for any damages
       
     7   arising from the use of this software.
       
     8 
       
     9   Permission is granted to anyone to use this software for any purpose,
       
    10   including commercial applications, and to alter it and redistribute it
       
    11   freely, subject to the following restrictions:
       
    12 
       
    13   1. The origin of this software must not be misrepresented; you must not
       
    14      claim that you wrote the original software. If you use this software
       
    15      in a product, an acknowledgment in the product documentation would be
       
    16      appreciated but is not required.
       
    17   2. Altered source versions must be plainly marked as such, and must not be
       
    18      misrepresented as being the original software.
       
    19   3. This notice may not be removed or altered from any source distribution.
       
    20 */
       
    21 #include "../../SDL_internal.h"
       
    22 
       
    23 #ifdef SDL_JOYSTICK_HIDAPI
       
    24 
       
    25 #include "SDL_hints.h"
       
    26 #include "SDL_log.h"
       
    27 #include "SDL_events.h"
       
    28 #include "SDL_timer.h"
       
    29 #include "SDL_joystick.h"
       
    30 #include "SDL_gamecontroller.h"
       
    31 #include "../SDL_sysjoystick.h"
       
    32 #include "SDL_hidapijoystick_c.h"
       
    33 
       
    34 
       
    35 #ifdef SDL_JOYSTICK_HIDAPI_XBOX360
       
    36 
       
    37 #define USB_PACKET_LENGTH   64
       
    38 
       
    39 typedef struct
       
    40 {
       
    41     Uint16 vendor_id;
       
    42     Uint16 product_id;
       
    43     const char *name;
       
    44 } SDL_DriverXbox360_DeviceName;
       
    45 
       
    46 static const SDL_DriverXbox360_DeviceName xbox360_devicenames[] = {
       
    47     { 0x0079, 0x18d4, "GPD Win 2 X-Box Controller" },
       
    48     { 0x044f, 0xb326, "Thrustmaster Gamepad GP XID" },
       
    49     { 0x045e, 0x028e, "Microsoft X-Box 360 pad" },
       
    50     { 0x045e, 0x028f, "Microsoft X-Box 360 pad v2" },
       
    51     { 0x045e, 0x0291, "Xbox 360 Wireless Receiver (XBOX)" },
       
    52     { 0x045e, 0x0719, "Xbox 360 Wireless Receiver" },
       
    53     { 0x046d, 0xc21d, "Logitech Gamepad F310" },
       
    54     { 0x046d, 0xc21e, "Logitech Gamepad F510" },
       
    55     { 0x046d, 0xc21f, "Logitech Gamepad F710" },
       
    56     { 0x046d, 0xc242, "Logitech Chillstream Controller" },
       
    57     { 0x046d, 0xcaa3, "Logitech DriveFx Racing Wheel" },
       
    58     { 0x056e, 0x2004, "Elecom JC-U3613M" },
       
    59     { 0x06a3, 0xf51a, "Saitek P3600" },
       
    60     { 0x0738, 0x4716, "Mad Catz Wired Xbox 360 Controller" },
       
    61     { 0x0738, 0x4718, "Mad Catz Street Fighter IV FightStick SE" },
       
    62     { 0x0738, 0x4726, "Mad Catz Xbox 360 Controller" },
       
    63     { 0x0738, 0x4728, "Mad Catz Street Fighter IV FightPad" },
       
    64     { 0x0738, 0x4736, "Mad Catz MicroCon Gamepad" },
       
    65     { 0x0738, 0x4738, "Mad Catz Wired Xbox 360 Controller (SFIV)" },
       
    66     { 0x0738, 0x4740, "Mad Catz Beat Pad" },
       
    67     { 0x0738, 0x4758, "Mad Catz Arcade Game Stick" },
       
    68     { 0x0738, 0x9871, "Mad Catz Portable Drum" },
       
    69     { 0x0738, 0xb726, "Mad Catz Xbox controller - MW2" },
       
    70     { 0x0738, 0xb738, "Mad Catz MVC2TE Stick 2" },
       
    71     { 0x0738, 0xbeef, "Mad Catz JOYTECH NEO SE Advanced GamePad" },
       
    72     { 0x0738, 0xcb02, "Saitek Cyborg Rumble Pad - PC/Xbox 360" },
       
    73     { 0x0738, 0xcb03, "Saitek P3200 Rumble Pad - PC/Xbox 360" },
       
    74     { 0x0738, 0xcb29, "Saitek Aviator Stick AV8R02" },
       
    75     { 0x0738, 0xf738, "Super SFIV FightStick TE S" },
       
    76     { 0x07ff, 0xffff, "Mad Catz GamePad" },
       
    77     { 0x0e6f, 0x0105, "HSM3 Xbox360 dancepad" },
       
    78     { 0x0e6f, 0x0113, "Afterglow AX.1 Gamepad for Xbox 360" },
       
    79     { 0x0e6f, 0x011f, "Rock Candy Gamepad Wired Controller" },
       
    80     { 0x0e6f, 0x0131, "PDP EA Sports Controller" },
       
    81     { 0x0e6f, 0x0133, "Xbox 360 Wired Controller" },
       
    82     { 0x0e6f, 0x0201, "Pelican PL-3601 'TSZ' Wired Xbox 360 Controller" },
       
    83     { 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360" },
       
    84     { 0x0e6f, 0x021f, "Rock Candy Gamepad for Xbox 360" },
       
    85     { 0x0e6f, 0x0301, "Logic3 Controller" },
       
    86     { 0x0e6f, 0x0401, "Logic3 Controller" },
       
    87     { 0x0e6f, 0x0413, "Afterglow AX.1 Gamepad for Xbox 360" },
       
    88     { 0x0e6f, 0x0501, "PDP Xbox 360 Controller" },
       
    89     { 0x0e6f, 0xf900, "PDP Afterglow AX.1" },
       
    90     { 0x0f0d, 0x000a, "Hori Co. DOA4 FightStick" },
       
    91     { 0x0f0d, 0x000c, "Hori PadEX Turbo" },
       
    92     { 0x0f0d, 0x000d, "Hori Fighting Stick EX2" },
       
    93     { 0x0f0d, 0x0016, "Hori Real Arcade Pro.EX" },
       
    94     { 0x0f0d, 0x001b, "Hori Real Arcade Pro VX" },
       
    95     { 0x11c9, 0x55f0, "Nacon GC-100XF" },
       
    96     { 0x12ab, 0x0004, "Honey Bee Xbox360 dancepad" },
       
    97     { 0x12ab, 0x0301, "PDP AFTERGLOW AX.1" },
       
    98     { 0x12ab, 0x0303, "Mortal Kombat Klassic FightStick" },
       
    99     { 0x1430, 0x4748, "RedOctane Guitar Hero X-plorer" },
       
   100     { 0x1430, 0xf801, "RedOctane Controller" },
       
   101     { 0x146b, 0x0601, "BigBen Interactive XBOX 360 Controller" },
       
   102     { 0x1532, 0x0037, "Razer Sabertooth" },
       
   103     { 0x15e4, 0x3f00, "Power A Mini Pro Elite" },
       
   104     { 0x15e4, 0x3f0a, "Xbox Airflo wired controller" },
       
   105     { 0x15e4, 0x3f10, "Batarang Xbox 360 controller" },
       
   106     { 0x162e, 0xbeef, "Joytech Neo-Se Take2" },
       
   107     { 0x1689, 0xfd00, "Razer Onza Tournament Edition" },
       
   108     { 0x1689, 0xfd01, "Razer Onza Classic Edition" },
       
   109     { 0x1689, 0xfe00, "Razer Sabertooth" },
       
   110     { 0x1bad, 0x0002, "Harmonix Rock Band Guitar" },
       
   111     { 0x1bad, 0x0003, "Harmonix Rock Band Drumkit" },
       
   112     { 0x1bad, 0x0130, "Ion Drum Rocker" },
       
   113     { 0x1bad, 0xf016, "Mad Catz Xbox 360 Controller" },
       
   114     { 0x1bad, 0xf018, "Mad Catz Street Fighter IV SE Fighting Stick" },
       
   115     { 0x1bad, 0xf019, "Mad Catz Brawlstick for Xbox 360" },
       
   116     { 0x1bad, 0xf021, "Mad Cats Ghost Recon FS GamePad" },
       
   117     { 0x1bad, 0xf023, "MLG Pro Circuit Controller (Xbox)" },
       
   118     { 0x1bad, 0xf025, "Mad Catz Call Of Duty" },
       
   119     { 0x1bad, 0xf027, "Mad Catz FPS Pro" },
       
   120     { 0x1bad, 0xf028, "Street Fighter IV FightPad" },
       
   121     { 0x1bad, 0xf02e, "Mad Catz Fightpad" },
       
   122     { 0x1bad, 0xf030, "Mad Catz Xbox 360 MC2 MicroCon Racing Wheel" },
       
   123     { 0x1bad, 0xf036, "Mad Catz MicroCon GamePad Pro" },
       
   124     { 0x1bad, 0xf038, "Street Fighter IV FightStick TE" },
       
   125     { 0x1bad, 0xf039, "Mad Catz MvC2 TE" },
       
   126     { 0x1bad, 0xf03a, "Mad Catz SFxT Fightstick Pro" },
       
   127     { 0x1bad, 0xf03d, "Street Fighter IV Arcade Stick TE - Chun Li" },
       
   128     { 0x1bad, 0xf03e, "Mad Catz MLG FightStick TE" },
       
   129     { 0x1bad, 0xf03f, "Mad Catz FightStick SoulCaliber" },
       
   130     { 0x1bad, 0xf042, "Mad Catz FightStick TES+" },
       
   131     { 0x1bad, 0xf080, "Mad Catz FightStick TE2" },
       
   132     { 0x1bad, 0xf501, "HoriPad EX2 Turbo" },
       
   133     { 0x1bad, 0xf502, "Hori Real Arcade Pro.VX SA" },
       
   134     { 0x1bad, 0xf503, "Hori Fighting Stick VX" },
       
   135     { 0x1bad, 0xf504, "Hori Real Arcade Pro. EX" },
       
   136     { 0x1bad, 0xf505, "Hori Fighting Stick EX2B" },
       
   137     { 0x1bad, 0xf506, "Hori Real Arcade Pro.EX Premium VLX" },
       
   138     { 0x1bad, 0xf900, "Harmonix Xbox 360 Controller" },
       
   139     { 0x1bad, 0xf901, "Gamestop Xbox 360 Controller" },
       
   140     { 0x1bad, 0xf903, "Tron Xbox 360 controller" },
       
   141     { 0x1bad, 0xf904, "PDP Versus Fighting Pad" },
       
   142     { 0x1bad, 0xf906, "MortalKombat FightStick" },
       
   143     { 0x1bad, 0xfa01, "MadCatz GamePad" },
       
   144     { 0x1bad, 0xfd00, "Razer Onza TE" },
       
   145     { 0x1bad, 0xfd01, "Razer Onza" },
       
   146     { 0x24c6, 0x5000, "Razer Atrox Arcade Stick" },
       
   147     { 0x24c6, 0x5300, "PowerA MINI PROEX Controller" },
       
   148     { 0x24c6, 0x5303, "Xbox Airflo wired controller" },
       
   149     { 0x24c6, 0x530a, "Xbox 360 Pro EX Controller" },
       
   150     { 0x24c6, 0x531a, "PowerA Pro Ex" },
       
   151     { 0x24c6, 0x5397, "FUS1ON Tournament Controller" },
       
   152     { 0x24c6, 0x5500, "Hori XBOX 360 EX 2 with Turbo" },
       
   153     { 0x24c6, 0x5501, "Hori Real Arcade Pro VX-SA" },
       
   154     { 0x24c6, 0x5502, "Hori Fighting Stick VX Alt" },
       
   155     { 0x24c6, 0x5503, "Hori Fighting Edge" },
       
   156     { 0x24c6, 0x5506, "Hori SOULCALIBUR V Stick" },
       
   157     { 0x24c6, 0x550d, "Hori GEM Xbox controller" },
       
   158     { 0x24c6, 0x550e, "Hori Real Arcade Pro V Kai 360" },
       
   159     { 0x24c6, 0x5b00, "ThrustMaster Ferrari 458 Racing Wheel" },
       
   160     { 0x24c6, 0x5b02, "Thrustmaster, Inc. GPX Controller" },
       
   161     { 0x24c6, 0x5b03, "Thrustmaster Ferrari 458 Racing Wheel" },
       
   162     { 0x24c6, 0x5d04, "Razer Sabertooth" },
       
   163     { 0x24c6, 0xfafe, "Rock Candy Gamepad for Xbox 360" },
       
   164 };
       
   165 
       
   166 typedef struct {
       
   167     Uint8 last_state[USB_PACKET_LENGTH];
       
   168     Uint32 rumble_expiration;
       
   169 } SDL_DriverXbox360_Context;
       
   170 
       
   171 
       
   172 static SDL_bool
       
   173 HIDAPI_DriverXbox360_IsSupportedDevice(Uint16 vendor_id, Uint16 product_id, int interface_number, Uint16 usage_page, Uint16 usage)
       
   174 {
       
   175 #ifdef __MACOSX__
       
   176     return SDL_IsJoystickXbox360(vendor_id, product_id) || SDL_IsJoystickXboxOne(vendor_id, product_id);
       
   177 #else
       
   178     return SDL_IsJoystickXbox360(vendor_id, product_id);
       
   179 #endif
       
   180 }
       
   181 
       
   182 static const char *
       
   183 HIDAPI_DriverXbox360_GetDeviceName(Uint16 vendor_id, Uint16 product_id)
       
   184 {
       
   185     int i;
       
   186 
       
   187     for (i = 0; i < SDL_arraysize(xbox360_devicenames); ++i) {
       
   188         const SDL_DriverXbox360_DeviceName *entry = &xbox360_devicenames[i];
       
   189         if (vendor_id == entry->vendor_id && product_id == entry->product_id) {
       
   190             return entry->name;
       
   191         }
       
   192     }
       
   193     return NULL;
       
   194 }
       
   195 
       
   196 static SDL_bool SetSlotLED(hid_device *dev, Uint8 slot)
       
   197 {
       
   198     const Uint8 led_packet[] = { 0x01, 0x03, (2 + slot) };
       
   199 
       
   200     if (hid_write(dev, led_packet, sizeof(led_packet)) != sizeof(led_packet)) {
       
   201 		return SDL_FALSE;
       
   202 	}
       
   203 	return SDL_TRUE;
       
   204 }
       
   205 
       
   206 static SDL_bool
       
   207 HIDAPI_DriverXbox360_Init(SDL_Joystick *joystick, hid_device *dev, Uint16 vendor_id, Uint16 product_id, void **context)
       
   208 {
       
   209     SDL_DriverXbox360_Context *ctx;
       
   210 
       
   211     ctx = (SDL_DriverXbox360_Context *)SDL_calloc(1, sizeof(*ctx));
       
   212     if (!ctx) {
       
   213         SDL_OutOfMemory();
       
   214         return SDL_FALSE;
       
   215     }
       
   216     *context = ctx;
       
   217 
       
   218     /* Set the controller LED */
       
   219 	SetSlotLED(dev, (joystick->instance_id % 4));
       
   220 
       
   221     /* Initialize the joystick capabilities */
       
   222     joystick->nbuttons = SDL_CONTROLLER_BUTTON_MAX;
       
   223     joystick->naxes = SDL_CONTROLLER_AXIS_MAX;
       
   224     joystick->epowerlevel = SDL_JOYSTICK_POWER_WIRED;
       
   225 
       
   226     return SDL_TRUE;
       
   227 }
       
   228 
       
   229 static int
       
   230 HIDAPI_DriverXbox360_Rumble(SDL_Joystick *joystick, hid_device *dev, void *context, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms)
       
   231 {
       
   232     SDL_DriverXbox360_Context *ctx = (SDL_DriverXbox360_Context *)context;
       
   233 #ifdef __MACOSX__
       
   234     /* On Mac OS X the 360Controller driver uses this short report,
       
   235        and we need to prefix it with a magic token so hidapi passes it through untouched
       
   236      */
       
   237     Uint8 rumble_packet[] = { 'M', 'A', 'G', 'I', 'C', '0', 0x00, 0x04, 0x00, 0x00 };
       
   238 
       
   239     rumble_packet[6+2] = (low_frequency_rumble >> 8);
       
   240     rumble_packet[6+3] = (high_frequency_rumble >> 8);
       
   241 #else
       
   242     Uint8 rumble_packet[] = { 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
       
   243 
       
   244     rumble_packet[3] = (low_frequency_rumble >> 8);
       
   245     rumble_packet[4] = (high_frequency_rumble >> 8);
       
   246 #endif
       
   247 
       
   248     if (hid_write(dev, rumble_packet, sizeof(rumble_packet)) != sizeof(rumble_packet)) {
       
   249         return SDL_SetError("Couldn't send rumble packet");
       
   250     }
       
   251 
       
   252     if ((low_frequency_rumble || high_frequency_rumble) && duration_ms) {
       
   253         ctx->rumble_expiration = SDL_GetTicks() + duration_ms;
       
   254     } else {
       
   255         ctx->rumble_expiration = 0;
       
   256     }
       
   257     return 0;
       
   258 }
       
   259 
       
   260 static void
       
   261 HIDAPI_DriverXbox360_HandleStatePacket(SDL_Joystick *joystick, hid_device *dev, SDL_DriverXbox360_Context *ctx, Uint8 *data, int size)
       
   262 {
       
   263     Sint16 axis;
       
   264 #ifdef __MACOSX__
       
   265 	const SDL_bool invert_y_axes = SDL_FALSE;
       
   266 #else
       
   267 	const SDL_bool invert_y_axes = SDL_TRUE;
       
   268 #endif
       
   269 
       
   270     if (ctx->last_state[2] != data[2]) {
       
   271         SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_DPAD_UP, (data[2] & 0x01) ? SDL_PRESSED : SDL_RELEASED);
       
   272         SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_DPAD_DOWN, (data[2] & 0x02) ? SDL_PRESSED : SDL_RELEASED);
       
   273         SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_DPAD_LEFT, (data[2] & 0x04) ? SDL_PRESSED : SDL_RELEASED);
       
   274         SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_DPAD_RIGHT, (data[2] & 0x08) ? SDL_PRESSED : SDL_RELEASED);
       
   275         SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_START, (data[2] & 0x10) ? SDL_PRESSED : SDL_RELEASED);
       
   276         SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_BACK, (data[2] & 0x20) ? SDL_PRESSED : SDL_RELEASED);
       
   277         SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_LEFTSTICK, (data[2] & 0x40) ? SDL_PRESSED : SDL_RELEASED);
       
   278         SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_RIGHTSTICK, (data[2] & 0x80) ? SDL_PRESSED : SDL_RELEASED);
       
   279     }
       
   280 
       
   281     if (ctx->last_state[3] != data[3]) {
       
   282         SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_LEFTSHOULDER, (data[3] & 0x01) ? SDL_PRESSED : SDL_RELEASED);
       
   283         SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, (data[3] & 0x02) ? SDL_PRESSED : SDL_RELEASED);
       
   284         SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_GUIDE, (data[3] & 0x04) ? SDL_PRESSED : SDL_RELEASED);
       
   285         SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_A, (data[3] & 0x10) ? SDL_PRESSED : SDL_RELEASED);
       
   286         SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_B, (data[3] & 0x20) ? SDL_PRESSED : SDL_RELEASED);
       
   287         SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_X, (data[3] & 0x40) ? SDL_PRESSED : SDL_RELEASED);
       
   288         SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_Y, (data[3] & 0x80) ? SDL_PRESSED : SDL_RELEASED);
       
   289     }
       
   290 
       
   291     axis = ((int)data[4] * 257) - 32768;
       
   292     SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, axis);
       
   293     axis = ((int)data[5] * 257) - 32768;
       
   294     SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, axis);
       
   295     axis = *(Sint16*)(&data[6]);
       
   296     SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, axis);
       
   297     axis = *(Sint16*)(&data[8]);
       
   298 	if (invert_y_axes) {
       
   299 		axis = ~axis;
       
   300 	}
       
   301     SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTY, axis);
       
   302     axis = *(Sint16*)(&data[10]);
       
   303     SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTX, axis);
       
   304     axis = *(Sint16*)(&data[12]);
       
   305 	if (invert_y_axes) {
       
   306 		axis = ~axis;
       
   307 	}
       
   308     SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, axis);
       
   309 
       
   310     SDL_memcpy(ctx->last_state, data, SDL_min(size, sizeof(ctx->last_state)));
       
   311 }
       
   312 
       
   313 static void
       
   314 HIDAPI_DriverXbox360_Update(SDL_Joystick *joystick, hid_device *dev, void *context)
       
   315 {
       
   316     SDL_DriverXbox360_Context *ctx = (SDL_DriverXbox360_Context *)context;
       
   317     Uint8 data[USB_PACKET_LENGTH];
       
   318     int size;
       
   319 
       
   320     while ((size = hid_read_timeout(dev, data, sizeof(data), 0)) > 0) {
       
   321         switch (data[0]) {
       
   322         case 0x00:
       
   323             HIDAPI_DriverXbox360_HandleStatePacket(joystick, dev, ctx, data, size);
       
   324             break;
       
   325         default:
       
   326 #ifdef DEBUG_JOYSTICK
       
   327             SDL_Log("Unknown Xbox 360 packet: 0x%.2x\n", data[0]);
       
   328 #endif
       
   329             break;
       
   330         }
       
   331     }
       
   332 
       
   333     if (ctx->rumble_expiration) {
       
   334         Uint32 now = SDL_GetTicks();
       
   335         if (SDL_TICKS_PASSED(now, ctx->rumble_expiration)) {
       
   336             HIDAPI_DriverXbox360_Rumble(joystick, dev, context, 0, 0, 0);
       
   337         }
       
   338     }
       
   339 }
       
   340 
       
   341 static void
       
   342 HIDAPI_DriverXbox360_Quit(SDL_Joystick *joystick, hid_device *dev, void *context)
       
   343 {
       
   344     SDL_free(context);
       
   345 }
       
   346 
       
   347 SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverXbox360 =
       
   348 {
       
   349     SDL_HINT_JOYSTICK_HIDAPI_XBOX360,
       
   350     SDL_TRUE,
       
   351     HIDAPI_DriverXbox360_IsSupportedDevice,
       
   352     HIDAPI_DriverXbox360_GetDeviceName,
       
   353     HIDAPI_DriverXbox360_Init,
       
   354     HIDAPI_DriverXbox360_Rumble,
       
   355     HIDAPI_DriverXbox360_Update,
       
   356     HIDAPI_DriverXbox360_Quit
       
   357 };
       
   358 
       
   359 #endif /* SDL_JOYSTICK_HIDAPI_XBOX360 */
       
   360 
       
   361 #endif /* SDL_JOYSTICK_HIDAPI */
       
   362 
       
   363 /* vi: set ts=4 sw=4 expandtab: */