all repos — mgba @ 417a749fecb8c991e7dd3ec28171fbad64378d53

mGBA Game Boy Advance Emulator

Libretro: Fix crash changing allowing opposing directions (backports libretro/mgba@2619aa)
Vicki Pfau vi@endrift.com
Wed, 26 Jun 2019 10:15:51 -0700
commit

417a749fecb8c991e7dd3ec28171fbad64378d53

parent

43b6004cea5aacf62a61d92ef190f3b3a24911d0

2 files changed, 13 insertions(+), 1 deletions(-)

jump to
M CHANGESCHANGES

@@ -40,6 +40,7 @@ - GB SIO: Fix lockstep failing games aren't reloaded

- Core: Fix crash when exiting game with cheats loaded - GBA Cheats: Fix PARv3 Thumb hooks - mGUI: Fix crash if last loaded ROM directory disappears (fixes mgba.io/i/1466) + - Libretro: Fix crash changing allowing opposing directions (hhromic) Misc: - GBA Savedata: EEPROM performance fixes - GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash
M src/platform/libretro/libretro.csrc/platform/libretro/libretro.c

@@ -297,7 +297,18 @@ .key = "mgba_allow_opposing_directions",

.value = 0 }; if (environCallback(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { - ((struct GBA*) core->board)->allowOpposingDirections = strcmp(var.value, "yes") == 0; + struct GBA* gba = core->board; + struct GB* gb = core->board; + switch (core->platform(core)) { + case PLATFORM_GBA: + gba->allowOpposingDirections = strcmp(var.value, "yes") == 0; + break; + case PLATFORM_GB: + gb->allowOpposingDirections = strcmp(var.value, "yes") == 0; + break; + default: + break; + } } var.key = "mgba_frameskip";