(Android) Input binds - cleanups

This commit is contained in:
twinaphex 2014-08-13 22:50:22 +02:00
parent a523f072ed
commit 1c35e607b5
2 changed files with 2 additions and 78 deletions

View File

@ -446,8 +446,6 @@ static void handle_hotplug(android_input_t *android, struct android_app *android
else if (*port == 1)
strlcpy(name_buf, "TTT THT Arcade (Player 2)", sizeof(name_buf));
}
else if (strstr(device_name, "Onlive Wireless Controller"))
device = DEVICE_ONLIVE_WIRELESS_CONTROLLER;
else if (strstr(device_name, "MadCatz") && strstr(device_name, "PC USB Wired Stick"))
device = DEVICE_MADCATZ_PC_USB_STICK;
else if (strstr(device_name, "Logicool") && strstr(device_name, "RumblePad 2"))
@ -497,13 +495,9 @@ static void handle_hotplug(android_input_t *android, struct android_app *android
else if (strstr(device_name, "idroid:con"))
device = DEVICE_IDROID_CON;
else if (strstr(device_name, "2-Axis, 8-Button"))
device = DEVICE_GENIUS_MAXFIRE_G08XU;
strlcpy(name_buf, "Genius Maxfire G08XU", sizeof(name_buf));
else if (strstr(device_name, "USB,2-axis 8-button gamepad"))
device = DEVICE_USB_2_AXIS_8_BUTTON_GAMEPAD;
else if (strstr(device_name, "RetroUSB.com RetroPad"))
device = DEVICE_RETROUSB_RETROPAD;
else if (strstr(device_name, "RetroUSB.com SNES RetroPort"))
device = DEVICE_RETROUSB_SNES_RETROPORT;
else if (strstr(device_name, "CYPRESS USB"))
device = DEVICE_CYPRESS_USB;
else if (strstr(device_name, "Mayflash Wii Classic"))
@ -527,7 +521,7 @@ static void handle_hotplug(android_input_t *android, struct android_app *android
else if (strstr(device_name, "Thrustmaster T Mini"))
device = DEVICE_THRUSTMASTER_T_MINI;
else if (strstr(device_name, "2Axes 11Keys Game Pad"))
device = DEVICE_TOMEE_NES_USB;
strlcpy(name_buf, "Tomee NES USB", sizeof(name_buf));
else if (strstr(device_name, "rk29-keypad") || strstr(device_name, "GAMEMID"))
strlcpy(name_buf, "GameMID", sizeof(name_buf));
else if (strstr(device_name, "USB Gamepad"))

View File

@ -151,42 +151,6 @@ static void android_input_set_keybinds(void *data, unsigned device,
android->keycode_lut[198] |= ((RETRO_DEVICE_ID_JOYPAD_L3+1) << shift);
android->keycode_lut[199] |= ((RETRO_DEVICE_ID_JOYPAD_R3+1) << shift);
break;
case DEVICE_ONLIVE_WIRELESS_CONTROLLER:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Onlive Wireless",
sizeof(g_settings.input.device_names[port]));
/* TODO - Does D-pad work as D-pad? */
android->keycode_lut[102] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
android->keycode_lut[4] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
android->keycode_lut[100] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift);
android->keycode_lut[99] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
android->keycode_lut[96] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
android->keycode_lut[97] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
android->keycode_lut[102] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift);
android->keycode_lut[103] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
/* TODO -
* LT - find out value
* RT - find out value
*/
break;
case DEVICE_GENIUS_MAXFIRE_G08XU:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Genius Maxfire G08XU",
sizeof(g_settings.input.device_names[port]));
android->keycode_lut[97] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
android->keycode_lut[96] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
android->keycode_lut[99] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift);
android->keycode_lut[98] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
android->keycode_lut[100] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift);
android->keycode_lut[101] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
android->keycode_lut[102] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
android->keycode_lut[103] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
break;
case DEVICE_USB_2_AXIS_8_BUTTON_GAMEPAD:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "USB 2 Axis 8 button",
@ -201,30 +165,6 @@ static void android_input_set_keybinds(void *data, unsigned device,
android->keycode_lut[194] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
android->keycode_lut[195] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
break;
case DEVICE_RETROUSB_RETROPAD:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "RetroUSB NES",
sizeof(g_settings.input.device_names[port]));
android->keycode_lut[97] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
android->keycode_lut[96] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
android->keycode_lut[98] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
android->keycode_lut[99] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
break;
case DEVICE_RETROUSB_SNES_RETROPORT:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "RetroUSB SNES",
sizeof(g_settings.input.device_names[port]));
android->keycode_lut[101] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
android->keycode_lut[97] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
android->keycode_lut[100] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift);
android->keycode_lut[96] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
android->keycode_lut[102] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift);
android->keycode_lut[103] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
android->keycode_lut[98] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
android->keycode_lut[99] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
break;
case DEVICE_CYPRESS_USB:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Cypress USB",
@ -291,16 +231,6 @@ static void android_input_set_keybinds(void *data, unsigned device,
android->keycode_lut[196] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
android->keycode_lut[197] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
break;
case DEVICE_TOMEE_NES_USB:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Tomee NES USB",
sizeof(g_settings.input.device_names[port]));
android->keycode_lut[105]|= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
android->keycode_lut[104]|= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
android->keycode_lut[96]|= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
android->keycode_lut[97]|= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
break;
case DEVICE_THRUSTMASTER_T_MINI:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Thrustmaster T Mini",