Mercurial > repos > simple16
diff src/cpu.c @ 20:a9364f5ee81a
Fix timing of port IO
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 29 Mar 2016 19:57:34 -0700 |
parents | d8ae30286d17 |
children | fb14515266f4 |
line wrap: on
line diff
--- a/src/cpu.c Mon Mar 28 23:43:31 2016 -0700 +++ b/src/cpu.c Tue Mar 29 19:57:34 2016 -0700 @@ -100,6 +100,7 @@ uint16_t cpu_read_port(cpu *context, uint8_t port) { + context->cycles += context->clock_inc; port &= 0xF; if (context->port_handlers[port].read) { return context->port_handlers[port].read(context, port); @@ -109,6 +110,7 @@ void cpu_write_port(cpu *context, uint8_t port, uint16_t value) { + context->cycles += context->clock_inc; port &= 0xF; if (context->port_handlers[port].write) { context->port_handlers[port].write(context, port, value);