From 607230ae185b91ca83340f15544f5723f488a666 Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 18 Nov 2020 03:30:13 +0100 Subject: [PATCH] Fixed the VIA machines. --- src/chipset/via_apollo.c | 12 +++--------- src/include/86box/sio.h | 1 + src/machine/m_at_socket7.c | 4 ++-- src/sio/sio_fdc37c669.c | 12 +++++++++++- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/chipset/via_apollo.c b/src/chipset/via_apollo.c index c8055fbb4..f1c468460 100644 --- a/src/chipset/via_apollo.c +++ b/src/chipset/via_apollo.c @@ -363,20 +363,16 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv) apollo_smram_map(dev, 1, 0x000a0000, 0x00020000, 1); /* SMM: Code DRAM, Data DRAM */ apollo_smram_map(dev, 0, 0x000a0000, 0x00020000, 3); /* Non-SMM: Code Invalid, Data Invalid */ break; - } else if(dev->id >= VIA_597) switch (val & 0x03) { + } else if (dev->id >= VIA_597) switch (val & 0x03) { case 0x00: default: /* Disable SMI Address Redirection (default) */ apollo_smram_map(dev, 1, 0x000a0000, 0x00020000, 0); - if (dev->id == VIA_597) - apollo_smram_map(dev, 1, 0x00030000, 0x00020000, 1); apollo_smram_map(dev, 0, 0x000a0000, 0x00020000, 0); break; case 0x01: /* Allow access to DRAM Axxxx-Bxxxx for both normal and SMI cycles */ apollo_smram_map(dev, 1, 0x000a0000, 0x00020000, 1); - if (dev->id == VIA_597) - apollo_smram_map(dev, 1, 0x00030000, 0x00020000, 1); apollo_smram_map(dev, 0, 0x000a0000, 0x00020000, 1); break; case 0x02: @@ -391,8 +387,6 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv) case 0x03: /* Allow SMI Axxxx-Bxxxx DRAM access */ apollo_smram_map(dev, 1, 0x000a0000, 0x00020000, 1); - if (dev->id == VIA_597) - apollo_smram_map(dev, 1, 0x00030000, 0x00020000, 1); apollo_smram_map(dev, 0, 0x000a0000, 0x00020000, 0); break; } else switch(val & 0x03) { @@ -711,7 +705,7 @@ const device_t via_vpx_device = { "VIA Apollo VPX", DEVICE_PCI, - VIA_597, /*VT82C585*/ + VIA_585, /*VT82C585*/ via_apollo_init, via_apollo_close, via_apollo_reset, @@ -725,7 +719,7 @@ const device_t amd640_device = { "AMD 640 System Controller", DEVICE_PCI, - VIA_597, /*VT82C595*/ + VIA_595, /*VT82C595*/ via_apollo_init, via_apollo_close, via_apollo_reset, diff --git a/src/include/86box/sio.h b/src/include/86box/sio.h index f913d9835..df4d84a73 100644 --- a/src/include/86box/sio.h +++ b/src/include/86box/sio.h @@ -25,6 +25,7 @@ extern const device_t fdc37c663_device; extern const device_t fdc37c665_device; extern const device_t fdc37c666_device; extern const device_t fdc37c669_device; +extern const device_t fdc37c669_370_device; extern const device_t fdc37c931apm_device; extern const device_t fdc37c931apm_compaq_device; extern const device_t fdc37c932fr_device; diff --git a/src/machine/m_at_socket7.c b/src/machine/m_at_socket7.c index 3a902855e..c2d2d6e5d 100644 --- a/src/machine/m_at_socket7.c +++ b/src/machine/m_at_socket7.c @@ -1028,7 +1028,7 @@ machine_at_ficva502_init(const machine_t *model) device_add(&via_vpx_device); device_add(&via_vt82c586b_device); device_add(&keyboard_ps2_pci_device); - device_add(&fdc37c669_device); + device_add(&fdc37c669_370_device); device_add(&sst_flash_29ee010_device); spd_register(SPD_TYPE_SDRAM, 0x3, 256); @@ -1062,7 +1062,7 @@ machine_at_ficpa2012_init(const machine_t *model) device_add(&via_vt82c586b_device); device_add(&keyboard_ps2_pci_device); device_add(&w83877f_device); - device_add(&sst_flash_39sf010_device); + device_add(&sst_flash_29ee010_device); spd_register(SPD_TYPE_SDRAM, 0x7, 512); return ret; diff --git a/src/sio/sio_fdc37c669.c b/src/sio/sio_fdc37c669.c index d9797d38d..b2d76814e 100644 --- a/src/sio/sio_fdc37c669.c +++ b/src/sio/sio_fdc37c669.c @@ -281,7 +281,7 @@ fdc37c669_init(const device_t *info) dev->uart[0] = device_add_inst(&ns16550_device, 1); dev->uart[1] = device_add_inst(&ns16550_device, 2); - io_sethandler(0x3f0, 0x0002, + io_sethandler(info->local ? 0x370 : 0x3f0, 0x0002, fdc37c669_read, NULL, NULL, fdc37c669_write, NULL, NULL, dev); fdc37c669_reset(dev); @@ -298,3 +298,13 @@ const device_t fdc37c669_device = { { NULL }, NULL, NULL, NULL }; + + +const device_t fdc37c669_370_device = { + "SMC FDC37C669 Super I/O (Port 370h)", + 0, + 1, + fdc37c669_init, fdc37c669_close, NULL, + { NULL }, NULL, NULL, + NULL +};