From: Alan Cox Date: Fri, 6 Jul 2018 00:15:28 +0000 (+0100) Subject: trs80m1: further selector work X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=a4860e254425e8a589b9a7697aeb4e6ebb211345;p=FUZIX.git trs80m1: further selector work Generalize the fork code --- diff --git a/Kernel/platform-trs80m1/tricks.s b/Kernel/platform-trs80m1/tricks.s index ecf26e3d..4925f252 100644 --- a/Kernel/platform-trs80m1/tricks.s +++ b/Kernel/platform-trs80m1/tricks.s @@ -8,6 +8,12 @@ .globl bankfork ; for debugging + .globl bankpatch1 ; so the mapping code can patch us + .globl bankpatch2 + + + .area _COMMONMEM + ; ; This is related so we will keep it here. Copy the process memory ; for a fork. a is the page base of the parent, c of the child @@ -16,7 +22,7 @@ ; really matters on a 1.77Mhz processor ! ; ; Interrupts are off so I guess the stack pointer is spare (Watch -; out for NMI if we do model 3 this way!) +; out for NMI as we do model 3 this way!) ; bankfork: ld (cpatch0 + 1),a ; patch parent into loop @@ -38,6 +44,7 @@ copyloop: ex af,af' ; Save A as we need an A for ioports cpatch0: ld a,#0 ; parent bank (patched in for speed) +bankpatch1: out (0x43),a pop bc ; copy 16 bytes out of parent pop de @@ -51,6 +58,7 @@ cpatch0: ld (sp_patch+1),sp cpatch1: ld a,#0 ; child bank (also patched in for speed) +bankpatch2: out (0x43),a push iy ; and put them back into the child push ix diff --git a/Kernel/platform-trs80m1/trs80-bank.s b/Kernel/platform-trs80m1/trs80-bank.s index ad3a10e9..542615b0 100644 --- a/Kernel/platform-trs80m1/trs80-bank.s +++ b/Kernel/platform-trs80m1/trs80-bank.s @@ -26,6 +26,9 @@ .globl vtbufinit .globl _trs80_mapper + .globl bankpatch1 + .globl bankpatch2 + .globl s__COMMONMEM .globl l__COMMONMEM @@ -138,7 +141,12 @@ mapper_init: ld (map_bank1),hl inc h ld (map_bank2),hl + ret mapper_selector: + ; Patch the fast copier for our port numbering + ld a,#0x1f + ld (bankpatch1 + 1),a + ld (bankpatch2 + 1),a ret ;------------------------------------------------------------------------------