all repos — mgba @ 6b1cbbd5e2f08c52a5f22ac6a71c3b2caba523d1

mGBA Game Boy Advance Emulator

ARM7: Fix setting spsr privilege bits when spsr is empty
Jeffrey Pfau jeffrey@endrift.com
Fri, 10 Jun 2016 10:17:29 -0700
commit

6b1cbbd5e2f08c52a5f22ac6a71c3b2caba523d1

parent

723b91dfe346c9f59ddd37e5e2074699b791907f

2 files changed, 3 insertions(+), 2 deletions(-)

jump to
M CHANGESCHANGES

@@ -26,6 +26,7 @@ - All: Fix instruction tables getting zeroed when linking sometimes

- SDL: Fix SDL 1.2 build - ARM7: Fix flags on SBC/RSC - Util: Fix realloc semantics in utf16to8 + - ARM7: Fix setting spsr privilege bits when spsr is empty Misc: - GBA: Slightly optimize GBAProcessEvents - Qt: Add preset for DualShock 4
M src/arm/isa-arm.csrc/arm/isa-arm.c

@@ -659,7 +659,7 @@ int f = opcode & 0x00080000;

int32_t operand = cpu->gprs[opcode & 0x0000000F]; int32_t mask = (c ? 0x000000FF : 0) | (f ? 0xFF000000 : 0); mask &= PSR_USER_MASK | PSR_PRIV_MASK | PSR_STATE_MASK; - cpu->spsr.packed = (cpu->spsr.packed & ~mask) | (operand & mask);) + cpu->spsr.packed = (cpu->spsr.packed & ~mask) | (operand & mask) | 0x00000010;) DEFINE_INSTRUCTION_ARM(MRS, \ int rd = (opcode >> 12) & 0xF; \

@@ -701,7 +701,7 @@ int rotate = (opcode & 0x00000F00) >> 7;

int32_t operand = ROR(opcode & 0x000000FF, rotate); int32_t mask = (c ? 0x000000FF : 0) | (f ? 0xFF000000 : 0); mask &= PSR_USER_MASK | PSR_PRIV_MASK | PSR_STATE_MASK; - cpu->spsr.packed = (cpu->spsr.packed & ~mask) | (operand & mask);) + cpu->spsr.packed = (cpu->spsr.packed & ~mask) | (operand & mask) | 0x00000010;) DEFINE_INSTRUCTION_ARM(SWI, cpu->irqh.swi32(cpu, opcode & 0xFFFFFF))