Remove rarch_input_set_default_keybinds - merge with function

pointer set_default_keybind_lut
This commit is contained in:
twinaphex 2013-03-13 16:06:13 +01:00
parent 8f5a49dc7e
commit 4bd0999940
11 changed files with 105 additions and 106 deletions

View File

@ -100,20 +100,10 @@ void rarch_input_set_keybind(unsigned player, unsigned keybind_action, uint64_t
break;
case KEYBIND_DEFAULT:
*key = g_settings.input.binds[default_retro_joypad_id]->def_joykey;
*key = g_settings.input.binds[player][default_retro_joypad_id].def_joykey;
break;
default:
break;
}
}
void rarch_input_set_default_keybinds(unsigned player)
{
for (unsigned i = 0; i < RARCH_CUSTOM_BIND_LIST_END; i++)
{
g_settings.input.binds[player][i].id = i;
g_settings.input.binds[player][i].joykey = g_settings.input.binds[i]->def_joykey;
}
g_settings.input.dpad_emulation[player] = DPAD_EMULATION_LSTICK;
}

View File

@ -28,7 +28,6 @@ enum keybind_set_id
};
const char *rarch_input_find_platform_key_label(uint64_t joykey);
void rarch_input_set_default_keybinds(unsigned player);
void rarch_input_set_keybind(unsigned player, unsigned keybind_action, uint64_t default_retro_joypad_id);
#endif

View File

@ -900,7 +900,6 @@ static int rgui_settings_toggle_setting(unsigned setting, rgui_action_t action,
g_settings.input.device[port]++;
g_settings.input.device[port] %= RARCH_DEVICE_LAST;
driver.input->set_default_keybind_lut(g_settings.input.device[port], port);
rarch_input_set_default_keybinds(port);
driver.input->set_analog_dpad_mapping(g_settings.input.device[port], g_settings.input.dpad_emulation[port], port);
break;
#endif

View File

@ -2041,7 +2041,7 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
#endif
case SETTING_CONTROLS_DEFAULT_ALL:
if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)) || (input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)) || (input & (1ULL << RMENU_DEVICE_NAV_START)))
rarch_input_set_default_keybinds(currently_selected_controller_menu);
driver.input->set_default_keybind_lut(g_settings.input.device[currently_selected_controller_menu], currently_selected_controller_menu);
break;
}

View File

@ -534,7 +534,7 @@ HRESULT CRetroArchControls::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
case SETTING_CONTROLS_DPAD_EMULATION:
break;
case SETTING_CONTROLS_DEFAULT_ALL:
rarch_input_set_default_keybinds(0);
driver.input->set_default_keybind_lut(g_settings.input.device[controlno], controlno);
for(i = 0; i < RARCH_FIRST_META_KEY; i++)
{

View File

@ -238,6 +238,7 @@ struct settings
struct retro_keybind binds[MAX_PLAYERS][RARCH_BIND_LIST_END];
float axis_threshold;
int joypad_map[MAX_PLAYERS];
unsigned device[MAX_PLAYERS];
unsigned dpad_emulation[MAX_PLAYERS];
bool debug_enable;
#ifdef ANDROID
@ -245,9 +246,6 @@ struct settings
unsigned back_behavior;
unsigned icade_profile[MAX_PLAYERS];
unsigned icade_count;
#endif
#ifdef RARCH_CONSOLE
unsigned device[MAX_PLAYERS];
#endif
bool netplay_client_swap_input;

View File

@ -244,87 +244,91 @@ static void gx_input_set_analog_dpad_mapping(unsigned device, unsigned map_dpad_
static void gx_set_default_keybind_lut(unsigned device, unsigned port)
{
(void)port;
switch (device)
{
#ifdef HW_RVL
case GX_DEVICE_WIIMOTE:
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_B]->def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_1].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_Y]->def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_A].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_SELECT]->def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_MINUS].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_START]->def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_PLUS].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_UP]->def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_UP].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_DOWN]->def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_DOWN].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_LEFT]->def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_LEFT].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_RIGHT]->def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_RIGHT].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_A]->def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_2].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_X]->def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_B].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_L]->def_joykey = NO_BTN;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_R]->def_joykey = NO_BTN;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_L2]->def_joykey = NO_BTN;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_R2]->def_joykey = NO_BTN;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_L3]->def_joykey = NO_BTN;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_R3]->def_joykey = NO_BTN;
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;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_START].def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_PLUS].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_UP].def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_UP].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_DOWN].def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_DOWN].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_LEFT].def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_LEFT].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_RIGHT].def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_RIGHT].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_A].def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_2].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_X].def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_B].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_L].def_joykey = NO_BTN;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_R].def_joykey = NO_BTN;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_L2].def_joykey = NO_BTN;
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_NUNCHUK:
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_B]->def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_B].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_Y]->def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_2].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_SELECT]->def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_MINUS].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_START]->def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_PLUS].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_UP]->def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_UP].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_DOWN]->def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_DOWN].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_LEFT]->def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_LEFT].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_RIGHT]->def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_RIGHT].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_A]->def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_A].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_X]->def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_1].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_L]->def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_Z].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_R]->def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_C].joykey;;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_L2]->def_joykey = NO_BTN;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_R2]->def_joykey = NO_BTN;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_L3]->def_joykey = NO_BTN;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_R3]->def_joykey = NO_BTN;
break;
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;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_START].def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_PLUS].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_UP].def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_UP].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_DOWN].def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_DOWN].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_LEFT].def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_LEFT].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_RIGHT].def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_RIGHT].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_A].def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_A].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_X].def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_1].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_L].def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_Z].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_R].def_joykey = platform_keys[GX_DEVICE_WIIMOTE_ID_JOYPAD_C].joykey;;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_L2].def_joykey = NO_BTN;
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:
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_B]->def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_B].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_Y]->def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_Y].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_SELECT]->def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_MINUS].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_START]->def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_PLUS].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_UP]->def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_UP].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_DOWN]->def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_DOWN].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_LEFT]->def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_LEFT].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_RIGHT]->def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_RIGHT].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_A]->def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_A].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_X]->def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_X].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_L]->def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_L_TRIGGER].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_R]->def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_R_TRIGGER].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_L2]->def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_ZL_TRIGGER].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_R2]->def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_ZR_TRIGGER].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_L3]->def_joykey = NO_BTN;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_R3]->def_joykey = NO_BTN;
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;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_START].def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_PLUS].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_UP].def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_UP].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_DOWN].def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_DOWN].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_LEFT].def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_LEFT].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_RIGHT].def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_RIGHT].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_A].def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_A].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_X].def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_X].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_L].def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_L_TRIGGER].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_R].def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_R_TRIGGER].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_L2].def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_ZL_TRIGGER].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_R2].def_joykey = platform_keys[GX_DEVICE_CLASSIC_ID_JOYPAD_ZR_TRIGGER].joykey;
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;
#endif
case GX_DEVICE_GAMECUBE:
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_B]->def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_B].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_Y]->def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_Y].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_SELECT]->def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_Z_TRIGGER].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_START]->def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_START].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_UP]->def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_UP].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_DOWN]->def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_DOWN].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_LEFT]->def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_LEFT].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_RIGHT]->def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_RIGHT].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_A]->def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_A].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_X]->def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_X].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_L]->def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_L_TRIGGER].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_R]->def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_R_TRIGGER].joykey;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_L2]->def_joykey = NO_BTN;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_R2]->def_joykey = NO_BTN;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_L3]->def_joykey = NO_BTN;
g_settings.input.binds[RETRO_DEVICE_ID_JOYPAD_R3]->def_joykey = NO_BTN;
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;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_START].def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_START].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_UP].def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_UP].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_DOWN].def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_DOWN].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_LEFT].def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_LEFT].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_RIGHT].def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_RIGHT].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_A].def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_A].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_X].def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_X].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_L].def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_L_TRIGGER].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_R].def_joykey = platform_keys[GX_DEVICE_GC_ID_JOYPAD_R_TRIGGER].joykey;
g_settings.input.binds[port][RETRO_DEVICE_ID_JOYPAD_L2].def_joykey = NO_BTN;
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;
default:
break;
}
for (unsigned i = 0; i < RARCH_CUSTOM_BIND_LIST_END; i++)
{
g_settings.input.binds[port][i].id = i;
g_settings.input.binds[port][i].joykey = g_settings.input.binds[port][i].def_joykey;
}
g_settings.input.dpad_emulation[port] = DPAD_EMULATION_LSTICK;
}
static void *gx_input_init(void)
@ -339,10 +343,7 @@ static void *gx_input_init(void)
#endif
for(unsigned i = 0; i < MAX_PLAYERS; i++)
{
gx_set_default_keybind_lut(0, i);
rarch_input_set_default_keybinds(i);
}
for(unsigned i = 0; i < MAX_PADS; i++)
gx_input_set_analog_dpad_mapping(g_settings.input.device[i], g_settings.input.dpad_emulation[i], i);

View File

@ -430,10 +430,15 @@ static void ps3_input_free_input(void *data)
static void ps3_set_default_keybind_lut(unsigned device, unsigned port)
{
(void)device;
(void)port;
for (int i = 0; i < RARCH_CUSTOM_BIND_LIST_END; i++)
g_settings.input.binds[i]->def_joykey = platform_keys[i].joykey;
{
g_settings.input.binds[port][i].id = i;
g_settings.input.binds[port][i].def_joykey = platform_keys[i].joykey;
g_settings.input.binds[port][i].joykey = g_settings.input.binds[port][i].def_joykey;
}
g_settings.input.dpad_emulation[port] = DPAD_EMULATION_LSTICK;
}
static void* ps3_input_init(void)
@ -444,10 +449,7 @@ static void* ps3_input_init(void)
#endif
for(unsigned i = 0; i < MAX_PLAYERS; i++)
{
ps3_set_default_keybind_lut(0, i);
rarch_input_set_default_keybinds(i);
}
for (unsigned i = 0; i < MAX_PADS; i++)
ps3_input_set_analog_dpad_mapping(0, g_settings.input.dpad_emulation[i], i);

View File

@ -154,7 +154,13 @@ static void psp_free_input(void *data)
static void psp_set_default_keybind_lut(unsigned device, unsigned port)
{
(void)device;
(void)port;
for (unsigned i = 0; i < RARCH_CUSTOM_BIND_LIST_END; i++)
{
g_settings.input.binds[port][i].id = i;
g_settings.input.binds[port][i].joykey = g_settings.input.binds[port][i].def_joykey;
}
g_settings.input.dpad_emulation[port] = DPAD_EMULATION_LSTICK;
}
static void* psp_input_initialize(void)
@ -165,10 +171,8 @@ static void* psp_input_initialize(void)
sceCtrlSetSamplingMode(DEFAULT_SAMPLING_MODE);
for(unsigned i = 0; i < MAX_PLAYERS; i++)
{
psp_set_default_keybind_lut(0, i);
rarch_input_set_default_keybinds(i);
}
return (void*)-1;
}

View File

@ -272,10 +272,15 @@ static void xdk_input_free_input(void *data)
static void xdk_set_default_keybind_lut(unsigned device, unsigned port)
{
(void)device;
(void)port;
for (int i = 0; i < RARCH_CUSTOM_BIND_LIST_END; i++)
g_settings.input.binds[i]->def_joykey = platform_keys[i].joykey;
{
g_settings.input.binds[port][i].id = i;
g_settings.input.binds[port][i].def_joykey = platform_keys[i].joykey;
g_settings.input.binds[port][i].joykey = g_settings.input.binds[port][i].def_joykey;
}
g_settings.input.dpad_emulation[port] = DPAD_EMULATION_LSTICK;
}
static void xdk_input_set_analog_dpad_mapping(unsigned device, unsigned map_dpad_enum, unsigned controller_id)
@ -330,10 +335,7 @@ static void *xdk_input_init(void)
#endif
for(unsigned i = 0; i < MAX_PLAYERS; i++)
{
xdk_set_default_keybind_lut(0, i);
rarch_input_set_default_keybinds(i);
}
for(unsigned i = 0; i < MAX_PADS; i++)
xdk_input_set_analog_dpad_mapping(0, g_settings.input.dpad_emulation[i], i);

View File

@ -85,7 +85,14 @@ static void xenon360_input_free_input(void *data)
static void xenon360_input_set_default_keybind_lut(unsigned device, unsigned port)
{
(void)device;
(void)port;
for (unsigned i = 0; i < RARCH_CUSTOM_BIND_LIST_END; i++)
{
g_settings.input.binds[port][i].id = i;
g_settings.input.binds[port][i].joykey = g_settings.input.binds[port][i].def_joykey;
}
g_settings.input.dpad_emulation[port] = DPAD_EMULATION_LSTICK;
}
static void xenon360_input_set_analog_dpad_mapping(unsigned device, unsigned map_dpad_enum, unsigned controller_id)
@ -98,10 +105,7 @@ static void xenon360_input_set_analog_dpad_mapping(unsigned device, unsigned map
static void* xenon360_input_init(void)
{
for(unsigned i = 0; i < MAX_PLAYERS; i++)
{
xenon360_input_set_default_keybind_lut(0, i);
rarch_input_set_default_keybinds(i);
}
for(unsigned i = 0; i < MAX_PADS; i++)
xenon360_input_set_analog_dpad_mapping(0, g_settings.input.dpad_emulation[i], i);