From a386ef64f6376b3ef8434a6cdf456495287fcbca Mon Sep 17 00:00:00 2001 From: Peter Fors Date: Mon, 31 Mar 2025 20:31:05 +0200 Subject: currently 90% working --- cpu_opcodes.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cpu_opcodes.c') diff --git a/cpu_opcodes.c b/cpu_opcodes.c index 2d308da..5fd5634 100644 --- a/cpu_opcodes.c +++ b/cpu_opcodes.c @@ -544,7 +544,9 @@ static void opcode_clc(struct nes_state * restrict state) { static void opcode_cld(struct nes_state * restrict state) { struct cpu_state * restrict cpu = &state->cpu; memory_read_dummy(state, cpu->pc); +#ifdef ENABLE_DECIMAL_MODE cpu->d = 0; +#endif } static void opcode_cli(struct nes_state * restrict state) { @@ -568,7 +570,9 @@ static void opcode_sec(struct nes_state * restrict state) { static void opcode_sed(struct nes_state * restrict state) { struct cpu_state * restrict cpu = &state->cpu; memory_read_dummy(state, cpu->pc); +#ifdef ENABLE_DECIMAL_MODE cpu->d = 1; +#endif } static void opcode_sei(struct nes_state * restrict state) { -- cgit v1.2.3