From 842ea803de9049d17b93796d7150e657f754bb91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20GIBERT?= Date: Sat, 14 Apr 2018 13:44:24 +0100 Subject: [PATCH] Kernel 0.9.1 : SSC, irq & various bugfix --- DRV/X.SSC.DRV.S.txt | 75 +++++++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 33 deletions(-) diff --git a/DRV/X.SSC.DRV.S.txt b/DRV/X.SSC.DRV.S.txt index b6a1352b..82db3bed 100644 --- a/DRV/X.SSC.DRV.S.txt +++ b/DRV/X.SSC.DRV.S.txt @@ -100,11 +100,17 @@ CS.END DEVSIG.Offset .HS 05070B0C DEVSIG.Value .HS 38180131 DEVSIG.Length .EQ DEVSIG.Value-DEVSIG.Offset + MSG.DETECT .DO SSCIRQ=1 + .AZ "Apple SSC (Super Serial Card,//c Serial Port) Driver (IRQ Enabled).\r\n" + .ELSE + .AZ "Apple SSC (Super Serial Card,//c Serial Port) Driver.\r\n" + .FIN + MSG.DETECT.OK .AZ "SSC Installed As Device : %s\r\n" MSG.DETECT.KO .AZ "No SSC Found.\r\n" ARGS .BS 2 @@ -113,11 +119,17 @@ ARGS .BS 2 *-------------------------------------- DEV.HEADER cld jmp (DRV.CS.START,x) + .DO SSCIRQ=1 + .DA #S.DEV.S.WRITE+S.DEV.S.READ+S.DEV.S.IRQ + .ELSE + .DA #S.DEV.S.WRITE+S.DEV.S.READ + .FIN + .BS 6 DEV.HEADER.NAME .AZ "COM1" NAME *-------------------------------------- @@ -133,9 +145,13 @@ DRV.CS.START .DA STATUS .DA CLOSE .DA READ .DA WRITE + .DO SSCIRQ=1 + .DA IRQ + .FIN + L.STAT .DA STAT .DA 0 end or relocation *-------------------------------------- @@ -152,24 +168,21 @@ OPEN php stz SSC.RESET-$8F,x + lda #SSC.CTL.CLKINT+SSC.CTL.B9600+SSC.CTL.8D+SSC.CTL.1S+SSC.CMD.NOP + sta SSC.CTL-$8F,x + .DO SSCIRQ=1 + lda #SSC.CMD.TEIRQ+SSC.CMD.TE+SSC.CMD.DTR + sta SSC.CMD-$8F,x + stz INBUF.HEAD stz INBUF.TAIL stz OUTBUF.HEAD stz OUTBUF.TAIL - lda #SSC.CTL.CLKINT+SSC.CTL.B9600+SSC.CTL.8D+SSC.CTL.1S+SSC.CMD.NOP - sta SSC.CTL-$8F,x - - lda #SSC.CMD.TEIRQ+SSC.CMD.TE+SSC.CMD.DTR - sta SSC.CMD-$8F,x - .ELSE - lda #SSC.CTL.CLKINT+SSC.CTL.B9600+SSC.CTL.8D+SSC.CTL.1S+SSC.CMD.NOP - sta SSC.CTL-$8F,x - lda #SSC.CMD.RIRQDIS+SSC.CMD.TE+SSC.CMD.DTR sta SSC.CMD-$8F,x @@ -196,7 +209,7 @@ READ .DO SSCIRQ=1 sei ldx INBUF.TAIL cpx INBUF.HEAD - beq .9 + beq .2 lda INBUF,x inx @@ -211,8 +224,14 @@ READ .DO SSCIRQ=1 clc rts -.9 plp - lda #0 +.2 ldx DEVSLOTn08F + lda SSC.STATUS-$8F,x + and #SSC.STATUS.nDSR true when 0 + beq .90 + + lda #26 EOF + +.90 plp sec rts @@ -220,7 +239,6 @@ READ .DO SSCIRQ=1 ldx DEVSLOTn08F lda SSC.STATUS-$8F,x - bmi * and #SSC.STATUS.RDRF incoming char? beq .9 @@ -243,9 +261,9 @@ WRITE .DO SSCIRQ=1 ldx DEVSLOTn08F -* lda SSC.STATUS-$8F,x -* bit #SSC.STATUS.DCD+SSC.STATUS.DSR true when 0 -* bne .9 + lda SSC.STATUS-$8F,x + bit #SSC.STATUS.nDSR true when 0 + bne .90 lda OUTBUF.HEAD cmp OUTBUF.TAIL Buffer Empty? @@ -276,13 +294,11 @@ WRITE .DO SSCIRQ=1 tya sta OUTBUF,x -* ldx DEVSLOTn08F -* lda #SSC.CMD.TEIRQ+SSC.CMD.DTR -* sta SSC.CMD-$8F,x plp clc rts - + +.90 lda #26 EOF .9 plp sec rts @@ -325,36 +341,33 @@ IRQ ldx DEVSLOTn08F bpl .9 IRQ from this device ? no, exit !!!!Applewin bug #308!!!! bit #SSC.STATUS.RDRF incoming char? - beq .3 + beq .2 *------------ IRQ In pha -.1 lda INBUF.HEAD + lda INBUF.HEAD tay save actual head for later inc and #BUF.MASK cmp INBUF.TAIL - beq .2 buffer full, discard and exit + beq .1 buffer full, discard and exit sta INBUF.HEAD lda SSC.DATA-$8F,x read data to clear IRQ sta INBUF,y -.2 pla -* lda SSC.STATUS-$8F,x -* bit #SSC.STATUS.RDRF incoming char? -* bne .1 +.1 pla *------------ IRQ Out -.3 bit #SSC.STATUS.TDRE +.2 bit #SSC.STATUS.TDRE beq .8 no transmition possible.... -.4 ldy OUTBUF.TAIL something to transmit ? + ldy OUTBUF.TAIL something to transmit ? cpy OUTBUF.HEAD beq .8 in that case, HOW TO CLEAR IRQ ???? @@ -367,10 +380,6 @@ IRQ ldx DEVSLOTn08F sta OUTBUF.TAIL -* lda SSC.STATUS-$8F,x -* bit #SSC.STATUS.TDRE -* bne .4 - .8 clc rts