From c8fbee1b62845e9894a849509527573cc96d48d1 Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 22 May 2025 06:20:04 +0200 Subject: [PATCH] Fixes to the two recently NSC Super I/O chips and the two boards that use the PC87309 (Tyan Tsunami ATX and the Freeway). --- src/machine/m_at_slot1.c | 1 - src/machine/m_at_slot2.c | 1 - src/sio/sio_pc87307.c | 4 +++- src/sio/sio_pc87309.c | 6 ++++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/machine/m_at_slot1.c b/src/machine/m_at_slot1.c index 773826316..c764b4229 100644 --- a/src/machine/m_at_slot1.c +++ b/src/machine/m_at_slot1.c @@ -585,7 +585,6 @@ machine_at_s1846_init(const machine_t *model) device_add(&i440bx_device); device_add(&piix4e_device); device_add_params(&pc87309_device, (void *) (PCX730X_AMI | PC87309_PC87309)); - device_add(&keyboard_ps2_ami_pci_device); device_add(&intel_flash_bxt_device); spd_register(SPD_TYPE_SDRAM, 0x7, 256); diff --git a/src/machine/m_at_slot2.c b/src/machine/m_at_slot2.c index 37c0acdfd..7bf412823 100644 --- a/src/machine/m_at_slot2.c +++ b/src/machine/m_at_slot2.c @@ -140,7 +140,6 @@ machine_at_fw6400gx_init(const machine_t *model) device_add(&i440gx_device); device_add(&piix4e_device); - device_add(&keyboard_ps2_ami_pci_device); device_add_params(&pc87309_device, (void *) (PCX730X_15C | PCX730X_AMI | PC87309_PC87309)); device_add(ics9xxx_get(ICS9250_08)); device_add(&sst_flash_29ee020_device); diff --git a/src/sio/sio_pc87307.c b/src/sio/sio_pc87307.c index 7bc9bb441..7e51c5975 100644 --- a/src/sio/sio_pc87307.c +++ b/src/sio/sio_pc87307.c @@ -12,11 +12,13 @@ * * Copyright 2020-2025 Miran Grca. */ +#include #include #include #include #include #include +#define HAVE_STDARG_H #include <86box/86box.h> #include <86box/io.h> #include <86box/timer.h> @@ -400,7 +402,7 @@ pc87307_write(uint16_t port, uint8_t val, void *priv) break; case 0x21: dev->regs[dev->cur_reg] = val; - fdc_toggle_flag(dev->fdc, FDC_FLAG_PS2_MCA, !!(val & 0x04)); + fdc_toggle_flag(dev->fdc, FDC_FLAG_PS2_MCA, !(val & 0x04)); break; case 0x22: dev->regs[dev->cur_reg] = val; diff --git a/src/sio/sio_pc87309.c b/src/sio/sio_pc87309.c index d2d3f4ac0..8bbbb7036 100644 --- a/src/sio/sio_pc87309.c +++ b/src/sio/sio_pc87309.c @@ -12,11 +12,13 @@ * * Copyright 2020-2025 Miran Grca. */ +#include #include #include #include #include #include +#define HAVE_STDARG_H #include <86box/86box.h> #include <86box/io.h> #include <86box/timer.h> @@ -249,7 +251,7 @@ superio_handler(pc87309_t *dev) pc87309_read, NULL, NULL, pc87309_write, NULL, NULL, dev); - switch (dev->regs[0x22] & 0x0b) { + switch (dev->regs[0x21] & 0x0b) { default: dev->superio_base = 0x0000; break; @@ -300,7 +302,7 @@ pc87309_write(uint16_t port, uint8_t val, void *priv) break; case 0x21: dev->regs[dev->cur_reg] = val; - fdc_toggle_flag(dev->fdc, FDC_FLAG_PS2_MCA, !!(val & 0x04)); + fdc_toggle_flag(dev->fdc, FDC_FLAG_PS2_MCA, !(val & 0x04)); superio_handler(dev); break; case 0x22: