all repos — mgba @ 7a91b4a98aef707d996f559c8427974a74585695

mGBA Game Boy Advance Emulator

LR35902: Implement SCF and CCF
Jeffrey Pfau jeffrey@endrift.com
Sun, 17 Jan 2016 03:07:21 -0800
commit

7a91b4a98aef707d996f559c8427974a74585695

parent

4271d89129b064cac04fb50e7e8c4be85dbc57b3

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

jump to
M src/lr35902/emitter-lr35902.hsrc/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.csrc/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, \