From 0d13988212b843014937eb04f2f9e2463eefca73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20GIBERT?= Date: Thu, 21 Dec 2017 13:03:32 +0100 Subject: [PATCH] Kernel 0.9.1 : SSC, correction after AppleWin Bugfix #308 --- DRV/SSC.DRV.S.txt | 5 ++-- DRV/SSC.I.DRV.S.txt | 66 +++++++++++++++++++++------------------------ 2 files changed, 33 insertions(+), 38 deletions(-) diff --git a/DRV/SSC.DRV.S.txt b/DRV/SSC.DRV.S.txt index 71e8cbf4..91b6a938 100644 --- a/DRV/SSC.DRV.S.txt +++ b/DRV/SSC.DRV.S.txt @@ -137,7 +137,7 @@ OPEN ldx DEVSLOTn0 sei stz SSC.RESET,x - lda #SSC.CTL.CLKEXT+SSC.CTL.B9600+SSC.CTL.8D+SSC.CTL.1S+SSC.CMD.NOP + lda #SSC.CTL.CLKINT+SSC.CTL.B9600+SSC.CTL.8D+SSC.CTL.1S+SSC.CMD.NOP sta SSC.CTL,x ldx DEVSLOTn0 @@ -203,7 +203,8 @@ STAT .DA #S.DSTAT.S.WRITE+S.DSTAT.S.READ >PSTR "Serial Card/Port" .DA #S.DSTAT.T.CHAR .DA #0 - .DA $0900 + .DA #0 + .DA #91 *-------------------------------------- MAN SAVE /A2OSX.SRC/DRV/SSC.DRV.S diff --git a/DRV/SSC.I.DRV.S.txt b/DRV/SSC.I.DRV.S.txt index 1d450b07..761eaac9 100644 --- a/DRV/SSC.I.DRV.S.txt +++ b/DRV/SSC.I.DRV.S.txt @@ -146,7 +146,7 @@ OPEN php stz OUTBUF.HEAD stz OUTBUF.TAIL - lda #SSC.CTL.CLKEXT+SSC.CTL.B9600+SSC.CTL.8D+SSC.CTL.1S+SSC.CMD.NOP + lda #SSC.CTL.CLKINT+SSC.CTL.B9600+SSC.CTL.8D+SSC.CTL.1S+SSC.CMD.NOP sta SSC.CTL,x lda #SSC.CMD.TEIRQ+SSC.CMD.TE+SSC.CMD.DTR @@ -225,7 +225,7 @@ WRITE php cmp OUTBUF.TAIL beq .9 Buffer Full!! - sta OUTBUF.TAIL + sta OUTBUF.HEAD tya sta OUTBUF,x @@ -244,64 +244,57 @@ WRITE php * IRQ Handler * on exit, CC if handled *-------------------------------------- -IRQ stz .8+1 - -.1 ldx DEVSLOTn0 +IRQ ldx DEVSLOTn0 lda SSC.STATUS,x -* bpl .9 IRQ from this device ? no, exit !!!!Applewin bug #308!!!! +* and #SSC.STATUS.IRQ Useless + bpl .9 IRQ from this device ? no, exit !!!!Applewin bug #308!!!! bit #SSC.STATUS.RDRF incoming char? - beq .4 + beq .3 *------------ IRQ In - ldy SSC.DATA,x read data to clear IRQ - - ldx INBUF.HEAD - txa +.1 lda INBUF.HEAD + tay save actual head for later + inc and #BUF.MASK cmp INBUF.TAIL - beq .8 buffer full, discard and exit + beq .2 buffer full, discard and exit sta INBUF.HEAD - tya - sta INBUF,x - dec .8+1 - - bra .1 + lda SSC.DATA,x read data to clear IRQ + sta INBUF,y + +.2 lda SSC.STATUS,x + bit #SSC.STATUS.RDRF incoming char? + bne .1 *------------ IRQ Out - -.3 ldx DEVSLOTn0 - lda SSC.STATUS,x -.4 bit #SSC.STATUS.TDRE +.3 bit #SSC.STATUS.TDRE beq .8 no transmition possible.... - ldy OUTBUF.TAIL something to transmit ? +.4 ldy OUTBUF.TAIL something to transmit ? cpy OUTBUF.HEAD - beq .8 + beq .8 in that case, HOW TO CLEAR IRQ ???? lda OUTBUF,y - sta SSC.DATA,x + sta SSC.DATA,x write data to clear IRQ - iny - cpy #BUF.SIZE - bne .5 - ldy #0 + tya + inc + and #BUF.MASK -.5 sty OUTBUF.TAIL + sta OUTBUF.TAIL - dec .8+1 + lda SSC.STATUS,x + bit #SSC.STATUS.TDRE + bne .4 - bra .3 - -.8 lda #$ff did we finally handle and IRQ condtion ? - beq .9 - clc +.8 clc rts .9 sec @@ -321,7 +314,8 @@ STAT .DA #S.DSTAT.S.WRITE+S.DSTAT.S.READ+S.DEV.S.IRQ >PSTR "Serial Card/Port" .DA #S.DSTAT.T.CHAR .DA #0 - .DA $0900 + .DA #0 + .DA #91 *-------------------------------------- MAN SAVE /A2OSX.SRC/DRV/SSC.I.DRV.S