summaryrefslogtreecommitdiff
path: root/blastem.c
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2013-05-14 21:59:56 -0700
committerMike Pavone <pavone@retrodev.com>2013-05-14 21:59:56 -0700
commite405770744091c32a66f67ff315ef54a00241146 (patch)
tree9e6a7f503222dd7ba340924a3da3ecfa58e6299a /blastem.c
parent9fa33049138aaee23501e87a088bc08109e2a58c (diff)
Some Z80 interrupt fixes
Diffstat (limited to 'blastem.c')
-rw-r--r--blastem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/blastem.c b/blastem.c
index a25bba3..c16a178 100644
--- a/blastem.c
+++ b/blastem.c
@@ -170,8 +170,8 @@ void sync_z80(z80_context * z_context, uint32_t mclks)
z_context->sync_cycle = mclks / MCLKS_PER_Z80;
uint32_t vint_cycle = vdp_next_vint_z80(gen->vdp) / MCLKS_PER_Z80;
while (z_context->current_cycle < z_context->sync_cycle) {
- if (z_context->iff1 && z_context->current_cycle < ZVINT_CYCLE) {
- z_context->int_cycle = vint_cycle;
+ if (z_context->iff1 && z_context->current_cycle < vint_cycle) {
+ z_context->int_cycle = vint_cycle < z_context->int_enable_cycle ? z_context->int_enable_cycle : vint_cycle;
}
z_context->target_cycle = z_context->sync_cycle < z_context->int_cycle ? z_context->sync_cycle : z_context->int_cycle;
dprintf("Running Z80 from cycle %d to cycle %d. Native PC: %p\n", z_context->current_cycle, z_context->sync_cycle, z_context->native_pc);