changeset 2818:05426dd4e24e lwtools-port

ll_init now puts CoCo SDC in enhanced mode. Added defs/cocosdc.d definition file Address of device is now obtained from descriptor Renamed ddsd_cocosdc.asm to ddsd0_cocosdc.asm
author Boisy Pitre <boisy.pitre@nuance.com>
date Thu, 02 May 2013 14:53:28 -0500
parents 5c6b71612ce4
children c3ebfd514c0b
files defs/cocosdc.d level1/modules/llcocosdc.asm level1/modules/superdesc.asm level2/coco3/bootfiles/makefile level2/coco3/modules/makefile
diffstat 5 files changed, 91 insertions(+), 71 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/defs/cocosdc.d	Thu May 02 14:53:28 2013 -0500
@@ -0,0 +1,18 @@
+          IFNE      COCOSDC.D-1
+COCOSDC.D SET       1
+
+********************************************************************
+* cocosdc.d - CoCo SDC definitions
+*
+* $Id$
+*
+* Edt/Rev  YYYY/MM/DD  Modified by
+* Comment
+* ------------------------------------------------------------------
+*          2014/05/02  Boisy G. Pitre
+* Created
+
+
+SDAddr         SET       $FF4A
+
+               ENDC      
--- a/level1/modules/llcocosdc.asm	Wed May 01 08:38:04 2013 -0500
+++ b/level1/modules/llcocosdc.asm	Thu May 02 14:53:28 2013 -0500
@@ -61,6 +61,9 @@
 *    B  = error code
 *
 ll_init                  
+               ldy      V.PORT-UOFFSET,u
+               ldb      #$43
+               stb      -$0A,y
                clrb      
                rts       
 
@@ -133,44 +136,42 @@
                lda       PD.DRV,y
                ldb       V.PhysSect,u
                ldx       V.PhysSect+1,u
+               ldy       V.PORT-UOFFSET,u
                ldu       V.CchPSpot,u
- ldy #$FF4A
- stb -1,y
- stx ,y
- ldb #$43
- stb $FF40
- ora #$80
- sta -2,y
- exg a,a
+
+               stb       -1,y
+               stx       ,y
+               ora       #$80
+               sta       -2,y
+               exg       a,a
 
- ldx #0
-rdWait lda -2,y
- bmi rdFail
- bita #2
- bne rdRdy
- leax -1,x
- bne rdWait
-rdFail clr $FF40
- ldb #E$Read
- coma
- rts
+               ldx       #0
+rdWait         lda       -2,y
+               bmi       rdFail
+               bita      #2
+               bne       rdRdy
+               leax      -1,x
+               bne       rdWait
+rdFail
+               ldb       #E$Read
+               coma
+               rts
 
-rdRdy leax ,u
- ldd #32*256+8
-rdChnk ldu ,y
- stu ,x
- ldu ,y
- stu 2,x
- ldu ,y
- stu 4,x
- ldu ,y
- stu 6,x
- abx
- deca
- bne rdChnk
+rdRdy          leax      ,u
+               ldd       #32*256+8
+rdChnk         ldu       ,y
+               stu       ,x
+               ldu       ,y
+               stu       2,x
+               ldu       ,y
+               stu       4,x
+               ldu       ,y
+               stu       6,x
+               abx
+               deca
+               bne       rdChnk
 
- clr $FF40
- rts
+               rts
 
 
 * ll_write
@@ -188,46 +189,43 @@
                lda       PD.DRV,y
                ldb       V.PhysSect,u
                ldx       V.PhysSect+1,u
+               ldy       V.PORT-UOFFSET,u
                ldu       V.CchPSpot,u
 
- ldy #$FF4A
- stb -1,y
- stx ,y
- ldb #$43
- stb $FF40
- ora #$A0
- sta -2,y
- exg a,a
+               stb       -1,y
+               stx       ,y
+               ora       #$A0
+               sta       -2,y
+               exg       a,a
 
- ldx #0
-wrWait lda -2,y
- bmi wrFail
- bita #2
- bne wrRdy
- leax -1,x
- bne wrWait
-wrFail clr $FF40
- ldb  #E$Write
- coma
- rts
+               ldx       #0
+wrWait         lda       -2,y
+               bmi       wrFail
+               bita      #2
+               bne       wrRdy
+               leax      -1,x
+               bne       wrWait
+wrFail
+               ldb       #E$Write
+               coma
+               rts
 
-wrRdy leax ,u
- ldd #64*256+4
-wrChnk ldu ,x
- stu ,y
- ldu 2,x
- stu ,y
- abx
- deca
- bne wrChnk
+wrRdy          leax      ,u
+               ldd       #64*256+4
+wrChnk         ldu       ,x
+               stu       ,y
+               ldu       2,x
+               stu       ,y
+               abx
+               deca
+               bne       wrChnk
 
-wrComp lda -2,y
- bmi wrFail
- lsra
- bcs wrComp
+wrComp         lda       -2,y
+               bmi       wrFail
+               lsra
+               bcs       wrComp
 
- clr $FF40
- rts
+               rts
 
                EMOD      
 eom            EQU       *
--- a/level1/modules/superdesc.asm	Wed May 01 08:38:04 2013 -0500
+++ b/level1/modules/superdesc.asm	Thu May 02 14:53:28 2013 -0500
@@ -114,7 +114,11 @@
                IFNE      IDE
                USE       ide.d
                ELSE
+               IFNE      TC3+KTLR+D4N1+HDII
                USE       scsi.d
+               ELSE
+               USE       cocosdc.d
+               ENDC
                ENDC
                ENDC
 
--- a/level2/coco3/bootfiles/makefile	Wed May 01 08:38:04 2013 -0500
+++ b/level2/coco3/bootfiles/makefile	Thu May 02 14:53:28 2013 -0500
@@ -163,7 +163,7 @@
 		$(MD)/rbf.mn \
                 $(FLOPPY_40D) \
 		$(RBCOCOSDC) \
-                $(MD)/ddsd_cocosdc.dd \
+                $(MD)/ddsd0_cocosdc.dd \
 		$(MD)/scf.mn \
 		$(VTIO_COGRF_80) \
 		$(PIPE) \
--- a/level2/coco3/modules/makefile	Wed May 01 08:38:04 2013 -0500
+++ b/level2/coco3/modules/makefile	Thu May 02 14:53:28 2013 -0500
@@ -47,7 +47,7 @@
 		ddi0_ide.dd i0_ide.dd i1_ide.dd ih_ide.dd \
 		dds0_tc3.dd s0_tc3.dd s1_tc3.dd s2_tc3.dd s3_tc3.dd s4_tc3.dd \
 		s5_tc3.dd s6_tc3.dd sh_tc3.dd \
-		ddsd_cocosdc.dd sd0_cocosdc.dd sd1_cocosdc.dd
+		ddsd0_cocosdc.dd sd0_cocosdc.dd sd1_cocosdc.dd
 
 SCF		= scf.mn \
 		vtio.dr vrn.dr scbbp.dr scbbt.dr scdwp.dr sspak.dr sc6551.dr \
@@ -384,7 +384,7 @@
 	$(AS) $(ASOUT)$@ $< $(IDEFLAGS) $(HDBDOS)
 
 # SuperSD Descriptors
-ddsd_cocosdc.dd: superdesc.asm
+ddsd0_cocosdc.dd: superdesc.asm
 	$(AS) $(ASOUT)$@ $< $(SDFLAGS) -DDD=1
 
 sd0_cocosdc.dd: superdesc.asm