all repos — mgba @ f6b88660d248f643319ae430b4ecda7c3e3dcbbe

mGBA Game Boy Advance Emulator

GBA: Reset now reloads multiboot ROMs
Vicki Pfau vi@endrift.com
Sun, 04 Nov 2018 15:54:00 -0800
commit

f6b88660d248f643319ae430b4ecda7c3e3dcbbe

parent

ed0a7c68eab07e4dca5b2744b2a45ef7b00917b1

2 files changed, 15 insertions(+), 5 deletions(-)

jump to
M CHANGESCHANGES

@@ -1,6 +1,7 @@

0.8.0: (Future) Bugfixes: - GBA: All IRQs have 7 cycle delay (fixes mgba.io/i/539, mgba.io/i/1208) + - GBA: Reset now reloads multiboot ROMs Misc: - GBA Savedata: EEPROM performance fixes - GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash
M src/gba/gba.csrc/gba/gba.c

@@ -216,6 +216,20 @@ GBATimerInit(gba);

GBASIOReset(&gba->sio); + bool isELF = false; +#ifdef USE_ELF + struct ELF* elf = ELFOpen(gba->romVf); + if (elf) { + isELF = true; + ELFClose(elf); + } +#endif + + if (GBAIsMB(gba->romVf) && !isELF) { + gba->romVf->seek(gba->romVf, 0, SEEK_SET); + gba->romVf->read(gba->romVf, gba->memory.wram, gba->pristineRomSize); + } + gba->lastJump = 0; gba->haltPending = false; gba->idleDetectionStep = 0;

@@ -343,11 +357,6 @@ gba->pristineRomSize = SIZE_WORKING_RAM;

} gba->isPristine = true; memset(gba->memory.wram, 0, SIZE_WORKING_RAM); - vf->read(vf, gba->memory.wram, gba->pristineRomSize); - if (!gba->memory.wram) { - mLOG(GBA, WARN, "Couldn't map ROM"); - return false; - } gba->yankedRomSize = 0; gba->memory.romSize = 0; gba->memory.romMask = 0;