Identified the BDA XB1 Classic Controller
authorSam Lantinga <slouken@libsdl.org>
Fri, 13 Dec 2019 16:12:33 -0800
changeset 13342f778fa778ec8
parent 13341 f4c907df37f5
child 13343 bf120d8c7ff7
Identified the BDA XB1 Classic Controller
src/joystick/controller_type.h
src/joystick/darwin/SDL_sysjoystick.c
     1.1 --- a/src/joystick/controller_type.h	Fri Dec 13 16:07:25 2019 -0800
     1.2 +++ b/src/joystick/controller_type.h	Fri Dec 13 16:12:33 2019 -0800
     1.3 @@ -381,6 +381,7 @@
     1.4  	{ MAKE_CONTROLLER_ID( 0x24c6, 0x543a ), k_eControllerType_XBoxOneController, NULL },	// PowerA Xbox One wired controller
     1.5  	{ MAKE_CONTROLLER_ID( 0x24c6, 0x551a ), k_eControllerType_XBoxOneController, NULL },	// PowerA FUSION Pro Controller
     1.6  	{ MAKE_CONTROLLER_ID( 0x24c6, 0x561a ), k_eControllerType_XBoxOneController, NULL },	// PowerA FUSION Controller
     1.7 +	{ MAKE_CONTROLLER_ID( 0x24c6, 0x581a ), k_eControllerType_XBoxOneController, NULL },	// BDA XB1 Classic Controller
     1.8  	{ MAKE_CONTROLLER_ID( 0x24c6, 0x591a ), k_eControllerType_XBoxOneController, NULL },	// PowerA FUSION Pro Controller
     1.9  	{ MAKE_CONTROLLER_ID( 0x24c6, 0x791a ), k_eControllerType_XBoxOneController, NULL },	// PowerA Fusion Fight Pad
    1.10  	{ MAKE_CONTROLLER_ID( 0x2e24, 0x1688 ), k_eControllerType_XBoxOneController, NULL },	// Hyperkin X91
    1.11 @@ -419,7 +420,6 @@
    1.12  	{ MAKE_CONTROLLER_ID( 0x0079, 0x1874 ), k_eControllerType_XBox360Controller, NULL },	// Unknown Controller
    1.13  
    1.14  	{ MAKE_CONTROLLER_ID( 0x2f24, 0x0050 ), k_eControllerType_XBoxOneController, NULL },	// Unknown Controller
    1.15 -	{ MAKE_CONTROLLER_ID( 0x24c6, 0x581a ), k_eControllerType_XBoxOneController, NULL },	// Unknown Controller
    1.16  	{ MAKE_CONTROLLER_ID( 0x2f24, 0x2e ), k_eControllerType_XBoxOneController, NULL },	// Unknown Controller
    1.17  	{ MAKE_CONTROLLER_ID( 0x9886, 0x24 ), k_eControllerType_XBoxOneController, NULL },	// Unknown Controller
    1.18  	{ MAKE_CONTROLLER_ID( 0x2f24, 0x91 ), k_eControllerType_XBoxOneController, NULL },	// Unknown Controller
     2.1 --- a/src/joystick/darwin/SDL_sysjoystick.c	Fri Dec 13 16:07:25 2019 -0800
     2.2 +++ b/src/joystick/darwin/SDL_sysjoystick.c	Fri Dec 13 16:12:33 2019 -0800
     2.3 @@ -400,6 +400,7 @@
     2.4      Sint32 product = 0;
     2.5      Sint32 version = 0;
     2.6      const char *name;
     2.7 +    const char *manufacturer_remapped;
     2.8      char manufacturer_string[256];
     2.9      char product_string[256];
    2.10      CFTypeRef refCF = NULL;
    2.11 @@ -464,6 +465,12 @@
    2.12                  break;
    2.13              }
    2.14          }
    2.15 +
    2.16 +        manufacturer_remapped = SDL_GetCustomJoystickManufacturer(manufacturer_string);
    2.17 +        if (manufacturer_remapped != manufacturer_string) {
    2.18 +            SDL_strlcpy(manufacturer_string, manufacturer_remapped, sizeof(manufacturer_string));
    2.19 +        }
    2.20 +
    2.21          if (SDL_strncasecmp(manufacturer_string, product_string, SDL_strlen(manufacturer_string)) == 0) {
    2.22              SDL_strlcpy(pDevice->product, product_string, sizeof(pDevice->product));
    2.23          } else {