From: Leo C Date: Fri, 12 Jun 2015 18:06:59 +0000 (+0200) Subject: use ?xmove (DMA) to copy ccp to/from extra bank X-Git-Tag: hexrel-6.7~15 X-Git-Url: http://cloudbase.mooo.com/gitweb/z180-stamp-cpm3.git/commitdiff_plain/573b9c257400ca4c610eff4e48b12cc347ee5f25 use ?xmove (DMA) to copy ccp to/from extra bank --- diff --git a/cbios/Makefile b/cbios/Makefile index e24e41f..7324f37 100644 --- a/cbios/Makefile +++ b/cbios/Makefile @@ -109,7 +109,7 @@ bnkbios3.map: cpm3.sys ld80 -o /dev/null -ms bnkbios3.map -P $(PSEG) -D $(DSEG) $(OBJ) -cpm3.sys: bnkbios3.spr +cpm3.sys: bnkbios3.spr gencpm.dat zxcc gencpm -AUTO @echo diff --git a/cbios/boot.180 b/cbios/boot.180 index 2a43b75..7e8c063 100644 --- a/cbios/boot.180 +++ b/cbios/boot.180 @@ -11,7 +11,7 @@ extrn ioini1l,msginit,mmuinit,intinit,cpu_frq extrn prt0ini,gs_rtc extrn @civec,@covec,@aivec,@aovec,@lovec - extrn @cbnk,?bnksl + extrn @cbnk,?move,?xmove include config.inc include z180reg.inc @@ -89,79 +89,58 @@ hwini_skip: ret - cseg ; boot loading must be done from resident memory + cseg ; boot loading must be done from resident memory ; This version of the boot loader loads the CCP from a file ; called CCP.COM on the system drive (A:). - + ; First time, load the A:CCP.COM file into TPA ?ldccp: - ; First time, load the A:CCP.COM file into TPA ld c,resetdsk call bdos xor a - ld (ccp$fcb+15),a ; zero extent + ld (ccp$fcb+15),a ; zero extent ld hl,0 - ld (fcb$nr),hl ; start at beginning of file + ld (fcb$nr),hl ; start at beginning of file ld de,ccp$fcb - ld c,open ; open file containing CCP + ld c,open ; open file containing CCP call bdos inc a - jp z,no$ccp ; error if no file... + jp z,no$ccp ; error if no file... ld de,0100h ld c,setdma ; start of TPA call bdos ld de,128 - ld c,setmulti ; allow up to 16k bytes + ld c,setmulti ; allow up to 16k bytes call bdos ld de,ccp$fcb - ld c,read ; load the thing - call bdos ; read records - ; now, - ; copy CCP to bank 0 for reloading - ld hl,0100h - ld bc,ccpsize ; clone 3K, just in case - ld a,(@cbnk) - push af ; save current bank -ld$1: - ld a,tpa$bank - call ?bnksl ; select TPA - ld a,(hl) - push af ; get a byte - ld a,2 - call ?bnksl ; select extra bank - pop af - ld (hl),a ; save the byte - cpi ; bump pointer, drop count - jp pe,ld$1 - pop af - call ?bnksl ; restore original bank - ret - -no$ccp: ; here if we couldn't find the file - call pr.inln ; report this... - db 13,10,'BIOS Err on A: No CCP.COM file',0 + ld c,read ; load the thing + call bdos ; read records - call ?conin ; get a response - jp ?ldccp ; and try again + ; now, copy CCP to bank 0 for reloading + ld bc,2*256 + tpa$bank ; c: src$bnk, b: dst$bnk + jr mov_ccp + ; just copy in the other direction ?rlccp: + ld bc,tpa$bank*256 + 2 ; c: src$bnk, b: dst$bnk +mov_ccp: + call ?xmove ld hl,0100h - ld bc,ccpsize ; clone 3K -rl$1: - ld a,2 - call ?bnksl ; select extra bank - ld a,(hl) ; get a byte - ex af,af' - ld a,tpa$bank - call ?bnksl ; select TPA - ex af,af' - ld (hl),a ; save the byte - cpi ; bump pointer, drop count - jp pe,rl$1 + ld d,h + ld e,l + ld bc,ccpsize ; clone 3K, just in case + call ?move ret +no$ccp: ; here if we couldn't find the file + call pr.inln ; report this... + db 13,10,'BIOS Err on A: No CCP.COM file',0 + + call ?conin ; get a response + jr ?ldccp ; and try again + ccp$fcb:db 1,'CCP ','COM',0,0,0,0 ds 16 diff --git a/cbios/gencpm.dat b/cbios/gencpm.dat index 3a0c020..33eeda6 100644 --- a/cbios/gencpm.dat +++ b/cbios/gencpm.dat @@ -4,9 +4,9 @@ PAGLEN = 17 BACKSPC = N RUBOUT = N BOOTDRV = A -MEMTOP = EB +MEMTOP = FE BNKSWT = Y -COMBAS = C0 +COMBAS = F0 LERROR = Y NUMSEGS = 03 MEMSEG00 = 50,30,00