diff --git a/CHANGES b/CHANGES index 866b6125c..35e65d7d4 100644 --- a/CHANGES +++ b/CHANGES @@ -39,6 +39,7 @@ Misc: - All: Add QUIET parameter to silence CMake - GBA Video: Null renderer should return proper register values - Libretro: Disable logging game errors, BIOS calls and stubs in release builds + - ARM7: Support forcing Thumb mode via MSR 0.4.0: (2016-02-02) Features: diff --git a/src/arm/isa-arm.c b/src/arm/isa-arm.c index 518ab5134..bf826f44b 100644 --- a/src/arm/isa-arm.c +++ b/src/arm/isa-arm.c @@ -629,6 +629,9 @@ DEFINE_INSTRUCTION_ARM(MSR, if (mask & PSR_USER_MASK) { cpu->cpsr.packed = (cpu->cpsr.packed & ~PSR_USER_MASK) | (operand & PSR_USER_MASK); } + if (mask & PSR_STATE_MASK) { + cpu->cpsr.packed = (cpu->cpsr.packed & ~PSR_STATE_MASK) | (operand & PSR_STATE_MASK); + } if (cpu->privilegeMode != MODE_USER && (mask & PSR_PRIV_MASK)) { ARMSetPrivilegeMode(cpu, (enum PrivilegeMode) ((operand & 0x0000000F) | 0x00000010)); cpu->cpsr.packed = (cpu->cpsr.packed & ~PSR_PRIV_MASK) | (operand & PSR_PRIV_MASK); diff --git a/src/arm/isa-inlines.h b/src/arm/isa-inlines.h index 42a581b4a..2e7395a00 100644 --- a/src/arm/isa-inlines.h +++ b/src/arm/isa-inlines.h @@ -85,6 +85,8 @@ static inline void _ARMSetMode(struct ARMCore* cpu, enum ExecutionMode execution break; case MODE_THUMB: cpu->cpsr.t = 1; + cpu->prefetch[0] &= 0xFFFF; + cpu->prefetch[1] &= 0xFFFF; } cpu->nextEvent = cpu->cycles; }