mirror of https://github.com/mgba-emu/mgba.git
GBA Memory: Fix prefetch mask when swapping modes within a region
This commit is contained in:
parent
3f4d2f6086
commit
34fed8086c
1
CHANGES
1
CHANGES
|
@ -11,6 +11,7 @@ Emulation fixes:
|
||||||
- GBA SIO: Add missing NORMAL8 implementation bits (fixes mgba.io/i/2172)
|
- GBA SIO: Add missing NORMAL8 implementation bits (fixes mgba.io/i/2172)
|
||||||
- GBA SIO: Fix missing interrupt on an unattached NORMAL transfer
|
- GBA SIO: Fix missing interrupt on an unattached NORMAL transfer
|
||||||
- GBA SIO: Fix SI value for unattached MULTI mode
|
- GBA SIO: Fix SI value for unattached MULTI mode
|
||||||
|
- GBA Memory: Fix prefetch mask when swapping modes within a region
|
||||||
- GBA Video: Revert scanline latching changes (fixes mgba.io/i/2153, mgba.io/i/2149)
|
- GBA Video: Revert scanline latching changes (fixes mgba.io/i/2153, mgba.io/i/2149)
|
||||||
Other fixes:
|
Other fixes:
|
||||||
- 3DS: Fix disabling "wide" mode on 2DS (fixes mgba.io/i/2167)
|
- 3DS: Fix disabling "wide" mode on 2DS (fixes mgba.io/i/2167)
|
||||||
|
|
|
@ -127,6 +127,7 @@ void GBAMemoryReset(struct GBA* gba) {
|
||||||
memset(gba->memory.io, 0, sizeof(gba->memory.io));
|
memset(gba->memory.io, 0, sizeof(gba->memory.io));
|
||||||
GBAAdjustWaitstates(gba, 0);
|
GBAAdjustWaitstates(gba, 0);
|
||||||
|
|
||||||
|
gba->memory.activeRegion = -1;
|
||||||
gba->memory.agbPrintProtect = 0;
|
gba->memory.agbPrintProtect = 0;
|
||||||
gba->memory.agbPrintBase = 0;
|
gba->memory.agbPrintBase = 0;
|
||||||
memset(&gba->memory.agbPrintCtx, 0, sizeof(gba->memory.agbPrintCtx));
|
memset(&gba->memory.agbPrintCtx, 0, sizeof(gba->memory.agbPrintCtx));
|
||||||
|
@ -266,6 +267,11 @@ static void GBASetActiveRegion(struct ARMCore* cpu, uint32_t address) {
|
||||||
gba->lastJump = address;
|
gba->lastJump = address;
|
||||||
memory->lastPrefetchedPc = 0;
|
memory->lastPrefetchedPc = 0;
|
||||||
if (newRegion == memory->activeRegion) {
|
if (newRegion == memory->activeRegion) {
|
||||||
|
if (cpu->cpsr.t) {
|
||||||
|
cpu->memory.activeMask |= WORD_SIZE_THUMB;
|
||||||
|
} else {
|
||||||
|
cpu->memory.activeMask &= -WORD_SIZE_ARM;
|
||||||
|
}
|
||||||
if (newRegion < REGION_CART0 || (address & (SIZE_CART0 - 1)) < memory->romSize) {
|
if (newRegion < REGION_CART0 || (address & (SIZE_CART0 - 1)) < memory->romSize) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,6 +158,7 @@ bool GBADeserialize(struct GBA* gba, const struct GBASerializedState* state) {
|
||||||
mLOG(GBA_STATE, WARN, "Savestate has unaligned PC and is probably corrupted");
|
mLOG(GBA_STATE, WARN, "Savestate has unaligned PC and is probably corrupted");
|
||||||
gba->cpu->gprs[ARM_PC] &= ~1;
|
gba->cpu->gprs[ARM_PC] &= ~1;
|
||||||
}
|
}
|
||||||
|
gba->memory.activeRegion = -1;
|
||||||
gba->cpu->memory.setActiveRegion(gba->cpu, gba->cpu->gprs[ARM_PC]);
|
gba->cpu->memory.setActiveRegion(gba->cpu, gba->cpu->gprs[ARM_PC]);
|
||||||
if (state->biosPrefetch) {
|
if (state->biosPrefetch) {
|
||||||
LOAD_32(gba->memory.biosPrefetch, 0, &state->biosPrefetch);
|
LOAD_32(gba->memory.biosPrefetch, 0, &state->biosPrefetch);
|
||||||
|
|
Loading…
Reference in New Issue