From 4c42cc1596a2a499aad44e3ffd0a42922fbefb39 Mon Sep 17 00:00:00 2001 From: SarahW Date: Mon, 6 Nov 2017 22:10:32 +0000 Subject: [PATCH] Implement Headland fast reset. Fixes AMI 386SX clone. --- src/headland.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/headland.c b/src/headland.c index b4f460f..b3bc4d0 100644 --- a/src/headland.c +++ b/src/headland.c @@ -2,6 +2,7 @@ #include "io.h" #include "mem.h" #include "cpu.h" +#include "x86.h" #include "headland.h" @@ -12,6 +13,8 @@ void headland_write(uint16_t addr, uint8_t val, void *priv) { if (addr & 1) { + uint8_t old_val = headland_regs[headland_index]; + if (headland_index == 0xc1 && !is486) val = 0; headland_regs[headland_index] = val; pclog("Headland write %02X %02X\n",headland_index,val); @@ -24,6 +27,11 @@ void headland_write(uint16_t addr, uint8_t val, void *priv) else mem_set_mem_state(0xf0000, 0x10000, MEM_READ_EXTERNAL | MEM_WRITE_INTERNAL); } + else if (headland_index == 0x87) + { + if ((val & 1) && !(old_val & 1)) + softresetx86(); + } } else headland_index = val;