From 620ee3cf514e8d6219d96a1dd7c9d5da808a8c4f Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Thu, 7 May 2020 23:43:49 +0300 Subject: [PATCH] Make the libretro frontend not crash on rumble-less frontends --- libretro/libretro.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libretro/libretro.c b/libretro/libretro.c index 14bfaa8..9e0f9a3 100644 --- a/libretro/libretro.c +++ b/libretro/libretro.c @@ -142,6 +142,8 @@ static void GB_update_keys_status(GB_gameboy_t *gb, unsigned port) static void rumble_callback(GB_gameboy_t *gb, double amplitude) { + if (!rumble.set_rumble_state) return; + if (gb == &gameboy[0]) { rumble.set_rumble_state(0, RETRO_RUMBLE_STRONG, 65535 * amplitude); }