Mercurial > repos > blastem
changeset 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 | 788545f4064f |
children | 7c46891a29b1 |
files | blastem.c z80_to_x86.c |
diffstat | 2 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/blastem.c Wed Jun 18 16:39:42 2014 -0700 +++ b/blastem.c Thu Jun 19 08:14:35 2014 -0700 @@ -192,11 +192,11 @@ } 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 + Z80_VINT_DURATION)) { + if (z_context->iff1 && z_context->int_cycle == CYCLE_NEVER && 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; - 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); + 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); z80_run(z_context); dprintf("Z80 ran to cycle %d\n", z_context->current_cycle); }
--- a/z80_to_x86.c Wed Jun 18 16:39:42 2014 -0700 +++ b/z80_to_x86.c Thu Jun 19 08:14:35 2014 -0700 @@ -1964,6 +1964,7 @@ context->banked_code_map = malloc(sizeof(native_map_slot) * (1 << 9)); memset(context->banked_code_map, 0, sizeof(native_map_slot) * (1 << 9)); context->options = options; + context->int_cycle = 0xFFFFFFFF; } void z80_reset(z80_context * context)