LR35902: Implement RRCA and RRA
Jeffrey Pfau jeffrey@endrift.com
Tue, 19 Jan 2016 23:13:06 -0800
2 files changed,
18 insertions(+),
2 deletions(-)
M
src/lr35902/emitter-lr35902.h
→
src/lr35902/emitter-lr35902.h
@@ -25,7 +25,7 @@ DECLARE_INSTRUCTION_LR35902(EMITTER, DECBC), \
DECLARE_INSTRUCTION_LR35902(EMITTER, INCC), \ DECLARE_INSTRUCTION_LR35902(EMITTER, DECC), \ DECLARE_INSTRUCTION_LR35902(EMITTER, LDC_), \ - DECLARE_INSTRUCTION_LR35902(EMITTER, STUB), \ + DECLARE_INSTRUCTION_LR35902(EMITTER, RRCA_), \ DECLARE_INSTRUCTION_LR35902(EMITTER, STUB), \ DECLARE_INSTRUCTION_LR35902(EMITTER, LDDE), \ DECLARE_INSTRUCTION_LR35902(EMITTER, LDDE_A), \@@ -41,7 +41,7 @@ DECLARE_INSTRUCTION_LR35902(EMITTER, DECDE), \
DECLARE_INSTRUCTION_LR35902(EMITTER, INCE), \ DECLARE_INSTRUCTION_LR35902(EMITTER, DECE), \ DECLARE_INSTRUCTION_LR35902(EMITTER, LDE_), \ - DECLARE_INSTRUCTION_LR35902(EMITTER, STUB), \ + DECLARE_INSTRUCTION_LR35902(EMITTER, RRA_), \ DECLARE_INSTRUCTION_LR35902(EMITTER, JRNZ), \ DECLARE_INSTRUCTION_LR35902(EMITTER, LDHL), \ DECLARE_INSTRUCTION_LR35902(EMITTER, LDIHLA), \
M
src/lr35902/isa-lr35902.c
→
src/lr35902/isa-lr35902.c
@@ -628,6 +628,22 @@ cpu->f.h = 0;
cpu->f.n = 0; cpu->f.c = cpu->a & 1;) +DEFINE_INSTRUCTION_LR35902(RRA_, + int low = cpu->a & 1; + cpu->a = (cpu->a >> 1) | (cpu->f.c << 7); + cpu->f.z = 0; + cpu->f.h = 0; + cpu->f.n = 0; + cpu->f.c = cpu->f.c = low;) + +DEFINE_INSTRUCTION_LR35902(RRCA_, + int low = cpu->a & 1; + cpu->a = (cpu->a >> 1) | (low << 7); + cpu->f.z = 0; + cpu->f.h = 0; + cpu->f.n = 0; + cpu->f.c = low;) + DEFINE_INSTRUCTION_LR35902(DI, cpu->irqh.setInterrupts(cpu, false)); DEFINE_INSTRUCTION_LR35902(EI, cpu->irqh.setInterrupts(cpu, true)); DEFINE_INSTRUCTION_LR35902(HALT, cpu->cycles = cpu->nextEvent);