From 6c8138ea69019464f3e64a1af1591c909f0b8e06 Mon Sep 17 00:00:00 2001 From: revvv <8734113+revvv@users.noreply.github.com> Date: Tue, 21 Nov 2023 15:12:42 +0100 Subject: [PATCH] Wii/Wii U: Fix 3 USB controllers. See #7015 Fixes commit a4b934b which did not update all array indices. --- input/connect/connect_nesusb.c | 2 +- input/connect/connect_retrode.c | 4 ++-- input/connect/connect_snesusb.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/input/connect/connect_nesusb.c b/input/connect/connect_nesusb.c index 3677f00af72..61749797e2b 100644 --- a/input/connect/connect_nesusb.c +++ b/input/connect/connect_nesusb.c @@ -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) diff --git a/input/connect/connect_retrode.c b/input/connect/connect_retrode.c index cd3bb1a62bd..b4322e66d42 100644 --- a/input/connect/connect_retrode.c +++ b/input/connect/connect_retrode.c @@ -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) diff --git a/input/connect/connect_snesusb.c b/input/connect/connect_snesusb.c index 919adfa70ef..5f4231ab54b 100644 --- a/input/connect/connect_snesusb.c +++ b/input/connect/connect_snesusb.c @@ -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)