Wii: Analog support
Jeffrey Pfau jeffrey@endrift.com
Sun, 16 Aug 2015 01:37:15 -0700
1 files changed,
14 insertions(+),
0 deletions(-)
jump to
M
src/platform/wii/main.c
→
src/platform/wii/main.c
@@ -231,6 +231,20 @@ }
if (padkeys & PAD_BUTTON_DOWN) { keys |= 1 << GBA_KEY_DOWN; } + int x = PAD_StickX(0); + int y = PAD_StickY(0); + if (x < -0x40) { + keys |= 1 << GBA_KEY_LEFT; + } + if (x > 0x40) { + keys |= 1 << GBA_KEY_RIGHT; + } + if (y < -0x40) { + keys |= 1 << GBA_KEY_DOWN; + } + if (y > 0x40) { + keys |= 1 << GBA_KEY_UP; + } if (padkeys & PAD_TRIGGER_Z) { break; }