ARM7: Support forcing Thumb mode via MSR
Jeffrey Pfau jeffrey@endrift.com
Thu, 12 May 2016 00:18:49 -0700
3 files changed,
6 insertions(+),
0 deletions(-)
M
CHANGES
→
CHANGES
@@ -39,6 +39,7 @@ - Windows: Add native VDir support
- 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:
M
src/arm/isa-arm.c
→
src/arm/isa-arm.c
@@ -629,6 +629,9 @@ int32_t mask = (c ? 0x000000FF : 0) | (f ? 0xFF000000 : 0);
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);
M
src/arm/isa-inlines.h
→
src/arm/isa-inlines.h
@@ -85,6 +85,8 @@ cpu->cpsr.t = 0;
break; case MODE_THUMB: cpu->cpsr.t = 1; + cpu->prefetch[0] &= 0xFFFF; + cpu->prefetch[1] &= 0xFFFF; } cpu->nextEvent = cpu->cycles; }