mirror of
https://github.com/A2osX/A2osX.git
synced 2025-01-22 06:31:33 +00:00
Kernel 0.94+
This commit is contained in:
parent
43d989f537
commit
abe684f04c
Binary file not shown.
Binary file not shown.
@ -9,6 +9,7 @@ SSCIRQ .EQ 1
|
||||
.INB inc/mli.e.i
|
||||
.INB inc/com.i
|
||||
.INB inc/com.6551.i
|
||||
.INB inc/io.i
|
||||
.INB usr/src/shared/x.ssc.drv.s
|
||||
*--------------------------------------
|
||||
MAN
|
||||
|
@ -114,7 +114,7 @@ CS.RUN ldy #S.PS.ARGC
|
||||
>PUSHBI O.RDWR
|
||||
>PUSHBI 0 type
|
||||
>PUSHWZ auxtype
|
||||
|
||||
|
||||
>SYSCALL FOpen
|
||||
bcs .99
|
||||
|
||||
@ -125,7 +125,7 @@ CS.RUN ldy #S.PS.ARGC
|
||||
iny #S.PS.hStdErr
|
||||
sta (pPS),y
|
||||
sta hFILE
|
||||
|
||||
|
||||
CS.RUN.LOOP0 >SLEEP
|
||||
|
||||
>PUSHW L.ENV.TERM
|
||||
@ -177,8 +177,8 @@ CS.RUN.EXIT lda bExitOnClose
|
||||
bmi .8
|
||||
|
||||
ldy #S.PS.S
|
||||
lda (ZPPtr1),y
|
||||
cmp #S.PS.S.QUIT
|
||||
lda (pPS),y
|
||||
cmp #S.PS.S.QUIT I've been killed :-(
|
||||
beq .8
|
||||
|
||||
jmp CS.RUN.LOOP0
|
||||
|
@ -8,11 +8,6 @@ NEW
|
||||
.ELSE
|
||||
.TF drv/ssc.drv
|
||||
.FIN
|
||||
*--------------------------------------
|
||||
.DO SSCIRQ=1
|
||||
BUF.SIZE .EQ $40
|
||||
BUF.MASK .EQ $3F
|
||||
.FIN
|
||||
*--------------------------------------
|
||||
ZPArgPtr .EQ ZPBIN
|
||||
ZPParityPtr .EQ ZPBIN+2
|
||||
@ -77,13 +72,13 @@ Dev.Detect >STYA ARGS
|
||||
inc ZPArgPtr+1 no match, try next slot....
|
||||
lda ZPArgPtr+1
|
||||
cmp #$C8
|
||||
bne .1
|
||||
bne .1
|
||||
>LDYA L.MSG.DETECT.KO
|
||||
>SYSCALL PutS
|
||||
|
||||
lda #MLI.E.NODEV Not Found in any slot, exiting
|
||||
sec
|
||||
rts
|
||||
rts
|
||||
|
||||
.4 lda ZPArgPtr+1
|
||||
and #$0F
|
||||
@ -101,7 +96,7 @@ Dev.Detect >STYA ARGS
|
||||
sta DEVSLOTn08F
|
||||
jsr Dev.ParseArgs
|
||||
bcs .9
|
||||
|
||||
|
||||
.8 >PUSHW L.MSG.DETECT.OK
|
||||
>PUSHW L.FD.DEV.NAME
|
||||
>PUSHBI 2
|
||||
@ -147,10 +142,10 @@ Dev.ParseArgs >LDYA ARGS
|
||||
|
||||
>STYA ZPControlPtr
|
||||
stx ZPhControl
|
||||
|
||||
|
||||
>PUSHW ZPArgPtr
|
||||
>PUSHW L.SSCANF.ARGS
|
||||
|
||||
|
||||
>PUSHW L.DCB.BAUD
|
||||
>PUSHW L.DCB.DATA
|
||||
>PUSHW L.DCB.STOP
|
||||
@ -226,8 +221,10 @@ STATUS jsr STATUS.CONTROL.Init
|
||||
ldy #S.IOCTL.STATCODE
|
||||
lda (ZPIOCTL),y
|
||||
beq .1
|
||||
|
||||
cmp #S.IOCTL.STATCODE.GETDIB
|
||||
bne STATUS.DCB
|
||||
|
||||
ldy #S.DIB-1
|
||||
.HS 2C bit abs
|
||||
.1 ldy #3
|
||||
@ -258,6 +255,7 @@ STATUS.DCB cmp #S.IOCTL.STATCODE.GETDCB
|
||||
lda DIB+S.DIB.S
|
||||
and #S.DIB.S.OPENED
|
||||
beq OPEN.E
|
||||
|
||||
.DO SSCIRQ=1
|
||||
lda INBUF.TAIL
|
||||
eor INBUF.HEAD
|
||||
@ -301,25 +299,50 @@ OPEN.E lda #MLI.E.OPEN
|
||||
|
||||
OPEN.1 php
|
||||
sei
|
||||
ldx DEVSLOTn08F
|
||||
stz SSC.RESET-$8F,x
|
||||
|
||||
.DO SSCIRQ=1
|
||||
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.DTR
|
||||
sta SSC.CMD-$8F,x
|
||||
|
||||
>LDYAI 256
|
||||
>SYSCALL2 NewStkObj
|
||||
bcs .99
|
||||
|
||||
stx hINBUF
|
||||
>STYA READ.INBUF+1
|
||||
>STYA IRQ.INBUF+1
|
||||
|
||||
>LDYAI 256
|
||||
>SYSCALL2 NewStkObj
|
||||
bcs .90
|
||||
|
||||
stx hOUTBUF
|
||||
>STYA WRITE.OUTBUF+1
|
||||
>STYA IRQ.OUTBUF+1
|
||||
|
||||
stz INBUF.HEAD
|
||||
stz INBUF.TAIL
|
||||
stz OUTBUF.HEAD
|
||||
stz OUTBUF.TAIL
|
||||
|
||||
|
||||
ldx DEVSLOTn08F
|
||||
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
|
||||
|
||||
lda #SSC.CMD.TEIRQ+SSC.CMD.DTR
|
||||
sta SSC.CMD-$8F,x
|
||||
|
||||
.ELSE
|
||||
|
||||
ldx DEVSLOTn08F
|
||||
stz SSC.RESET-$8F,x
|
||||
|
||||
lda #SSC.CTL.CLKINT+SSC.CTL.B115200+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
|
||||
|
||||
.FIN
|
||||
|
||||
lda SSC.DATA-$8F,x discard any garbage byte
|
||||
@ -331,11 +354,35 @@ OPEN.1 php
|
||||
plp
|
||||
clc
|
||||
rts
|
||||
|
||||
.DO SSCIRQ=1
|
||||
|
||||
.90 pha
|
||||
lda hINBUF
|
||||
>SYSCALL FreeStkObj
|
||||
pla
|
||||
|
||||
.99 plp
|
||||
sec
|
||||
rts
|
||||
|
||||
.FIN
|
||||
*--------------------------------------
|
||||
CLOSE php
|
||||
CLOSE lda DIB+S.DIB.S
|
||||
bit #S.DIB.S.OPENED
|
||||
bne OPEN.E
|
||||
|
||||
php
|
||||
sei
|
||||
ldx DEVSLOTn08F
|
||||
stz SSC.RESET-$8F,x
|
||||
stz SSC.RESET-$8F,x
|
||||
|
||||
.DO SSCIRQ=1
|
||||
lda hINBUF
|
||||
>SYSCALL FreeStkObj
|
||||
lda hOUTBUF
|
||||
>SYSCALL FreeStkObj
|
||||
.FIN
|
||||
|
||||
lda #S.DIB.S.OPENED
|
||||
trb DIB+S.DIB.S
|
||||
@ -351,79 +398,85 @@ READ php
|
||||
stz ZPCount2
|
||||
stz ZPCount2+1
|
||||
|
||||
.10 inc ZPCount
|
||||
bne .11
|
||||
.DO SSCIRQ=1
|
||||
sta SETREADAUX
|
||||
.FIN
|
||||
|
||||
READ.10 inc ZPCount
|
||||
bne READ.11
|
||||
|
||||
inc ZPCount+1
|
||||
beq .8
|
||||
beq READ.8
|
||||
|
||||
.11 .DO SSCIRQ=1
|
||||
READ.11 .DO SSCIRQ=1
|
||||
ldy INBUF.TAIL
|
||||
cpy INBUF.HEAD
|
||||
beq .2
|
||||
beq READ.2
|
||||
|
||||
lda INBUF,y
|
||||
iny
|
||||
cpy #BUF.SIZE
|
||||
bne .1
|
||||
|
||||
ldy #0
|
||||
.1 sty INBUF.TAIL
|
||||
READ.INBUF lda $FFFF,y SELF MODIFIED
|
||||
inc INBUF.TAIL
|
||||
|
||||
sta (ZPBufPtr)
|
||||
inc ZPBufPtr
|
||||
bne .12
|
||||
bne READ.12
|
||||
|
||||
inc ZPBufPtr+1
|
||||
|
||||
.12 inc ZPCount2
|
||||
bne .10
|
||||
READ.12 inc ZPCount2
|
||||
bne READ.10
|
||||
|
||||
inc ZPCount2+1
|
||||
bra .10
|
||||
bra READ.10
|
||||
.FIN
|
||||
.2 lda SSC.STATUS-$8F,x
|
||||
|
||||
READ.2 lda SSC.STATUS-$8F,x
|
||||
bit #SSC.STATUS.nDCD true when 0
|
||||
bne .9
|
||||
bne READ.9
|
||||
|
||||
bit #SSC.STATUS.RDRF incoming char?
|
||||
beq .8
|
||||
beq READ.8
|
||||
|
||||
lda SSC.DATA-$8F,x
|
||||
sta (ZPBufPtr)
|
||||
inc ZPBufPtr
|
||||
bne .13
|
||||
bne READ.13
|
||||
|
||||
inc ZPBufPtr+1
|
||||
|
||||
.13 inc ZPCount2
|
||||
bne .2
|
||||
READ.13 inc ZPCount2
|
||||
bne READ.2
|
||||
|
||||
inc ZPCount2+1
|
||||
bra .2
|
||||
bra READ.2
|
||||
|
||||
.8 lda ZPCount2
|
||||
bne .81
|
||||
READ.8 lda ZPCount2
|
||||
bne READ.81
|
||||
|
||||
ora ZPCount2+1
|
||||
beq .99
|
||||
beq READ.99
|
||||
|
||||
lda ZPCount2
|
||||
|
||||
.81 ldy #S.IOCTL.BYTECNT
|
||||
READ.81 ldy #S.IOCTL.BYTECNT
|
||||
sta (ZPIOCTL),y
|
||||
iny
|
||||
lda ZPCount2+1
|
||||
sta (ZPIOCTL),y
|
||||
|
||||
.DO SSCIRQ=1
|
||||
sta CLRREADAUX
|
||||
.FIN
|
||||
plp
|
||||
clc
|
||||
rts
|
||||
|
||||
.9 lda #MLI.E.IO
|
||||
READ.9 lda #MLI.E.IO
|
||||
.HS 2C BIT ABS
|
||||
|
||||
.99 lda #E.NODATA
|
||||
READ.99 lda #E.NODATA
|
||||
.DO SSCIRQ=1
|
||||
sta CLRREADAUX
|
||||
.FIN
|
||||
plp
|
||||
sec
|
||||
rts
|
||||
@ -432,75 +485,83 @@ WRITE php
|
||||
sei
|
||||
jsr READ.WRITE.Init
|
||||
|
||||
.2 inc ZPCount
|
||||
bne .3
|
||||
.DO SSCIRQ=1
|
||||
sta SETWRITEAUX
|
||||
.FIN
|
||||
|
||||
WRITE.2 inc ZPCount
|
||||
bne WRITE.3
|
||||
|
||||
inc ZPCount+1
|
||||
beq .8
|
||||
beq WRITE.8
|
||||
|
||||
.3 .DO SSCIRQ=1
|
||||
WRITE.3 .DO SSCIRQ=1
|
||||
lda SSC.STATUS-$8F,x
|
||||
bit #SSC.STATUS.nDCD true when 0
|
||||
bne .9
|
||||
bne WRITE.9
|
||||
|
||||
lda OUTBUF.HEAD
|
||||
cmp OUTBUF.TAIL Buffer Empty?
|
||||
bne .6 not empty, queue char
|
||||
bne WRITE.6 not empty, queue char
|
||||
|
||||
lda SSC.STATUS-$8F,x
|
||||
and #SSC.STATUS.TDRE Register Empty ?
|
||||
beq .5 not empty, queue char
|
||||
beq WRITE.5 not empty, queue char
|
||||
|
||||
lda (ZPBufPtr) yes, write directly to ACIA
|
||||
sta SSC.DATA-$8F,x
|
||||
inc ZPBufPtr
|
||||
bne .2
|
||||
bne WRITE.2
|
||||
|
||||
inc ZPBufPtr+1
|
||||
|
||||
bra .2
|
||||
|
||||
.5 lda OUTBUF.HEAD
|
||||
.6 tay
|
||||
bra WRITE.2
|
||||
|
||||
WRITE.5 lda OUTBUF.HEAD
|
||||
WRITE.6 tay
|
||||
inc
|
||||
and #BUF.MASK
|
||||
cmp OUTBUF.TAIL
|
||||
beq .99 Buffer Full!!
|
||||
cmp OUTBUF.TAIL
|
||||
beq WRITE.99 Buffer Full!!
|
||||
|
||||
sta OUTBUF.HEAD
|
||||
lda (ZPBufPtr)
|
||||
sta OUTBUF,y
|
||||
WRITE.OUTBUF sta $FFFF,y SELF MODIFIED
|
||||
inc ZPBufPtr
|
||||
bne .2
|
||||
bne WRITE.2
|
||||
|
||||
inc ZPBufPtr+1
|
||||
bra .2
|
||||
bra WRITE.2
|
||||
|
||||
.ELSE
|
||||
.4 lda SSC.STATUS-$8F,x
|
||||
WRITE.4 lda SSC.STATUS-$8F,x
|
||||
bit #SSC.STATUS.nDCD true when 0
|
||||
bne .9
|
||||
bne WRITE.9
|
||||
|
||||
bit #SSC.STATUS.TDRE Outgoing char?
|
||||
beq .4
|
||||
beq WRITE.4
|
||||
|
||||
lda (ZPBufPtr)
|
||||
sta SSC.DATA-$8F,x
|
||||
inc ZPBufPtr
|
||||
bne .2
|
||||
bne WRITE.2
|
||||
|
||||
inc ZPBufPtr+1
|
||||
|
||||
bra .2
|
||||
bra WRITE.2
|
||||
.FIN
|
||||
|
||||
.8 plp
|
||||
WRITE.8 .DO SSCIRQ=1
|
||||
sta CLRWRITEAUX
|
||||
.FIN
|
||||
plp
|
||||
clc
|
||||
rts
|
||||
|
||||
.9 lda #MLI.E.IO
|
||||
WRITE.9 lda #MLI.E.IO
|
||||
.HS 2C BIT ABS
|
||||
.99 lda #E.NODATA
|
||||
WRITE.99 lda #E.NODATA
|
||||
.DO SSCIRQ=1
|
||||
sta CLRWRITEAUX
|
||||
.FIN
|
||||
plp
|
||||
sec
|
||||
rts
|
||||
@ -514,7 +575,7 @@ STATUS.CONTROL.Init
|
||||
lda (ZPIOCTL),y
|
||||
sta ZPBufPtr
|
||||
|
||||
iny
|
||||
iny
|
||||
|
||||
lda (ZPIOCTL),y
|
||||
sta ZPBufPtr+1
|
||||
@ -538,45 +599,47 @@ STATUS.CONTROL.Init
|
||||
IRQ ldx DEVSLOTn08F
|
||||
lda SSC.STATUS-$8F,x
|
||||
* and #SSC.STATUS.IRQ Useless
|
||||
bpl .9 IRQ from this device ? no, exit !!!!Applewin bug #308!!!!
|
||||
bpl IRQ.9 IRQ from this device ? no, exit !!!!Applewin bug #308!!!!
|
||||
|
||||
sta SETREADAUX
|
||||
sta SETWRITEAUX
|
||||
|
||||
bit #SSC.STATUS.RDRF incoming char?
|
||||
beq .2
|
||||
beq IRQ.2
|
||||
*------------ IRQ In
|
||||
|
||||
pha
|
||||
lda INBUF.HEAD
|
||||
tay save actual head for later
|
||||
inc
|
||||
and #BUF.MASK
|
||||
cmp INBUF.TAIL
|
||||
beq .1 buffer full, discard and exit
|
||||
beq IRQ.1 buffer full, discard and exit
|
||||
|
||||
sta INBUF.HEAD
|
||||
|
||||
lda SSC.DATA-$8F,x read data to clear IRQ
|
||||
sta INBUF,y
|
||||
lda SSC.DATA-$8F,x read data to clear IRQ
|
||||
IRQ.INBUF sta $FFFF,y SELF MODIFIED
|
||||
|
||||
.1 pla
|
||||
IRQ.1 pla
|
||||
*------------ IRQ Out
|
||||
.2 bit #SSC.STATUS.TDRE
|
||||
beq .8 no transmition possible....
|
||||
IRQ.2 bit #SSC.STATUS.TDRE
|
||||
beq IRQ.8 no transmition possible....
|
||||
|
||||
ldy OUTBUF.TAIL something to transmit ?
|
||||
cpy OUTBUF.HEAD
|
||||
beq .8 in that case, HOW TO CLEAR IRQ ????
|
||||
beq IRQ.8 in that case, HOW TO CLEAR IRQ ????
|
||||
|
||||
lda OUTBUF,y
|
||||
sta SSC.DATA-$8F,x write data to clear IRQ
|
||||
tya
|
||||
inc
|
||||
and #BUF.MASK
|
||||
sta OUTBUF.TAIL
|
||||
IRQ.OUTBUF lda $FFFF,y SELF MODIFIED
|
||||
sta SSC.DATA-$8F,x write data to clear IRQ
|
||||
inc OUTBUF.TAIL
|
||||
|
||||
.8 clc
|
||||
IRQ.8 sta CLRREADAUX
|
||||
sta CLRWRITEAUX
|
||||
|
||||
clc
|
||||
rts
|
||||
|
||||
.9 sec
|
||||
IRQ.9 sec
|
||||
rts
|
||||
.FIN
|
||||
*--------------------------------------
|
||||
@ -587,8 +650,8 @@ INBUF.TAIL .BS 1
|
||||
INBUF.HEAD .BS 1
|
||||
OUTBUF.TAIL .BS 1
|
||||
OUTBUF.HEAD .BS 1
|
||||
INBUF .BS BUF.SIZE
|
||||
OUTBUF .BS BUF.SIZE
|
||||
hINBUF .BS 1
|
||||
hOUTBUF .BS 1
|
||||
.FIN
|
||||
*--------------------------------------
|
||||
DIB .DO SSCIRQ=1
|
||||
|
@ -543,9 +543,13 @@ RWDRV.SIZE .EQ RWDRV.B.END-RWDRV.B.START
|
||||
RMDRVX.TMP .EQ $200
|
||||
RWDRV.XM.RUN .EQ $300
|
||||
*--------------------------------------
|
||||
RWDRVX.B.START
|
||||
.PH $0300
|
||||
RWDRVX.B.START .PH $0300
|
||||
RWDRVX.START sta RWDRVX.XM.BANK+1 setup BANK
|
||||
|
||||
lda DRV.COMMAND DRV.COMMAND: 1=READ,2=WRITE
|
||||
lsr
|
||||
php
|
||||
|
||||
ldy #RRAMWRAMBNK1
|
||||
|
||||
txa
|
||||
@ -563,7 +567,7 @@ RWDRVX.START sta RWDRVX.XM.BANK+1 setup BANK
|
||||
ldy DRV.BUFF
|
||||
ldx DRV.BUFF+1
|
||||
|
||||
lsr DRV.COMMAND DRV.COMMAND: 1=READ,2=WRITE
|
||||
plp
|
||||
bcc .2 CC=WRITE, CS=READ
|
||||
|
||||
stz RWDRVX.XM.SRC+1 READ from src LO = 0
|
||||
@ -643,7 +647,6 @@ RWDRVX.XM.DST sta $FFFF,x
|
||||
stz RWBankSelect
|
||||
*--------------------------------------
|
||||
RWDRVX.XM.MNLC bit RRAMWRAMBNK1 ProDOS always uses LCBANK1
|
||||
* bit RRAMWRAMBNK1
|
||||
|
||||
lda #0
|
||||
|
||||
@ -655,10 +658,7 @@ RWDRVX.XM.SRCLC bcc RWDRVX.XM.MNLC CC=WRITE,CS=READ?
|
||||
.HS 2C BIT ABS
|
||||
RWDRVX.XM.DSTLC bcs RWDRVX.XM.MNLC CC=WRITE,CS=READ?
|
||||
*--------------------------------------
|
||||
RWDRVX.XM.RWLC ldx #$FF
|
||||
|
||||
* bit $C000,x
|
||||
bit $C000,x
|
||||
RWDRVX.XM.RWLC bit $C000
|
||||
|
||||
RWDRVX.XM.BANK lda #$FF
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user