From 96eb247e9ac59e325e94452eda4504fda33dab8c Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 7 Sep 2020 23:11:46 +0200 Subject: [PATCH] Added the variant of the PC87309 Super I/O chip on ports 15Ch and 15Dh. --- src/include/86box/sio.h | 1 + src/machine/m_at_slot2.c | 2 +- src/sio/sio_pc87309.c | 19 +++++++++++++++++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/include/86box/sio.h b/src/include/86box/sio.h index a06c95cdb..ee155f3fa 100644 --- a/src/include/86box/sio.h +++ b/src/include/86box/sio.h @@ -32,6 +32,7 @@ extern const device_t pc87306_device; extern const device_t pc87307_device; extern const device_t pc87307_15c_device; extern const device_t pc87309_device; +extern const device_t pc87309_15c_device; extern const device_t pc87332_device; extern const device_t pc87332_ps1_device; extern const device_t pc97307_device; diff --git a/src/machine/m_at_slot2.c b/src/machine/m_at_slot2.c index ab77c8006..525e26ea7 100644 --- a/src/machine/m_at_slot2.c +++ b/src/machine/m_at_slot2.c @@ -180,7 +180,7 @@ 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(&pc87309_device); + device_add(&pc87309_15c_device); device_add(&sst_flash_29ee020_device); spd_register(SPD_TYPE_SDRAM, 0xF, 512); diff --git a/src/sio/sio_pc87309.c b/src/sio/sio_pc87309.c index 42dfb4f8c..ecbc76de7 100644 --- a/src/sio/sio_pc87309.c +++ b/src/sio/sio_pc87309.c @@ -460,8 +460,13 @@ pc87309_init(const device_t *info) pc87309_reset(dev); - io_sethandler(0x02e, 0x0002, - pc87309_read, NULL, NULL, pc87309_write, NULL, NULL, dev); + if (info->local & 0x100) { + io_sethandler(0x15c, 0x0002, + pc87309_read, NULL, NULL, pc87309_write, NULL, NULL, dev); + } else { + io_sethandler(0x02e, 0x0002, + pc87309_read, NULL, NULL, pc87309_write, NULL, NULL, dev); + } return dev; } @@ -475,3 +480,13 @@ const device_t pc87309_device = { NULL, NULL, NULL, NULL }; + + +const device_t pc87309_15c_device = { + "National Semiconductor PC87309 Super I/O (Port 15Ch)", + 0, + 0x1e0, + pc87309_init, pc87309_close, NULL, + NULL, NULL, NULL, + NULL +};