mirror of https://github.com/mgba-emu/mgba.git
GBA: Reset active region as needed when loading a ROM
This commit is contained in:
parent
b75812a99d
commit
91abd41eab
1
CHANGES
1
CHANGES
|
@ -1,6 +1,7 @@
|
|||
0.6.1: (Future)
|
||||
Bugfixes:
|
||||
- Python: Fix importing .gb or .gba before .core
|
||||
- GBA: Reset active region as needed when loading a ROM
|
||||
Misc:
|
||||
- Qt: Don't rebuild library view if style hasn't changed
|
||||
|
||||
|
|
|
@ -308,6 +308,9 @@ bool GBALoadMB(struct GBA* gba, struct VFile* vf) {
|
|||
gba->memory.romSize = 0;
|
||||
gba->memory.romMask = 0;
|
||||
gba->romCrc32 = doCrc32(gba->memory.wram, gba->pristineRomSize);
|
||||
if (gba->cpu && gba->memory.activeRegion == REGION_WORKING_RAM) {
|
||||
gba->cpu->memory.setActiveRegion(gba->cpu, gba->cpu->gprs[ARM_PC]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -342,6 +345,9 @@ bool GBALoadROM(struct GBA* gba, struct VFile* vf) {
|
|||
gba->romCrc32 = doCrc32(gba->memory.rom, gba->memory.romSize);
|
||||
GBAHardwareInit(&gba->memory.hw, &((uint16_t*) gba->memory.rom)[GPIO_REG_DATA >> 1]);
|
||||
GBAVFameDetect(&gba->memory.vfame, gba->memory.rom, gba->memory.romSize);
|
||||
if (gba->cpu && gba->memory.activeRegion >= REGION_CART0) {
|
||||
gba->cpu->memory.setActiveRegion(gba->cpu, gba->cpu->gprs[ARM_PC]);
|
||||
}
|
||||
// TODO: error check
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue