From fe0ed815a9aa5b59b9aa09d9312f362cba79f1e4 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Wed, 10 Jan 2018 21:48:55 -0600 Subject: [PATCH] Move bank switch set up for the mem init functions. This also changes bank_switch to mirror at boot what the reset function does later on. Without doing so, our init memory routines will fail. --- src/apple2.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/apple2.c b/src/apple2.c index 083b760..7b15448 100644 --- a/src/apple2.c +++ b/src/apple2.c @@ -66,6 +66,9 @@ apple2_create(int width, int height) return NULL; } + // This is more-or-less the same setup you do in apple2_reset(). + apple2_set_bank_switch(mach, MEMORY_ROM | MEMORY_WRITE | MEMORY_RAM2); + // Set the read/write mappers for everything apple2_mem_map(mach); @@ -125,11 +128,6 @@ apple2_create(int width, int height) // We default to lo-res mode. apple2_set_video(mach, VIDEO_LORES); - // At cold boot, we don't care what the bank switch is; the reset - // function will do the right thing, so let's default the flags to - // zero. - mach->bank_switch = 0; - // Let's install our bitmap font. mach->sysfont = vm_bitfont_create(mach->screen, objstore_apple2_sysfont(),