(RGUI) RGUI input code now no longer GEKKO-specific

This commit is contained in:
twinaphex 2013-03-15 01:22:52 +01:00
parent 375aa08e58
commit 0166ce4585
7 changed files with 262 additions and 105 deletions

View File

@ -281,6 +281,9 @@ static void *android_input_init(void)
g_settings.input.dpad_emulation[i] = ANALOG_DPAD_LSTICK;
}
for (i = 0; i < MAX_PLAYERS; i++)
strlcpy(g_settings.input.device_names[i], "Custom", sizeof(g_settings.input.device_names[i]));
if ((dlopen("/system/lib/libandroid.so", RTLD_LOCAL | RTLD_LAZY)) == 0)
{
RARCH_WARN("Unable to open libandroid.so\n");
@ -326,6 +329,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
switch (device)
{
case DEVICE_LOGITECH_RUMBLEPAD2:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Logitech Rumblepad 2",
sizeof(g_settings.input.device_names[port]));
keycode_lut[AKEYCODE_BUTTON_2] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
keycode_lut[AKEYCODE_BUTTON_1] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
keycode_lut[AKEYCODE_BUTTON_9] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
@ -340,6 +347,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_12] |= ((RETRO_DEVICE_ID_JOYPAD_R3+1) << shift);
break;
case DEVICE_LOGITECH_DUAL_ACTION:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Logitech Dual Action",
sizeof(g_settings.input.device_names[port]));
keycode_lut[AKEYCODE_BUTTON_A] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
keycode_lut[AKEYCODE_BUTTON_X] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
keycode_lut[AKEYCODE_BUTTON_Y] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
@ -355,7 +366,11 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_START] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
break;
case DEVICE_ICONTROLPAD_BLUEZ_IME:
g_settings.input.device[port] = device;
g_settings.input.dpad_emulation[port] = ANALOG_DPAD_NONE;
strlcpy(g_settings.input.device_names[port], "iControlpad Bluez IME",
sizeof(g_settings.input.device_names[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);
@ -382,9 +397,13 @@ static void android_input_set_keybinds(void *data, unsigned device,
// Up - 15
break;
case DEVICE_TTT_THT_ARCADE:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "TTT THT Arcade",
sizeof(g_settings.input.device_names[port]));
dpad_state[id].dzone_min = -2.00f;
dpad_state[id].dzone_max = 1.00f;
/* same as Rumblepad 2 - merge? */
//keycode_lut[AKEYCODE_BUTTON_7] |= ((RETRO_DEVICE_ID_JOYPAD_L2+1) << shift);
@ -418,7 +437,11 @@ static void android_input_set_keybinds(void *data, unsigned device,
#endif
break;
case DEVICE_TOMMO_NEOGEOX_ARCADE:
g_settings.input.device[port] = device;
g_settings.input.dpad_emulation[port] = ANALOG_DPAD_NONE;
strlcpy(g_settings.input.device_names[port], "TOMMO Neogeo X Arcade",
sizeof(g_settings.input.device_names[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);
@ -431,6 +454,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
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",
sizeof(g_settings.input.device_names[port]));
keycode_lut[AKEYCODE_BUTTON_A] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
keycode_lut[AKEYCODE_BUTTON_B] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
keycode_lut[AKEYCODE_BUTTON_C] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
@ -444,6 +471,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_MODE] |= ((RARCH_QUIT_KEY+1) << shift);
break;
case DEVICE_LOGICOOL_RUMBLEPAD2:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Logicool Rumblepad 2",
sizeof(g_settings.input.device_names[port]));
// Rumblepad 2 DInput */
/* TODO: Add L3/R3 */
keycode_lut[AKEYCODE_BUTTON_B] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
@ -461,6 +492,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_R1] |= ((RETRO_DEVICE_ID_JOYPAD_R2+1) << shift);
break;
case DEVICE_IDROID_X360:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "iDroid x360",
sizeof(g_settings.input.device_names[port]));
g_settings.input.dpad_emulation[port] = ANALOG_DPAD_NONE;
keycode_lut[AKEYCODE_DPAD_UP] |= ((RETRO_DEVICE_ID_JOYPAD_UP+1) << shift);
keycode_lut[AKEYCODE_DPAD_DOWN] |= ((RETRO_DEVICE_ID_JOYPAD_DOWN+1) << shift);
@ -489,6 +524,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_NUMPAD_4] |= ((RETRO_DEVICE_ID_JOYPAD_LEFT+1) << shift);
break;
case DEVICE_ZEEMOTE_STEELSERIES:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Zeemote Steelseries",
sizeof(g_settings.input.device_names[port]));
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_Y] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift);
@ -499,6 +538,9 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_R1] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
break;
case DEVICE_HUIJIA_USB_SNES:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Huijia USB SNES",
sizeof(g_settings.input.device_names[port]));
dpad_state[id].dzone_min = -1.00f;
dpad_state[id].dzone_max = 1.00f;
@ -512,6 +554,9 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_8] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
break;
case DEVICE_SUPER_SMARTJOY:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Super Smartjoy",
sizeof(g_settings.input.device_names[port]));
dpad_state[id].dzone_min = -1.00f;
dpad_state[id].dzone_max = 1.00f;
@ -525,6 +570,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_8] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
break;
case DEVICE_SAITEK_RUMBLE_P480:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Saitek Rumble P480",
sizeof(g_settings.input.device_names[port]));
keycode_lut[AKEYCODE_BUTTON_3] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
keycode_lut[AKEYCODE_BUTTON_1] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
keycode_lut[AKEYCODE_BUTTON_9] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
@ -540,6 +589,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
break;
case DEVICE_MS_SIDEWINDER_DUAL_STRIKE:
/* TODO - unfinished */
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "MS Sidewinder Dual Strike",
sizeof(g_settings.input.device_names[port]));
keycode_lut[AKEYCODE_BUTTON_4] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
keycode_lut[AKEYCODE_BUTTON_2] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
keycode_lut[AKEYCODE_BUTTON_6] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
@ -551,6 +604,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_9] |= ((RETRO_DEVICE_ID_JOYPAD_L2) << shift);
break;
case DEVICE_MS_SIDEWINDER:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "MS Sidewinder",
sizeof(g_settings.input.device_names[port]));
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);
@ -565,6 +622,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_R1] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
break;
case DEVICE_MS_XBOX:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Xbox",
sizeof(g_settings.input.device_names[port]));
/* TODO: left and right triggers for Xbox 1*/
keycode_lut[AKEYCODE_BUTTON_SELECT] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
keycode_lut[AKEYCODE_BUTTON_START] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
@ -578,6 +639,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_R1] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
break;
case DEVICE_WISEGROUP_PLAYSTATION2:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "WiseGroup PlayStation2",
sizeof(g_settings.input.device_names[port]));
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);
@ -596,6 +661,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_12] |= ((RETRO_DEVICE_ID_JOYPAD_R3+1) << shift);
break;
case DEVICE_JCPS102_PLAYSTATION2:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "JCPS102 PlayStation2",
sizeof(g_settings.input.device_names[port]));
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);
@ -614,6 +683,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_12] |= ((RETRO_DEVICE_ID_JOYPAD_R3+1) << shift);
break;
case DEVICE_GENERIC_PLAYSTATION2_CONVERTER:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Generic PlayStation2",
sizeof(g_settings.input.device_names[port]));
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);
@ -632,6 +705,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_12] |= ((RETRO_DEVICE_ID_JOYPAD_R3+1) << shift);
break;
case DEVICE_KEYBOARD_RETROPAD:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Generic Keyboard",
sizeof(g_settings.input.device_names[port]));
// Keyboard
// TODO: Map L2/R2/L3/R3
keycode_lut[AKEYCODE_Z] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
@ -663,6 +740,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_ESCAPE] |= ((RARCH_QUIT_KEY+1) << shift);
break;
case DEVICE_PLAYSTATION3_VERSION1:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "PlayStation3 Ver.1",
sizeof(g_settings.input.device_names[port]));
g_settings.input.dpad_emulation[port] = ANALOG_DPAD_NONE;
keycode_lut[AKEYCODE_DPAD_UP] |= ((RETRO_DEVICE_ID_JOYPAD_UP+1) << shift);
keycode_lut[AKEYCODE_DPAD_DOWN] |= ((RETRO_DEVICE_ID_JOYPAD_DOWN+1) << shift);
@ -683,7 +764,11 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_1] |= ((RARCH_MENU_TOGGLE+1) << shift);
break;
case DEVICE_PLAYSTATION3_VERSION2:
g_settings.input.device[port] = device;
g_settings.input.dpad_emulation[port] = ANALOG_DPAD_NONE;
strlcpy(g_settings.input.device_names[port], "PlayStation3 Ver.2",
sizeof(g_settings.input.device_names[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);
@ -703,7 +788,11 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_THUMBR] |= ((RETRO_DEVICE_ID_JOYPAD_R3+1) << shift);
break;
case DEVICE_MOGA:
g_settings.input.device[port] = device;
g_settings.input.dpad_emulation[port] = ANALOG_DPAD_NONE;
strlcpy(g_settings.input.device_names[port], "MOGA",
sizeof(g_settings.input.device_names[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);
@ -719,6 +808,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
break;
case DEVICE_PSMOVE_NAVI:
/* TODO - unfinished */
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "PS Move Navi",
sizeof(g_settings.input.device_names[port]));
keycode_lut[AKEYCODE_BUTTON_7] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
keycode_lut[AKEYCODE_BUTTON_8] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
keycode_lut[AKEYCODE_BUTTON_5] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift);
@ -732,7 +825,11 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_UNKNOWN] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
break;
case DEVICE_JXD_S7300B:
g_settings.input.device[port] = device;
g_settings.input.dpad_emulation[port] = ANALOG_DPAD_NONE;
strlcpy(g_settings.input.device_names[port], "JXD S7300B",
sizeof(g_settings.input.device_names[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);
@ -755,6 +852,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
//keycode_lut[AKEYCODE_VOLUME_DOWN] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
break;
case DEVICE_IDROID_CON:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "i.droid",
sizeof(g_settings.input.device_names[port]));
keycode_lut[AKEYCODE_BUTTON_2] |= ((RETRO_DEVICE_ID_JOYPAD_B+1) << shift);
keycode_lut[AKEYCODE_BUTTON_3] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
keycode_lut[AKEYCODE_BUTTON_1] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
@ -769,6 +870,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_12] |= ((RETRO_DEVICE_ID_JOYPAD_R3+1) << shift);
break;
case DEVICE_NYKO_PLAYPAD_PRO:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Nyko Playpad Pro",
sizeof(g_settings.input.device_names[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);
@ -785,6 +890,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_THUMBR] |= ((RETRO_DEVICE_ID_JOYPAD_R3+1) << shift);
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]));
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_X] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift);
@ -795,6 +904,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_R1] |= ((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",
sizeof(g_settings.input.device_names[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);
@ -805,8 +918,12 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_8] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
break;
case DEVICE_BUFFALO_BGC_FC801:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Buffalo BGC FC801",
sizeof(g_settings.input.device_names[port]));
dpad_state[id].dzone_min = -1.00f;
dpad_state[id].dzone_max = 1.00f;
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);
@ -817,12 +934,20 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_8] |= ((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]));
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_C] |= ((RETRO_DEVICE_ID_JOYPAD_SELECT+1) << shift);
keycode_lut[AKEYCODE_BUTTON_X] |= ((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]));
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);
@ -833,6 +958,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_X] |= ((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",
sizeof(g_settings.input.device_names[port]));
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_C] |= ((RETRO_DEVICE_ID_JOYPAD_R2+1) << shift);
@ -844,7 +973,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_L2] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
break;
case DEVICE_MAYFLASH_WII_CLASSIC:
g_settings.input.device[port] = device;
g_settings.input.dpad_emulation[port] = ANALOG_DPAD_NONE;
strlcpy(g_settings.input.device_names[port], "Mayflash Wii Classic",
sizeof(g_settings.input.device_names[port]));
keycode_lut[AKEYCODE_BUTTON_12] |= ((RETRO_DEVICE_ID_JOYPAD_UP+1) << shift);
keycode_lut[AKEYCODE_BUTTON_14] |= ((RETRO_DEVICE_ID_JOYPAD_DOWN+1) << shift);
@ -863,7 +995,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_10] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
break;
case DEVICE_SZMY_POWER_DUAL_BOX_WII:
g_settings.input.device[port] = device;
g_settings.input.dpad_emulation[port] = ANALOG_DPAD_NONE;
strlcpy(g_settings.input.device_names[port], "SZMy Power Dual Box Wii",
sizeof(g_settings.input.device_names[port]));
keycode_lut[AKEYCODE_BUTTON_13] |= ((RETRO_DEVICE_ID_JOYPAD_UP+1) << shift);
keycode_lut[AKEYCODE_BUTTON_15] |= ((RETRO_DEVICE_ID_JOYPAD_DOWN+1) << shift);
@ -882,6 +1017,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_10] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
break;
case DEVICE_TOODLES_2008_CHIMP:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Toodles 2008 Chimp",
sizeof(g_settings.input.device_names[port]));
keycode_lut[AKEYCODE_BUTTON_A] |= ((RETRO_DEVICE_ID_JOYPAD_X+1) << shift);
keycode_lut[AKEYCODE_BUTTON_X] |= ((RETRO_DEVICE_ID_JOYPAD_Y+1) << shift);
keycode_lut[AKEYCODE_BUTTON_Z] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
@ -894,6 +1033,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
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]));
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);
@ -910,6 +1053,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
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",
sizeof(g_settings.input.device_names[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);
@ -924,6 +1071,10 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_R1] |= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
break;
case DEVICE_XPERIA_PLAY:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Xperia Play",
sizeof(g_settings.input.device_names[port]));
if (zeus_id < 0)
{
RARCH_LOG("zeus_pad 1 detected: %d\n", id);
@ -957,6 +1108,9 @@ static void android_input_set_keybinds(void *data, unsigned device,
case DEVICE_BROADCOM_BLUETOOTH_HID:
if ((g_settings.input.icade_count +1) < 4)
{
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Broadcom Bluetooth HID",
sizeof(g_settings.input.device_names[port]));
g_settings.input.icade_count++;
switch(g_settings.input.icade_profile[g_settings.input.icade_count])
@ -1008,6 +1162,9 @@ static void android_input_set_keybinds(void *data, unsigned device,
}
break;
case DEVICE_THRUST_PREDATOR:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Thrust Predator",
sizeof(g_settings.input.device_names[port]));
/* TODO: L3/R3 */
keycode_lut[AKEYCODE_BUTTON_2] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
@ -1022,6 +1179,9 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_10] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
break;
case DEVICE_DRAGONRISE:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "DragonRise",
sizeof(g_settings.input.device_names[port]));
/* TODO: L3/R3 */
keycode_lut[AKEYCODE_BUTTON_2] |= ((RETRO_DEVICE_ID_JOYPAD_A+1) << shift);
@ -1034,6 +1194,9 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_8] |= ((RETRO_DEVICE_ID_JOYPAD_START+1) << shift);
break;
case DEVICE_MOGA_IME:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Moga IME",
sizeof(g_settings.input.device_names[port]));
/* TODO:
* right stick up: 188
* right stick down: 189
@ -1054,6 +1217,9 @@ static void android_input_set_keybinds(void *data, unsigned device,
keycode_lut[AKEYCODE_BUTTON_R1]|= ((RETRO_DEVICE_ID_JOYPAD_R+1) << shift);
break;
case DEVICE_CCPCREATIONS_WIIUSE_IME:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "ccpCreations WiiUse IME",
sizeof(g_settings.input.device_names[port]));
g_settings.input.dpad_emulation[port] = ANALOG_DPAD_NONE;
/* Player 1 */
@ -1158,6 +1324,9 @@ static void android_input_set_keybinds(void *data, unsigned device,
break;
case DEVICE_NONE:
default:
g_settings.input.device[port] = 0;
strlcpy(g_settings.input.device_names[port], "Unknown",
sizeof(g_settings.input.device_names[port]));
break;
}

View File

@ -21,53 +21,6 @@
#define AKEY_EVENT_NO_ACTION 255
enum {
DEVICE_NONE = 0,
DEVICE_LOGITECH_RUMBLEPAD2,
DEVICE_LOGITECH_DUAL_ACTION,
DEVICE_ICONTROLPAD_BLUEZ_IME,
DEVICE_TTT_THT_ARCADE,
DEVICE_TOMMO_NEOGEOX_ARCADE,
DEVICE_MADCATZ_PC_USB_STICK,
DEVICE_LOGICOOL_RUMBLEPAD2,
DEVICE_IDROID_X360,
DEVICE_ZEEMOTE_STEELSERIES,
DEVICE_HUIJIA_USB_SNES,
DEVICE_SUPER_SMARTJOY,
DEVICE_SAITEK_RUMBLE_P480,
DEVICE_MS_SIDEWINDER_DUAL_STRIKE,
DEVICE_MS_SIDEWINDER,
DEVICE_MS_XBOX,
DEVICE_WISEGROUP_PLAYSTATION2,
DEVICE_JCPS102_PLAYSTATION2,
DEVICE_GENERIC_PLAYSTATION2_CONVERTER,
DEVICE_PSMOVE_NAVI,
DEVICE_JXD_S7300B,
DEVICE_IDROID_CON,
DEVICE_GENIUS_MAXFIRE_G08XU,
DEVICE_USB_2_AXIS_8_BUTTON_GAMEPAD,
DEVICE_BUFFALO_BGC_FC801,
DEVICE_RETROUSB_RETROPAD,
DEVICE_RETROUSB_SNES_RETROPORT,
DEVICE_CYPRESS_USB,
DEVICE_MAYFLASH_WII_CLASSIC,
DEVICE_SZMY_POWER_DUAL_BOX_WII,
DEVICE_ARCHOS_GAMEPAD,
DEVICE_JXD_S5110,
DEVICE_XPERIA_PLAY,
DEVICE_BROADCOM_BLUETOOTH_HID,
DEVICE_THRUST_PREDATOR,
DEVICE_DRAGONRISE,
DEVICE_PLAYSTATION3_VERSION1,
DEVICE_PLAYSTATION3_VERSION2,
DEVICE_MOGA_IME,
DEVICE_NYKO_PLAYPAD_PRO,
DEVICE_TOODLES_2008_CHIMP,
DEVICE_MOGA,
DEVICE_CCPCREATIONS_WIIUSE_IME,
DEVICE_KEYBOARD_RETROPAD,
} android_input_device_enums;
enum {
ICADE_PROFILE_RED_SAMURAI = 0,
ICADE_PROFILE_IPEGA_PG9017,
@ -81,8 +34,7 @@ enum {
AKEYCODE_CTRL_RIGHT = 114,
AKEYCODE_CAPS_LOCK = 115,
AKEYCODE_SCROLL_LOCK = 116,
AKEYCODE_SYSRQ = 120,
AKEYCODE_BREAK = 121,
AKEYCODE_SYSRQ = 120, AKEYCODE_BREAK = 121,
AKEYCODE_MOVE_HOME = 122,
AKEYCODE_MOVE_END = 123,
AKEYCODE_INSERT = 124,

View File

@ -205,6 +205,67 @@ typedef struct audio_driver
#define GET_HAT_DIR(x) (x & HAT_MASK)
#define GET_HAT(x) (x & (~HAT_MASK))
enum {
#if defined(ANDROID)
DEVICE_NONE = 0,
DEVICE_LOGITECH_RUMBLEPAD2,
DEVICE_LOGITECH_DUAL_ACTION,
DEVICE_ICONTROLPAD_BLUEZ_IME,
DEVICE_TTT_THT_ARCADE,
DEVICE_TOMMO_NEOGEOX_ARCADE,
DEVICE_MADCATZ_PC_USB_STICK,
DEVICE_LOGICOOL_RUMBLEPAD2,
DEVICE_IDROID_X360,
DEVICE_ZEEMOTE_STEELSERIES,
DEVICE_HUIJIA_USB_SNES,
DEVICE_SUPER_SMARTJOY,
DEVICE_SAITEK_RUMBLE_P480,
DEVICE_MS_SIDEWINDER_DUAL_STRIKE,
DEVICE_MS_SIDEWINDER,
DEVICE_MS_XBOX,
DEVICE_WISEGROUP_PLAYSTATION2,
DEVICE_JCPS102_PLAYSTATION2,
DEVICE_GENERIC_PLAYSTATION2_CONVERTER,
DEVICE_PSMOVE_NAVI,
DEVICE_JXD_S7300B,
DEVICE_IDROID_CON,
DEVICE_GENIUS_MAXFIRE_G08XU,
DEVICE_USB_2_AXIS_8_BUTTON_GAMEPAD,
DEVICE_BUFFALO_BGC_FC801,
DEVICE_RETROUSB_RETROPAD,
DEVICE_RETROUSB_SNES_RETROPORT,
DEVICE_CYPRESS_USB,
DEVICE_MAYFLASH_WII_CLASSIC,
DEVICE_SZMY_POWER_DUAL_BOX_WII,
DEVICE_ARCHOS_GAMEPAD,
DEVICE_JXD_S5110,
DEVICE_XPERIA_PLAY,
DEVICE_BROADCOM_BLUETOOTH_HID,
DEVICE_THRUST_PREDATOR,
DEVICE_DRAGONRISE,
DEVICE_PLAYSTATION3_VERSION1,
DEVICE_PLAYSTATION3_VERSION2,
DEVICE_MOGA_IME,
DEVICE_NYKO_PLAYPAD_PRO,
DEVICE_TOODLES_2008_CHIMP,
DEVICE_MOGA,
DEVICE_CCPCREATIONS_WIIUSE_IME,
DEVICE_KEYBOARD_RETROPAD,
#elif defined(GEKKO)
DEVICE_GAMECUBE = 0,
#ifdef HW_RVL
DEVICE_WIIMOTE,
DEVICE_NUNCHUK,
DEVICE_CLASSIC,
#endif
#elif defined(_XBOX)
DEVICE_XBOX_PAD = 0,
#elif defined(__CELLOS_LV2__)
DEVICE_SIXAXIS = 0,
#endif
DEVICE_LAST
} device_enums;
enum analog_dpad_bind_enums
{
ANALOG_DPAD_NONE = 0,

View File

@ -125,13 +125,6 @@ unsigned rgui_gx_resolutions[GX_RESOLUTIONS_LAST][2] = {
};
unsigned rgui_current_gx_resolution = GX_RESOLUTIONS_640_480;
static const char *rgui_device_labels[] = {
"GameCube Controller",
"Wiimote",
"Wiimote + Nunchuk",
"Classic Controller",
};
#endif
unsigned RGUI_WIDTH = 320;
@ -423,9 +416,7 @@ static void render_text(rgui_handle_t *rgui)
char message[256];
char type_str[256];
int w = rgui_is_controller_menu(menu_type) ? 26 : 19;
#ifdef RARCH_CONSOLE
unsigned port = menu_type - RGUI_SETTINGS_CONTROLLER_1;
#endif
switch (type)
{
case RGUI_FILE_PLAIN:
@ -507,12 +498,9 @@ static void render_text(rgui_handle_t *rgui)
case RGUI_SETTINGS_CONTROLLER_4:
snprintf(type_str, sizeof(type_str), "...");
break;
#ifdef GEKKO
case RGUI_SETTINGS_BIND_DEVICE:
snprintf(type_str, sizeof(type_str), "%s", rgui_device_labels[g_settings.input.device[port]]);
snprintf(type_str, sizeof(type_str), g_settings.input.device_names[port]);
break;
#endif
#ifdef RARCH_CONSOLE
case RGUI_SETTINGS_BIND_DPAD_EMULATION:
switch(g_settings.input.dpad_emulation[port])
{
@ -555,7 +543,6 @@ static void render_text(rgui_handle_t *rgui)
strlcpy(type_str, key_label.desc, sizeof(type_str));
}
break;
#endif
default:
type_str[0] = 0;
w = 0;
@ -610,9 +597,7 @@ static void render_text(rgui_handle_t *rgui)
static int rgui_settings_toggle_setting(unsigned setting, rgui_action_t action, unsigned menu_type)
{
#ifdef RARCH_CONSOLE
unsigned port = menu_type - RGUI_SETTINGS_CONTROLLER_1;
#endif
unsigned port = menu_type - RGUI_SETTINGS_CONTROLLER_1;
switch (setting)
{
@ -899,16 +884,15 @@ static int rgui_settings_toggle_setting(unsigned setting, rgui_action_t action,
}
break;
// controllers
#ifdef GEKKO
case RGUI_SETTINGS_BIND_DEVICE:
g_settings.input.device[port] += RARCH_DEVICE_LAST;
g_settings.input.device[port] += DEVICE_LAST;
if (action == RGUI_ACTION_START)
g_settings.input.device[port] = 0;
else if (action == RGUI_ACTION_LEFT)
g_settings.input.device[port]--;
else if (action == RGUI_ACTION_RIGHT)
g_settings.input.device[port]++;
g_settings.input.device[port] %= RARCH_DEVICE_LAST;
g_settings.input.device[port] %= DEVICE_LAST;
if (driver.input->set_keybinds)
{
unsigned keybind_action = (1ULL << KEYBINDS_ACTION_SET_DEFAULT_BINDS);
@ -932,8 +916,6 @@ static int rgui_settings_toggle_setting(unsigned setting, rgui_action_t action,
keybind_action);
}
break;
#endif
#ifdef RARCH_CONSOLE
case RGUI_SETTINGS_BIND_DPAD_EMULATION:
g_settings.input.dpad_emulation[port] += ANALOG_DPAD_LAST;
if (action == RGUI_ACTION_START)
@ -999,7 +981,6 @@ static int rgui_settings_toggle_setting(unsigned setting, rgui_action_t action,
driver.input->set_keybinds(driver.input_data, g_settings.input.device[setting - RGUI_SETTINGS_BIND_UP], port,
rgui_controller_lut[setting - RGUI_SETTINGS_BIND_UP], keybind_action);
}
#endif
default:
break;
}
@ -1044,12 +1025,10 @@ static void rgui_settings_populate_entries(rgui_handle_t *rgui)
#ifdef HAVE_LIBRETRO_MANAGEMENT
rgui_list_push(rgui->selection_buf, "Core", RGUI_SETTINGS_CORE, 0);
#endif
#ifdef GEKKO
rgui_list_push(rgui->selection_buf, "Controller #1 Config", RGUI_SETTINGS_CONTROLLER_1, 0);
rgui_list_push(rgui->selection_buf, "Controller #2 Config", RGUI_SETTINGS_CONTROLLER_2, 0);
rgui_list_push(rgui->selection_buf, "Controller #3 Config", RGUI_SETTINGS_CONTROLLER_3, 0);
rgui_list_push(rgui->selection_buf, "Controller #4 Config", RGUI_SETTINGS_CONTROLLER_4, 0);
#endif
rgui_list_push(rgui->selection_buf, "Debug Text", RGUI_SETTINGS_DEBUG_TEXT, 0);
#ifndef HAVE_DYNAMIC
rgui_list_push(rgui->selection_buf, "Restart RetroArch", RGUI_SETTINGS_RESTART_EMULATOR, 0);
@ -1059,7 +1038,6 @@ static void rgui_settings_populate_entries(rgui_handle_t *rgui)
static void rgui_settings_controller_populate_entries(rgui_handle_t *rgui)
{
#ifdef RARCH_CONSOLE
rgui_list_clear(rgui->selection_buf);
rgui_list_push(rgui->selection_buf, "Device", RGUI_SETTINGS_BIND_DEVICE, 0);
@ -1080,7 +1058,6 @@ static void rgui_settings_controller_populate_entries(rgui_handle_t *rgui)
rgui_list_push(rgui->selection_buf, "R2", RGUI_SETTINGS_BIND_R2, 0);
rgui_list_push(rgui->selection_buf, "L3", RGUI_SETTINGS_BIND_L3, 0);
rgui_list_push(rgui->selection_buf, "R3", RGUI_SETTINGS_BIND_R3, 0);
#endif
}
static int rgui_viewport_iterate(rgui_handle_t *rgui, rgui_action_t action)

View File

@ -231,10 +231,11 @@ struct settings
float axis_threshold;
int joypad_map[MAX_PLAYERS];
unsigned device[MAX_PLAYERS];
char device_names[MAX_PLAYERS][64];
unsigned dpad_emulation[MAX_PLAYERS];
bool debug_enable;
#ifdef ANDROID
bool autodetect_enable;
#ifdef ANDROID
unsigned back_behavior;
unsigned icade_profile[MAX_PLAYERS];
unsigned icade_count;

View File

@ -219,7 +219,9 @@ static void gx_input_set_keybinds(void *data, unsigned device, unsigned port,
switch (device)
{
#ifdef HW_RVL
case GX_DEVICE_WIIMOTE:
case DEVICE_WIIMOTE:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Wiimote", sizeof(g_settings.input.device_names[port]));
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_B].def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_1].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_Y].def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_A].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_SELECT].def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_MINUS].joykey;
@ -237,7 +239,9 @@ static void gx_input_set_keybinds(void *data, unsigned device, unsigned port,
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_L3].def_joykey = NO_BTN;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_R3].def_joykey = NO_BTN;
break;
case GX_DEVICE_NUNCHUK:
case DEVICE_NUNCHUK:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Wiimote + Nunchuk", sizeof(g_settings.input.device_names[port]));
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_B].def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_B].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_Y].def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_2].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_SELECT].def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_MINUS].joykey;
@ -254,7 +258,9 @@ static void gx_input_set_keybinds(void *data, unsigned device, unsigned port,
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_R2].def_joykey = NO_BTN;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_L3].def_joykey = NO_BTN;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_R3].def_joykey = NO_BTN; break;
case GX_DEVICE_CLASSIC:
case DEVICE_CLASSIC:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Classic Controller", sizeof(g_settings.input.device_names[port]));
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_B].def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_B].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_Y].def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_Y].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_SELECT].def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_MINUS].joykey;
@ -273,7 +279,9 @@ static void gx_input_set_keybinds(void *data, unsigned device, unsigned port,
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_R3].def_joykey = NO_BTN;
break;
#endif
case GX_DEVICE_GAMECUBE:
case DEVICE_GAMECUBE:
g_settings.input.device[port] = device;
strlcpy(g_settings.input.device_names[port], "Gamecube Controller", sizeof(g_settings.input.device_names[port]));
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_B].def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_B].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_Y].def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_Y].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_SELECT].def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_Z_TRIGGER].joykey;
@ -308,26 +316,26 @@ static void gx_input_set_keybinds(void *data, unsigned device, unsigned port,
switch (device)
{
#ifdef HW_RVL
case GX_DEVICE_WIIMOTE:
case DEVICE_WIIMOTE:
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_UP].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_DOWN].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_LEFT].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_RIGHT].joykey;
break;
case GX_DEVICE_NUNCHUK:
case DEVICE_NUNCHUK:
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_LSTICK_UP_DPAD].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_LSTICK_DOWN_DPAD].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_LSTICK_LEFT_DPAD].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_LSTICK_RIGHT_DPAD].joykey;
break;
case GX_DEVICE_CLASSIC:
case DEVICE_CLASSIC:
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[GX_DEVICE_CLASSIC_ID_RSTICK_UP_DPAD].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[GX_DEVICE_CLASSIC_ID_RSTICK_DOWN_DPAD].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[GX_DEVICE_CLASSIC_ID_RSTICK_LEFT_DPAD].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[GX_DEVICE_CLASSIC_ID_RSTICK_RIGHT_DPAD].joykey;
break;
#endif
case GX_DEVICE_GAMECUBE:
case DEVICE_GAMECUBE:
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[GX_DEVICE_GC_ID_RSTICK_UP_DPAD].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[GX_DEVICE_GC_ID_RSTICK_DOWN_DPAD].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[GX_DEVICE_GC_ID_RSTICK_LEFT_DPAD].joykey;
@ -343,26 +351,26 @@ static void gx_input_set_keybinds(void *data, unsigned device, unsigned port,
switch (device)
{
#ifdef HW_RVL
case GX_DEVICE_WIIMOTE:
case DEVICE_WIIMOTE:
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_UP].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_DOWN].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_LEFT].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_RIGHT].joykey;
break;
case GX_DEVICE_NUNCHUK:
case DEVICE_NUNCHUK:
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_LSTICK_UP_DPAD].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_LSTICK_DOWN_DPAD].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_LSTICK_LEFT_DPAD].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_LSTICK_RIGHT_DPAD].joykey;
break;
case GX_DEVICE_CLASSIC:
case DEVICE_CLASSIC:
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[GX_DEVICE_CLASSIC_ID_LSTICK_UP_DPAD].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[GX_DEVICE_CLASSIC_ID_LSTICK_DOWN_DPAD].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[GX_DEVICE_CLASSIC_ID_LSTICK_LEFT_DPAD].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[GX_DEVICE_CLASSIC_ID_LSTICK_RIGHT_DPAD].joykey;
break;
#endif
case GX_DEVICE_GAMECUBE:
case DEVICE_GAMECUBE:
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[GX_DEVICE_GC_ID_LSTICK_UP_DPAD].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[GX_DEVICE_GC_ID_LSTICK_DOWN_DPAD].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[GX_DEVICE_GC_ID_LSTICK_LEFT_DPAD].joykey;
@ -378,26 +386,26 @@ static void gx_input_set_keybinds(void *data, unsigned device, unsigned port,
switch (device)
{
#ifdef HW_RVL
case GX_DEVICE_WIIMOTE:
case DEVICE_WIIMOTE:
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_UP].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_DOWN].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_LEFT].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_RIGHT].joykey;
break;
case GX_DEVICE_NUNCHUK:
case DEVICE_NUNCHUK:
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_UP].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_DOWN].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_LEFT].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_RIGHT].joykey;
break;
case GX_DEVICE_CLASSIC:
case DEVICE_CLASSIC:
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_UP].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_DOWN].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_LEFT].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_RIGHT].joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_RIGHT].joykey;
break;
#endif
case GX_DEVICE_GAMECUBE:
case DEVICE_GAMECUBE:
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_UP].joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_UP].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_DOWN].joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_DOWN].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_LEFT].joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_LEFT].joykey;
@ -470,6 +478,7 @@ static void *gx_input_init(void)
keybind_action);
}
return (void*)-1;
}

View File

@ -178,16 +178,4 @@ enum gx_device_id
RARCH_LAST_PLATFORM_KEY
};
enum
{
GX_DEVICE_GAMECUBE = 0,
#ifdef HW_RVL
GX_DEVICE_WIIMOTE,
GX_DEVICE_NUNCHUK,
GX_DEVICE_CLASSIC,
#endif
RARCH_DEVICE_LAST
};
#endif