all repos — mgba @ 4ea859af01d6bf244698cddc2fa7529a10a25da8

mGBA Game Boy Advance Emulator

Libretro: Fix BIOS booting
Jeffrey Pfau jeffrey@endrift.com
Thu, 15 Sep 2016 19:35:29 -0700
commit

4ea859af01d6bf244698cddc2fa7529a10a25da8

parent

50f51f4b38dff5e96b4e539d4f65ed0f1ec7b726

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

jump to
M src/platform/libretro/libretro.csrc/platform/libretro/libretro.c

@@ -275,18 +275,6 @@ void static _setupMaps(struct mCore* core) {

#ifdef M_CORE_GBA if (core->platform(core) == PLATFORM_GBA) { struct GBA* gba = core->board; - gba->luminanceSource = &lux; - - const char* sysDir = 0; - if (environCallback(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &sysDir)) { - char biosPath[PATH_MAX]; - snprintf(biosPath, sizeof(biosPath), "%s%s%s", sysDir, PATH_SEP, "gba_bios.bin"); - struct VFile* bios = VFileOpen(biosPath, O_RDONLY); - if (bios) { - core->loadBIOS(core, bios, 0); - } - } - struct retro_memory_descriptor descs[11]; struct retro_memory_map mmaps; size_t romSize = gba->memory.romSize + (gba->memory.romSize & 1);

@@ -417,8 +405,25 @@

_reloadSettings(); core->loadROM(core, rom); core->loadSave(core, save); - core->reset(core); + +#ifdef M_CORE_GBA + if (core->platform(core) == PLATFORM_GBA) { + struct GBA* gba = core->board; + gba->luminanceSource = &lux; + + const char* sysDir = 0; + if (environCallback(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &sysDir)) { + char biosPath[PATH_MAX]; + snprintf(biosPath, sizeof(biosPath), "%s%s%s", sysDir, PATH_SEP, "gba_bios.bin"); + struct VFile* bios = VFileOpen(biosPath, O_RDONLY); + if (bios) { + core->loadBIOS(core, bios, 0); + } + } + } +#endif + core->reset(core); _setupMaps(core); return true;