From e35f05b94fe57296800cc9977c62278434577df1 Mon Sep 17 00:00:00 2001 From: Samuel Walker Date: Tue, 4 Feb 2025 15:46:38 -0700 Subject: [PATCH] memory timing passed --- lib/cpu_proc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/cpu_proc.c b/lib/cpu_proc.c index 588f323..4146d2a 100644 --- a/lib/cpu_proc.c +++ b/lib/cpu_proc.c @@ -117,7 +117,7 @@ static void proc_cb(cpu_context *ctx) { emu_cycles(1); if(reg == RT_HL) { - emu_cycles(2); + //emu_cycles(2); } switch(bit_op) { @@ -333,11 +333,11 @@ static void proc_inc(cpu_context *ctx) { u16 val = cpu_read_reg(ctx->cur_inst->reg_1) + 1; if(is_16_bit(ctx->cur_inst->reg_1)) { - emu_cycles(1); + //emu_cycles(1); } if (ctx->cur_inst->reg_1 == RT_HL && ctx->dest_is_mem) { - val = bus_read(cpu_read_reg(RT_HL)) + 1; + val = ctx->fetched_data + 1; val &= 0xFF; bus_write(cpu_read_reg(RT_HL), val); } else { @@ -356,11 +356,11 @@ static void proc_dec(cpu_context *ctx) { u16 val = cpu_read_reg(ctx->cur_inst->reg_1) - 1; if(is_16_bit(ctx->cur_inst->reg_1)) { - emu_cycles(1); + //emu_cycles(1); } if (ctx->cur_inst->reg_1 == RT_HL && ctx->dest_is_mem) { - val = bus_read(cpu_read_reg(RT_HL)) - 1; + val = ctx->fetched_data - 1; val &= 0xFF; bus_write(cpu_read_reg(RT_HL), val); } else {