From 23be1855b5f5493e2bcfd6df99598e3a1aaeb02d Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Sat, 13 Mar 2010 08:14:04 +0000 Subject: [PATCH] Fix mapping of multiple joystick buttons to the same C64 key/button. Removed some dead code as well. --- Src/C64.h | 1 - Src/Display.cpp | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Src/C64.h b/Src/C64.h index 6c32ca8..2368e8b 100644 --- a/Src/C64.h +++ b/Src/C64.h @@ -173,7 +173,6 @@ private: int joy_minx[2], joy_maxx[2], joy_miny[2], joy_maxy[2]; // For dynamic joystick calibration uint8 joykey; // Joystick keyboard emulation mask value - bool joy_button_pressed[MAX_JOYSTICK_BUTTONS]; uint8 orig_kernal_1d84, // Original contents of kernal locations $1d84 and $1d85 orig_kernal_1d85; // (for undoing the Fast Reset patch) diff --git a/Src/Display.cpp b/Src/Display.cpp index aed18e6..ee35385 100644 --- a/Src/Display.cpp +++ b/Src/Display.cpp @@ -895,7 +895,6 @@ uint8 C64::poll_joystick_buttons(int port, uint8 *table, bool *has_event) int kc = ThePrefs.JoystickButtons[i]; event_t ev = (event_t)ThePrefs.MenuJoystickButtons[i]; - this->joy_button_pressed[i] = cur; if (cur && ev != EVENT_NONE) { Gui::gui->pushJoystickEvent(ev); @@ -904,7 +903,8 @@ uint8 C64::poll_joystick_buttons(int port, uint8 *table, bool *has_event) if (kc == JOY_NONE) continue; - table[kc] = cur ? 2 : 1; + if (table[kc] == 0) + table[kc] = cur ? 2 : 1; } return out;