diff --git a/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java b/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java index 30e9416a43..2a60fb46d9 100644 --- a/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java +++ b/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java @@ -252,6 +252,7 @@ public class HIDDeviceManager { 0x24c6, // PowerA 0x2c22, // Qanba 0x2dc8, // 8BitDo + 0x9886, // ASTRO Gaming }; if (usbInterface.getInterfaceClass() == UsbConstants.USB_CLASS_VENDOR_SPEC && diff --git a/src/hidapi/libusb/hid.c b/src/hidapi/libusb/hid.c index b5273fb651..07c6fd390a 100644 --- a/src/hidapi/libusb/hid.c +++ b/src/hidapi/libusb/hid.c @@ -683,6 +683,7 @@ static int is_xbox360(unsigned short vendor_id, const struct libusb_interface_de 0x24c6, /* PowerA */ 0x2c22, /* Qanba */ 0x2dc8, /* 8BitDo */ + 0x9886, /* ASTRO Gaming */ }; if (intf_desc->bInterfaceClass == LIBUSB_CLASS_VENDOR_SPEC && diff --git a/src/joystick/controller_type.c b/src/joystick/controller_type.c index dd2f8f2b8a..caa42c3e6e 100644 --- a/src/joystick/controller_type.c +++ b/src/joystick/controller_type.c @@ -147,6 +147,7 @@ static const ControllerDescription_t arrControllers[] = { { MAKE_CONTROLLER_ID( 0x2c22, 0x2500 ), k_eControllerType_PS4Controller, NULL }, // Qanba Dragon { MAKE_CONTROLLER_ID( 0x2c22, 0x2503 ), k_eControllerType_XInputPS4Controller, NULL }, // Qanba Dragon Arcade Joystick { MAKE_CONTROLLER_ID( 0x7545, 0x0104 ), k_eControllerType_PS4Controller, NULL }, // Armor 3 or Level Up Cobra - At least one variant has gyro + { MAKE_CONTROLLER_ID (0x9886, 0x0024 ), k_eControllerType_XInputPS4Controller, NULL }, // Astro C40 in Xbox 360 mode { MAKE_CONTROLLER_ID( 0x9886, 0x0025 ), k_eControllerType_PS4Controller, NULL }, // Astro C40 // Removing the Giotek because there were a bunch of help tickets from users w/ issues including from non-PS4 controller users. This VID/PID is probably used in different FW's // { MAKE_CONTROLLER_ID( 0x7545, 0x1122 ), k_eControllerType_PS4Controller, NULL }, // Giotek VX4 - trackpad/gyro don't work. Had to not filter on interface info. Light bar is flaky, but works. @@ -467,7 +468,6 @@ static const ControllerDescription_t arrControllers[] = { { MAKE_CONTROLLER_ID( 0x2f24, 0x0050 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller { MAKE_CONTROLLER_ID( 0x2f24, 0x2e ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x9886, 0x24 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller { MAKE_CONTROLLER_ID( 0x2f24, 0x91 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller { MAKE_CONTROLLER_ID( 0x1430, 0x719 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller { MAKE_CONTROLLER_ID( 0xf0d, 0xed ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller diff --git a/src/joystick/hidapi/SDL_hidapi_xbox360.c b/src/joystick/hidapi/SDL_hidapi_xbox360.c index 062f9b67f5..18e41572c1 100644 --- a/src/joystick/hidapi/SDL_hidapi_xbox360.c +++ b/src/joystick/hidapi/SDL_hidapi_xbox360.c @@ -63,6 +63,10 @@ static SDL_bool HIDAPI_DriverXbox360_IsSupportedDevice(SDL_HIDAPI_Device *device { const int XB360W_IFACE_PROTOCOL = 129; /* Wireless */ + if (vendor_id == USB_VENDOR_ASTRO && product_id == USB_PRODUCT_ASTRO_C40_XBOX360) { + /* This is the ASTRO C40 in Xbox 360 mode */ + return SDL_TRUE; + } if (vendor_id == USB_VENDOR_NVIDIA) { /* This is the NVIDIA Shield controller which doesn't talk Xbox controller protocol */ return SDL_FALSE; diff --git a/src/joystick/hidapi/SDL_hidapijoystick.c b/src/joystick/hidapi/SDL_hidapijoystick.c index 110590281a..a0fff20a46 100644 --- a/src/joystick/hidapi/SDL_hidapijoystick.c +++ b/src/joystick/hidapi/SDL_hidapijoystick.c @@ -242,6 +242,7 @@ static SDL_GamepadType SDL_GetJoystickGameControllerProtocol(const char *name, U 0x24c6, /* PowerA */ 0x2c22, /* Qanba */ 0x2dc8, /* 8BitDo */ + 0x9886, /* ASTRO Gaming */ }; int i; diff --git a/src/joystick/usb_ids.h b/src/joystick/usb_ids.h index 8336ff0ce1..07702e5f2c 100644 --- a/src/joystick/usb_ids.h +++ b/src/joystick/usb_ids.h @@ -27,6 +27,7 @@ #define USB_VENDOR_8BITDO 0x2dc8 #define USB_VENDOR_AMAZON 0x1949 #define USB_VENDOR_APPLE 0x05ac +#define USB_VENDOR_ASTRO 0x9886 #define USB_VENDOR_BACKBONE 0x358a #define USB_VENDOR_DRAGONRISE 0x0079 #define USB_VENDOR_GOOGLE 0x18d1 @@ -53,6 +54,7 @@ #define USB_PRODUCT_8BITDO_XBOX_CONTROLLER 0x2002 #define USB_PRODUCT_AMAZON_LUNA_CONTROLLER 0x0419 +#define USB_PRODUCT_ASTRO_C40_XBOX360 0x0024 #define USB_PRODUCT_BACKBONE_ONE_IOS 0x0103 #define USB_PRODUCT_BACKBONE_ONE_IOS_PS5 0x0104 #define USB_PRODUCT_GOOGLE_STADIA_CONTROLLER 0x9400