From a30ab5a748196a1364b38f7551fe4f9e859e141c Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Mon, 25 Jun 2018 19:33:30 -0400 Subject: add sbc_d8() --- ops.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'ops.yaml') diff --git a/ops.yaml b/ops.yaml index 3d6f7b8..71489b5 100644 --- a/ops.yaml +++ b/ops.yaml @@ -3579,6 +3579,8 @@ ops: hex: 0xDD cat: "invalid" op: XX + code: | + cpu_set_state(ctx, old_pc, GB_CPU_STATE_INVALID); - id: SBC A, d8 hex: 0xDE cat: "8-bit math" @@ -3594,7 +3596,7 @@ ops: h: H c: C code: | - cpu_set_state(ctx, old_pc, GB_CPU_STATE_INVALID); + sbc_d8(ctx, old_pc + 1); - id: RST 18H hex: 0xDF cat: "jumps/calls" @@ -9502,6 +9504,14 @@ templates: sbc(ctx, mmu_rb(ctx, cpu_rw(ctx, RW_HL))); } + static void + sbc_d8( + gb_t * const ctx, + const uint16_t addr + ) { + sbc(ctx, mmu_rb(ctx, addr)); + } + static void and( gb_t * const ctx, -- cgit v1.2.3