From 412ae3726b0e1882f2af5f3728e348b752582ef6 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 2 Jan 2018 21:35:25 +0100 Subject: [PATCH] Implemented the OPTi 495 A20 state switch (register 0x27 bit 7), fixes the A20 gate stuck error. --- src/machine/m_at_opti495.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/machine/m_at_opti495.c b/src/machine/m_at_opti495.c index 2033f4153..e629ffb25 100644 --- a/src/machine/m_at_opti495.c +++ b/src/machine/m_at_opti495.c @@ -292,6 +292,12 @@ static void opti495_write(uint16_t addr, uint8_t val, void *p) else mem_set_mem_state(0xf0000, 0x10000, MEM_READ_EXTERNAL | MEM_WRITE_INTERNAL); } + if (optireg == 0x27) + { + mem_a20_key = (val & 0x80) ? 0x00 : 0x02; + mem_a20_recalc(); + flushmmucache(); + } } break; }