diff --git a/input/android_input.c b/input/android_input.c index 3229b5579e..22904ad918 100644 --- a/input/android_input.c +++ b/input/android_input.c @@ -407,7 +407,26 @@ static void handle_hotplug(void *data, unsigned *port, unsigned id, else if (strstr(device_name, "SEGA VIRTUA STICK High Grade")) strlcpy(name_buf, "Sega Virtua Stick", sizeof(name_buf)); else if (strstr(device_name, "TTT THT Arcade console 2P USB Play")) - device = DEVICE_TTT_THT_ARCADE; + { + //FIXME - need to do a similar thing here as we did for nVidia Shield + //and Xperia Play. We need to keep 'count' of the amount of similar (grouped) + //devices. + // + //For Xperia Play - count similar devices and bind them to the same 'player' + //port + // + //For nVidia Shield - see above + // + //For TTT HT - keep track of how many of these 'pads' are already + //connected, and based on that, assign one of them to be Player 1 and + //the other to be Player 2. + // + //If this is finally implemented right, then these port conditionals can go. + if (*port == 0) + strlcpy(name_buf, "TTT THT Arcade (Player 1)", sizeof(name_buf)); + else if (*port == 1) + strlcpy(name_buf, "TTT THT Arcade (Player 2)", sizeof(name_buf)); + } else if (strstr(device_name, "TOMMO NEOGEOX Arcade Stick")) strlcpy(name_buf, "TOMMO Neo-Geo X", sizeof(name_buf)); else if (strstr(device_name, "Onlive Wireless Controller")) diff --git a/input/android_input.c.rem b/input/android_input.c.rem index 6f82642802..a2d96affa6 100644 --- a/input/android_input.c.rem +++ b/input/android_input.c.rem @@ -66,43 +66,6 @@ static void android_input_set_keybinds(void *data, unsigned device, // Down - 12 // Up - 15 break; - case DEVICE_TTT_THT_ARCADE: - g_settings.input.device[port] = device; - strlcpy(g_settings.input.device_names[port], "TTT THT Arcade", - sizeof(g_settings.input.device_names[port])); - - /* same as Rumblepad 2 - merge? */ - //android->keycode_lut[194] |= ((RETRO_DEVICE_ID_JOYPAD_L2+1) << shift); - - android->keycode_lut[188] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift); - android->keycode_lut[189] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift); - android->keycode_lut[192] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift); - android->keycode_lut[193] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift); - android->keycode_lut[190] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift); - android->keycode_lut[194] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift); - android->keycode_lut[191] |= ((RETRO_DEVICE_ID_JOYPAD_R2+1) << shift); - android->keycode_lut[195] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift); - android->keycode_lut[196] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift); - - /* TODO - unsure about pad 2 still */ -#if 0 - android->keycode_lut[101] |= ((RETRO_DEVICE_ID_JOYPAD_UP+1) << shift); - android->keycode_lut[100] |= ((RETRO_DEVICE_ID_JOYPAD_DOWN+1) << shift); - android->keycode_lut[98] |= ((RETRO_DEVICE_ID_JOYPAD_LEFT+1) << shift); - android->keycode_lut[99] |= ((RETRO_DEVICE_ID_JOYPAD_RIGHT+1) << shift); - - android->keycode_lut[198] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift); - android->keycode_lut[199] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift); - android->keycode_lut[200] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift); - android->keycode_lut[201] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift); - android->keycode_lut[202] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift); - android->keycode_lut[203] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift); - android->keycode_lut[96] |= ((RETRO_DEVICE_ID_JOYPAD_L2+1) << shift); - android->keycode_lut[97] |= ((RETRO_DEVICE_ID_JOYPAD_R2+1) << shift); - android->keycode_lut[98] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift); - android->keycode_lut[99] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift); -#endif - break; case DEVICE_MADCATZ_PC_USB_STICK: g_settings.input.device[port] = device; strlcpy(g_settings.input.device_names[port], "Madcatz PC USB Stick", diff --git a/input/autoconf/builtin_android.c b/input/autoconf/builtin_android.c index 9f4173cc70..29ffde801c 100644 --- a/input/autoconf/builtin_android.c +++ b/input/autoconf/builtin_android.c @@ -41,6 +41,52 @@ DECL_AXIS(r_y_plus, -3) \ DECL_AXIS(r_y_minus, +3) \ DECL_MENU(108) +// TODO +// Verify if stick works +// Verify whether or not hats can go or +// analog stick +#define TTT_HT_PLAYER1_DEFAULT_BINDS \ +DECL_BTN(a, 193) \ +DECL_BTN(b, 192) \ +DECL_BTN(x, 189) \ +DECL_BTN(y, 188) \ +DECL_BTN(start, 196) \ +DECL_BTN(select, 195) \ +DECL_BTN(up, h0up) \ +DECL_BTN(down, h0down) \ +DECL_BTN(left, h0left) \ +DECL_BTN(right, h0right) \ +DECL_BTN(l, 190) \ +DECL_BTN(r, 194) \ +DECL_BTN(l2, 194) \ +DECL_BTN(r2, 191) \ +DECL_AXIS(l_x_plus, +0) \ +DECL_AXIS(l_x_minus, -0) \ +DECL_AXIS(l_y_plus, +1) \ +DECL_AXIS(l_y_minus, -1) + +// TODO +// Verify if stick works +#define TTT_HT_PLAYER2_DEFAULT_BINDS \ +DECL_BTN(a, 200) \ +DECL_BTN(b, 199) \ +DECL_BTN(x, 201) \ +DECL_BTN(y, 198) \ +DECL_BTN(start, 99) \ +DECL_BTN(select, 98) \ +DECL_BTN(up, 101) \ +DECL_BTN(down, 100) \ +DECL_BTN(left, 98) \ +DECL_BTN(right, 99) \ +DECL_BTN(l, 202) \ +DECL_BTN(r, 203) \ +DECL_BTN(l2, 96) \ +DECL_BTN(r2, 97) \ +DECL_AXIS(l_x_plus, +0) \ +DECL_AXIS(l_x_minus, -0) \ +DECL_AXIS(l_y_plus, +1) \ +DECL_AXIS(l_y_minus, -1) + // TODO // Verify buttons #define IDROID_X360_DEFAULT_BINDS \ @@ -761,6 +807,14 @@ const char* const input_builtin_autoconfs[] = "input_driver = \"android\" \n" SZMY_POWER_DUAL_BOX_WII_CLASSIC_DEFAULT_BINDS, + "input_device = \"TTT THT Arcade (Player 1)\" \n" + "input_driver = \"android\" \n" + TTT_HT_PLAYER1_DEFAULT_BINDS, + + "input_device = \"TTT THT Arcade (Player 2)\" \n" + "input_driver = \"android\" \n" + TTT_HT_PLAYER2_DEFAULT_BINDS, + "input_device = \"JXD S7300B\" \n" "input_driver = \"android\" \n" JXD_S7300B_DEFAULT_BINDS,