From 904ac544462043688be26401be9fd9cee1a3a62c Mon Sep 17 00:00:00 2001 From: SarahW Date: Wed, 19 Jul 2017 19:35:44 +0100 Subject: [PATCH] Move A20 gate initialisation to mem.c. Patch from Greatpsycho. --- src/mem.c | 5 ++++- src/model.c | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mem.c b/src/mem.c index 25fb4f7..be215ad 100644 --- a/src/mem.c +++ b/src/mem.c @@ -1938,7 +1938,7 @@ void mem_add_bios() } int mem_a20_key = 0, mem_a20_alt = 0; -static int mem_a20_state = 1; +static int mem_a20_state = 2; void mem_init() { @@ -2000,6 +2000,8 @@ void mem_init() if (romset == ROM_IBMPS1_2011) mem_mapping_add(&romext_mapping, 0xc8000, 0x08000, mem_read_romext, mem_read_romextw, mem_read_romextl, NULL, NULL, NULL, romext, 0, NULL); // pclog("Mem resize %i %i\n",mem_size,c); + mem_a20_key = 2; + mem_a20_alt = 0; } static void mem_remap_top(int max_size) @@ -2091,6 +2093,7 @@ void mem_resize() // pclog("Mem resize %i %i\n",mem_size,c); mem_a20_key = 2; + mem_a20_alt = 0; mem_a20_recalc(); } diff --git a/src/model.c b/src/model.c index d26d293..8fecc2a 100644 --- a/src/model.c +++ b/src/model.c @@ -308,7 +308,6 @@ void xt_laserxt_init() void at_init() { AT = 1; - mem_a20_key = mem_a20_alt = 0; common_init(); mem_add_bios(); pit_set_out_func(&pit, 1, pit_refresh_timer_at);