LR35902: Implement SCF and CCF
Jeffrey Pfau jeffrey@endrift.com
Sun, 17 Jan 2016 03:07:21 -0800
2 files changed,
11 insertions(+),
2 deletions(-)
M
src/lr35902/emitter-lr35902.h
→
src/lr35902/emitter-lr35902.h
@@ -65,7 +65,7 @@ DECLARE_INSTRUCTION_LR35902(EMITTER, INCSP), \
DECLARE_INSTRUCTION_LR35902(EMITTER, INC_HL), \ DECLARE_INSTRUCTION_LR35902(EMITTER, DEC_HL), \ DECLARE_INSTRUCTION_LR35902(EMITTER, LDHL_), \ - DECLARE_INSTRUCTION_LR35902(EMITTER, STUB), \ + DECLARE_INSTRUCTION_LR35902(EMITTER, SCF), \ DECLARE_INSTRUCTION_LR35902(EMITTER, JRC), \ DECLARE_INSTRUCTION_LR35902(EMITTER, ADDHL_SP), \ DECLARE_INSTRUCTION_LR35902(EMITTER, LDA_DHL), \@@ -73,7 +73,7 @@ DECLARE_INSTRUCTION_LR35902(EMITTER, DECSP), \
DECLARE_INSTRUCTION_LR35902(EMITTER, INCA), \ DECLARE_INSTRUCTION_LR35902(EMITTER, DECA), \ DECLARE_INSTRUCTION_LR35902(EMITTER, LDA_), \ - DECLARE_INSTRUCTION_LR35902(EMITTER, STUB), \ + DECLARE_INSTRUCTION_LR35902(EMITTER, CCF), \ DECLARE_INSTRUCTION_LR35902(EMITTER, LDB_B), \ DECLARE_INSTRUCTION_LR35902(EMITTER, LDB_C), \ DECLARE_INSTRUCTION_LR35902(EMITTER, LDB_D), \
M
src/lr35902/isa-lr35902.c
→
src/lr35902/isa-lr35902.c
@@ -510,6 +510,15 @@ DEFINE_INSTRUCTION_LR35902(DECSP,
--cpu->sp; cpu->executionState = LR35902_CORE_STALL;) +DEFINE_INSTRUCTION_LR35902(SCF, + cpu->f.c = 1; + cpu->f.h = 0; + cpu->f.n = 0;) + +DEFINE_INSTRUCTION_LR35902(CCF, + cpu->f.c ^= 1; + cpu->f.h = 0; + cpu->f.n = 0;) #define DEFINE_POPPUSH_INSTRUCTION_LR35902(REG, HH, H, L) \ DEFINE_INSTRUCTION_LR35902(POP ## REG ## Delay, \