From e0f4953de81ee5369da63440efb97294ea9ea09a Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Sat, 28 Jul 2012 02:27:41 +0200 Subject: [PATCH] (RARCH_CONSOLE) Add second param to set_default_keybind_lut (port is player no) --- 360/xenon360_input.c | 3 ++- 360/xinput_360_input.c | 3 ++- console/retroarch_console_input.c | 5 +++-- driver.h | 2 +- input/null.c | 3 ++- ps3/ps3_input.c | 3 ++- wii/gx_input.c | 4 +++- xbox1/xinput_xbox_input.c | 3 ++- 8 files changed, 17 insertions(+), 9 deletions(-) diff --git a/360/xenon360_input.c b/360/xenon360_input.c index 141e9eaa64..1034bff604 100644 --- a/360/xenon360_input.c +++ b/360/xenon360_input.c @@ -119,9 +119,10 @@ static bool xenon360_key_pressed(void *data, int key) return false; } -static void xenon360_input_set_default_keybind_lut(unsigned device) +static void xenon360_input_set_default_keybind_lut(unsigned device, unsigned port) { (void)device; + (void)port; } static void xenon360_input_set_analog_dpad_mapping(unsigned device, unsigned map_dpad_enum, unsigned controller_id) diff --git a/360/xinput_360_input.c b/360/xinput_360_input.c index 2959f82b9c..46248a87d2 100644 --- a/360/xinput_360_input.c +++ b/360/xinput_360_input.c @@ -206,9 +206,10 @@ static bool xinput_input_key_pressed(void *data, int key) return retval; } -static void xinput_set_default_keybind_lut(unsigned device) +static void xinput_set_default_keybind_lut(unsigned device, unsigned port) { (void)device; + (void)port; rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_B] = platform_keys[XDK_DEVICE_ID_JOYPAD_A].joykey; rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_Y] = platform_keys[XDK_DEVICE_ID_JOYPAD_X].joykey; diff --git a/console/retroarch_console_input.c b/console/retroarch_console_input.c index 5c0658629c..0d003aeea7 100644 --- a/console/retroarch_console_input.c +++ b/console/retroarch_console_input.c @@ -138,10 +138,11 @@ void rarch_input_set_default_keybinds(unsigned player) void rarch_input_set_controls_default (const input_driver_t *input) { - input->set_default_keybind_lut(STUB_DEVICE); - for(uint32_t x = 0; x < MAX_PLAYERS; x++) + { + input->set_default_keybind_lut(STUB_DEVICE, x); rarch_input_set_default_keybinds(x); + } } const char *rarch_input_get_default_keybind_name(unsigned id) diff --git a/driver.h b/driver.h index 2942c37334..b5deccd1cc 100644 --- a/driver.h +++ b/driver.h @@ -160,7 +160,7 @@ typedef struct input_driver bool (*key_pressed)(void *data, int key); void (*free)(void *data); #ifdef RARCH_CONSOLE - void (*set_default_keybind_lut)(unsigned device); + void (*set_default_keybind_lut)(unsigned device, unsigned port); void (*set_analog_dpad_mapping)(unsigned device, unsigned map_dpad_enum, unsigned controller_id); void (*post_init)(void); unsigned max_pads; diff --git a/input/null.c b/input/null.c index 4fb026472c..b416896637 100644 --- a/input/null.c +++ b/input/null.c @@ -52,9 +52,10 @@ static void null_input_free(void *data) } #ifdef RARCH_CONSOLE -static void null_set_default_keybind_lut(unsigned device) +static void null_set_default_keybind_lut(unsigned device, unsigned port) { (void)device; + (void)port; } static void null_set_analog_dpad_mapping(unsigned device, unsigned map_dpad_enum, unsigned controller_id) diff --git a/ps3/ps3_input.c b/ps3/ps3_input.c index e2d5589199..d523e441c1 100644 --- a/ps3/ps3_input.c +++ b/ps3/ps3_input.c @@ -478,9 +478,10 @@ static bool ps3_key_pressed(void *data, int key) } } -static void ps3_set_default_keybind_lut(unsigned device) +static void ps3_set_default_keybind_lut(unsigned device, unsigned port) { (void)device; + (void)port; rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_B] = platform_keys[PS3_DEVICE_ID_JOYPAD_CROSS].joykey; rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_Y] = platform_keys[PS3_DEVICE_ID_JOYPAD_SQUARE].joykey; diff --git a/wii/gx_input.c b/wii/gx_input.c index 6c8cb5d498..8f8a4b15bc 100644 --- a/wii/gx_input.c +++ b/wii/gx_input.c @@ -435,9 +435,11 @@ static bool wii_key_pressed(void *data, int key) } } -static void wii_set_default_keybind_lut(unsigned device) +static void wii_set_default_keybind_lut(unsigned device, unsigned port) { (void)device; //TODO: Remove when you start using it in this function + (void)port; + #if defined(CLASSIC_PAD) rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_B] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_B].joykey; rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_Y] = platform_keys[WII_DEVICE_CLASSIC_ID_JOYPAD_Y].joykey; diff --git a/xbox1/xinput_xbox_input.c b/xbox1/xinput_xbox_input.c index 24eb920be2..ff7fdcec0b 100644 --- a/xbox1/xinput_xbox_input.c +++ b/xbox1/xinput_xbox_input.c @@ -164,9 +164,10 @@ static void xinput_input_free_input(void *data) (void)data; } -static void xinput_set_default_keybind_lut(unsigned device) +static void xinput_set_default_keybind_lut(unsigned device, unsigned port) { (void)device; + (void)port; rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_B] = platform_keys[XDK_DEVICE_ID_JOYPAD_A].joykey; rarch_default_keybind_lut[RETRO_DEVICE_ID_JOYPAD_Y] = platform_keys[XDK_DEVICE_ID_JOYPAD_X].joykey;