From 74c4af579ad6861bd61b13e81e56768e33cbacd3 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 22 Jul 2024 19:46:27 +0200 Subject: [PATCH] Genoa Unknown 486: Redirect 0C02h writes directly to Compaq 80C00000h writes, fixes the soft reset hang without having to reset the memory mapping on soft reset. --- src/chipset/compaq_386.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/src/chipset/compaq_386.c b/src/chipset/compaq_386.c index a0bd036f3..3b40734aa 100644 --- a/src/chipset/compaq_386.c +++ b/src/chipset/compaq_386.c @@ -750,28 +750,18 @@ compaq_386_init(UNUSED(const device_t *info)) static void compaq_genoa_outw(uint16_t port, uint16_t val, void *priv) { - if (port == 0x0c02) { - if (val) - mem_set_mem_state(0x000e0000, 0x00020000, MEM_READ_EXTANY | MEM_WRITE_EXTANY); - else - mem_set_mem_state(0x000e0000, 0x00020000, MEM_READ_INTERNAL | MEM_WRITE_INTERNAL); - - flushmmucache_nopc(); - } -} - -static void -compaq_genoa_reset(void *priv) -{ - mem_set_mem_state(0x000e0000, 0x00020000, MEM_READ_EXTANY | MEM_WRITE_EXTANY); + if (port == 0x0c02) + cpq_write_regs(0x80c00000, val, priv); } static void * compaq_genoa_init(UNUSED(const device_t *info)) { - io_sethandler(0x0c02, 2, NULL, NULL, NULL, NULL, compaq_genoa_outw, NULL, NULL); + void *cpq = device_add(&compaq_386_device); - device_add(&compaq_386_device); + pclog_toggle_suppr(); + + io_sethandler(0x0c02, 2, NULL, NULL, NULL, NULL, compaq_genoa_outw, NULL, cpq); return ram; } @@ -793,11 +783,11 @@ const device_t compaq_386_device = { const device_t compaq_genoa_device = { .name = "Compaq Genoa Memory Control", .internal_name = "compaq_genoa", - .flags = DEVICE_SOFTRESET, + .flags = 0, .local = 0, .init = compaq_genoa_init, .close = NULL, - .reset = compaq_genoa_reset, + .reset = NULL, { .available = NULL }, .speed_changed = NULL, .force_redraw = NULL,