]> cloudbase.mooo.com Git - z180-stamp-cpm3.git/commitdiff
use ?xmove (DMA) to copy ccp to/from extra bank
authorLeo C <erbl259-lmu@yahoo.de>
Fri, 12 Jun 2015 18:06:59 +0000 (20:06 +0200)
committerLeo C <erbl259-lmu@yahoo.de>
Fri, 12 Jun 2015 18:06:59 +0000 (20:06 +0200)
cbios/Makefile
cbios/boot.180
cbios/gencpm.dat

index e24e41f90ac012fd6606748aa7dc53ff6d47adfd..7324f37ec4198623c9561fce196d152ff10d606a 100644 (file)
@@ -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
 
index 2a43b75671a8bc0b88ae76a35248fa1646ca5bfa..7e8c0637935c4c94b83fb052dd818e6771341742 100644 (file)
@@ -11,7 +11,7 @@
        extrn   ioini1l,msginit,mmuinit,intinit,cpu_frq\r
        extrn   prt0ini,gs_rtc\r
        extrn   @civec,@covec,@aivec,@aovec,@lovec\r
-       extrn   @cbnk,?bnksl\r
+       extrn   @cbnk,?move,?xmove\r
 \r
        include config.inc\r
        include z180reg.inc\r
@@ -89,79 +89,58 @@ hwini_skip:
        ret\r
 \r
 \r
-       cseg                    ; boot loading must be done from resident memory\r
+       cseg            ; boot loading must be done from resident memory\r
 \r
 ;      This version of the boot loader loads the CCP from a file\r
 ;      called CCP.COM on the system drive (A:).\r
 \r
-\r
+       ; First time, load the A:CCP.COM file into TPA\r
 ?ldccp:\r
-                               ; First time, load the A:CCP.COM file into TPA\r
        ld      c,resetdsk\r
        call    bdos\r
        xor     a\r
-       ld      (ccp$fcb+15),a  ; zero extent\r
+       ld      (ccp$fcb+15),a          ; zero extent\r
        ld      hl,0\r
-       ld      (fcb$nr),hl     ; start at beginning of file\r
+       ld      (fcb$nr),hl             ; start at beginning of file\r
        ld      de,ccp$fcb\r
-       ld      c,open          ; open file containing CCP\r
+       ld      c,open                  ; open file containing CCP\r
        call    bdos\r
        inc     a\r
-       jp      z,no$ccp        ; error if no file...\r
+       jp      z,no$ccp                ; error if no file...\r
        ld      de,0100h\r
        ld      c,setdma                ; start of TPA\r
        call    bdos\r
        ld      de,128\r
-       ld      c,setmulti      ; allow up to 16k bytes\r
+       ld      c,setmulti              ; allow up to 16k bytes\r
        call    bdos\r
        ld      de,ccp$fcb\r
-       ld      c,read          ; load the thing\r
-       call    bdos            ; read records\r
-                               ; now,\r
-                               ;   copy CCP to bank 0 for reloading\r
-       ld      hl,0100h\r
-       ld      bc,ccpsize      ; clone 3K, just in case\r
-       ld      a,(@cbnk)\r
-       push    af              ; save current bank\r
-ld$1:\r
-       ld      a,tpa$bank\r
-       call    ?bnksl          ; select TPA\r
-       ld      a,(hl)\r
-       push    af              ; get a byte\r
-       ld      a,2\r
-       call    ?bnksl          ; select extra bank\r
-       pop     af\r
-       ld      (hl),a          ; save the byte\r
-       cpi                     ; bump pointer, drop count\r
-       jp      pe,ld$1\r
-       pop     af\r
-       call    ?bnksl          ; restore original bank\r
-       ret\r
-\r
-no$ccp:                                ; here if we couldn't find the file\r
-       call    pr.inln         ; report this...\r
-       db      13,10,'BIOS Err on A: No CCP.COM file',0\r
+       ld      c,read                  ; load the thing\r
+       call    bdos                    ; read records\r
 \r
-       call    ?conin          ; get a response\r
-       jp      ?ldccp          ; and try again\r
+       ; now, copy CCP to bank 0 for reloading\r
 \r
+       ld      bc,2*256 + tpa$bank     ; c: src$bnk, b: dst$bnk\r
+       jr      mov_ccp\r
 \r
+       ; just copy in the other direction\r
 ?rlccp:\r
+       ld      bc,tpa$bank*256 + 2     ; c: src$bnk, b: dst$bnk\r
+mov_ccp:\r
+       call    ?xmove\r
        ld      hl,0100h\r
-       ld      bc,ccpsize      ; clone 3K\r
-rl$1:\r
-       ld      a,2\r
-       call    ?bnksl          ; select extra bank\r
-       ld      a,(hl)          ; get a byte\r
-       ex      af,af'\r
-       ld      a,tpa$bank\r
-       call    ?bnksl          ; select TPA\r
-       ex      af,af'\r
-       ld      (hl),a          ; save the byte\r
-       cpi                     ; bump pointer, drop count\r
-       jp      pe,rl$1\r
+       ld      d,h\r
+       ld      e,l\r
+       ld      bc,ccpsize              ; clone 3K, just in case\r
+       call    ?move\r
        ret\r
 \r
+no$ccp:                                        ; here if we couldn't find the file\r
+       call    pr.inln                 ; report this...\r
+       db      13,10,'BIOS Err on A: No CCP.COM file',0\r
+\r
+       call    ?conin                  ; get a response\r
+       jr      ?ldccp                  ; and try again\r
+\r
 \r
 ccp$fcb:db     1,'CCP     ','COM',0,0,0,0\r
        ds      16\r
index 3a0c020c18cfece3ddc6d3cdb46164477d9b6c1d..33eeda6ca308d77de2e5601d84be36f4f79cca08 100644 (file)
@@ -4,9 +4,9 @@ PAGLEN   = 17
 BACKSPC  = N\r
 RUBOUT   = N\r
 BOOTDRV  = A\r
-MEMTOP   = EB\r
+MEMTOP   = FE\r
 BNKSWT   = Y\r
-COMBAS   = C0\r
+COMBAS   = F0\r
 LERROR   = Y\r
 NUMSEGS  = 03\r
 MEMSEG00 = 50,30,00\r