mirror of https://github.com/mgba-emu/mgba.git
ARM7: Support forcing Thumb mode via MSR
This commit is contained in:
parent
b37761327e
commit
b5ff48a74e
1
CHANGES
1
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:
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue