ARM: Fix MSR when CPSR.T is set
MerryMage MerryMage@users.noreply.github.com
Sun, 06 Aug 2017 00:18:16 +0100
2 files changed,
7 insertions(+),
4 deletions(-)
M
CHANGES
→
CHANGES
@@ -29,6 +29,7 @@ - Qt: Fix GL display when loading a game from CLI (fixes mgba.io/i/843)
- GB, GBA Savedata: Fix savestate-related save overwriting (fixes mgba.io/i/834) - Qt: Fix timezone issues with time overrides - Qt: Fix sprite export pausing game indefinitely (fixes mgba.io/i/841) + - ARM: Fix MSR when T bit is set Misc: - GBA Timer: Use global cycles for timers - GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722)
M
src/arm/isa-arm.c
→
src/arm/isa-arm.c
@@ -663,8 +663,9 @@ cpu->cpsr.packed = (cpu->cpsr.packed & ~PSR_PRIV_MASK) | (operand & PSR_PRIV_MASK);
} _ARMReadCPSR(cpu); if (cpu->executionMode == MODE_THUMB) { - LOAD_16(cpu->prefetch[0], (cpu->gprs[ARM_PC] - WORD_SIZE_THUMB) & cpu->memory.activeMask, cpu->memory.activeRegion); - LOAD_16(cpu->prefetch[1], cpu->gprs[ARM_PC] & cpu->memory.activeMask, cpu->memory.activeRegion); + cpu->prefetch[0] = 0x46C0; // nop + cpu->prefetch[1] &= 0xFFFF; + cpu->gprs[ARM_PC] += WORD_SIZE_THUMB; } else { LOAD_32(cpu->prefetch[0], (cpu->gprs[ARM_PC] - WORD_SIZE_ARM) & cpu->memory.activeMask, cpu->memory.activeRegion); LOAD_32(cpu->prefetch[1], cpu->gprs[ARM_PC] & cpu->memory.activeMask, cpu->memory.activeRegion);@@ -704,8 +705,9 @@ cpu->cpsr.packed = (cpu->cpsr.packed & ~PSR_PRIV_MASK) | (operand & PSR_PRIV_MASK);
} _ARMReadCPSR(cpu); if (cpu->executionMode == MODE_THUMB) { - LOAD_16(cpu->prefetch[0], (cpu->gprs[ARM_PC] - WORD_SIZE_THUMB) & cpu->memory.activeMask, cpu->memory.activeRegion); - LOAD_16(cpu->prefetch[1], cpu->gprs[ARM_PC] & cpu->memory.activeMask, cpu->memory.activeRegion); + cpu->prefetch[0] = 0x46C0; // nop + cpu->prefetch[1] &= 0xFFFF; + cpu->gprs[ARM_PC] += WORD_SIZE_THUMB; } else { LOAD_32(cpu->prefetch[0], (cpu->gprs[ARM_PC] - WORD_SIZE_ARM) & cpu->memory.activeMask, cpu->memory.activeRegion); LOAD_32(cpu->prefetch[1], cpu->gprs[ARM_PC] & cpu->memory.activeMask, cpu->memory.activeRegion);