From b7b0e520ef1dcd1fd1f121d5e014515d90cf4e85 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 13 Jun 2014 17:44:49 +0200 Subject: [PATCH] (Android) Add default binds for MUCH iRead i5 and FC30 --- input/android_input.c | 4 ++-- input/android_input.c.rem | 37 ----------------------------- input/autoconf/builtin_android.c | 40 ++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 39 deletions(-) diff --git a/input/android_input.c b/input/android_input.c index fc1e5f2ad3..13b9f3097f 100644 --- a/input/android_input.c +++ b/input/android_input.c @@ -427,7 +427,7 @@ static void handle_hotplug(void *data, unsigned *port, unsigned id, else if (strstr(device_name, "Jess Tech Dual Analog Rumble Pad")) device = DEVICE_SAITEK_RUMBLE_P480; else if (strstr(device_name, "mtk-kpd")) - device = DEVICE_MUCH_IREADGO_I5; + strlcpy(name_buf, "MUCH iReadyGo i5", sizeof(name_buf)); else if (strstr(device_name, "Wikipad")) strlcpy(name_buf, "Wikipad", sizeof(name_buf)); else if (strstr(device_name, "Microsoft")) @@ -478,7 +478,7 @@ static void handle_hotplug(void *data, unsigned *port, unsigned id, else if (strstr(device_name, "BUFFALO BGC-FC801")) device = DEVICE_BUFFALO_BGC_FC801; else if (strstr(device_name, "8Bitdo FC30")) - device = DEVICE_FC30_GAMEPAD; + strlcpy(name_buf, "FC30 Gamepad", sizeof(name_buf)); else if (strstr(device_name, "RetroUSB.com RetroPad")) device = DEVICE_RETROUSB_RETROPAD; else if (strstr(device_name, "RetroUSB.com SNES RetroPort")) diff --git a/input/android_input.c.rem b/input/android_input.c.rem index d5ad9efe7e..1fb65ad11b 100644 --- a/input/android_input.c.rem +++ b/input/android_input.c.rem @@ -812,43 +812,6 @@ static void android_input_set_keybinds(void *data, unsigned device, android->keycode_lut[AKEYCODE_BUTTON_L1]|= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift); android->keycode_lut[AKEYCODE_BUTTON_R1]|= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift); break; - case DEVICE_MUCH_IREADGO_I5: - g_settings.input.device[port] = device; - strlcpy(g_settings.input.device_names[port], "MUCH iReadyGo i5", - sizeof(g_settings.input.device_names[port])); - - android->keycode_lut[AKEYCODE_DPAD_UP] |= ((RETRO_DEVICE_ID_JOYPAD_UP+1) << shift); - android->keycode_lut[AKEYCODE_DPAD_DOWN] |= ((RETRO_DEVICE_ID_JOYPAD_DOWN+1) << shift); - android->keycode_lut[AKEYCODE_DPAD_LEFT] |= ((RETRO_DEVICE_ID_JOYPAD_LEFT+1) << shift); - android->keycode_lut[AKEYCODE_DPAD_RIGHT]|= ((RETRO_DEVICE_ID_JOYPAD_RIGHT+1) << shift); - - android->keycode_lut[AKEYCODE_BUTTON_B] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift); - android->keycode_lut[AKEYCODE_DPAD_CENTER] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift); - android->keycode_lut[AKEYCODE_BUTTON_Y] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift); - android->keycode_lut[AKEYCODE_BUTTON_X] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift); - android->keycode_lut[AKEYCODE_BUTTON_L1] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift); - android->keycode_lut[AKEYCODE_BUTTON_R1] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift); - - break; - case DEVICE_FC30_GAMEPAD: - g_settings.input.device[port] = device; - strlcpy(g_settings.input.device_names[port], "FC30 Gamepad", - sizeof(g_settings.input.device_names[port])); - - android->keycode_lut[AKEYCODE_DPAD_UP] |= ((RETRO_DEVICE_ID_JOYPAD_UP+1) << shift); - android->keycode_lut[AKEYCODE_DPAD_DOWN] |= ((RETRO_DEVICE_ID_JOYPAD_DOWN+1) << shift); - android->keycode_lut[AKEYCODE_DPAD_LEFT] |= ((RETRO_DEVICE_ID_JOYPAD_LEFT+1) << shift); - android->keycode_lut[AKEYCODE_DPAD_RIGHT]|= ((RETRO_DEVICE_ID_JOYPAD_RIGHT+1) << shift); - - android->keycode_lut[AKEYCODE_BUTTON_A] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift); - android->keycode_lut[AKEYCODE_BUTTON_B] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift); - android->keycode_lut[AKEYCODE_BUTTON_X] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift); - android->keycode_lut[AKEYCODE_BUTTON_Y] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift); - android->keycode_lut[AKEYCODE_BUTTON_L1] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift); - android->keycode_lut[AKEYCODE_BUTTON_R1] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift); - android->keycode_lut[AKEYCODE_BUTTON_C] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift); - android->keycode_lut[AKEYCODE_BUTTON_START] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift); - break; case DEVICE_CCPCREATIONS_WIIUSE_IME: g_settings.input.device[port] = device; strlcpy(g_settings.input.device_names[port], "ccpCreations WiiUse IME", diff --git a/input/autoconf/builtin_android.c b/input/autoconf/builtin_android.c index 6eac0609d8..a7b5510fa5 100644 --- a/input/autoconf/builtin_android.c +++ b/input/autoconf/builtin_android.c @@ -57,6 +57,20 @@ DECL_BTN(right, h0right) \ DECL_BTN(l, 194) \ DECL_BTN(r, 195) +#define FC30_GAMEPAD_DEFAULT_BINDS \ +DECL_BTN(up, 19) \ +DECL_BTN(down, 20) \ +DECL_BTN(left, 21) \ +DECL_BTN(right, 22) \ +DECL_BTN(a, 96) \ +DECL_BTN(b, 97) \ +DECL_BTN(x, 99) \ +DECL_BTN(y, 100) \ +DECL_BTN(l, 102) \ +DECL_BTN(r, 103) \ +DECL_BTN(select, 98) \ +DECL_BTN(start, 108) + #define ZEUS_DEFAULT_BINDS \ DECL_BTN(a, 4) \ DECL_BTN(b, 23) \ @@ -72,6 +86,28 @@ DECL_BTN(l, 102) \ DECL_BTN(r, 103) \ "input_menu_toggle_btn = 82\n" +// TODO +// - Analog sticks - verify if they work +#define MUCH_IREADYGO_I5_DEFAULT_BINDS \ +DECL_BTN(a, 97) \ +DECL_BTN(b, 23) \ +DECL_BTN(x, 100) \ +DECL_BTN(y, 99) \ +DECL_BTN(up, 19) \ +DECL_BTN(down, 20) \ +DECL_BTN(left, 21) \ +DECL_BTN(right, 22) \ +DECL_BTN(l, 102) \ +DECL_BTN(r, 103) \ +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) + // TODO // - Analog sticks - verify if they work // - L2 / R2 buttons @@ -509,6 +545,10 @@ const char* const input_builtin_autoconfs[] = "input_device = \"SideWinder Classic\" \n" "input_driver = \"android\" \n" SIDEWINDER_CLASSIC_DEFAULT_BINDS, + + "input_device = \"MUCH iReadyGo i5\" \n" + "input_driver = \"android\" \n" + MUCH_IREADYGO_I5_DEFAULT_BINDS "input_device = \"XBox 360\" \n" "input_driver = \"android\" \n"