SDL: Added support for the Dragonrise GameCube adapter with VID 0x1843

From fbb6934905ec3ff75c920db619ef199b4175b636 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 10 Nov 2023 16:34:33 -0800
Subject: [PATCH] Added support for the Dragonrise GameCube adapter with VID
 0x1843

---
 src/joystick/SDL_gamepad.c                | 4 +++-
 src/joystick/hidapi/SDL_hidapi_gamecube.c | 4 +++-
 src/joystick/usb_ids.h                    | 3 ++-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/joystick/SDL_gamepad.c b/src/joystick/SDL_gamepad.c
index fabec016f5b1..a365254b3b95 100644
--- a/src/joystick/SDL_gamepad.c
+++ b/src/joystick/SDL_gamepad.c
@@ -701,7 +701,9 @@ static GamepadMapping_t *SDL_CreateMappingForHIDAPIGamepad(SDL_JoystickGUID guid
     SDL_GetJoystickGUIDInfo(guid, &vendor, &product, NULL, NULL);
 
     if ((vendor == USB_VENDOR_NINTENDO && product == USB_PRODUCT_NINTENDO_GAMECUBE_ADAPTER) ||
-        (vendor == USB_VENDOR_DRAGONRISE && product == USB_PRODUCT_EVORETRO_GAMECUBE_ADAPTER)) {
+        (vendor == USB_VENDOR_DRAGONRISE &&
+         (product == USB_PRODUCT_EVORETRO_GAMECUBE_ADAPTER1 ||
+          product == USB_PRODUCT_EVORETRO_GAMECUBE_ADAPTER2))) {
         /* GameCube driver has 12 buttons and 6 axes */
         SDL_strlcat(mapping_string, "a:b0,b:b1,dpdown:b6,dpleft:b4,dpright:b5,dpup:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b9,righttrigger:a5,rightx:a2,righty:a3,start:b8,x:b2,y:b3,", sizeof(mapping_string));
     } else if (vendor == USB_VENDOR_NINTENDO &&
diff --git a/src/joystick/hidapi/SDL_hidapi_gamecube.c b/src/joystick/hidapi/SDL_hidapi_gamecube.c
index 397a77f05749..e52fbf9dc05b 100644
--- a/src/joystick/hidapi/SDL_hidapi_gamecube.c
+++ b/src/joystick/hidapi/SDL_hidapi_gamecube.c
@@ -72,7 +72,9 @@ static SDL_bool HIDAPI_DriverGameCube_IsSupportedDevice(SDL_HIDAPI_Device *devic
         /* Nintendo Co., Ltd.  Wii U GameCube Controller Adapter */
         return SDL_TRUE;
     }
-    if (vendor_id == USB_VENDOR_DRAGONRISE && product_id == USB_PRODUCT_EVORETRO_GAMECUBE_ADAPTER) {
+    if (vendor_id == USB_VENDOR_DRAGONRISE &&
+        (product_id == USB_PRODUCT_EVORETRO_GAMECUBE_ADAPTER1 ||
+         product_id == USB_PRODUCT_EVORETRO_GAMECUBE_ADAPTER2)) {
         /* EVORETRO GameCube Controller Adapter */
         return SDL_TRUE;
     }
diff --git a/src/joystick/usb_ids.h b/src/joystick/usb_ids.h
index 875e98895596..08bd21bca52c 100644
--- a/src/joystick/usb_ids.h
+++ b/src/joystick/usb_ids.h
@@ -63,7 +63,8 @@
 #define USB_PRODUCT_BACKBONE_ONE_IOS_PS5                  0x0104
 #define USB_PRODUCT_GAMESIR_G7                            0x1001
 #define USB_PRODUCT_GOOGLE_STADIA_CONTROLLER              0x9400
-#define USB_PRODUCT_EVORETRO_GAMECUBE_ADAPTER             0x1846
+#define USB_PRODUCT_EVORETRO_GAMECUBE_ADAPTER1            0x1843
+#define USB_PRODUCT_EVORETRO_GAMECUBE_ADAPTER2            0x1846
 #define USB_PRODUCT_HORI_FIGHTING_COMMANDER_OCTA_SERIES_X 0x0150
 #define USB_PRODUCT_HORI_HORIPAD_PRO_SERIES_X             0x014f
 #define USB_PRODUCT_HORI_FIGHTING_STICK_ALPHA_PS4         0x011c