From 8c0293b76b30550cd4bb5cda99e4eb1eabe9380b Mon Sep 17 00:00:00 2001 From: Alberto Mardegan Date: Mon, 29 Jan 2024 00:20:05 +0300 Subject: [PATCH] ogc: Do't use 0x0000 as a product ID for the joysticks With the previous logic, the first GameCube controller was given the product ID 0x0000, which might be used as a special value in some applications. With this change the first GameCube controller is given the product ID 0x0100. --- src/joystick/ogc/SDL_sysjoystick.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/joystick/ogc/SDL_sysjoystick.c b/src/joystick/ogc/SDL_sysjoystick.c index b767e88b556a8..fc7ea71c1c73d 100644 --- a/src/joystick/ogc/SDL_sysjoystick.c +++ b/src/joystick/ogc/SDL_sysjoystick.c @@ -496,7 +496,7 @@ static SDL_JoystickGUID OGC_JoystickGetDeviceGUID(int device_index) * Since we want the gamepads to appear with the numeric ID in their * name, we make them unique by assigning a different product depending on * the port. */ - product = index << 8; + product = (index + 1) << 8; if (index >= GC_JOYSTICKS_START && index < GC_JOYSTICKS_END) { bus = SDL_HARDWARE_BUS_UNKNOWN; } else {