Libretro: Fix crash changing allowing opposing directions (backports libretro/mgba@2619aa)
Vicki Pfau vi@endrift.com
Wed, 26 Jun 2019 10:15:51 -0700
2 files changed,
13 insertions(+),
1 deletions(-)
M
CHANGES
→
CHANGES
@@ -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.c
→
src/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";