From 14660a8c1295aeb8d9feb0e8d2854312879c6332 Mon Sep 17 00:00:00 2001 From: aliaspider Date: Tue, 17 Jan 2017 12:41:55 +0100 Subject: [PATCH] (WiiU) simplify input code, add button labels for autoconfigs. --- input/drivers_joypad/wiiu_joypad.c | 122 ++++------------ input/input_autodetect_builtin.c | 216 ++++++++++++++--------------- 2 files changed, 136 insertions(+), 202 deletions(-) diff --git a/input/drivers_joypad/wiiu_joypad.c b/input/drivers_joypad/wiiu_joypad.c index f941254fab..8610f64108 100644 --- a/input/drivers_joypad/wiiu_joypad.c +++ b/input/drivers_joypad/wiiu_joypad.c @@ -163,51 +163,28 @@ static void wiiu_joypad_poll(void) if (!vpadError) { - pad_state[0] = 0; - pad_state[0] |= (vpad.hold & VPAD_BUTTON_LEFT) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_LEFT) : 0; - pad_state[0] |= (vpad.hold & VPAD_BUTTON_DOWN) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_DOWN) : 0; - pad_state[0] |= (vpad.hold & VPAD_BUTTON_RIGHT) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_RIGHT) : 0; - pad_state[0] |= (vpad.hold & VPAD_BUTTON_UP) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_UP) : 0; - pad_state[0] |= (vpad.hold & VPAD_BUTTON_PLUS) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_START) : 0; - pad_state[0] |= (vpad.hold & VPAD_BUTTON_MINUS) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_SELECT) : 0; - pad_state[0] |= (vpad.hold & VPAD_BUTTON_X) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_X) : 0; - pad_state[0] |= (vpad.hold & VPAD_BUTTON_Y) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_Y) : 0; - pad_state[0] |= (vpad.hold & VPAD_BUTTON_B) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_B) : 0; - pad_state[0] |= (vpad.hold & VPAD_BUTTON_A) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_A) : 0; - pad_state[0] |= (vpad.hold & VPAD_BUTTON_R) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_R) : 0; - pad_state[0] |= (vpad.hold & VPAD_BUTTON_L) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_L) : 0; - pad_state[0] |= (vpad.hold & VPAD_BUTTON_ZR) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_R2) : 0; - pad_state[0] |= (vpad.hold & VPAD_BUTTON_ZL) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_L2) : 0; - pad_state[0] |= (vpad.hold & VPAD_BUTTON_STICK_R) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_R3) : 0; - pad_state[0] |= (vpad.hold & VPAD_BUTTON_STICK_L) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_L3) : 0; - - analog_state[0][RETRO_DEVICE_INDEX_ANALOG_LEFT] [RETRO_DEVICE_ID_ANALOG_X] = vpad.leftStick.x * 0x7FF0; - analog_state[0][RETRO_DEVICE_INDEX_ANALOG_LEFT] [RETRO_DEVICE_ID_ANALOG_Y] = -vpad.leftStick.y * 0x7FF0; - analog_state[0][RETRO_DEVICE_INDEX_ANALOG_RIGHT] [RETRO_DEVICE_ID_ANALOG_X] = vpad.rightStick.x * 0x7FF0; - analog_state[0][RETRO_DEVICE_INDEX_ANALOG_RIGHT] [RETRO_DEVICE_ID_ANALOG_Y] = -vpad.rightStick.y * 0x7FF0; + pad_state[0] = vpad.hold & ~0x7F800000; /* clear out emulated analog sticks */ + analog_state[0][RETRO_DEVICE_INDEX_ANALOG_LEFT] [RETRO_DEVICE_ID_ANALOG_X] = vpad.leftStick.x * 0x7FF0; + analog_state[0][RETRO_DEVICE_INDEX_ANALOG_LEFT] [RETRO_DEVICE_ID_ANALOG_Y] = vpad.leftStick.y * 0x7FF0; + analog_state[0][RETRO_DEVICE_INDEX_ANALOG_RIGHT] [RETRO_DEVICE_ID_ANALOG_X] = vpad.rightStick.x * 0x7FF0; + analog_state[0][RETRO_DEVICE_INDEX_ANALOG_RIGHT] [RETRO_DEVICE_ID_ANALOG_Y] = vpad.rightStick.y * 0x7FF0; BIT64_CLEAR(lifecycle_state, RARCH_MENU_TOGGLE); - if (((vpad.tpNormal.touched) && (vpad.tpNormal.x > 200) && (vpad.tpNormal.validity) == 0) || - (vpad.trigger & VPAD_BUTTON_HOME)) + if ((vpad.tpNormal.touched) && (vpad.tpNormal.x > 200) && (vpad.tpNormal.validity) == 0) BIT64_SET(lifecycle_state, RARCH_MENU_TOGGLE); /* panic button */ - if ((vpad.hold & VPAD_BUTTON_R) && - (vpad.hold & VPAD_BUTTON_L) && - (vpad.hold & VPAD_BUTTON_STICK_R) && - (vpad.hold & VPAD_BUTTON_STICK_L)) + if ((vpad.hold & (VPAD_BUTTON_R | VPAD_BUTTON_L | VPAD_BUTTON_STICK_R | VPAD_BUTTON_STICK_L)) + == (VPAD_BUTTON_R | VPAD_BUTTON_L | VPAD_BUTTON_STICK_R | VPAD_BUTTON_STICK_L)) command_event(CMD_EVENT_QUIT, NULL); } for (c = 0; c < 4; c++) { KPADData kpad; - u32 result; - result = KPADRead(c, &kpad, 1); - - if (!result) + if (!KPADRead(c, &kpad, 1)) continue; if (pad_type[c] != kpad.device_type) @@ -216,77 +193,38 @@ static void wiiu_joypad_poll(void) wiiu_joypad_autodetect_add(c + 1); } - pad_state[c + 1] = 0; - switch (kpad.device_type) { case WIIUINPUT_TYPE_WIIMOTE: - pad_state[c + 1] |= (kpad.btns_h & WPAD_BUTTON_LEFT) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_LEFT) : 0; - pad_state[c + 1] |= (kpad.btns_h & WPAD_BUTTON_DOWN) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_DOWN) : 0; - pad_state[c + 1] |= (kpad.btns_h & WPAD_BUTTON_RIGHT) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_RIGHT) : 0; - pad_state[c + 1] |= (kpad.btns_h & WPAD_BUTTON_UP) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_UP) : 0; - pad_state[c + 1] |= (kpad.btns_h & WPAD_BUTTON_PLUS) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_START) : 0; - pad_state[c + 1] |= (kpad.btns_h & WPAD_BUTTON_MINUS) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_SELECT) : 0; - pad_state[c + 1] |= (kpad.btns_h & WPAD_BUTTON_1) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_X) : 0; - pad_state[c + 1] |= (kpad.btns_h & WPAD_BUTTON_2) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_Y) : 0; - pad_state[c + 1] |= (kpad.btns_h & WPAD_BUTTON_B) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_B) : 0; - pad_state[c + 1] |= (kpad.btns_h & WPAD_BUTTON_A) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_A) : 0; - - analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_LEFT] [RETRO_DEVICE_ID_ANALOG_X] = 0; - analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_LEFT] [RETRO_DEVICE_ID_ANALOG_Y] = 0; - analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_RIGHT] [RETRO_DEVICE_ID_ANALOG_X] = 0; - analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_RIGHT] [RETRO_DEVICE_ID_ANALOG_Y] = 0; + pad_state[c + 1] = kpad.btns_h; + analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_LEFT] [RETRO_DEVICE_ID_ANALOG_X] = 0; + analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_LEFT] [RETRO_DEVICE_ID_ANALOG_Y] = 0; + analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_RIGHT] [RETRO_DEVICE_ID_ANALOG_X] = 0; + analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_RIGHT] [RETRO_DEVICE_ID_ANALOG_Y] = 0; break; case WIIUINPUT_TYPE_NUNCHUK: - pad_state[c + 1] |= (kpad.btns_h & WPAD_BUTTON_LEFT) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_LEFT) : 0; - pad_state[c + 1] |= (kpad.btns_h & WPAD_BUTTON_DOWN) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_DOWN) : 0; - pad_state[c + 1] |= (kpad.btns_h & WPAD_BUTTON_RIGHT) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_RIGHT) : 0; - pad_state[c + 1] |= (kpad.btns_h & WPAD_BUTTON_UP) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_UP) : 0; - pad_state[c + 1] |= (kpad.btns_h & WPAD_BUTTON_PLUS) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_START) : 0; - pad_state[c + 1] |= (kpad.btns_h & WPAD_BUTTON_MINUS) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_SELECT) : 0; - pad_state[c + 1] |= (kpad.btns_h & WPAD_BUTTON_1) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_X) : 0; - pad_state[c + 1] |= (kpad.btns_h & WPAD_BUTTON_2) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_Y) : 0; - pad_state[c + 1] |= (kpad.btns_h & WPAD_BUTTON_B) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_B) : 0; - pad_state[c + 1] |= (kpad.btns_h & WPAD_BUTTON_A) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_A) : 0; - pad_state[c + 1] |= (kpad.btns_h & WPAD_BUTTON_Z) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_R) : 0; - pad_state[c + 1] |= (kpad.btns_h & WPAD_BUTTON_C) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_L) : 0; - - analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_LEFT] [RETRO_DEVICE_ID_ANALOG_X] = kpad.nunchuck.stick_x * 0x7FF0; - analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_LEFT] [RETRO_DEVICE_ID_ANALOG_Y] = -kpad.nunchuck.stick_y * 0x7FF0; - analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_RIGHT] [RETRO_DEVICE_ID_ANALOG_X] = 0; - analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_RIGHT] [RETRO_DEVICE_ID_ANALOG_Y] = 0; + pad_state[c + 1] = kpad.btns_h; + analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_LEFT] [RETRO_DEVICE_ID_ANALOG_X] = kpad.nunchuck.stick_x * 0x7FF0; + analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_LEFT] [RETRO_DEVICE_ID_ANALOG_Y] = kpad.nunchuck.stick_y * 0x7FF0; + analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_RIGHT] [RETRO_DEVICE_ID_ANALOG_X] = 0; + analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_RIGHT] [RETRO_DEVICE_ID_ANALOG_Y] = 0; break; case WIIUINPUT_TYPE_PRO_CONTROLLER: + pad_state[c + 1] = kpad.classic.btns_h & ~0x3FC0000; /* clear out emulated analog sticks */ + analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_LEFT] [RETRO_DEVICE_ID_ANALOG_X] = kpad.classic.lstick_x * 0x7FF0; + analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_LEFT] [RETRO_DEVICE_ID_ANALOG_Y] = kpad.classic.lstick_y * 0x7FF0; + analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_RIGHT] [RETRO_DEVICE_ID_ANALOG_X] = kpad.classic.rstick_x * 0x7FF0; + analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_RIGHT] [RETRO_DEVICE_ID_ANALOG_Y] = kpad.classic.rstick_y * 0x7FF0; + break; - pad_state[c + 1] |= (kpad.classic.btns_h & WPAD_PRO_BUTTON_STICK_R) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_R3) : 0; - pad_state[c + 1] |= (kpad.classic.btns_h & WPAD_PRO_BUTTON_STICK_L) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_L3) : 0; - - /* fallthrough */ case WIIUINPUT_TYPE_CLASSIC_CONTROLLER: - pad_state[c + 1] |= (kpad.classic.btns_h & WPAD_CLASSIC_BUTTON_LEFT) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_LEFT) : 0; - pad_state[c + 1] |= (kpad.classic.btns_h & WPAD_CLASSIC_BUTTON_DOWN) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_DOWN) : 0; - pad_state[c + 1] |= (kpad.classic.btns_h & WPAD_CLASSIC_BUTTON_RIGHT) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_RIGHT) : - 0; - pad_state[c + 1] |= (kpad.classic.btns_h & WPAD_CLASSIC_BUTTON_UP) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_UP) : 0; - pad_state[c + 1] |= (kpad.classic.btns_h & WPAD_CLASSIC_BUTTON_PLUS) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_START) : - 0; - pad_state[c + 1] |= (kpad.classic.btns_h & WPAD_CLASSIC_BUTTON_MINUS) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_SELECT) : - 0; - pad_state[c + 1] |= (kpad.classic.btns_h & WPAD_CLASSIC_BUTTON_X) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_X) : 0; - pad_state[c + 1] |= (kpad.classic.btns_h & WPAD_CLASSIC_BUTTON_Y) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_Y) : 0; - pad_state[c + 1] |= (kpad.classic.btns_h & WPAD_CLASSIC_BUTTON_B) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_B) : 0; - pad_state[c + 1] |= (kpad.classic.btns_h & WPAD_CLASSIC_BUTTON_A) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_A) : 0; - pad_state[c + 1] |= (kpad.classic.btns_h & WPAD_CLASSIC_BUTTON_R) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_R) : 0; - pad_state[c + 1] |= (kpad.classic.btns_h & WPAD_CLASSIC_BUTTON_L) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_L) : 0; - pad_state[c + 1] |= (kpad.classic.btns_h & WPAD_CLASSIC_BUTTON_ZR) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_R2) : 0; - pad_state[c + 1] |= (kpad.classic.btns_h & WPAD_CLASSIC_BUTTON_ZL) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_L2) : 0; - - analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_LEFT] [RETRO_DEVICE_ID_ANALOG_X] = kpad.classic.lstick_x * 0x7FF0; - analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_LEFT] [RETRO_DEVICE_ID_ANALOG_Y] = -kpad.classic.lstick_y * 0x7FF0; - analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_RIGHT] [RETRO_DEVICE_ID_ANALOG_X] = kpad.classic.rstick_x * 0x7FF0; - analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_RIGHT] [RETRO_DEVICE_ID_ANALOG_Y] = -kpad.classic.rstick_y * 0x7FF0; + pad_state[c + 1] = kpad.classic.btns_h & ~0xFF0000; /* clear out emulated analog sticks */ + analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_LEFT] [RETRO_DEVICE_ID_ANALOG_X] = kpad.classic.lstick_x * 0x7FF0; + analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_LEFT] [RETRO_DEVICE_ID_ANALOG_Y] = kpad.classic.lstick_y * 0x7FF0; + analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_RIGHT] [RETRO_DEVICE_ID_ANALOG_X] = kpad.classic.rstick_x * 0x7FF0; + analog_state[c + 1][RETRO_DEVICE_INDEX_ANALOG_RIGHT] [RETRO_DEVICE_ID_ANALOG_Y] = kpad.classic.rstick_y * 0x7FF0; break; } } diff --git a/input/input_autodetect_builtin.c b/input/input_autodetect_builtin.c index 3061277223..8c6c7f3a17 100644 --- a/input/input_autodetect_builtin.c +++ b/input/input_autodetect_builtin.c @@ -27,7 +27,9 @@ #endif #define DECL_BTN(btn, bind) "input_" #btn "_btn = " #bind "\n" +#define DECL_BTN_EX(btn, bind, name) "input_" #btn "_btn = " #bind "\ninput_" #btn "_btn_label = \"" name "\"\n" #define DECL_AXIS(axis, bind) "input_" #axis "_axis = " #bind "\n" +#define DECL_AXIS_EX(axis, bind, name) "input_" #axis "_axis = " #bind "\ninput_" #axis "_axis_label = \"" name "\"\n" #define DECL_MENU(btn) "input_menu_toggle_btn = " #btn "\n" #define DECL_AUTOCONF_DEVICE(device, driver, binds) "input_device = \"" #device "\" \ninput_driver = \"" #driver "\" \n" binds @@ -196,124 +198,118 @@ DECL_AXIS(r_y_minus, +3) #ifdef WIIU #define WIIUINPUT_GAMEPAD_DEFAULT_BINDS \ -DECL_BTN(a, 8) \ -DECL_BTN(b, 0) \ -DECL_BTN(x, 9) \ -DECL_BTN(y, 1) \ -DECL_BTN(start, 3) \ -DECL_BTN(select, 2) \ -DECL_BTN(up, 4) \ -DECL_BTN(down, 5) \ -DECL_BTN(left, 6) \ -DECL_BTN(right, 7) \ -DECL_BTN(l, 10) \ -DECL_BTN(r, 11) \ -DECL_BTN(l2, 12) \ -DECL_BTN(r2, 13) \ -DECL_AXIS(l_x_plus, +0) \ -DECL_AXIS(l_x_minus, -0) \ -DECL_AXIS(l_y_plus, +1) \ -DECL_AXIS(l_y_minus, -1) \ -DECL_AXIS(r_x_plus, +2) \ -DECL_AXIS(r_x_minus, -2) \ -DECL_AXIS(r_y_plus, -3) \ -DECL_AXIS(r_y_minus, +3) +DECL_BTN_EX(menu_toggle, 1, "Home") \ +DECL_BTN_EX(select, 2, "-") \ +DECL_BTN_EX(start, 3, "+") \ +DECL_BTN_EX(r, 4, "R") \ +DECL_BTN_EX(l, 5, "L") \ +DECL_BTN_EX(r2, 6, "ZR") \ +DECL_BTN_EX(l2, 7, "ZL") \ +DECL_BTN_EX(down, 8, "D-Pad Down") \ +DECL_BTN_EX(up, 9, "D-Pad Up") \ +DECL_BTN_EX(right, 10, "D-Pad Right") \ +DECL_BTN_EX(left, 11, "D-Pad Left") \ +DECL_BTN_EX(y, 12, "Y") \ +DECL_BTN_EX(x, 13, "X") \ +DECL_BTN_EX(b, 14, "B") \ +DECL_BTN_EX(a, 15, "A") \ +DECL_BTN_EX(r3, 17, "Right Thumb") \ +DECL_BTN_EX(l3, 18, "Left Thumb") \ +DECL_AXIS_EX(l_x_plus, +0, "L-Stick right") \ +DECL_AXIS_EX(l_x_minus, -0, "L-Stick left") \ +DECL_AXIS_EX(l_y_minus, +1, "L-Stick up") \ +DECL_AXIS_EX(l_y_plus, -1, "L-Stick down") \ +DECL_AXIS_EX(r_x_plus, +2, "R-Stick right") \ +DECL_AXIS_EX(r_x_minus, -2, "R-Stick left") \ +DECL_AXIS_EX(r_y_minus, +3, "R-Stick up") \ +DECL_AXIS_EX(r_y_plus, -3, "R-Stick down") #define WIIUINPUT_PRO_CONTROLLER_DEFAULT_BINDS \ -DECL_BTN(a, 8) \ -DECL_BTN(b, 0) \ -DECL_BTN(x, 9) \ -DECL_BTN(y, 1) \ -DECL_BTN(start, 3) \ -DECL_BTN(select, 2) \ -DECL_BTN(up, 4) \ -DECL_BTN(down, 5) \ -DECL_BTN(left, 6) \ -DECL_BTN(right, 7) \ -DECL_BTN(l, 10) \ -DECL_BTN(r, 11) \ -DECL_BTN(l2, 12) \ -DECL_BTN(r2, 13) \ -DECL_AXIS(l_x_plus, +0) \ -DECL_AXIS(l_x_minus, -0) \ -DECL_AXIS(l_y_plus, +1) \ -DECL_AXIS(l_y_minus, -1) \ -DECL_AXIS(r_x_plus, +2) \ -DECL_AXIS(r_x_minus, -2) \ -DECL_AXIS(r_y_plus, -3) \ -DECL_AXIS(r_y_minus, +3) +DECL_BTN_EX(up, 0, "D-Pad Up") \ +DECL_BTN_EX(left, 1, "D-Pad Left") \ +DECL_BTN_EX(r2, 2, "ZR") \ +DECL_BTN_EX(x, 3, "X") \ +DECL_BTN_EX(a, 4, "A") \ +DECL_BTN_EX(y, 5, "Y") \ +DECL_BTN_EX(b, 6, "B") \ +DECL_BTN_EX(l2, 7, "ZL") \ +DECL_BTN_EX(r, 9, "R") \ +DECL_BTN_EX(start, 10, "+") \ +DECL_BTN_EX(menu_toggle, 11, "Home") \ +DECL_BTN_EX(select, 12, "-") \ +DECL_BTN_EX(l, 13, "L") \ +DECL_BTN_EX(down, 14, "D-Pad Down") \ +DECL_BTN_EX(right, 15, "D-Pad Right") \ +DECL_BTN_EX(r3, 16, "Right Thumb") \ +DECL_BTN_EX(l3, 17, "Left Thumb") \ +DECL_AXIS_EX(l_x_plus, +0, "L-Stick right") \ +DECL_AXIS_EX(l_x_minus, -0, "L-Stick left") \ +DECL_AXIS_EX(l_y_minus, +1, "L-Stick up") \ +DECL_AXIS_EX(l_y_plus, -1, "L-Stick down") \ +DECL_AXIS_EX(r_x_plus, +2, "R-Stick right") \ +DECL_AXIS_EX(r_x_minus, -2, "R-Stick left") \ +DECL_AXIS_EX(r_y_minus, +3, "R-Stick up") \ +DECL_AXIS_EX(r_y_plus, -3, "R-Stick down") #define WIIUINPUT_CLASSIC_CONTROLLER_DEFAULT_BINDS \ -DECL_BTN(a, 8) \ -DECL_BTN(b, 0) \ -DECL_BTN(x, 9) \ -DECL_BTN(y, 1) \ -DECL_BTN(start, 3) \ -DECL_BTN(select, 2) \ -DECL_BTN(up, 4) \ -DECL_BTN(down, 5) \ -DECL_BTN(left, 6) \ -DECL_BTN(right, 7) \ -DECL_BTN(l, 10) \ -DECL_BTN(r, 11) \ -DECL_BTN(l2, 12) \ -DECL_BTN(r2, 13) \ -DECL_AXIS(l_x_plus, +0) \ -DECL_AXIS(l_x_minus, -0) \ -DECL_AXIS(l_y_plus, +1) \ -DECL_AXIS(l_y_minus, -1) \ -DECL_AXIS(r_x_plus, +2) \ -DECL_AXIS(r_x_minus, -2) \ -DECL_AXIS(r_y_plus, -3) \ -DECL_AXIS(r_y_minus, +3) +DECL_BTN_EX(up, 0, "D-Pad Up") \ +DECL_BTN_EX(left, 1, "D-Pad Left") \ +DECL_BTN_EX(r2, 2, "ZR") \ +DECL_BTN_EX(x, 3, "X") \ +DECL_BTN_EX(a, 4, "A") \ +DECL_BTN_EX(y, 5, "Y") \ +DECL_BTN_EX(b, 6, "B") \ +DECL_BTN_EX(l2, 7, "ZL") \ +DECL_BTN_EX(r, 9, "R") \ +DECL_BTN_EX(start, 10, "+") \ +DECL_BTN_EX(menu_toggle, 11, "Home") \ +DECL_BTN_EX(select, 12, "-") \ +DECL_BTN_EX(l, 13, "L") \ +DECL_BTN_EX(down, 14, "D-Pad Down") \ +DECL_BTN_EX(right, 15, "D-Pad Right") \ +DECL_AXIS_EX(l_x_plus, +0, "L-Stick right") \ +DECL_AXIS_EX(l_x_minus, -0, "L-Stick left") \ +DECL_AXIS_EX(l_y_minus, +1, "L-Stick up") \ +DECL_AXIS_EX(l_y_plus, -1, "L-Stick down") \ +DECL_AXIS_EX(r_x_plus, +2, "R-Stick right") \ +DECL_AXIS_EX(r_x_minus, -2, "R-Stick left") \ +DECL_AXIS_EX(r_y_minus, +3, "R-Stick up") \ +DECL_AXIS_EX(r_y_plus, -3, "R-Stick down") #define WIIUINPUT_WIIMOTE_DEFAULT_BINDS \ -DECL_BTN(a, 8) \ -DECL_BTN(b, 0) \ -DECL_BTN(x, 9) \ -DECL_BTN(y, 1) \ -DECL_BTN(start, 3) \ -DECL_BTN(select, 2) \ -DECL_BTN(up, 4) \ -DECL_BTN(down, 5) \ -DECL_BTN(left, 6) \ -DECL_BTN(right, 7) \ -DECL_BTN(l, 10) \ -DECL_BTN(r, 11) \ -DECL_BTN(l2, 12) \ -DECL_BTN(r2, 13) \ -DECL_AXIS(l_x_plus, +0) \ -DECL_AXIS(l_x_minus, -0) \ -DECL_AXIS(l_y_plus, +1) \ -DECL_AXIS(l_y_minus, -1) \ -DECL_AXIS(r_x_plus, +2) \ -DECL_AXIS(r_x_minus, -2) \ -DECL_AXIS(r_y_plus, -3) \ -DECL_AXIS(r_y_minus, +3) +DECL_BTN_EX(down, 0, "D-Pad Left") \ +DECL_BTN_EX(up, 1, "D-Pad Right") \ +DECL_BTN_EX(right, 2, "D-Pad Down") \ +DECL_BTN_EX(left, 3, "D-Pad Up") \ +DECL_BTN_EX(start, 4, "+") \ +DECL_BTN_EX(a, 8, "2") \ +DECL_BTN_EX(b, 9, "1") \ +DECL_BTN_EX(x, 10, "B") \ +DECL_BTN_EX(y, 11, "A") \ +DECL_BTN_EX(select, 12, "-") \ +DECL_BTN_EX(l, 13, "Z") \ +DECL_BTN_EX(r, 14, "C") \ +DECL_BTN_EX(menu_toggle, 15, "Home") #define WIIUINPUT_NUNCHUK_DEFAULT_BINDS \ -DECL_BTN(a, 8) \ -DECL_BTN(b, 0) \ -DECL_BTN(x, 9) \ -DECL_BTN(y, 1) \ -DECL_BTN(start, 3) \ -DECL_BTN(select, 2) \ -DECL_BTN(up, 4) \ -DECL_BTN(down, 5) \ -DECL_BTN(left, 6) \ -DECL_BTN(right, 7) \ -DECL_BTN(l, 10) \ -DECL_BTN(r, 11) \ -DECL_BTN(l2, 12) \ -DECL_BTN(r2, 13) \ -DECL_AXIS(l_x_plus, +0) \ -DECL_AXIS(l_x_minus, -0) \ -DECL_AXIS(l_y_plus, +1) \ -DECL_AXIS(l_y_minus, -1) \ -DECL_AXIS(r_x_plus, +2) \ -DECL_AXIS(r_x_minus, -2) \ -DECL_AXIS(r_y_plus, -3) \ -DECL_AXIS(r_y_minus, +3) +DECL_BTN_EX(left, 0, "D-Pad Left") \ +DECL_BTN_EX(right, 1, "D-Pad Right") \ +DECL_BTN_EX(down, 2, "D-Pad Down") \ +DECL_BTN_EX(up, 3, "D-Pad Up") \ +DECL_BTN_EX(start, 4, "+") \ +DECL_BTN_EX(y, 8, "2") \ +DECL_BTN_EX(x, 9, "1") \ +DECL_BTN_EX(b, 10, "B") \ +DECL_BTN_EX(a, 11, "A") \ +DECL_BTN_EX(select, 12, "-") \ +DECL_BTN_EX(l, 13, "Z") \ +DECL_BTN_EX(r, 14, "C") \ +DECL_BTN_EX(menu_toggle, 15, "Home") \ +DECL_AXIS_EX(l_x_plus, +0, "Stick Right") \ +DECL_AXIS_EX(l_x_minus, -0, "Stick Left") \ +DECL_AXIS_EX(l_y_minus, +1, "Stick Up") \ +DECL_AXIS_EX(l_y_plus, -1, "Stick Down") \ + #endif #define GXINPUT_GAMECUBE_DEFAULT_BINDS \