Added support for unofficial Mad Catz controllers

This commit is contained in:
Kristian Lauszus 2012-10-03 21:19:52 +02:00
parent d6b628b5a4
commit 80e689a8b8
2 changed files with 5 additions and 3 deletions

View file

@ -92,7 +92,7 @@ uint8_t XBOXUSB::Init(uint8_t parent, uint8_t port, bool lowspeed) {
VID = ((USB_DEVICE_DESCRIPTOR*)buf)->idVendor; VID = ((USB_DEVICE_DESCRIPTOR*)buf)->idVendor;
PID = ((USB_DEVICE_DESCRIPTOR*)buf)->idProduct; PID = ((USB_DEVICE_DESCRIPTOR*)buf)->idProduct;
if(VID != XBOX_VID) // We just check if it's a xbox controller using the Vendor ID if(VID != XBOX_VID && VID != MADCATZ_VID) // We just check if it's a xbox controller using the Vendor ID
goto FailUnknownDevice; goto FailUnknownDevice;
if(PID == XBOX_WIRELESS_PID) { if(PID == XBOX_WIRELESS_PID) {
#ifdef DEBUG #ifdef DEBUG

View file

@ -37,15 +37,17 @@
#define XBOX_INPUT_PIPE 1 #define XBOX_INPUT_PIPE 1
#define XBOX_OUTPUT_PIPE 2 #define XBOX_OUTPUT_PIPE 2
//PID and VID of the different devices // PID and VID of the different devices
#define XBOX_VID 0x045E // Microsoft Corporation #define XBOX_VID 0x045E // Microsoft Corporation
#define XBOX_WIRELESS_PID 0x028F // Wireless controller only support charging #define XBOX_WIRELESS_PID 0x028F // Wireless controller only support charging
#define XBOX_WIRELESS_RECEIVER_PID 0x0719 // Microsoft Wireless Gaming Receiver #define XBOX_WIRELESS_RECEIVER_PID 0x0719 // Microsoft Wireless Gaming Receiver
#define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID 0x0291 // Third party Wireless Gaming Receiver #define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID 0x0291 // Third party Wireless Gaming Receiver
#define MADCATZ_VID 0x1BAD // For unofficial Mad Catz controllers
#define XBOX_REPORT_BUFFER_SIZE 14 // Size of the input report buffer #define XBOX_REPORT_BUFFER_SIZE 14 // Size of the input report buffer
// used in control endpoint header for HID Commands // Used in control endpoint header for HID Commands
#define bmREQ_HID_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE #define bmREQ_HID_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
#define HID_REQUEST_SET_REPORT 0x09 #define HID_REQUEST_SET_REPORT 0x09