From 80e689a8b82c9458234facd8386bd146fe4e06f1 Mon Sep 17 00:00:00 2001 From: Kristian Lauszus Date: Wed, 3 Oct 2012 21:19:52 +0200 Subject: [PATCH] Added support for unofficial Mad Catz controllers --- XBOXUSB.cpp | 2 +- XBOXUSB.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/XBOXUSB.cpp b/XBOXUSB.cpp index 76e0b3b3..255f3730 100644 --- a/XBOXUSB.cpp +++ b/XBOXUSB.cpp @@ -92,7 +92,7 @@ uint8_t XBOXUSB::Init(uint8_t parent, uint8_t port, bool lowspeed) { VID = ((USB_DEVICE_DESCRIPTOR*)buf)->idVendor; 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; if(PID == XBOX_WIRELESS_PID) { #ifdef DEBUG diff --git a/XBOXUSB.h b/XBOXUSB.h index 45823311..78d56549 100644 --- a/XBOXUSB.h +++ b/XBOXUSB.h @@ -37,15 +37,17 @@ #define XBOX_INPUT_PIPE 1 #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_WIRELESS_PID 0x028F // Wireless controller only support charging #define XBOX_WIRELESS_RECEIVER_PID 0x0719 // Microsoft 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 -// 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 HID_REQUEST_SET_REPORT 0x09