Libretro: BIOS loading

This commit is contained in:
Jeffrey Pfau 2015-07-17 20:48:23 -07:00
parent 1975fc7706
commit 85c4162ad1
2 changed files with 16 additions and 0 deletions

View File

@ -27,6 +27,7 @@ Features:
- 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

View File

@ -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 @@ void retro_init(void) {
}
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 @@ void retro_init(void) {
}
void retro_deinit(void) {
if (bios) {
bios->close(bios);
bios = 0;
}
GBADestroy(&gba);
}