]> cloudbase.mooo.com Git - z180-stamp-cpm3.git/blobdiff - cbios/move.180
interbank move via dma. (re)enable multisector transfer
[z180-stamp-cpm3.git] / cbios / move.180
index 92b56ceacaf8c7f595e1cfdb9167eb67c57397c3..1e46c825ee1edeb3e45ef2c980d1b539b7bd2461 100644 (file)
    if banked
 
 inter_bank_move:               ; source in HL, dest in DE, count in BC
-    if 0                       ; *** DOES NOT WORK PROPERLY
-                               ;     (Crossing Bank boundary problems)
+
+    if 1                       ; works with new memory map
+
        push    bc
        push    de
        push    hl
 
-;TODO: check if source range crosses bank/common boundary
+       out0    (bcr0l),c       ; setup DMA count
+       out0    (bcr0h),b
 
        ld      a,(src$bnk)
        call    bnk2phy
@@ -61,8 +63,6 @@ inter_bank_move:              ; source in HL, dest in DE, count in BC
        out0    (sar0h),h
        out0    (sar0b),a
 
-;TODO: check if destination range crosses bank/common boundary
-
        ex      de,hl
        ld      a,(dst$bnk)
        call    bnk2phy
@@ -73,8 +73,6 @@ inter_bank_move:              ; source in HL, dest in DE, count in BC
 
        ld      a,M_MMOD        ; DMA burst mode
        out0    (dmode),a
-       out0    (bcr0l),c       ; setup DMA count
-       out0    (bcr0h),b
        ld      a,M_DE0+M_NDWE1 ; enable DMA0
        out0    (dstat),a       ; move the block
 
@@ -92,7 +90,7 @@ inter_bank_move:              ; source in HL, dest in DE, count in BC
 
        ret                     ; return with src in DE, dst in HL, count = 0
 
-    else                       ; *** INNEFICIENT, BUT WORKS
+    else                       ; inefficient fall back
 
        ld      (tmp$sp),sp
        ld      sp,tmp$stk