all repos — mgba @ 9565e8830c8b84502a5e484d5d970ca1995b06af

mGBA Game Boy Advance Emulator

Wii: Add analog support for menuing
Jeffrey Pfau jeffrey@endrift.com
Fri, 28 Aug 2015 21:42:39 -0700
commit

9565e8830c8b84502a5e484d5d970ca1995b06af

parent

c0d19a1ad56673bbb98584d58cf5aa9be5de1c8f

1 files changed, 14 insertions(+), 0 deletions(-)

jump to
M src/platform/wii/main.csrc/platform/wii/main.c

@@ -382,6 +382,20 @@ u32 ext = 0;

WPAD_Probe(0, &ext); int keys = 0; + int x = PAD_StickX(0); + int y = PAD_StickY(0); + if (x < -0x40) { + keys |= 1 << GUI_INPUT_LEFT; + } + if (x > 0x40) { + keys |= 1 << GUI_INPUT_RIGHT; + } + if (y < -0x40) { + keys |= 1 << GUI_INPUT_DOWN; + } + if (y > 0x40) { + keys |= 1 << GUI_INPUT_UP; + } if ((padkeys & PAD_BUTTON_A) || (wiiPad & WPAD_BUTTON_2) || ((ext == WPAD_EXP_CLASSIC) && (wiiPad & (WPAD_CLASSIC_BUTTON_A | WPAD_CLASSIC_BUTTON_Y)))) { keys |= 1 << GUI_INPUT_SELECT;