(Android) Add iPega PG9017 Mode 2 autodetection

This commit is contained in:
twinaphex 2013-08-07 01:12:46 +02:00
parent a12558d554
commit 95cf04f1e1
3 changed files with 19 additions and 0 deletions

View File

@ -1354,6 +1354,22 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_DPAD_LEFT] |= ((RETRO_DEVICE_ID_JOYPAD_LEFT+1) << shift);
keycode_lut[AKEYCODE_DPAD_RIGHT]|= ((RETRO_DEVICE_ID_JOYPAD_RIGHT+1) << shift);
break;
case ICADE_PROFILE_IPEGA_PG9017_MODE2:
strlcpy(g_settings.input.device_names[port], "iPega PG-9017 (Mode2)",
sizeof(g_settings.input.device_names[port]));
keycode_lut[AKEYCODE_M] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
keycode_lut[AKEYCODE_J] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
keycode_lut[AKEYCODE_K] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
keycode_lut[AKEYCODE_I] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift);
keycode_lut[AKEYCODE_Q] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift);
keycode_lut[AKEYCODE_P] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
keycode_lut[AKEYCODE_R] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
keycode_lut[AKEYCODE_Y] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
keycode_lut[AKEYCODE_DPAD_UP] |= ((RETRO_DEVICE_ID_JOYPAD_UP+1) << shift);
keycode_lut[AKEYCODE_DPAD_DOWN] |= ((RETRO_DEVICE_ID_JOYPAD_DOWN+1) << shift);
keycode_lut[AKEYCODE_DPAD_LEFT] |= ((RETRO_DEVICE_ID_JOYPAD_LEFT+1) << shift);
keycode_lut[AKEYCODE_DPAD_RIGHT]|= ((RETRO_DEVICE_ID_JOYPAD_RIGHT+1) << shift);
break;
case ICADE_PROFILE_GAMESTOP_WIRELESS:
strlcpy(g_settings.input.device_names[port], "Gamestop Wireless",
sizeof(g_settings.input.device_names[port]));

View File

@ -24,6 +24,7 @@
enum {
ICADE_PROFILE_RED_SAMURAI = 0,
ICADE_PROFILE_IPEGA_PG9017,
ICADE_PROFILE_IPEGA_PG9017_MODE2,
ICADE_PROFILE_GAMESTOP_WIRELESS,
} icade_profile_enums;

View File

@ -33,6 +33,7 @@
<string-array name="icade_profiles">
<item>Red Samurai</item>
<item>iPega PG-9017</item>
<item>iPega PG-9017 (Mode 2)</item>
<item>Gamestop Wireless</item>
</string-array>
@ -40,6 +41,7 @@
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
</string-array>
<string-array name="key_bind_values">