# HG changeset patch # User Michael Pavone # Date 1550303935 28800 # Node ID 28635b733d972f4fa0d4401c464d4f62b7972a30 # Parent 043cf458704cfcd48da332f915c3ebb1fc5f13f1 Add appropriate cycles for IO access diff -r 043cf458704c -r 28635b733d97 z80_util.c --- a/z80_util.c Fri Feb 15 23:58:34 2019 -0800 +++ b/z80_util.c Fri Feb 15 23:58:55 2019 -0800 @@ -32,6 +32,7 @@ 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 @@ 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;