Libretro: Fix crash changing allowing opposing directions (backports libretro/mgba@2619aa)

This commit is contained in:
Vicki Pfau 2019-06-26 10:15:51 -07:00
parent 43b6004cea
commit 417a749fec
2 changed files with 13 additions and 1 deletions

View File

@ -40,6 +40,7 @@ Other fixes:
- 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

View File

@ -297,7 +297,18 @@ void retro_run(void) {
.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";