From 2232ee19bdefede245ee7ee9f3743d4546f335b9 Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Mon, 2 Sep 2013 21:21:26 +0200 Subject: [PATCH] Added support for GameStop wired controller Thanks to robertadamsnet --- XBOXUSB.cpp | 4 ++-- XBOXUSB.h | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/XBOXUSB.cpp b/XBOXUSB.cpp index 7279f636..1b195f70 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 && VID != MADCATZ_VID && VID != JOYTECH_VID) // Check VID + if (VID != XBOX_VID && VID != MADCATZ_VID && VID != JOYTECH_VID && VID != GAMESTOP_VID) // Check VID goto FailUnknownDevice; if (PID == XBOX_WIRELESS_PID) { #ifdef DEBUG_USB_HOST @@ -104,7 +104,7 @@ uint8_t XBOXUSB::Init(uint8_t parent, uint8_t port, bool lowspeed) { Notify(PSTR("\r\nThis library only supports Xbox 360 controllers via USB"), 0x80); #endif goto FailUnknownDevice; - } else if (PID != XBOX_WIRED_PID) // Check PID + } else if (PID != XBOX_WIRED_PID && PID != GAMESTOP_WIRED_PID) // Check PID goto FailUnknownDevice; // Allocate new address according to device class diff --git a/XBOXUSB.h b/XBOXUSB.h index 11d4bbad..13f1057f 100644 --- a/XBOXUSB.h +++ b/XBOXUSB.h @@ -42,11 +42,13 @@ #define XBOX_VID 0x045E // Microsoft Corporation #define MADCATZ_VID 0x1BAD // For unofficial Mad Catz controllers #define JOYTECH_VID 0x162E // For unofficial Joytech controllers +#define GAMESTOP_VID 0x0E6F // Gamestop controller #define XBOX_WIRED_PID 0x028E // Microsoft 360 Wired controller #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 GAMESTOP_WIRED_PID 0x0401 // Gamestop wired controller #define XBOX_REPORT_BUFFER_SIZE 14 // Size of the input report buffer @@ -108,7 +110,7 @@ public: * @return Returns true if the device's VID and PID matches this driver. */ virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) { - return ((vid == XBOX_VID || vid == MADCATZ_VID || vid == JOYTECH_VID) && pid == XBOX_WIRED_PID); + return ((vid == XBOX_VID || vid == MADCATZ_VID || vid == JOYTECH_VID || vid == GAMESTOP_VID) && (pid == XBOX_WIRED_PID || pid == GAMESTOP_WIRED_PID)); }; /**@}*/