diff --git a/src/chipset/compaq_386.c b/src/chipset/compaq_386.c index 4eb21de72..6a015937e 100644 --- a/src/chipset/compaq_386.c +++ b/src/chipset/compaq_386.c @@ -37,6 +37,7 @@ #include <86box/vid_cga.h> #include <86box/vid_cga_comp.h> #include <86box/plat_unused.h> +#include <86box/chipset.h> #define RAM_DIAG_L_BASE_MEM_640KB 0x00 #define RAM_DIAG_L_BASE_MEM_INV 0x10 @@ -749,18 +750,22 @@ 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 (port == 0x0c02) { if (val) - mem_set_mem_state(0x000e0000, 0x00020000, MEM_READ_EXTANY | MEM_WRITE_EXTANY); + mem_set_mem_state(0x000e0000, 0x00020000, MEM_READ_EXTANY | MEM_WRITE_INTERNAL); else mem_set_mem_state(0x000e0000, 0x00020000, MEM_READ_INTERNAL | MEM_WRITE_INTERNAL); + + flushmmucache_nopc(); } } static void * compaq_genoa_init(UNUSED(const device_t *info)) { - io_sethandler(0x0c02, 3, NULL, NULL, NULL, NULL, compaq_genoa_outw, NULL, ram); + io_sethandler(0x0c02, 2, NULL, NULL, NULL, NULL, compaq_genoa_outw, NULL, NULL); + + device_add(&compaq_386_device); return ram; }