Skip to content

Commit

Permalink
Wii/Wii U: Fix 3 USB controllers. See #7015
Browse files Browse the repository at this point in the history
Fixes commit a4b934b which did not update all array indices.
  • Loading branch information
revvv committed Nov 21, 2023
1 parent 598a0c0 commit 6c8138e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion input/connect/connect_nesusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static int16_t hidpad_nesusb_get_axis(void *data, unsigned axis)
if (!device || axis >= 2)
return 0;

val = device->data[4 + axis];
val = device->data[3 + axis];
val = (val << 8) - 0x8000;

if (abs(val) > 0x1000)
Expand Down
4 changes: 2 additions & 2 deletions input/connect/connect_retrode.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ static int16_t hidpad_retrode_get_axis(void *pad_data, unsigned axis)
return 0;

if (pad->datatype == RETRODE_TYPE_PAD)
val = pad->data[2 + axis];
val = pad->data[1 + axis];
else
val = device->pad_data[0].data[2 + axis];
val = device->pad_data[0].data[1 + axis];

/* map Retrode values to a known gamepad (VID=0x0079, PID=0x0011) */
if (val == 0x9C)
Expand Down
2 changes: 1 addition & 1 deletion input/connect/connect_snesusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static int16_t hidpad_snesusb_get_axis(void *data, unsigned axis)
if (!device || axis >= 2)
return 0;

val = device->data[1 + axis];
val = device->data[axis];
val = (val << 8) - 0x8000;

if (abs(val) > 0x1000)
Expand Down

0 comments on commit 6c8138e

Please sign in to comment.