Bring drivewire.s changes across from coco3.
authorNeal Andrew Crook <neal@pippaluk.org.uk>
Sat, 11 Jun 2016 18:39:57 +0000 (19:39 +0100)
committerNeal Andrew Crook <neal@pippaluk.org.uk>
Fri, 1 Jul 2016 20:38:55 +0000 (21:38 +0100)
Comment out drivewire poll call here because I've not made any of the other
changes needed for drivewire support yet.
Corrections to some code comments.

Kernel/platform-multicomp09/devtty.c
Kernel/platform-multicomp09/drivewire.s
Kernel/platform-multicomp09/multicomp09.s
Kernel/platform-multicomp09/tricks.s

index 73ee51b..a0d3a07 100644 (file)
@@ -188,7 +188,7 @@ void platform_interrupt(void)
                timer_interrupt();
        }
 
-       dw_vpoll();
+        //     dw_vpoll();
 }
 
 
index 8582fc7..214d468 100644 (file)
@@ -53,9 +53,11 @@ _dw_reset:
 
 _dw_operation:
        pshs y
+       ldd 6,x         ; test for kernel/usr mapping
+       beq kern@       ; is zero, so must be a kernel xfer.
+       jsr map_process_always
        ; get parameters from C, X points to cmd packet
-       ldy 4,s         ; driveptr
-       lda ,y          ; for now, contains minor = drive number directly
+kern@  lda 5,x         ; minor = drive number
        ldb ,x          ; write flag
        ; buffer location into Y
        ldy 3,x
@@ -69,7 +71,8 @@ _dw_operation:
 @done  bcs @err
        bne @err
        ldx #0
-@ret   puls y,pc
+@ret   jsr map_kernel
+       puls y,pc
 @err   ldx #0xFFFF
        bra @ret
 
@@ -127,9 +130,9 @@ ReRead   pshs  a
         ldy   #$0005
         lbsr  DWWrite
         puls  a
-        ldx   4,s                      get read buffer pointer
-        ldy   #256                     read 256 bytes
-        ldd   #133*1                   1 second timeout
+        ldx   4,s                      get read buffer pointer
+        ldy   #256                     read 256 bytes
+        ldd   #133*1                   1 second timeout
         bsr   DWRead
          bcs   ReadEx
          bne   ReadEx
@@ -167,6 +170,7 @@ JMCPBCK  equ 0
 BAUD38400 equ 0
 
 ; These files are copied almost as-is from HDB-DOS
+       *PRAGMA nonewsource
          include "dw.def"
          include "dwread.s"
          include "dwwrite.s"
index a49d295..6852099 100644 (file)
@@ -242,7 +242,7 @@ init_hardware:
        ;; set up the map1 registers (MAPSEL=8..f) to use pages 0-7
        ;; ..to match the pre-existing setup of map0.
        ;; _krn_mmu_map is set up with the required values.
-       ;; while doing this, were careful to keep MMUADR_MAP1 *clear* because we are using
+       ;; while doing this, keep TR=0 because we are using
        ;; map0 and don't want to switch the map yet.
        lda     #(MMU_MAP0|8)   ; stay in map0, select 1st mapping register for map1
        ldx     #MMUADR
@@ -281,8 +281,8 @@ gomap1:     lda     #MMU_MAP1
 atmap1:
 
 
-       ;; Multicomp09 has RAM up at the hardware vector positions
-       ;; so we can write the addresses directly, 2 bytes per vector;
+       ;; Multicomp09 has RAM at the hardware vector positions
+       ;; so we can write the addresses directly; 2 bytes per vector:
        ;; no need for a jump op-code.
        ldx     #0xfff2         ; address of SWI3 vector
        ldy     #badswi_handler
@@ -412,25 +412,25 @@ map_process_2:
        ldx     #MMUADR
 
        ldb     ,y+             ; page from usr_mmu_map
-       std     ,x              ; Write A to MMUADR to set MAPSEL=8, then write B to MMUDAT
+       std     ,x              ; Write A to MMUADR to set MAPSEL=0, then write B to MMUDAT
        inca                    ; next mapsel
        ldb     ,y+             ; next page from usr_mmu_map
-       std     ,x              ; Write A to MMUADR to set MAPSEL=9, then write B to MMUDAT
+       std     ,x              ; Write A to MMUADR to set MAPSEL=1, then write B to MMUDAT
        inca                    ; next mapsel
        ldb     ,y+             ; next page from usr_mmu_map
-       std     ,x              ; Write A to MMUADR to set MAPSEL=a, then write B to MMUDAT
+       std     ,x              ; Write A to MMUADR to set MAPSEL=2, then write B to MMUDAT
        inca                    ; next mapsel
        ldb     ,y+             ; next page from usr_mmu_map
-       std     ,x              ; Write A to MMUADR to set MAPSEL=b, then write B to MMUDAT
+       std     ,x              ; Write A to MMUADR to set MAPSEL=3, then write B to MMUDAT
        inca                    ; next mapsel
        ldb     ,y+             ; next page from usr_mmu_map
-       std     ,x              ; Write A to MMUADR to set MAPSEL=c, then write B to MMUDAT
+       std     ,x              ; Write A to MMUADR to set MAPSEL=4, then write B to MMUDAT
        inca                    ; next mapsel
        ldb     ,y+             ; next page from usr_mmu_map
-       std     ,x              ; Write A to MMUADR to set MAPSEL=d, then write B to MMUDAT
+       std     ,x              ; Write A to MMUADR to set MAPSEL=5, then write B to MMUDAT
        inca                    ; next mapsel
        ldb     ,y+             ; next page from usr_mmu_map
-       std     ,x              ; Write A to MMUADR to set MAPSEL=e, then write B to MMUDAT
+       std     ,x              ; Write A to MMUADR to set MAPSEL=6, then write B to MMUDAT
 
        lda     #MMU_MAP0
        sta     ,x              ; new mapping goes live here
index c889929..dc70e86 100644 (file)
@@ -250,7 +250,7 @@ skip2@      incb
 ;;; uses low 32Kbyte of kernel address space as the "window" for this
 ;;; use map 8,9 (0x0000-0x3fff) for dest, map 10,11 (0x4000-0x7fff) for source
 copybank
-       pshs    d,x,u,y         ; changing this will affect "ldb 1,s" below
+       pshs    d,x,u,y         ; changing this will affect "ldb 0,s" below
        ;; map in dest
        ldx     #MMUADR         ; for storing
        lda     #(MMU_MAP1+8)   ; mapsel=8, for dest, in B