summaryrefslogtreecommitdiff
path: root/z80_util.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2019-02-19 22:51:33 -0800
committerMichael Pavone <pavone@retrodev.com>2019-02-19 22:51:33 -0800
commita7792f6ea9784f9a085ecb50861f32082aa53518 (patch)
treee64293a6810c08026697c807843c8e8c3f6e3c98 /z80_util.c
parent405fd7b0318a6982339ef89ef1c066754adab1ee (diff)
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
Diffstat (limited to 'z80_util.c')
-rw-r--r--z80_util.c4
1 files changed, 2 insertions, 2 deletions
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)