GBA: Reset now reloads multiboot ROMs

This commit is contained in:
Vicki Pfau 2018-11-04 15:54:00 -08:00
parent ed0a7c68ea
commit f6b88660d2
2 changed files with 15 additions and 5 deletions

View File

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

View File

@ -216,6 +216,20 @@ void GBAReset(struct ARMCore* cpu) {
GBASIOReset(&gba->sio); 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->lastJump = 0;
gba->haltPending = false; gba->haltPending = false;
gba->idleDetectionStep = 0; gba->idleDetectionStep = 0;
@ -343,11 +357,6 @@ bool GBALoadMB(struct GBA* gba, struct VFile* vf) {
} }
gba->isPristine = true; gba->isPristine = true;
memset(gba->memory.wram, 0, SIZE_WORKING_RAM); 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->yankedRomSize = 0;
gba->memory.romSize = 0; gba->memory.romSize = 0;
gba->memory.romMask = 0; gba->memory.romMask = 0;