Skip to content

Commit

Permalink
ogc: Do't use 0x0000 as a product ID for the joysticks
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mardy committed Jan 28, 2024
1 parent 223d7c5 commit 8c0293b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/joystick/ogc/SDL_sysjoystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8c0293b

Please sign in to comment.