all repos — mgba @ 85c4162ad1203c40d930f04b0b8ae550d7d2e353

mGBA Game Boy Advance Emulator

Libretro: BIOS loading
Jeffrey Pfau jeffrey@endrift.com
Fri, 17 Jul 2015 20:48:23 -0700
commit

85c4162ad1203c40d930f04b0b8ae550d7d2e353

parent

1975fc77062eb05c3482723556914803bc400066

2 files changed, 16 insertions(+), 0 deletions(-)

jump to
M CHANGESCHANGES

@@ -27,6 +27,7 @@ - Configurable display driver, between software and OpenGL

- Undo-able savestate loading and saving - Controller profiles now store shortcut settings - Default controller profiles for several common controllers + - Libretro now supports BIOS and rumble Bugfixes: - ARM7: Fix SWI and IRQ timings - GBA Audio: Force audio FIFOs to 32-bit
M src/platform/libretro/libretro.csrc/platform/libretro/libretro.c

@@ -39,6 +39,7 @@ static struct VFile* rom;

static void* data; static struct VFile* save; static void* savedata; +static struct VFile* bios; static struct GBAAVStream stream; static int rumbleLevel; static struct CircleBuffer rumbleHistory;

@@ -152,6 +153,16 @@ gba.rumble = &rumble;

} rom = 0; + 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"); + bios = VFileOpen(biosPath, O_RDONLY); + if (bios) { + GBALoadBIOS(&gba, bios); + } + } + GBAVideoSoftwareRendererCreate(&renderer); renderer.outputBuffer = malloc(256 * VIDEO_VERTICAL_PIXELS * BYTES_PER_PIXEL); renderer.outputBufferStride = 256;

@@ -166,6 +177,10 @@ #endif

} void retro_deinit(void) { + if (bios) { + bios->close(bios); + bios = 0; + } GBADestroy(&gba); }