From 68fbbbd7f4f90e5be76672df266c814e332b0454 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 7 Nov 2013 05:21:09 +0100 Subject: [PATCH] (PS3) No longer crashes on loading overlays --- ps3/ps3_input.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ps3/ps3_input.c b/ps3/ps3_input.c index 5e07d27c47..06564b3ab6 100644 --- a/ps3/ps3_input.c +++ b/ps3/ps3_input.c @@ -198,8 +198,7 @@ static int16_t ps3_input_state(void *data, const struct retro_keybind **binds, unsigned index, unsigned id) { ps3_input_t *ps3 = (ps3_input_t*)data; - - uint64_t button = binds[port][id].joykey; + uint64_t button; int16_t retval = 0; if (port < ps3->pads_connected) @@ -207,6 +206,7 @@ static int16_t ps3_input_state(void *data, const struct retro_keybind **binds, switch (device) { case RETRO_DEVICE_JOYPAD: + button = binds[port][id].joykey; retval = (ps3->state[port] & button) ? 1 : 0; break; case RETRO_DEVICE_ANALOG: @@ -236,6 +236,8 @@ static int16_t ps3_input_state(void *data, const struct retro_keybind **binds, retval = ps3_mouse_device_state(data, port, id); break; #endif + default: + return 0; } }