# HG changeset patch # User Mike Pavone # Date 1371365459 25200 # Node ID de2c085ce1740621fc063aa60aeef15128fee9a2 # Parent f54af24aad1dbe113048a966a56dad3ad420d96f Assert z80 interrupt longer so that they are not missed when they should not be diff -r f54af24aad1d -r de2c085ce174 blastem.c --- a/blastem.c Sat Jun 15 23:10:48 2013 -0700 +++ b/blastem.c Sat Jun 15 23:50:59 2013 -0700 @@ -170,6 +170,8 @@ #define dputs #endif +#define Z80_VINT_DURATION 128 + void sync_z80(z80_context * z_context, uint32_t mclks) { if (z80_enabled && !reset && !busreq) { @@ -181,7 +183,7 @@ 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 < vint_cycle) { + if (z_context->iff1 && z_context->current_cycle < (vint_cycle + Z80_VINT_DURATION)) { 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;