mirror of
https://github.com/libretro/RetroArch
synced 2025-02-25 03:40:50 +00:00
(Android) Add gamepads to autodetection - (Archos gamepad, Xperia Play,
Xbox 1 Titanium X-Joyconverter, Xbox 360 wired, Red Samurai BT, Mayflash Wii Classic variant, RetroUSB NES, RetroUSB SNES, Buffalo SNES, Logicool F710, Elecom PS1/PS2)
This commit is contained in:
parent
b48cc4c107
commit
db1851d7c4
@ -141,6 +141,27 @@ void input_autodetect_setup (void *data, char *msg, size_t sizeof_msg, unsigned
|
||||
keycode_lut[AKEYCODE_BUTTON_START] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
|
||||
}
|
||||
}
|
||||
else if (strstr(name_buf, "Logicool"))
|
||||
{
|
||||
if (strstr(name_buf, "RumblePad 2"))
|
||||
{
|
||||
snprintf(msg, sizeof_msg, "RetroPad #%d is: Logitech Rumblepad2 (DInput).\n", port);
|
||||
/* TODO: Add L3/R3 */
|
||||
keycode_lut[AKEYCODE_BUTTON_B] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_C] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
|
||||
|
||||
keycode_lut[AKEYCODE_BUTTON_X] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_A] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift);
|
||||
|
||||
keycode_lut[AKEYCODE_BUTTON_L2] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_R2] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
|
||||
|
||||
keycode_lut[AKEYCODE_BUTTON_Y] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_Z] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_L1] |= ((RETRO_DEVICE_ID_JOYPAD_L2+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_R1] |= ((RETRO_DEVICE_ID_JOYPAD_R2+1) << shift);
|
||||
}
|
||||
}
|
||||
else if (strstr(name_buf, "HuiJia USB GamePad"))
|
||||
{
|
||||
snprintf(msg, sizeof_msg, "RetroPad #%d is: HuiJia USB Gamepad.\n", port);
|
||||
@ -168,21 +189,34 @@ void input_autodetect_setup (void *data, char *msg, size_t sizeof_msg, unsigned
|
||||
keycode_lut[AKEYCODE_BUTTON_8] |= ((RETRO_DEVICE_ID_JOYPAD_R) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_9] |= ((RETRO_DEVICE_ID_JOYPAD_L2) << shift);
|
||||
}
|
||||
else if (strstr(name_buf, "SideWinder"))
|
||||
else if (strstr(name_buf, "SideWinder") || strstr(name_buf, "X-Box"))
|
||||
{
|
||||
if (strstr(name_buf, "SideWinder"))
|
||||
{
|
||||
snprintf(msg, sizeof_msg, "RetroPad #%d is: Sidewinder.\n", port);
|
||||
keycode_lut[AKEYCODE_BUTTON_A] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_X] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_R2] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_L2] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_11] |= ((RETRO_DEVICE_ID_JOYPAD_L3+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_12] |= ((RETRO_DEVICE_ID_JOYPAD_R3+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_Z] |= ((RETRO_DEVICE_ID_JOYPAD_L2+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_C] |= ((RETRO_DEVICE_ID_JOYPAD_R2+1) << shift);
|
||||
}
|
||||
else if (strstr(name_buf, "X-Box 360") || strstr(name_buf, "X-Box"))
|
||||
{
|
||||
/* TODO: left and right triggers for Xbox 1*/
|
||||
snprintf(msg, sizeof_msg, "RetroPad #%d is: Xbox.\n", port);
|
||||
keycode_lut[AKEYCODE_BUTTON_SELECT] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_START] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_THUMBL] |= ((RETRO_DEVICE_ID_JOYPAD_L3+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_THUMBR] |= ((RETRO_DEVICE_ID_JOYPAD_R3+1) << shift);
|
||||
}
|
||||
|
||||
keycode_lut[AKEYCODE_BUTTON_A] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_X] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_B] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_Y] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_L1] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_R1] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_Z] |= ((RETRO_DEVICE_ID_JOYPAD_L2+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_C] |= ((RETRO_DEVICE_ID_JOYPAD_R2+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_11] |= ((RETRO_DEVICE_ID_JOYPAD_L3+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_12] |= ((RETRO_DEVICE_ID_JOYPAD_R3+1) << shift);
|
||||
}
|
||||
}
|
||||
else if (strstr(name_buf, "WiseGroup"))
|
||||
@ -203,7 +237,8 @@ void input_autodetect_setup (void *data, char *msg, size_t sizeof_msg, unsigned
|
||||
keycode_lut[AKEYCODE_BUTTON_11] |= ((RETRO_DEVICE_ID_JOYPAD_L3+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_12] |= ((RETRO_DEVICE_ID_JOYPAD_R3+1) << shift);
|
||||
}
|
||||
else if (strstr(name_buf, "TigerGame") || strstr(name_buf, "Game Controller Adapter"))
|
||||
else if (strstr(name_buf, "TigerGame") || strstr(name_buf, "Game Controller Adapter")
|
||||
|| strstr(name_buf, "JC-PS102U"))
|
||||
{
|
||||
snprintf(msg, sizeof_msg, "RetroPad #%d is: Mayflash PS2 converter.\n", port);
|
||||
g_settings.input.dpad_emulation[port] = DPAD_EMULATION_NONE;
|
||||
@ -336,6 +371,39 @@ void input_autodetect_setup (void *data, char *msg, size_t sizeof_msg, unsigned
|
||||
keycode_lut[AKEYCODE_BUTTON_THUMBL] |= ((RETRO_DEVICE_ID_JOYPAD_L3+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_THUMBR] |= ((RETRO_DEVICE_ID_JOYPAD_R3+1) << shift);
|
||||
}
|
||||
else if (strstr(name_buf, "USB,2-axis 8-button gamepad") ||
|
||||
strstr(name_buf, "BUFFALO BGC-FC801"))
|
||||
{
|
||||
snprintf(msg, sizeof_msg, "RetroPad #%d is: Buffalo NES/SNES.\n", port);
|
||||
keycode_lut[AKEYCODE_BUTTON_1] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_2] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_3] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_4] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_5] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_6] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_7] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_8] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
|
||||
}
|
||||
else if (strstr(name_buf, "RetroUSB.com RetroPad"))
|
||||
{
|
||||
snprintf(msg, sizeof_msg, "RetroPad #%d is: RetroUSB NES.\n", port);
|
||||
keycode_lut[AKEYCODE_BUTTON_B] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_A] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_7] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_8] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
|
||||
}
|
||||
else if (strstr(name_buf, "RetroUSB.com SNES RetroPort"))
|
||||
{
|
||||
snprintf(msg, sizeof_msg, "RetroPad #%d is: RetroUSB SNES.\n", port);
|
||||
keycode_lut[AKEYCODE_BUTTON_Z] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_B] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_Y] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_A] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_L1] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_R1] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_C] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_X] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
|
||||
}
|
||||
else if (strstr(name_buf, "CYPRESS USB"))
|
||||
{
|
||||
snprintf(msg, sizeof_msg, "RetroPad #%d is: Saturn USB.\n", port);
|
||||
@ -349,14 +417,26 @@ void input_autodetect_setup (void *data, char *msg, size_t sizeof_msg, unsigned
|
||||
keycode_lut[AKEYCODE_BUTTON_R1] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_L2] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
|
||||
}
|
||||
else if (strstr(name_buf, "Mayflash Wii Classic"))
|
||||
else if (strstr(name_buf, "Mayflash Wii Classic") ||
|
||||
strstr(name_buf, "SZMy-power LTD CO. Dual Box WII"))
|
||||
{
|
||||
snprintf(msg, sizeof_msg, "RetroPad #%d is: Mayflash Wii Classic.\n", port);
|
||||
g_settings.input.dpad_emulation[port] = DPAD_EMULATION_NONE;
|
||||
|
||||
if (strstr(name_buf, "Mayflash Wii Classic"))
|
||||
{
|
||||
keycode_lut[AKEYCODE_BUTTON_12] |= ((RETRO_DEVICE_ID_JOYPAD_UP+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_14] |= ((RETRO_DEVICE_ID_JOYPAD_DOWN+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_13] |= ((RETRO_DEVICE_ID_JOYPAD_LEFT+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_15] |= ((RETRO_DEVICE_ID_JOYPAD_RIGHT+1) << shift);
|
||||
}
|
||||
else if (strstr(name_buf, "SZMy-power LTD CO. Dual Box WII"))
|
||||
{
|
||||
keycode_lut[AKEYCODE_BUTTON_13] |= ((RETRO_DEVICE_ID_JOYPAD_UP+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_15] |= ((RETRO_DEVICE_ID_JOYPAD_DOWN+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_16] |= ((RETRO_DEVICE_ID_JOYPAD_LEFT+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_14] |= ((RETRO_DEVICE_ID_JOYPAD_RIGHT+1) << shift);
|
||||
}
|
||||
keycode_lut[AKEYCODE_BUTTON_4] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_3] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_2] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
|
||||
@ -382,6 +462,24 @@ void input_autodetect_setup (void *data, char *msg, size_t sizeof_msg, unsigned
|
||||
keycode_lut[AKEYCODE_BUTTON_L2] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_R2] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
|
||||
}
|
||||
else if (strstr(name_buf, "joy_key"))
|
||||
{
|
||||
snprintf(msg, sizeof_msg, "RetroPad #%d is: Archos Gamepad.\n", port);
|
||||
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);
|
||||
keycode_lut[AKEYCODE_BUTTON_A] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_B] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_X] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_Y] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_L1] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_R1] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_L2] |= ((RETRO_DEVICE_ID_JOYPAD_L2+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_R2] |= ((RETRO_DEVICE_ID_JOYPAD_R2+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_SELECT] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_START] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
|
||||
}
|
||||
else if (strstr(name_buf, "matrix_keyboard"))
|
||||
{
|
||||
snprintf(msg, sizeof_msg, "RetroPad #%d is: JXD S5110.\n", port);
|
||||
@ -398,10 +496,12 @@ void input_autodetect_setup (void *data, char *msg, size_t sizeof_msg, unsigned
|
||||
keycode_lut[AKEYCODE_BUTTON_L1] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_R1] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
|
||||
}
|
||||
else if (strstr(name_buf, "keypad-game-zeus"))
|
||||
else if (strstr(name_buf, "keypad-game-zeus") || strstr(name_buf, "keypad-zeus"))
|
||||
{
|
||||
volume_enable = false;
|
||||
snprintf(msg, sizeof_msg, "RetroPad #%d is: Xperia Play.\n", port);
|
||||
/* TODO: menu button */
|
||||
/* Menu : 82 */
|
||||
keycode_lut[AKEYCODE_DPAD_CENTER] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
|
||||
keycode_lut[AKEYCODE_BACK] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_X] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
|
||||
@ -415,6 +515,38 @@ void input_autodetect_setup (void *data, char *msg, size_t sizeof_msg, unsigned
|
||||
keycode_lut[AKEYCODE_BUTTON_L1] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift);
|
||||
keycode_lut[AKEYCODE_BUTTON_R1] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
|
||||
}
|
||||
else if (strstr(name_buf, "Broadcom Bluetooth HID"))
|
||||
{
|
||||
/* TODO: unsure about Select button here */
|
||||
/* TODO: hookup right stick
|
||||
* RStick Up: 37
|
||||
* RStick Down: 39
|
||||
* RStick Left:38
|
||||
* RStick Right: 40 */
|
||||
snprintf(msg, sizeof_msg, "RetroPad #%d is: Red Samurai.\n", port);
|
||||
keycode_lut[AKEYCODE_W] |= ((RETRO_DEVICE_ID_JOYPAD_UP+1) << shift);
|
||||
keycode_lut[AKEYCODE_S] |= ((RETRO_DEVICE_ID_JOYPAD_DOWN+1) << shift);
|
||||
keycode_lut[AKEYCODE_A] |= ((RETRO_DEVICE_ID_JOYPAD_LEFT+1) << shift);
|
||||
keycode_lut[AKEYCODE_D]|= ((RETRO_DEVICE_ID_JOYPAD_RIGHT+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);
|
||||
keycode_lut[AKEYCODE_BACK] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
|
||||
keycode_lut[AKEYCODE_ENTER] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
|
||||
keycode_lut[AKEYCODE_9] |= ((RETRO_DEVICE_ID_JOYPAD_L3+1) << shift);
|
||||
keycode_lut[AKEYCODE_0] |= ((RETRO_DEVICE_ID_JOYPAD_R3+1) << shift);
|
||||
keycode_lut[AKEYCODE_5] |= ((RETRO_DEVICE_ID_JOYPAD_L+1) << shift);
|
||||
keycode_lut[AKEYCODE_6] |= ((RETRO_DEVICE_ID_JOYPAD_L2+1) << shift);
|
||||
keycode_lut[AKEYCODE_7] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
|
||||
keycode_lut[AKEYCODE_8] |= ((RETRO_DEVICE_ID_JOYPAD_R2+1) << shift);
|
||||
|
||||
/* unsure if the person meant the SNES-mapping here or whether it's the pad */
|
||||
keycode_lut[AKEYCODE_1] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
|
||||
keycode_lut[AKEYCODE_2] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
|
||||
keycode_lut[AKEYCODE_3] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
|
||||
keycode_lut[AKEYCODE_4] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift);
|
||||
}
|
||||
if (strstr(current_ime, "com.ccpcreations.android.WiiUseAndroid"))
|
||||
{
|
||||
// Player 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user