all repos — mgba @ 37ce1383fcb16273934de645eb4bf71c2c68f72a

mGBA Game Boy Advance Emulator

Set bits in MSR properly
Jeffrey Pfau jeffrey@endrift.com
Fri, 12 Apr 2013 02:10:09 -0700
commit

37ce1383fcb16273934de645eb4bf71c2c68f72a

parent

6097890251e63a79ae9c3b28524c454d4ac20b3c

1 files changed, 2 insertions(+), 7 deletions(-)

jump to
M src/isa-arm.csrc/isa-arm.c

@@ -520,16 +520,11 @@ mask &= PSR_USER_MASK | PSR_PRIV_MASK | PSR_STATE_MASK; \

cpu->spsr.packed = (cpu->spsr.packed & ~mask) | (operand & mask); \ } else { \ if (mask & PSR_USER_MASK) { \ - cpu->cpsr.n = operand & 0x80000000; \ - cpu->cpsr.z = operand & 0x40000000; \ - cpu->cpsr.c = operand & 0x20000000; \ - cpu->cpsr.v = operand & 0x10000000; \ + cpu->cpsr.packed = (cpu->cpsr.packed & ~PSR_USER_MASK) | (operand & PSR_USER_MASK); \ } \ if (cpu->privilegeMode != MODE_USER && (mask & PSR_PRIV_MASK)) { \ ARMSetPrivilegeMode(cpu, (enum PrivilegeMode) ((operand & 0x0000000F) | 0x00000010)); \ - cpu->cpsr.priv = cpu->privilegeMode; \ - cpu->cpsr.i = operand & 0x00000080; \ - cpu->cpsr.f = operand & 0x00000040; \ + cpu->cpsr.packed = (cpu->cpsr.packed & ~PSR_PRIV_MASK) | (operand & PSR_PRIV_MASK); \ } \ })