From 4ca16fb2ef9288d64f9c895888e28dd94e7e1a36 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 18 Jan 2020 19:19:42 -0800 Subject: [PATCH] GBA: Clean up previous commit --- src/gba/gba.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/gba/gba.c b/src/gba/gba.c index 0513c7329..7c00151ec 100644 --- a/src/gba/gba.c +++ b/src/gba/gba.c @@ -384,20 +384,19 @@ bool GBALoadROM(struct GBA* gba, struct VFile* vf) { vf->seek(vf, 0, SEEK_SET); if (gba->pristineRomSize > SIZE_CART0) { gba->isPristine = false; -#ifdef FIXED_ROM_BUFFER - gba->memory.rom = romBuffer; -#else - gba->memory.rom = anonymousMemoryMap(SIZE_CART0); -#endif char ident; vf->seek(vf, 0xAC, SEEK_SET); vf->read(vf, &ident, 1); - vf->seek(vf, 0, SEEK_SET); if (ident == 'M') { gba->memory.romSize = 0x01000000; +#ifdef FIXED_ROM_BUFFER + gba->memory.rom = romBuffer; +#else + gba->memory.rom = anonymousMemoryMap(SIZE_CART0); +#endif } else { + gba->memory.rom = vf->map(vf, SIZE_CART0, MAP_READ); gba->memory.romSize = SIZE_CART0; - vf->read(vf, gba->memory.rom, SIZE_CART0); } } else { gba->isPristine = true;