From 4784cb411803b79cdfdf49d3c248c6f69229a913 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Fri, 15 Feb 2019 23:58:55 -0800 Subject: Add appropriate cycles for IO access --- z80_util.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'z80_util.c') diff --git a/z80_util.c b/z80_util.c index f2391b4..949d55e 100644 --- a/z80_util.c +++ b/z80_util.c @@ -32,6 +32,7 @@ void z80_io_read8(z80_context *context) context->opts->gen.memmap = context->io_map; context->opts->gen.memmap_chunks = context->io_chunks; + context->cycles += 4 * context->opts->gen.clock_divider; context->scratch1 = read_byte(context->scratch1, (void **)context->mem_pointers, &context->opts->gen, context); context->opts->gen.address_mask = tmp_mask; @@ -49,6 +50,7 @@ void z80_io_write8(z80_context *context) context->opts->gen.memmap = context->io_map; context->opts->gen.memmap_chunks = context->io_chunks; + context->cycles += 4 * context->opts->gen.clock_divider; write_byte(context->scratch2, context->scratch1, (void **)context->mem_pointers, &context->opts->gen, context); context->opts->gen.address_mask = tmp_mask; -- cgit v1.2.3