From 73a5e54ca893132cc39a69754358be3396c2ed1c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 11 Jan 2017 23:32:33 +0100 Subject: [PATCH] Initialize libretro_input_binds inside input_driver_init --- input/input_driver.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/input/input_driver.c b/input/input_driver.c index c5e4c78323..f2963a3055 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -383,7 +383,7 @@ int16_t input_state(unsigned port, unsigned device, { if (((id < RARCH_FIRST_META_KEY) || (device == RETRO_DEVICE_KEYBOARD))) { - bool bind_valid = libretro_input_binds[port][id].valid; + bool bind_valid = libretro_input_binds[port] && libretro_input_binds[port][id].valid; if (device == RETRO_DEVICE_KEYBOARD) bind_valid = true; @@ -964,11 +964,12 @@ void input_driver_poll(void) bool input_driver_init(void) { + unsigned i; + settings_t *settings = config_get_ptr(); + for (i = 0; i < settings->input.max_users; i++) + libretro_input_binds[i] = settings->input.binds[i]; if (current_input) - { - settings_t *settings = config_get_ptr(); current_input_data = current_input->init(settings->input.joypad_driver); - } if (!current_input_data) return false;