(Android) Add Samsung EI-GP20 binds

This commit is contained in:
twinaphex 2014-06-11 20:38:06 +02:00
parent 8a80cd59aa
commit 90cc90ca38
3 changed files with 21 additions and 27 deletions

View File

@ -611,7 +611,10 @@ static void handle_hotplug(void *data, unsigned *port, unsigned id,
strlcpy(name_buf, "NVIDIA Shield", sizeof(name_buf));
}
else if (strstr(name_buf, "Samsung Game Pad EI-GP20"))
{
device = DEVICE_SAMSUNG_GAMEPAD_EIGP20;
strlcpy(name_buf, "Samsung Gamepad EI-GP20", sizeof(name_buf));
}
if (strstr(current_ime, "net.obsidianx.android.mogaime"))
{

View File

@ -985,33 +985,6 @@ static void android_input_set_keybinds(void *data, unsigned device,
android->keycode_lut[AKEYCODE_BUTTON_7] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
android->keycode_lut[AKEYCODE_BUTTON_8] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
break;
case DEVICE_SAMSUNG_GAMEPAD_EIGP20:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Samsung Game Pad EI-GP20",
sizeof(g_settings.input.device_names[port]));
//B: "Pad 0: 96, ac=1, src = 1281"
android->keycode_lut[AKEYCODE_BUTTON_B] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
//A: "Pad 0: 97, ac=1, src = 1281"
android->keycode_lut[AKEYCODE_BUTTON_A] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
//X: "Pad 0: 99, ac=1, src = 1281"
android->keycode_lut[AKEYCODE_BUTTON_X] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift);
//Y: "Pad 0: 100, ac=1, src = 1281"
android->keycode_lut[AKEYCODE_BUTTON_Y] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
//Left Trigger: "Pad 0: 102, ac=1, src = 1281"
android->keycode_lut[AKEYCODE_BUTTON_L1] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift);
//Right Trigger: "Pad 0: 103, ac=1, src = 1281"
android->keycode_lut[AKEYCODE_BUTTON_R1] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
//Play Button: "Pad 0: 0, ac=1, src = 1281"
//Start: "Pad 0: 108, ac=1, src = 1281"
android->keycode_lut[AKEYCODE_BUTTON_START] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
//Select: "Pad 0: 109, ac=1, src = 1281"
android->keycode_lut[AKEYCODE_BUTTON_SELECT] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
break;
case DEVICE_TOMEE_NES_USB:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Tomee NES USB",

View File

@ -56,6 +56,20 @@ DECL_BTN(l, 102) \
DECL_BTN(r, 103) \
"input_menu_toggle_btn = 82\n"
#define SAMSUNG_EIGP20_DEFAULT_BINDS \
DECL_BTN(a, 97) \
DECL_BTN(b, 96) \
DECL_BTN(x, 99) \
DECL_BTN(y, 100) \
DECL_BTN(start, 108) \
DECL_BTN(select, 109) \
DECL_BTN(up, h0up) \
DECL_BTN(down, h0down) \
DECL_BTN(left, h0left) \
DECL_BTN(right, h0right) \
DECL_BTN(l, 102) \
DECL_BTN(r, 103)
#define SIXAXIS_DEFAULT_BINDS \
DECL_BTN(a, 97) \
DECL_BTN(b, 96) \
@ -160,6 +174,10 @@ const char* const input_builtin_autoconfs[] =
"input_driver = \"android\" \n"
ZEUS_DEFAULT_BINDS,
"input_device = \"Samsung Gamepad EI-GP20\" \n"
"input_driver = \"android\" \n"
SAMSUNG_EIGP20_DEFAULT_BINDS,
"input_device = \"RumblePad 2\" \n"
"input_driver = \"android\" \n"
RUMBLEPAD2_DEFAULT_BINDS,