From d885258eaa6f343a2207e8423da12cfcdb6f3c4f Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 10 Jul 2022 21:38:43 +0200 Subject: [PATCH] Fixed port_6x_init(). --- src/port_6x.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/port_6x.c b/src/port_6x.c index 62b1558fb..c583ffdf0 100644 --- a/src/port_6x.c +++ b/src/port_6x.c @@ -170,20 +170,24 @@ port_6x_init(const device_t *info) dev->flags = info->local & 0xff; - if (!(dev->flags & PORT_6X_TURBO) || (dev->flags & PORT_6X_EXT_REF)) - io_sethandler(0x0061, 1, port_61_read_simple, NULL, NULL, port_6x_write, NULL, NULL, dev); - else + if (dev->flags & (PORT_6X_TURBO | PORT_6X_EXT_REF)) { io_sethandler(0x0061, 1, port_61_read, NULL, NULL, port_6x_write, NULL, NULL, dev); + if (dev->flags & PORT_6X_EXT_REF) + timer_add(&dev->refresh_timer, port_6x_refresh, dev, 1); + + if (dev->flags & PORT_6X_MIRROR) + io_sethandler(0x0063, 1, port_61_read, NULL, NULL, port_6x_write, NULL, NULL, dev); + } else { + io_sethandler(0x0061, 1, port_61_read_simple, NULL, NULL, port_6x_write, NULL, NULL, dev); + + if (dev->flags & PORT_6X_MIRROR) + io_sethandler(0x0063, 1, port_61_read_simple, NULL, NULL, port_6x_write, NULL, NULL, dev); + } + if (dev->flags & PORT_6X_SWA) io_sethandler(0x0062, 1, port_62_read, NULL, NULL, NULL, NULL, NULL, dev); - if (dev->flags & PORT_6X_MIRROR) - io_sethandler(0x0063, 1, port_61_read, NULL, NULL, port_6x_write, NULL, NULL, dev); - - if (dev->flags & PORT_6X_EXT_REF) - timer_add(&dev->refresh_timer, port_6x_refresh, dev, 1); - return dev; }