(Android) Add default binds for Wikipad, Archos Gamepad and TOMMO

Neo-Geo X
This commit is contained in:
twinaphex 2014-06-12 03:48:01 +02:00
parent ba5ebbdb7d
commit 232ef7243a
3 changed files with 61 additions and 63 deletions

View File

@ -409,7 +409,7 @@ static void handle_hotplug(void *data, unsigned *port, unsigned id,
else if (strstr(device_name, "TTT THT Arcade console 2P USB Play"))
device = DEVICE_TTT_THT_ARCADE;
else if (strstr(device_name, "TOMMO NEOGEOX Arcade Stick"))
device = DEVICE_TOMMO_NEOGEOX_ARCADE;
strlcpy(name_buf, "TOMMO Neo-Geo X", 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"))
@ -429,7 +429,7 @@ static void handle_hotplug(void *data, unsigned *port, unsigned id,
else if (strstr(device_name, "mtk-kpd"))
device = DEVICE_MUCH_IREADGO_I5;
else if (strstr(device_name, "Wikipad"))
device = DEVICE_WIKIPAD;
strlcpy(name_buf, "Wikipad", sizeof(name_buf));
else if (strstr(device_name, "Microsoft"))
{
if (strstr(device_name, "Dual Strike"))
@ -492,7 +492,7 @@ static void handle_hotplug(void *data, unsigned *port, unsigned id,
else if (strstr(device_name, "Toodles 2008 ChImp"))
device = DEVICE_TOODLES_2008_CHIMP;
else if (strstr(device_name, "joy_key"))
device = DEVICE_ARCHOS_GAMEPAD;
strlcpy(name_buf, "Archos Gamepad", sizeof(name_buf));
else if (strstr(device_name, "matrix_keyboard"))
device = DEVICE_JXD_S5110;
else if (strstr(device_name, "tincore_adc_joystick"))

View File

@ -140,22 +140,6 @@ static void android_input_set_keybinds(void *data, unsigned device,
android->keycode_lut[AKEYCODE_BUTTON_X] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
#endif
break;
case DEVICE_TOMMO_NEOGEOX_ARCADE:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "TOMMO Neogeo X Arcade",
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_B+1) << shift);
android->keycode_lut[AKEYCODE_BUTTON_B] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
android->keycode_lut[AKEYCODE_BUTTON_X] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
android->keycode_lut[AKEYCODE_BUTTON_C] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift);
android->keycode_lut[AKEYCODE_BUTTON_R2] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
android->keycode_lut[AKEYCODE_BUTTON_L2] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
break;
case DEVICE_MADCATZ_PC_USB_STICK:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Madcatz PC USB Stick",
@ -634,26 +618,6 @@ static void android_input_set_keybinds(void *data, unsigned device,
android->keycode_lut[AKEYCODE_BUTTON_L2] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
android->keycode_lut[AKEYCODE_BUTTON_R2] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
break;
case DEVICE_ARCHOS_GAMEPAD:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Archos 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_B+1) << shift);
android->keycode_lut[AKEYCODE_BUTTON_B] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
android->keycode_lut[AKEYCODE_BUTTON_X] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
android->keycode_lut[AKEYCODE_BUTTON_Y] |= ((RETRO_DEVICE_ID_JOYPAD_X+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_L2] |= ((RETRO_DEVICE_ID_JOYPAD_L2+1) << shift);
android->keycode_lut[AKEYCODE_BUTTON_R2] |= ((RETRO_DEVICE_ID_JOYPAD_R2+1) << shift);
android->keycode_lut[AKEYCODE_BUTTON_SELECT] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
android->keycode_lut[AKEYCODE_BUTTON_START] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
break;
case DEVICE_JXD_S5110:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "JXD S5110",
@ -964,30 +928,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_WIKIPAD:
/* untested : D-pad/analogs */
/* untested: L2/R2 */
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Wikipad",
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_THUMBL] |= ((RETRO_DEVICE_ID_JOYPAD_L3+1) << shift);
android->keycode_lut[AKEYCODE_BUTTON_THUMBR] |= ((RETRO_DEVICE_ID_JOYPAD_R3+1) << shift);
android->keycode_lut[AKEYCODE_BUTTON_START] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
android->keycode_lut[AKEYCODE_BACK] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
break;
case DEVICE_FC30_GAMEPAD:
g_settings.input.device[port] = device;

View File

@ -56,6 +56,41 @@ DECL_BTN(l, 102) \
DECL_BTN(r, 103) \
"input_menu_toggle_btn = 82\n"
// TODO
// - Analog sticks
// - L2 / R2 buttons
#define WIKIPAD_DEFAULT_BINDS \
DECL_BTN(a, 96) \
DECL_BTN(b, 97) \
DECL_BTN(x, 99) \
DECL_BTN(y, 100) \
DECL_BTN(start, 108) \
DECL_BTN(select, 109) \
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_BTN(l3, 106) \
DECL_BTN(r3, 107)
#define ARCHOS_GAMEPAD_DEFAULT_BINDS \
DECL_BTN(a, 97) \
DECL_BTN(b, 96) \
DECL_BTN(x, 100) \
DECL_BTN(y, 99) \
DECL_BTN(start, 108) \
DECL_BTN(select, 109) \
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_BTN(l2, 104) \
DECL_BTN(r2, 105)
#define SAMSUNG_EIGP20_DEFAULT_BINDS \
DECL_BTN(a, 97) \
DECL_BTN(b, 96) \
@ -248,6 +283,17 @@ DECL_AXIS(right, +0) \
DECL_BTN(l, 194) \
DECL_BTN(r, 195)
#define TOMMO_NEOGEOX_DEFAULT_BINDS \
DECL_BTN(a, 97) \
DECL_BTN(b, 96) \
DECL_BTN(x, 98) \
DECL_BTN(y, 99) \
DECL_BTN(start, 105) \
DECL_BTN(select, 104) \
DECL_BTN(up, 19) \
DECL_BTN(down, 20) \
DECL_BTN(left, 21) \
DECL_BTN(right, 22)
#define RUMBLEPAD2_DEFAULT_BINDS \
DECL_BTN(a, 190) \
@ -286,6 +332,18 @@ const char* const input_builtin_autoconfs[] =
"input_driver = \"android\" \n"
ZEUS_DEFAULT_BINDS,
"input_device = \"Archos Gamepad\" \n"
"input_driver = \"android\" \n"
ARCHOS_GAMEPAD_DEFAULT_BINDS,
"input_device = \"Wikipad\" \n"
"input_driver = \"android\" \n"
WIKIPAD_DEFAULT_BINDS,
"input_device = \"TOMMO Neo-Geo X\" \n"
"input_driver = \"android\" \n"
TOMMO_NEOGEOX_DEFAULT_BINDS,
"input_device = \"Samsung Gamepad EI-GP20\" \n"
"input_driver = \"android\" \n"
SAMSUNG_EIGP20_DEFAULT_BINDS,