From 7619e3691073495c9fedfe386f7231c1982fbfb6 Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Mon, 25 Jan 2010 16:31:20 +0000 Subject: [PATCH] Implement joystick swapping --- Src/C64_SDL.h | 11 +++-------- Src/gui/options_menu.cpp | 3 ++- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Src/C64_SDL.h b/Src/C64_SDL.h index 1c18ef8..e841ee9 100644 --- a/Src/C64_SDL.h +++ b/Src/C64_SDL.h @@ -261,10 +261,6 @@ void C64::VBlank(bool draw_frame) uint32_t now; uint8 j1, j2; -#if defined(GEKKO) - WPAD_ScanPads(); -#endif - // Poll joysticks j1 = poll_joystick(0); j2 = poll_joystick(1); @@ -276,13 +272,12 @@ void C64::VBlank(bool draw_frame) if (this->fake_key_sequence) this->run_fake_key_sequence(); -#ifndef GEKKO - // Joystick keyboard emulation - if (TheDisplay->NumLock()) + + /* Keyboard joystick input */ + if (ThePrefs.JoystickSwap) j1 &= joykey; else j2 &= joykey; -#endif if (this->network_connection_type == MASTER) { diff --git a/Src/gui/options_menu.cpp b/Src/gui/options_menu.cpp index 32f8ab4..9cdf491 100644 --- a/Src/gui/options_menu.cpp +++ b/Src/gui/options_menu.cpp @@ -56,6 +56,7 @@ public: void updatePrefs() { + Gui::gui->np->JoystickSwap = !this->p_submenus[0].sel; Gui::gui->np->Emul1541Proc = !this->p_submenus[1].sel; Gui::gui->np->ShowLEDs = !this->p_submenus[2].sel; Gui::gui->np->DisplayOption = this->p_submenus[3].sel; @@ -77,7 +78,7 @@ public: { int submenu_defs[5]; - submenu_defs[0] = 0; + submenu_defs[0] = Gui::gui->np->JoystickSwap == true ? 0 : 1; submenu_defs[1] = !Gui::gui->np->Emul1541Proc; submenu_defs[2] = !Gui::gui->np->ShowLEDs; submenu_defs[3] = Gui::gui->np->DisplayOption;