From a7792f6ea9784f9a085ecb50861f32082aa53518 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Tue, 19 Feb 2019 22:51:33 -0800 Subject: Store sync_cycle in context rather than in a local in CPU DSL. Fix the timing of a number of instructions in new Z80 core --- z80_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'z80_util.c') diff --git a/z80_util.c b/z80_util.c index 949d55e..9802809 100644 --- a/z80_util.c +++ b/z80_util.c @@ -91,7 +91,7 @@ z80_context * init_z80_context(z80_options *options) return context; } -uint32_t z80_sync_cycle(z80_context *context, uint32_t target_cycle) +void z80_sync_cycle(z80_context *context, uint32_t target_cycle) { if (context->iff1 && context->int_cycle < target_cycle) { if (context->cycles > context->int_end_cycle) { @@ -103,7 +103,7 @@ uint32_t z80_sync_cycle(z80_context *context, uint32_t target_cycle) if (context->nmi_cycle < target_cycle) { target_cycle = context->nmi_cycle; } - return target_cycle; + context->sync_cycle = target_cycle; } void z80_run(z80_context *context, uint32_t target_cycle) -- cgit v1.2.3