From 605a29d7bd45af92d907d0ce869ec95615df1b9f Mon Sep 17 00:00:00 2001 From: ekeeke Date: Sun, 5 Feb 2023 18:08:05 +0100 Subject: [PATCH] [Core/Input] improved XE-1AP controller emulation (verified on real hardware) --- core/input_hw/xe_1ap.c | 10 +++++----- core/input_hw/xe_1ap.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/input_hw/xe_1ap.c b/core/input_hw/xe_1ap.c index 606011e..7cfb4f7 100644 --- a/core/input_hw/xe_1ap.c +++ b/core/input_hw/xe_1ap.c @@ -2,7 +2,7 @@ * Genesis Plus * XE-1AP analog controller support * - * Copyright (C) 2011-2015 Eke-Eke (Genesis Plus GX) + * Copyright (C) 2011-2022 Eke-Eke (Genesis Plus GX) * * Redistribution and use of this code or any derivative works are permitted * provided that the following conditions are met: @@ -96,12 +96,12 @@ INLINE unsigned char xe_1ap_read(int index) case 9: /* CH3 low (Throttle vertical or horizontal direction) */ data = input.analog[port+1][0] & 0x0F; break; - case 10: /* A B A' B' buttons status (active low) */ - data = (~input.pad[port] >> 6) & 0x0F; - break; - default: /* N/A */ + case 10: /* N/A */ data = 0x0F; break; + case 11: /* A B A' B' buttons status (active low) */ + data = (~input.pad[port] >> 6) & 0x0F; + break; } /* TL indicates current data cycle (0=1st cycle, 1=2nd cycle, etc) */ diff --git a/core/input_hw/xe_1ap.h b/core/input_hw/xe_1ap.h index 1a56e04..cf1081d 100644 --- a/core/input_hw/xe_1ap.h +++ b/core/input_hw/xe_1ap.h @@ -2,7 +2,7 @@ * Genesis Plus * XE-1AP analog controller support * - * Copyright (C) 2011-2015 Eke-Eke (Genesis Plus GX) + * Copyright (C) 2011-2022 Eke-Eke (Genesis Plus GX) * * Redistribution and use of this code or any derivative works are permitted * provided that the following conditions are met: