From 808bda9171c472cfed2e891f80a4ed55c93658a4 Mon Sep 17 00:00:00 2001 From: StapleButter Date: Sun, 2 Dec 2018 15:11:56 +0100 Subject: do not require dpad mappings for joystick axis to work --- src/libui_sdl/main.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index 9ca829e..e9b230b 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -243,16 +243,25 @@ int EmuThreadFunc(void* burp) bool pressed; if (btnid == 0x101) // up - pressed = (hat & SDL_HAT_UP) || (axisY <= -16384); + pressed = (hat & SDL_HAT_UP); else if (btnid == 0x104) // down - pressed = (hat & SDL_HAT_DOWN) || (axisY >= 16384); + pressed = (hat & SDL_HAT_DOWN); else if (btnid == 0x102) // right - pressed = (hat & SDL_HAT_RIGHT) || (axisX >= 16384); + pressed = (hat & SDL_HAT_RIGHT); else if (btnid == 0x108) // left - pressed = (hat & SDL_HAT_LEFT) || (axisX <= -16384); + pressed = (hat & SDL_HAT_LEFT); else pressed = SDL_JoystickGetButton(Joystick, btnid); + if (i == 4) // right + pressed = pressed || (axisX >= 16384); + else if (i == 5) // left + pressed = pressed || (axisX <= -16384); + else if (i == 6) // up + pressed = pressed || (axisY <= -16384); + else if (i == 7) // down + pressed = pressed || (axisY >= 16384); + if (pressed) joymask &= ~(1<Scancode == Config::KeyMapping[i]) KeyInputMask &= ~(1<Scancode == 0x58) // F12 + //if (evt->Scancode == 0x57) // F11 // NDS::debug(0); } -- cgit v1.2.3