From de7e5bebf3f6d07af5f3e9dae2ebb12179f42cad Mon Sep 17 00:00:00 2001 From: Daryl Borth Date: Sun, 1 Mar 2020 10:06:08 -0700 Subject: [PATCH] fix wii u pro controller button mapping not being used in one case --- source/input.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/source/input.cpp b/source/input.cpp index 9a439dd..0462877 100644 --- a/source/input.cpp +++ b/source/input.cpp @@ -906,15 +906,22 @@ static u32 DecodeJoy(unsigned short pad) } else if(wpad_exp_type == WPAD_EXP_CLASSIC) { // classic controller - - for (u32 i =0; i < MAXJP; ++i) - { - if ((pad_btns_h & btnmap[CTRLR_GCPAD][i]) // gamecube controller - || ( wiidrcp_btns_h & btnmap[CTRLR_WIIDRC][i] ) //wiiu gamepad - || ( (wpad_btns_h & btnmap[CTRLR_CLASSIC][i]) )) - J |= vbapadmap[i]; + if (wp->exp.classic.type == 2) { + for (u32 i = 0; i < MAXJP; ++i) + { + if (wpad_btns_h & btnmap[CTRLR_WUPC][i] ) + J |= vbapadmap[i]; + } + } + else { + for (u32 i = 0; i < MAXJP; ++i) + { + if ((pad_btns_h & btnmap[CTRLR_GCPAD][i]) // gamecube controller + || ( wiidrcp_btns_h & btnmap[CTRLR_WIIDRC][i] ) //wiiu gamepad + || ( (wpad_btns_h & btnmap[CTRLR_CLASSIC][i]) )) + J |= vbapadmap[i]; + } } - } else if(wpad_exp_type == WPAD_EXP_NUNCHUK) { // nunchuk + wiimote