From f028a8555ec000a5dd5e9dcb65a6b728b5f57362 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 16 Mar 2013 17:51:37 +0100 Subject: [PATCH] Revert "Move set_keybinds autoconfiguration (that is done on every console" This reverts commit c26653fca83af90fc14bd2fca0324bfaf1a1156f. --- driver.c | 32 -------------------------------- gx/gx_input.c | 31 +++++++++++++++++++++++++++++++ ps3/ps3_input.c | 30 ++++++++++++++++++++++++++++++ psp/psp_input.c | 30 ++++++++++++++++++++++++++++++ xdk/xdk_xinput_input.c | 30 ++++++++++++++++++++++++++++++ 5 files changed, 121 insertions(+), 32 deletions(-) diff --git a/driver.c b/driver.c index 52ba2ccb6f..91b3e90fb1 100644 --- a/driver.c +++ b/driver.c @@ -895,44 +895,12 @@ void init_video_input(void) RARCH_ERR("Cannot init input driver. Exiting ...\n"); rarch_fail(1, "init_video_input()"); } - } else { RARCH_ERR("Cannot find input driver. Exiting ...\n"); rarch_fail(1, "init_video_input()"); } - - if (driver.input != NULL) - { - for(unsigned i = 0; i < MAX_PLAYERS; i++) - { - unsigned action = 0; - - if (driver.input->set_keybinds) - action |= (1ULL << KEYBINDS_ACTION_SET_DEFAULT_BINDS); - - switch (g_settings.input.dpad_emulation[i]) - { - case ANALOG_DPAD_LSTICK: - action |= (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_LSTICK); - break; - case ANALOG_DPAD_RSTICK: - action |= (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_RSTICK); - break; - case ANALOG_DPAD_NONE: - action |= (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_NONE); - break; - default: - break; - } - - if (action) - if (driver.input->set_keybinds) - driver.input->set_keybinds(driver.input_data, 0, i, 0, - action); - } - } } #ifdef HAVE_OVERLAY diff --git a/gx/gx_input.c b/gx/gx_input.c index 1075c4c801..34a8a531e9 100644 --- a/gx/gx_input.c +++ b/gx/gx_input.c @@ -446,6 +446,37 @@ static void *gx_input_init(void) SYS_SetPowerCallback(power_callback); #endif + for(unsigned i = 0; i < MAX_PLAYERS; i++) + if (driver.input->set_keybinds) + driver.input->set_keybinds(driver.input_data, 0, i, 0, + (1ULL << KEYBINDS_ACTION_SET_DEFAULT_BINDS)); + + for(unsigned i = 0; i < MAX_PLAYERS; i++) + { + unsigned keybind_action = 0; + + switch (g_settings.input.dpad_emulation[i]) + { + case ANALOG_DPAD_LSTICK: + keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_LSTICK); + break; + case ANALOG_DPAD_RSTICK: + keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_RSTICK); + break; + case ANALOG_DPAD_NONE: + keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_NONE); + break; + default: + break; + } + + if (keybind_action) + if (driver.input->set_keybinds) + driver.input->set_keybinds(driver.input_data, 0, i, 0, + keybind_action); + } + + return (void*)-1; } diff --git a/ps3/ps3_input.c b/ps3/ps3_input.c index 23d3c7ef58..9eb2e26714 100644 --- a/ps3/ps3_input.c +++ b/ps3/ps3_input.c @@ -513,6 +513,36 @@ static void* ps3_input_init(void) cellMouseInit(MAX_MICE); #endif + for(unsigned i = 0; i < MAX_PLAYERS; i++) + if (driver.input->set_keybinds) + driver.input->set_keybinds(driver.input_data, 0, i, 0, + (1ULL << KEYBINDS_ACTION_SET_DEFAULT_BINDS)); + + for(unsigned i = 0; i < MAX_PLAYERS; i++) + { + unsigned keybind_action = 0; + + switch (g_settings.input.dpad_emulation[i]) + { + case ANALOG_DPAD_LSTICK: + keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_LSTICK); + break; + case ANALOG_DPAD_RSTICK: + keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_RSTICK); + break; + case ANALOG_DPAD_NONE: + keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_NONE); + break; + default: + break; + } + + if (keybind_action) + if (driver.input->set_keybinds) + driver.input->set_keybinds(driver.input_data, 0, i, 0, + keybind_action); + } + return (void*)-1; } diff --git a/psp/psp_input.c b/psp/psp_input.c index 96020ab347..319c8da520 100644 --- a/psp/psp_input.c +++ b/psp/psp_input.c @@ -167,6 +167,36 @@ static void* psp_input_initialize(void) #endif sceCtrlSetSamplingMode(DEFAULT_SAMPLING_MODE); + for(unsigned i = 0; i < MAX_PLAYERS; i++) + if (driver.input->set_keybinds) + driver.input->set_keybinds(driver.input_data, 0, i, 0, + (1ULL << KEYBINDS_ACTION_SET_DEFAULT_BINDS)); + + for(unsigned i = 0; i < MAX_PLAYERS; i++) + { + unsigned keybind_action = 0; + + switch (g_settings.input.dpad_emulation[i]) + { + case ANALOG_DPAD_LSTICK: + keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_LSTICK); + break; + case ANALOG_DPAD_RSTICK: + keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_RSTICK); + break; + case ANALOG_DPAD_NONE: + keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_NONE); + break; + default: + break; + } + + if (keybind_action) + if (driver.input->set_keybinds) + driver.input->set_keybinds(driver.input_data, 0, i, 0, + action); + } + return (void*)-1; } diff --git a/xdk/xdk_xinput_input.c b/xdk/xdk_xinput_input.c index 169e80932d..a31c6478a8 100644 --- a/xdk/xdk_xinput_input.c +++ b/xdk/xdk_xinput_input.c @@ -399,6 +399,36 @@ static void *xdk_input_init(void) while(XGetDeviceEnumerationStatus() == XDEVICE_ENUMERATION_BUSY) {} #endif + for(unsigned i = 0; i < MAX_PLAYERS; i++) + if (driver.input->set_keybinds) + driver.input->set_keybinds(driver.input_data, 0, i, 0, + (1ULL << KEYBINDS_ACTION_SET_DEFAULT_BINDS)); + + for(unsigned i = 0; i < MAX_PLAYERS; i++) + { + unsigned keybind_action = 0; + + switch (g_settings.input.dpad_emulation[i]) + { + case ANALOG_DPAD_LSTICK: + keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_LSTICK); + break; + case ANALOG_DPAD_RSTICK: + keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_RSTICK); + break; + case ANALOG_DPAD_NONE: + keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_NONE); + break; + default: + break; + } + + if (keybind_action) + if (driver.input->set_keybinds) + driver.input->set_keybinds(driver.input_data, 0, i, 0, + keybind_action); + } + return (void*)-1; }