all repos — mgba @ 4ca16fb2ef9288d64f9c895888e28dd94e7e1a36

mGBA Game Boy Advance Emulator

GBA: Clean up previous commit
Vicki Pfau vi@endrift.com
Sat, 18 Jan 2020 19:19:42 -0800
commit

4ca16fb2ef9288d64f9c895888e28dd94e7e1a36

parent

69a0372133bc1f7b806a23ecf89f8fb9c12f00c1

1 files changed, 6 insertions(+), 7 deletions(-)

jump to
M src/gba/gba.csrc/gba/gba.c

@@ -384,20 +384,19 @@ gba->pristineRomSize = vf->size(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;