From 905f94b03eed252eb932375629ad7ce5aabf94ad Mon Sep 17 00:00:00 2001 From: Daryl Borth Date: Thu, 16 Aug 2018 09:22:50 -0600 Subject: [PATCH] re-add explicit Wii U Pro controller mappings --- source/button_mapping.c | 24 +++++++++++++++- source/button_mapping.h | 9 +++--- source/filelist.h | 2 ++ source/images/icon_settings_wiiupro.png | Bin 0 -> 10737 bytes source/menu.cpp | 36 +++++++++++++++++++++++- source/pad.cpp | 23 +++++++++++++-- source/pad.h | 2 +- source/preferences.cpp | 2 ++ 8 files changed, 89 insertions(+), 9 deletions(-) create mode 100644 source/images/icon_settings_wiiupro.png diff --git a/source/button_mapping.c b/source/button_mapping.c index e41de22..c84bcda 100644 --- a/source/button_mapping.c +++ b/source/button_mapping.c @@ -26,7 +26,7 @@ * and for displaying the name of said button ***/ -CtrlrMap ctrlr_def[4] = { +CtrlrMap ctrlr_def[5] = { // Gamecube controller btn def { CTRLR_GCPAD, @@ -114,5 +114,27 @@ CtrlrMap ctrlr_def[4] = { {WPAD_CLASSIC_BUTTON_ZL, "ZL"}, {WPAD_CLASSIC_BUTTON_ZR, "ZR"} } +}, +// Wii U pro controller +{ + CTRLR_WUPC, + 15, + { + {WPAD_CLASSIC_BUTTON_DOWN, "DOWN"}, + {WPAD_CLASSIC_BUTTON_UP, "UP"}, + {WPAD_CLASSIC_BUTTON_LEFT, "LEFT"}, + {WPAD_CLASSIC_BUTTON_RIGHT, "RIGHT"}, + {WPAD_CLASSIC_BUTTON_A, "A"}, + {WPAD_CLASSIC_BUTTON_B, "B"}, + {WPAD_CLASSIC_BUTTON_X, "X"}, + {WPAD_CLASSIC_BUTTON_Y, "Y"}, + {WPAD_CLASSIC_BUTTON_PLUS, "PLUS"}, + {WPAD_CLASSIC_BUTTON_MINUS, "MINUS"}, + {WPAD_CLASSIC_BUTTON_HOME, "HOME"}, + {WPAD_CLASSIC_BUTTON_FULL_L, "L"}, + {WPAD_CLASSIC_BUTTON_FULL_R, "R"}, + {WPAD_CLASSIC_BUTTON_ZL, "ZL"}, + {WPAD_CLASSIC_BUTTON_ZR, "ZR"} + } } }; diff --git a/source/button_mapping.h b/source/button_mapping.h index d9d2628..ec19736 100644 --- a/source/button_mapping.h +++ b/source/button_mapping.h @@ -18,11 +18,12 @@ enum { CTRLR_GCPAD, CTRLR_WIIMOTE, CTRLR_NUNCHUK, - CTRLR_CLASSIC + CTRLR_CLASSIC, + CTRLR_WUPC }; -const char ctrlrName[4][20] = -{ "GameCube Controller", "Wiimote", "Nunchuk + Wiimote", "Classic Controller" }; +const char ctrlrName[5][32] = +{ "GameCube Controller", "Wiimote", "Nunchuk + Wiimote", "Classic Controller", "Wii U Pro Controller" }; typedef struct _btn_map { u32 btn; // button 'id' @@ -35,6 +36,6 @@ typedef struct _ctrlr_map { BtnMap map[15]; // controller button map } CtrlrMap; -extern CtrlrMap ctrlr_def[4]; +extern CtrlrMap ctrlr_def[5]; #endif diff --git a/source/filelist.h b/source/filelist.h index bf174de..56056a9 100644 --- a/source/filelist.h +++ b/source/filelist.h @@ -107,6 +107,8 @@ extern const u8 icon_settings_gamecube_png[]; extern const u32 icon_settings_gamecube_png_size; extern const u8 icon_settings_nunchuk_png[]; extern const u32 icon_settings_nunchuk_png_size; +extern const u8 icon_settings_wiiupro_png[]; +extern const u32 icon_settings_wiiupro_png_size; extern const u8 icon_settings_nescontroller_png[]; extern const u32 icon_settings_nescontroller_png_size; diff --git a/source/images/icon_settings_wiiupro.png b/source/images/icon_settings_wiiupro.png new file mode 100644 index 0000000000000000000000000000000000000000..e9fdad86b9aea4a84d04a240d83c0799bb0ee4ba GIT binary patch literal 10737 zcmZ`b zn;QC^r8rpt8$(H)deJw*`*x?g>!eC(%Zsm73GZ9M;d3|JHOaS^qDoqA<^TzTx? zq4I9dUOTZ9{J!+l<^OY6jOWVi_gmGcr(CmPSxf&`yq$PGO@z7|FUFkzDfM74uRiso z9_+vC787kdf3D2za7{|k5Sv*GvV2^50cGc{X^h-xi`3Nfh*wU83Ikv#EGc{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n=EAE9< zeq(y8ZSYs~C9%q*=M~3Pd6i ze|II5xD2KHfr!oQLZ3(3hMDX<{6eIdt3f$`U30FnT5q`nn}5G&_!ksf*cfs|Vxw33 zh^%Ps50$`Fet%tEb`nTg$zn$aMb)X?^`oGl9<%26It)U)?Wn?X1(3j-1ryxX!Er8%Ant5=lSkdD@IU!O0|LsHmpM^=6gMVio^3E#{ UKRf#0RyhI6@)~k=G8SR~0~GUPeEexp.type != WPAD_EXP_CLASSIC) + if(userInput[0].wpad->exp.type != WPAD_EXP_CLASSIC && userInput[0].wpad->exp.classic.type < 2) pressed = 0; // not a valid input else if(pressed <= 0x1000) + pressed = 0; + break; + case CTRLR_WUPC: + if(userInput[0].wpad->exp.type != WPAD_EXP_CLASSIC && userInput[0].wpad->exp.classic.type == 2) pressed = 0; // not a valid input + else if(pressed <= 0x1000) + pressed = 0; break; case CTRLR_NUNCHUK: diff --git a/source/pad.cpp b/source/pad.cpp index d0548ef..3edc7a8 100644 --- a/source/pad.cpp +++ b/source/pad.cpp @@ -39,7 +39,7 @@ static unsigned int myzappers[2][3]; u32 nespadmap[11]; // Original NES controller buttons u32 zapperpadmap[11]; // Original NES Zapper controller buttons -u32 btnmap[2][4][12]; // button mapping +u32 btnmap[2][5][12]; // button mapping void ResetControls(int consoleCtrl, int wiiCtrl) { @@ -111,6 +111,23 @@ void ResetControls(int consoleCtrl, int wiiCtrl) btnmap[CTRL_PAD][CTRLR_CLASSIC][i++] = WPAD_CLASSIC_BUTTON_FULL_L; } + /*** Classic Controller Padmap ***/ + if(consoleCtrl == -1 || (consoleCtrl == CTRL_PAD && wiiCtrl == CTRLR_WUPC)) + { + i=0; + btnmap[CTRL_PAD][CTRLR_WUPC][i++] = WPAD_CLASSIC_BUTTON_Y; + btnmap[CTRL_PAD][CTRLR_WUPC][i++] = WPAD_CLASSIC_BUTTON_B; + btnmap[CTRL_PAD][CTRLR_WUPC][i++] = WPAD_CLASSIC_BUTTON_X; + btnmap[CTRL_PAD][CTRLR_WUPC][i++] = WPAD_CLASSIC_BUTTON_A; + btnmap[CTRL_PAD][CTRLR_WUPC][i++] = WPAD_CLASSIC_BUTTON_MINUS; + btnmap[CTRL_PAD][CTRLR_WUPC][i++] = WPAD_CLASSIC_BUTTON_PLUS; + btnmap[CTRL_PAD][CTRLR_WUPC][i++] = WPAD_CLASSIC_BUTTON_UP; + btnmap[CTRL_PAD][CTRLR_WUPC][i++] = WPAD_CLASSIC_BUTTON_DOWN; + btnmap[CTRL_PAD][CTRLR_WUPC][i++] = WPAD_CLASSIC_BUTTON_LEFT; + btnmap[CTRL_PAD][CTRLR_WUPC][i++] = WPAD_CLASSIC_BUTTON_RIGHT; + btnmap[CTRL_PAD][CTRLR_WUPC][i++] = WPAD_CLASSIC_BUTTON_FULL_L; + } + /*** Nunchuk + wiimote Padmap ***/ if(consoleCtrl == -1 || (consoleCtrl == CTRL_PAD && wiiCtrl == CTRLR_NUNCHUK)) { @@ -366,6 +383,7 @@ static unsigned char DecodeJoy(unsigned short chan) s8 wm_ax = userInput[chan].WPAD_StickX(0); s8 wm_ay = userInput[chan].WPAD_StickY(0); u32 wp = userInput[chan].wpad->btns_h; + bool isWUPC = userInput[chan].wpad->exp.classic.type == 2; u32 exp_type; if ( WPAD_Probe(chan, &exp_type) != 0 ) @@ -468,7 +486,8 @@ static unsigned char DecodeJoy(unsigned short chan) if ( (jp & btnmap[CTRL_PAD][CTRLR_GCPAD][i]) // gamecube controller #ifdef HW_RVL || ( (exp_type == WPAD_EXP_NONE) && (wp & btnmap[CTRL_PAD][CTRLR_WIIMOTE][i]) ) // wiimote - || ( (exp_type == WPAD_EXP_CLASSIC) && (wp & btnmap[CTRL_PAD][CTRLR_CLASSIC][i]) ) // classic controller + || ( (exp_type == WPAD_EXP_CLASSIC && !isWUPC) && (wp & btnmap[CTRL_PAD][CTRLR_CLASSIC][i]) ) // classic controller + || ( (exp_type == WPAD_EXP_CLASSIC && isWUPC) && (wp & btnmap[CTRL_PAD][CTRLR_WUPC][i]) ) // wii u pro controller || ( (exp_type == WPAD_EXP_NUNCHUK) && (wp & btnmap[CTRL_PAD][CTRLR_NUNCHUK][i]) ) // nunchuk + wiimote #endif ) diff --git a/source/pad.h b/source/pad.h index b4f89c2..c92c1a6 100644 --- a/source/pad.h +++ b/source/pad.h @@ -22,7 +22,7 @@ #define RAPID_B 512 extern int rumbleRequest[4]; -extern u32 btnmap[2][4][12]; +extern u32 btnmap[2][5][12]; void SetControllers(); void ResetControls(int cc = -1, int wc = -1); diff --git a/source/preferences.cpp b/source/preferences.cpp index 18c72de..3308f0b 100644 --- a/source/preferences.cpp +++ b/source/preferences.cpp @@ -173,6 +173,7 @@ preparePrefsData () createXMLController(btnmap[CTRL_PAD][CTRLR_GCPAD], "btnmap_pad_gcpad", "NES Pad - GameCube Controller"); createXMLController(btnmap[CTRL_PAD][CTRLR_WIIMOTE], "btnmap_pad_wiimote", "NES Pad - Wiimote"); createXMLController(btnmap[CTRL_PAD][CTRLR_CLASSIC], "btnmap_pad_classic", "NES Pad - Classic Controller"); + createXMLController(btnmap[CTRL_PAD][CTRLR_WUPC], "btnmap_pad_wupc", "NES Pad - Wii U Pro Controller"); createXMLController(btnmap[CTRL_PAD][CTRLR_NUNCHUK], "btnmap_pad_nunchuk", "NES Pad - Nunchuk + Wiimote"); createXMLController(btnmap[CTRL_ZAPPER][CTRLR_GCPAD], "btnmap_zapper_gcpad", "Zapper - GameCube Controller"); createXMLController(btnmap[CTRL_ZAPPER][CTRLR_WIIMOTE], "btnmap_zapper_wiimote", "Zapper - Wiimote"); @@ -340,6 +341,7 @@ decodePrefsData () loadXMLController(btnmap[CTRL_PAD][CTRLR_GCPAD], "btnmap_pad_gcpad"); loadXMLController(btnmap[CTRL_PAD][CTRLR_WIIMOTE], "btnmap_pad_wiimote"); loadXMLController(btnmap[CTRL_PAD][CTRLR_CLASSIC], "btnmap_pad_classic"); + loadXMLController(btnmap[CTRL_PAD][CTRLR_WUPC], "btnmap_pad_wupc"); loadXMLController(btnmap[CTRL_PAD][CTRLR_NUNCHUK], "btnmap_pad_nunchuk"); loadXMLController(btnmap[CTRL_ZAPPER][CTRLR_GCPAD], "btnmap_zapper_gcpad"); loadXMLController(btnmap[CTRL_ZAPPER][CTRLR_WIIMOTE], "btnmap_zapper_wiimote");