diff --git a/src/port_6x.c b/src/port_6x.c index 750b9678c..971b92d28 100644 --- a/src/port_6x.c +++ b/src/port_6x.c @@ -46,6 +46,8 @@ #define PORT_6X_MIRROR 4 #define PORT_6X_SWA 8 +static int cycles_sub = 0; + static void port_6x_write(uint16_t port, uint8_t val, void *priv) { @@ -53,7 +55,7 @@ port_6x_write(uint16_t port, uint8_t val, void *priv) port &= 3; - cycles -= ISA_CYCLES(8); + cycles -= cycles_sub; if ((port == 3) && (dev->flags & PORT_6X_MIRROR)) port = 1; @@ -83,7 +85,7 @@ port_61_read_simple(UNUSED(uint16_t port), UNUSED(void *priv)) { uint8_t ret = ppi.pb & 0x1f; - cycles -= ISA_CYCLES(8); + cycles -= cycles_sub; if (ppispeakon) ret |= 0x20; @@ -97,7 +99,7 @@ port_61_read(UNUSED(uint16_t port), void *priv) const port_6x_t *dev = (port_6x_t *) priv; uint8_t ret = 0xff; - cycles -= ISA_CYCLES(8); + cycles -= cycles_sub; if (dev->flags & PORT_6X_EXT_REF) { ret = ppi.pb & 0x0f; @@ -197,6 +199,8 @@ port_6x_init(const device_t *info) if (dev->flags & PORT_6X_SWA) io_sethandler(0x0062, 1, port_62_read, NULL, NULL, NULL, NULL, NULL, dev); + cycles_sub = is486 ? ISA_CYCLES(8) : 0; + return dev; }