mirror of
https://github.com/A2osX/A2osX.git
synced 2025-01-27 09:34:38 +00:00
Kernel 0.9.1 : SSC, correction after AppleWin Bugfix #308
This commit is contained in:
parent
1543eeb518
commit
0d13988212
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user