From: Alan Cox Date: Fri, 25 May 2018 21:49:11 +0000 (+0100) Subject: trs80m1: set up the banks correctly X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=aa64ac2eb8a596dc3e799d4d5b0ababca79143ea;p=FUZIX.git trs80m1: set up the banks correctly --- diff --git a/Kernel/platform-trs80m1/discard.c b/Kernel/platform-trs80m1/discard.c index aeedbf80..f4415ce6 100644 --- a/Kernel/platform-trs80m1/discard.c +++ b/Kernel/platform-trs80m1/discard.c @@ -2,6 +2,7 @@ #include #include #include +#include void device_init(void) { @@ -20,15 +21,12 @@ uint8_t nbanks = 2; /* Default 2 banks, unless port 94 probe updates */ void pagemap_init(void) { -#ifdef CONFIG_MAP94 - int i = nbanks - 1; - while (i) { - pagemap_add(i); /* Mode 3, U64K low 32K mapped as low 32K */ - pagemap_add(i|0x80); /* Mode 3, U64K high 32K mapped as low 32K */ + int i = procmem / 32; /* How many banks do we have */ + if (i > MAX_MAPS) + i = MAX_MAPS; + i += 2; /* Banks 0/1 are the kernel and not included */ + while (i > 1) { + pagemap_add(i); i--; } -#else - pagemap_add(0x63); /* Mode 3, U64K low 32K mapped as low 32K */ - pagemap_add(0x73); /* Mode 3, U64K high 32K mapped as low 32K */ -#endif }