all repos — mgba @ 2fc5474d91eafa6e04e7d3d225db4cc52a5648bb

mGBA Game Boy Advance Emulator

Implement addressing mode 1 ROR immediate
Jeffrey Pfau jeffrey@endrift.com
Sat, 27 Apr 2013 01:54:57 -0700
commit

2fc5474d91eafa6e04e7d3d225db4cc52a5648bb

parent

2bc23e7aa26a554cb13e737d03404f6e2546548d

1 files changed, 8 insertions(+), 1 deletions(-)

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

@@ -64,7 +64,14 @@

static inline void _shiftROR(struct ARMCore* cpu, uint32_t opcode) { int rm = opcode & 0x0000000F; int immediate = (opcode & 0x00000F80) >> 7; - ARM_STUB; + if (immediate) { + cpu->shifterOperand = ARM_ROR(cpu->gprs[rm], immediate); + cpu->shifterCarryOut = cpu->gprs[rm] & (1 << (immediate - 1)); + } else { + // RRX + cpu->shifterOperand = (cpu->cpsr.c << 31) | (((uint32_t) cpu->gprs[rm]) >> 1); + cpu->shifterCarryOut = cpu->gprs[rm] & 0x00000001; + } } static inline void _shiftRORR(struct ARMCore* cpu, uint32_t opcode) {