comparison blastem.c @ 625:6aa2a8ab9c70

Slight cleanup of vint handling on the Z80
author Michael Pavone <pavone@retrodev.com>
date Thu, 19 Jun 2014 08:14:35 -0700
parents 66cc60215e5c
children 041578693329
comparison
equal deleted inserted replaced
624:788545f4064f 625:6aa2a8ab9c70
190 z80_reset(z_context); 190 z80_reset(z_context);
191 need_reset = 0; 191 need_reset = 0;
192 } 192 }
193 uint32_t vint_cycle = vdp_next_vint_z80(gen->vdp) / MCLKS_PER_Z80; 193 uint32_t vint_cycle = vdp_next_vint_z80(gen->vdp) / MCLKS_PER_Z80;
194 while (z_context->current_cycle < z_context->sync_cycle) { 194 while (z_context->current_cycle < z_context->sync_cycle) {
195 if (z_context->iff1 && z_context->current_cycle < (vint_cycle + Z80_VINT_DURATION)) { 195 if (z_context->iff1 && z_context->int_cycle == CYCLE_NEVER && z_context->current_cycle < (vint_cycle + Z80_VINT_DURATION)) {
196 z_context->int_cycle = vint_cycle < z_context->int_enable_cycle ? z_context->int_enable_cycle : vint_cycle; 196 z_context->int_cycle = vint_cycle < z_context->int_enable_cycle ? z_context->int_enable_cycle : vint_cycle;
197 } 197 }
198 z_context->target_cycle = z_context->sync_cycle < z_context->int_cycle ? z_context->sync_cycle : z_context->int_cycle; 198 z_context->target_cycle = z_context->sync_cycle < z_context->int_cycle ? z_context->sync_cycle : z_context->int_cycle;
199 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); 199 dprintf("Running Z80 from cycle %d to cycle %d. Int cycle: %d\n", z_context->current_cycle, z_context->sync_cycle, z_context->int_cycle);
200 z80_run(z_context); 200 z80_run(z_context);
201 dprintf("Z80 ran to cycle %d\n", z_context->current_cycle); 201 dprintf("Z80 ran to cycle %d\n", z_context->current_cycle);
202 } 202 }
203 } 203 }
204 } else { 204 } else {