(PSP) Fix default joykey binds

This commit is contained in:
twinaphex 2014-02-16 15:42:02 +01:00
parent 896cc6a375
commit ff149257e4
2 changed files with 33 additions and 30 deletions

View File

@ -532,35 +532,35 @@ static const bool input_autodetect_enable = true;
#ifndef IS_SALAMANDER
#if defined(__CELLOS_LV2__)
#define RETRO_DEF_JOYPAD_B (1ULL << RETRO_DEVICE_ID_JOYPAD_B)
#define RETRO_DEF_JOYPAD_Y (1ULL << RETRO_DEVICE_ID_JOYPAD_Y)
#define RETRO_DEF_JOYPAD_SELECT (1ULL << RETRO_DEVICE_ID_JOYPAD_SELECT)
#define RETRO_DEF_JOYPAD_START (1ULL << RETRO_DEVICE_ID_JOYPAD_START)
#define RETRO_DEF_JOYPAD_UP (1ULL << RETRO_DEVICE_ID_JOYPAD_UP)
#define RETRO_DEF_JOYPAD_DOWN (1ULL << RETRO_DEVICE_ID_JOYPAD_DOWN)
#define RETRO_DEF_JOYPAD_LEFT (1ULL << RETRO_DEVICE_ID_JOYPAD_LEFT)
#define RETRO_DEF_JOYPAD_RIGHT (1ULL << RETRO_DEVICE_ID_JOYPAD_RIGHT)
#define RETRO_DEF_JOYPAD_A (1ULL << RETRO_DEVICE_ID_JOYPAD_A)
#define RETRO_DEF_JOYPAD_X (1ULL << RETRO_DEVICE_ID_JOYPAD_X)
#define RETRO_DEF_JOYPAD_L (1ULL << RETRO_DEVICE_ID_JOYPAD_L)
#define RETRO_DEF_JOYPAD_R (1ULL << RETRO_DEVICE_ID_JOYPAD_R)
#define RETRO_DEF_JOYPAD_L2 (1ULL << RETRO_DEVICE_ID_JOYPAD_L2)
#define RETRO_DEF_JOYPAD_R2 (1ULL << RETRO_DEVICE_ID_JOYPAD_R2)
#define RETRO_DEF_JOYPAD_L3 (1ULL << RETRO_DEVICE_ID_JOYPAD_L3)
#define RETRO_DEF_JOYPAD_R3 (1ULL << RETRO_DEVICE_ID_JOYPAD_R3)
#define RETRO_DEF_JOYPAD_B RETRO_DEVICE_ID_JOYPAD_B
#define RETRO_DEF_JOYPAD_Y RETRO_DEVICE_ID_JOYPAD_Y
#define RETRO_DEF_JOYPAD_SELECT RETRO_DEVICE_ID_JOYPAD_SELECT
#define RETRO_DEF_JOYPAD_START RETRO_DEVICE_ID_JOYPAD_START
#define RETRO_DEF_JOYPAD_UP RETRO_DEVICE_ID_JOYPAD_UP
#define RETRO_DEF_JOYPAD_DOWN RETRO_DEVICE_ID_JOYPAD_DOWN
#define RETRO_DEF_JOYPAD_LEFT RETRO_DEVICE_ID_JOYPAD_LEFT
#define RETRO_DEF_JOYPAD_RIGHT RETRO_DEVICE_ID_JOYPAD_RIGHT
#define RETRO_DEF_JOYPAD_A RETRO_DEVICE_ID_JOYPAD_A
#define RETRO_DEF_JOYPAD_X RETRO_DEVICE_ID_JOYPAD_X
#define RETRO_DEF_JOYPAD_L RETRO_DEVICE_ID_JOYPAD_L
#define RETRO_DEF_JOYPAD_R RETRO_DEVICE_ID_JOYPAD_R
#define RETRO_DEF_JOYPAD_L2 RETRO_DEVICE_ID_JOYPAD_L2
#define RETRO_DEF_JOYPAD_R2 RETRO_DEVICE_ID_JOYPAD_R2
#define RETRO_DEF_JOYPAD_L3 RETRO_DEVICE_ID_JOYPAD_L3
#define RETRO_DEF_JOYPAD_R3 RETRO_DEVICE_ID_JOYPAD_R3
#elif defined(PSP)
#define RETRO_DEF_JOYPAD_B (1ULL << RETRO_DEVICE_ID_JOYPAD_B)
#define RETRO_DEF_JOYPAD_Y (1ULL << RETRO_DEVICE_ID_JOYPAD_Y)
#define RETRO_DEF_JOYPAD_SELECT (1ULL << RETRO_DEVICE_ID_JOYPAD_SELECT)
#define RETRO_DEF_JOYPAD_START (1ULL << RETRO_DEVICE_ID_JOYPAD_START)
#define RETRO_DEF_JOYPAD_UP (1ULL << RETRO_DEVICE_ID_JOYPAD_UP)
#define RETRO_DEF_JOYPAD_DOWN (1ULL << RETRO_DEVICE_ID_JOYPAD_DOWN)
#define RETRO_DEF_JOYPAD_LEFT (1ULL << RETRO_DEVICE_ID_JOYPAD_LEFT)
#define RETRO_DEF_JOYPAD_RIGHT (1ULL << RETRO_DEVICE_ID_JOYPAD_RIGHT)
#define RETRO_DEF_JOYPAD_A (1ULL << RETRO_DEVICE_ID_JOYPAD_A)
#define RETRO_DEF_JOYPAD_X (1ULL << RETRO_DEVICE_ID_JOYPAD_X)
#define RETRO_DEF_JOYPAD_L (1ULL << RETRO_DEVICE_ID_JOYPAD_L)
#define RETRO_DEF_JOYPAD_R (1ULL << RETRO_DEVICE_ID_JOYPAD_R)
#define RETRO_DEF_JOYPAD_B RETRO_DEVICE_ID_JOYPAD_B
#define RETRO_DEF_JOYPAD_Y RETRO_DEVICE_ID_JOYPAD_Y
#define RETRO_DEF_JOYPAD_SELECT RETRO_DEVICE_ID_JOYPAD_SELECT
#define RETRO_DEF_JOYPAD_START RETRO_DEVICE_ID_JOYPAD_START
#define RETRO_DEF_JOYPAD_UP RETRO_DEVICE_ID_JOYPAD_UP
#define RETRO_DEF_JOYPAD_DOWN RETRO_DEVICE_ID_JOYPAD_DOWN
#define RETRO_DEF_JOYPAD_LEFT RETRO_DEVICE_ID_JOYPAD_LEFT
#define RETRO_DEF_JOYPAD_RIGHT RETRO_DEVICE_ID_JOYPAD_RIGHT
#define RETRO_DEF_JOYPAD_A RETRO_DEVICE_ID_JOYPAD_A
#define RETRO_DEF_JOYPAD_X RETRO_DEVICE_ID_JOYPAD_X
#define RETRO_DEF_JOYPAD_L RETRO_DEVICE_ID_JOYPAD_L
#define RETRO_DEF_JOYPAD_R RETRO_DEVICE_ID_JOYPAD_R
#define RETRO_DEF_JOYPAD_L2 NO_BTN
#define RETRO_DEF_JOYPAD_R2 NO_BTN
#define RETRO_DEF_JOYPAD_L3 NO_BTN

View File

@ -83,6 +83,9 @@ typedef struct psp_input
int16_t analog_state[1][2][2];
} psp_input_t;
static void psp_input_set_keybinds(void *data, unsigned device, unsigned port,
unsigned id, unsigned keybind_action);
static void psp_input_poll(void *data)
{
SceCtrlData state_tmp;
@ -122,8 +125,8 @@ static void psp_input_poll(void *data)
#endif
if (g_settings.input.autodetect_enable)
{
if (strcmp(g_settings.input.device_names[port], "PSP") != 0)
psp_input_set_keybinds(NULL, DEVICE_PSP, port, 0, (1ULL << KEYBINDS_ACTION_SET_DEFAULT_BINDS));
if (strcmp(g_settings.input.device_names[0], "PSP") != 0)
psp_input_set_keybinds(NULL, DEVICE_PSP, 0, 0, (1ULL << KEYBINDS_ACTION_SET_DEFAULT_BINDS));
}
}