Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-06-25 17:39:51 +02:00
parent a1bbbf4723
commit 1da0f1677f
8 changed files with 241 additions and 216 deletions

Binary file not shown.

Binary file not shown.

View File

@ -40,6 +40,7 @@ bEscMode .BS 1
TimeOut .BS 1
hMsgBuf .BS 1
ZPMsgPtr .BS 2
ZPMsgPfxPtr .BS 2
ZPMsgCmdPtr .BS 2
@ -84,6 +85,7 @@ L.MSG.USER .DA MSG.USER
L.MSG.JOIN .DA MSG.JOIN
L.MSG.TOPBAR .DA MSG.TOPBAR
L.MSG.STATUSBAR .DA MSG.STATUSBAR
L.MSG.STATUSBARMSG .DA MSG.STATUSBARMSG
L.IRC.NICK .DA IRC.NICK
L.IRC.USER .DA IRC.USER
L.IRC.JOIN .DA IRC.JOIN
@ -113,7 +115,7 @@ CS.INIT >LDYA L.LIBTCPIP
.9 rts
*--------------------------------------
CS.RUN >LIBCALL hLIBTCPIP,LIBTCPIP.GETCFG is TCPIP loaded ?
>STYA ZPPtr1
lda (ZPPtr1) Configured ?
bmi CS.RUN.IPOK
@ -232,7 +234,7 @@ CS.RUN.OPENSKT >PUSHBI 0 no protocol
jsr CS.RUN.MkNod
bcs .99
jsr CS.RUN.GETBUF
bcs .99
@ -248,10 +250,13 @@ CS.RUN.OPENSKT >PUSHBI 0 no protocol
bcs .99
>SLEEP
jsr CS.RUN.JOIN
bcs .99
jsr CS.RUN.STATUSPDATE
bcs .99
CS.RUN.LOOP >SLEEP
lda hFile
@ -259,7 +264,7 @@ CS.RUN.LOOP >SLEEP
bcs .9
tay
bne .2
>PUSHWI MSGSIZE
>PUSHW ZPMsgPtr
lda hFile
@ -304,24 +309,30 @@ CS.RUN.MkNod >PUSHEA.G NodBuf
>PUSHB hSocket
>SYSCALL mknod
bcs .9
>PUSHEA.G NodBuf
>PUSHBI O.RDWR+O.TEXT
>PUSHBI S.FI.T.TXT
>PUSHWZ Aux type
>SYSCALL FOpen
bcs .9
sta hFile
.9 rts
*--------------------------------------
CS.RUN.GETBUF >LDYAI 256
CS.RUN.GETBUF >LDYAI MSGSIZE
>SYSCALL GetMem
bcs .9
stx hMsgBuf
>STYA ZPMsgPtr
>LDYAI 256
>SYSCALL GetMem
bcs .9
stx hUsrBuf
>STYA ZPUsrBufPtr
lda #0
sta (ZPUsrBufPtr)
@ -347,9 +358,6 @@ CS.RUN.SCRSETUP >PUSHW L.SEQ.INIT
jsr CS.RUN.TOPUPDATE
bcs .9
jsr CS.RUN.STATUSPDATE
bcs .9
jsr CS.RUN.TXTCLR
@ -387,14 +395,25 @@ CS.RUN.TOPUPDATE
CS.RUN.STATUSPDATE
>PUSHW ZPLineBufPtr
>PUSHW L.MSG.STATUSBAR
lda #4
>SYSCALL ArgV
>PUSHYA
>PUSHW ZPUsrBufPtr
>PUSHBI 4
>SYSCALL SPrintF
bra CS.RUN.STATUS
*--------------------------------------
CS.RUN.STATUSMSG
pha
>PUSHW ZPLineBufPtr
>PUSHW L.MSG.STATUSBARMSG
pla
>PUSHYA
>PUSHBI 2
CS.RUN.STATUS >SYSCALL SPrintF
>PUSHW L.SEQ.BAR
>PUSHBI 21
>PUSHW ZPLineBufPtr
@ -404,7 +423,7 @@ CS.RUN.STATUSPDATE
*--------------------------------------
CS.RUN.TXTCLR lda #0
sta (ZPTextPtr)
stz TextPtr
stz TextLen
stz bEscMode
@ -414,9 +433,8 @@ CS.RUN.TXTCLR lda #0
>SYSCALL PrintF
rts
*--------------------------------------
CS.RUN.NICK >PUSHW L.MSG.NICK
>PUSHBI 0
>SYSCALL printf
CS.RUN.NICK >LDYA L.MSG.NICK
jsr CS.RUN.STATUSMSG
>PUSHB hFile
>PUSHW L.IRC.NICK
@ -435,19 +453,17 @@ CS.RUN.NICK >PUSHW L.MSG.NICK
lda hFile
>SYSCALL fgets
bcs .9
jsr CS.RUN.SPLITMSG
jsr CS.RUN.DUMPMSG
ldx #$ff
dey
.3 inx
iny
lda IRC.REP.NOIDENT,x
ldy #$ff
.3 iny
lda IRC.REP.NOIDENT,y
beq .8
cmp (ZPMsgCmdPtr),y
cmp (ZPMsgExtPtr),y
beq .3
bra .1
@ -456,7 +472,7 @@ CS.RUN.NICK >PUSHW L.MSG.NICK
.9 rts
*--------------------------------------
CS.RUN.USER >LDYA L.MSG.USER
>SYSCALL PutS
jsr CS.RUN.STATUSMSG
>PUSHB hFile
@ -482,15 +498,13 @@ CS.RUN.USER >LDYA L.MSG.USER
.2 jsr CS.RUN.SPLITMSG
jsr CS.RUN.DUMPMSG
ldx #$ff
dey
.3 inx
iny
lda IRC.REP.001,x
ldy #$ff
.3 iny
lda IRC.REP.001,y
beq .8
cmp (ZPMsgCmdPtr),y
beq .3
@ -500,7 +514,7 @@ CS.RUN.USER >LDYA L.MSG.USER
.9 rts
*--------------------------------------
CS.RUN.JOIN >LDYA L.MSG.JOIN
>SYSCALL PutS
jsr CS.RUN.STATUSMSG
>PUSHB hFile
@ -529,7 +543,7 @@ CS.RUN.JOIN >LDYA L.MSG.JOIN
.2 >SYSCALL FPrintF
bcs .9
.3 >SLEEP
>PUSHWI MSGSIZE
@ -537,59 +551,59 @@ CS.RUN.JOIN >LDYA L.MSG.JOIN
lda hFile
>SYSCALL fgets
bcs .9
.4 jsr CS.RUN.SPLITMSG
jsr CS.RUN.DUMPMSG
ldx #$ff
dey
.5 inx
iny
lda IRC.REP.JOIN,x
ldy #$ff
.5 iny
lda IRC.REP.JOIN,y
beq .8
cmp (ZPMsgCmdPtr),y
beq .5
bra .3
.8 clc
.9 rts
*--------------------------------------
CS.RUN.REQ jsr CS.RUN.SPLITMSG
bcs .8
jsr CS.RUN.DUMPMSG
>LDYA L.IRC.CMDS
>STYA ZPPtr1
ldx #0
.1 lda (ZPPtr1)
beq .8
ldy #$ff
.2 iny
lda (ZPPtr1),y
cmp (ZPMsgCmdPtr),y
bne .3
ora #0
bne .2
jmp (J.IRC.CMDS,x)
.3 ora #0
beq .5
.4 iny
lda (ZPPtr1),y
bne .4
.5 inx
inx
tya
sec
adc ZPPtr1
@ -611,40 +625,30 @@ CS.RUN.CMD.PING >PUSHB hFile
*--------------------------------------
CS.RUN.CMD.PRIVMSG
>PUSHW L.SEQ.PRIVMSG
>PUSHW ZPMsgArgPtr
>PUSHW ZPMsgExtPtr
>PUSHBI 4
>SYSCALL PrintF
rts
*--------------------------------------
CS.RUN.CMD.MODE
CS.RUN.CMD.MODE
clc
rts
*--------------------------------------
CS.RUN.SPLITMSG lda ZPMsgPtr
stz ZPMsgPfxPtr+1
stz ZPMsgCmdPtr+1
stz ZPMsgArgPtr+1
stz ZPMsgExtPtr+1
CS.RUN.SPLITMSG >LDYA pData
>STYA ZPMsgPfxPtr
>STYA ZPMsgCmdPtr
>STYA ZPMsgArgPtr
>STYA ZPMsgExtPtr
ldy #0
lda (ZPMsgPtr)
cmp #':'
bne .3
.1 iny
lda (ZPMsgPtr),y
beq .9
cmp #C.SPACE
bne .1
lda #0
sta (ZPMsgPtr),y
bne .21
lda ZPMsgPtr
clc
adc #1
@ -653,84 +657,102 @@ CS.RUN.SPLITMSG lda ZPMsgPtr
adc #0
sta ZPMsgPfxPtr+1
.2 iny
.1 iny
lda (ZPMsgPtr),y
beq .9
cmp #C.SPACE
bne .1
lda #0
sta (ZPMsgPtr),y
.2 tya
tax
.21 iny
lda (ZPMsgPtr),y
beq .4
.3 cmp #C.SPACE
bne .2
bne .21
lda #0
sta (ZPMsgPtr),y
inc
.4 php
tya
txa
sec
adc ZPMsgPtr
sta ZPMsgCmdPtr
lda #0
adc ZPMsgPtr+1
sta ZPMsgCmdPtr+1
plp
beq .8
beq .80
tya
tax
iny
lda (ZPMsgPtr),y
cmp #':'
beq .8
.6 iny
lda (ZPMsgPtr),y
beq .7
cmp #C.SPACE
bne .6
lda #0
sta (ZPMsgPtr),y
inc
.7 php
tya
txa
sec
adc ZPMsgPtr
sta ZPMsgArgPtr
lda #0
adc ZPMsgPtr+1
sta ZPMsgArgPtr+1
plp
beq .80
.8 iny
tya
tya
sec
adc ZPMsgPtr
sta ZPMsgExtPtr
lda #0
adc ZPMsgPtr+1
sta ZPMsgExtPtr+1
.80 clc
rts
rts
.9 sec
rts
*--------------------------------------
CS.RUN.DUMPMSG >PUSHW L.SEQ.DUMPMSG
>PUSHW ZPMsgPfxPtr
>PUSHW ZPMsgCmdPtr
>PUSHW ZPMsgArgPtr
>PUSHW ZPMsgExtPtr
>PUSHBI 8
>SYSCALL PrintF
rts
@ -772,13 +794,13 @@ CS.RUN.CHARIN bit bEscMode
cmp #C.DEL
bne CS.RUN.CHARIN.INS
lda TextLen
beq .9
lda TextPtr
beq .9
lda #C.BS
>SYSCALL PutChar
jmp CS.RUN.CHARIN.DEL
@ -787,39 +809,40 @@ CS.RUN.CHARIN.INS
ldy TextLen
cpy #TEXTMAX
beq .8
inc TextLen
ldy TextPtr
sta (ZPTextPtr),y
iny
sty TextPtr
pha
lda #0
sta (ZPTextPtr),y
pla
>SYSCALL PutChar
rts
.8 clc
rts
CS.RUN.CHARIN.CTRL
cmp #C.CR
bne .8
>PUSHW L.SEQ.PRIVMSG
lda #4 channel
>SYSCALL ArgV
>PUSHYA
>PUSHW ZPTextPtr
>PUSHBI 4
>SYSCALL PrintF
bcs .9
jmp CS.RUN.TXTCLR
.8 clc
.9 rts
@ -838,11 +861,11 @@ CS.RUN.CHARIN.RIGHT
lda TextPtr
cmp TextLen
beq .9
inc
sta TextPtr
lda #C.FS
>SYSCALL PutChar
>SYSCALL PutChar
.9 rts
*--------------------------------------
CS.RUN.CHARIN.DEL
@ -860,7 +883,7 @@ CS.DOEVENT lda (pEvent)
*--------------------------------------
CS.QUIT lda hFile
beq .1
>SYSCALL fclose
.1 lda hSocket
@ -891,17 +914,18 @@ MSG.HOSTOK .AZ "Connecting to %d.%d.%d.%d:%D (%s)..."
MSG.SKTKO .AZ "Failed to Open Socket."
MSG.SKTOK .AZ "Connected\r\n(Exit key is Ctrl-T)\r\n"
MSG.SKTERR .AZ "Socket Error : $%h\r\n"
MSG.NICK .AZ "\e[2;1HRegistering User..."
MSG.NICK .AZ "Registering User..."
MSG.USER .AZ "Connecting User..."
MSG.JOIN .AZ "Joining Channel..."
MSG.TOPBAR .AZ "A2osX IRC %d.%d %s:%s %s"
MSG.STATUSBAR .AZ "%s:%s"
MSG.STATUSBARMSG .AZ "STATUS:%s"
*--------------------------------------
EscChars .AS 'DBAC'
EscChars.Cnt .EQ *-EscChars
EscChars.Remap .DA #C.BS,#C.VT,#C.LF,#C.FS
*--------------------------------------
IRC.REP.NOIDENT .AZ "NOTICE * :*** No Ident response"
IRC.REP.NOIDENT .AZ "*** No Ident response"
IRC.REP.001 .AZ "001"
IRC.REP.JOIN .AZ "JOIN"
*--------------------------------------
@ -917,11 +941,11 @@ IRC.JOINKEY .AZ "JOIN %s %s\r\n"
IRC.PONG .AZ "PONG %s\r\n"
IRC.PRIVMSG .AZ "PRIVMSG %s :%s\r\n"
*--------------------------------------
SEQ.INIT .AZ "\ec\e(B\e)0\e[?7l\e[2;20r\e[22;1H"
SEQ.INIT .AZ "\ec\e(B\e)0\e[?7l\e[2;20r\e[22;1H\e[?7h"
SEQ.BAR .AZ "\e7\e[%d;1H\e[7m\e[37;40m%80s\e[0m\e8"
SEQ.TXTCLR .AZ "\e[22;1H\e[K\r\n\e[K\r\n\e[K\e[22;1H"
SEQ.PRIVMSG .AZ "\e7\r\n\e[20;1H\e[7m%s:\e[0m%s\r\n\e8"
SEQ.DUMPMSG .AZ "\e7\r\n\e[20;1H\e[7m:%s %s \e[0m%s %s\r\n\e8"
SEQ.PRIVMSG .AZ "\e7\e[20;1H\r\n\e[7m%s:\e[0m%s\r\n\e8"
SEQ.DUMPMSG .AZ "\e7\e[20;1H\r\n\e[7m%s\e[0m %s %s %s\r\n\e8"
SEQ.RESET .AZ "\ec"
*--------------------------------------
SA.LOCAL .DA #AF.INET S.SOCKADDR.AF
@ -939,6 +963,7 @@ NOD.Template .AZ "/dev/irc%h"
.DUMMY
.OR 0
DS.START
NULLSTRING .BS 1
NodBuf .BS 11
DS.END
.ED

View File

@ -2,7 +2,7 @@ NEW
AUTO 3,1
.LIST OFF
*--------------------------------------
IO.D2.SeekTime .EQ 250
IO.D2.SeekTime .EQ 124
*--------------------------------------
IO.D2.Ph0Off .EQ $C080
IO.D2.Ph0On .EQ $C081

View File

@ -80,102 +80,80 @@ D2MoveHead >PULLB MoveTo
bcs .9
jsr D2MoveHead.1
jsr D2.Wait25600usec
jsr D2.Wait25600usec
jsr D2.Wait25600usec
jsr D2.Wait25600usec
clc
.9 rts
D2MoveHead.1 ldy #0
D2MoveHead.1
.1 lda MoveFrom
pha
.1 lda MoveTo
sec
sbc MoveFrom
jsr D2.QPhaseOn
lda #IO.D2.SeekTime
jsr D2.Wait100usecA
pla
cmp MoveTo
beq .8
bcc .2
pha
bcs .2
* Current < Target, must move in
cmp #2
bcc .5 one QT remaining
lda MoveFrom 2 or more
inc
inc
bra .3
* Current > Target, must move out
.HS B0 BCS
.2 cmp #$FF
bcs .6 one QT remaining
lda MoveFrom
dec
* Current > Target, must move out
.3 and #$FE
.2 dec
sta MoveFrom
and #6
ora Slotn0
tax
tya
beq .4
lda IO.D2.Ph0Off,y
lda #IO.D2.SeekTime
jsr D2.Wait100usecA
.4 lda IO.D2.Ph0On,x
txa
tay
pla
lda #IO.D2.SeekTime
jsr D2.Wait100usecA
jsr D2.AllPhasesOff
* lda #IO.D2.SeekTime
* jsr D2.Wait100usecA
bra .1
* Last QTrack
.5 tya
inc
inc
bra .7
.6 tya
* sec
adc #5
.7 and #$f6
.8 jsr D2.Wait25600usec
jsr D2.Wait25600usec
*--------------------------------------
D2.AllPhasesOff ldx Slotn0
lda IO.D2.Ph0Off,x
lda IO.D2.Ph1Off,x
lda IO.D2.Ph2Off,x
lda IO.D2.Ph3Off,x
rts
*--------------------------------------
D2.QPhaseOff clc
.HS B0 BCS
D2.QPhaseOn sec
pha
php
and #6
adc Slotn0
tax
lda IO.D2.Ph0Off,y
lda #IO.D2.SeekTime
jsr D2.Wait100usecA
lda IO.D2.Ph0On,y
nop
nop
lda IO.D2.Ph0On,x
lda #IO.D2.SeekTime
jsr D2.Wait100usecA
plp
pla
inc
and #6
adc Slotn0
tay
jsr D2.Wait25600usec
lda IO.D2.Ph0Off,y
nop
nop
lda IO.D2.Ph0Off,x
rts
.8 tya
beq .9
jsr D2.Wait25600usec
nop
nop
lda IO.D2.Ph0Off,y
.9 rts
rts
*--------------------------------------
D2.Wait25600usec
lda #0

View File

@ -71,16 +71,16 @@ L59BD jsr XRW.AllPhasesOff make sure all motor phases are off
lsr
lsr
lsr
sta XRW.ReqSector
pha save sector # across call
jsr regrwts
plx
bcs .3 if error
inc buf+1
txa
adc #$02
inc XRW.ReqSector
inc XRW.ReqSector
jsr regrwts get 2nd half of block
dec buf+1
@ -91,9 +91,8 @@ L59BD jsr XRW.AllPhasesOff make sure all motor phases are off
sec
rts
*--------------------------------------
regrwts ldy #3
regrwts ldy #1
sty XRW.RecalibrateCnt
sta XRW.ReqSector
* now check if the motor is on, then start it
@ -727,12 +726,15 @@ L57CC sec
L57CD pla place last byte into user buffer
ldy #$55
sta (buf),y
rts
XRW.Read.RTS rts
*--------------------------------------
* A = target track
*--------------------------------------
XRW.Seek pha save target track
ldx XRW.UnitIndex
XRW.Seek ldx XRW.UnitIndex
cmp XRW.D2Trk-1,x
beq XRW.Read.RTS
pha save target track
jsr XRW.Trk2Qtrk
sta XRW.TargetQTrack
@ -777,8 +779,8 @@ XRW.Seek pha save target track
pla
jsr XRW.QPhaseOff
jsr XRW.WaitSeekTime
jsr XRW.AllPhasesOff
* jsr XRW.WaitSeekTime
bra .1
.8 jsr XRW.Wait25600usec
@ -794,16 +796,22 @@ XRW.AllPhasesOff
XRW.QPhaseOff clc
.HS B0 BCS
XRW.QPhaseOn sec
pha
php
and #6
adc A2L
tax
plp
pla
inc
inc
and #$F7
and #6
adc A2L
tay
lda IO.D2.Ph0Off,x
nop
nop
lda IO.D2.Ph0Off,y
rts
*--------------------------------------

View File

@ -63,6 +63,7 @@ L.DCB.NIC .DA DCB.NIC
L.ETCNETWORK .DA ETCNETWORK
.DO DBG=1
L.MSG.DBG .DA MSG.DBG
L.MSG.DBG.REJECT .DA MSG.DBG.REJECT
.FIN
.DA 0
*--------------------------------------
@ -283,7 +284,16 @@ CS.RUN >PUSHB DevID
inx
bra .1
.2 lda hFrameIn
.2 .DO DBG=1
lda (pBuf)
cmp #$ff
beq .33
cmp #1
beq .33
>LDYA L.MSG.DBG.REJECT
>SYSCALL puts
.33 .FIN
lda hFrameIn
>SYSCALL FreeMem
jmp CS.RUN
@ -344,6 +354,7 @@ ETCNETWORK .AZ "${BOOT}etc/network"
MSG.DBG .AS "FRM %h%h%h%h%h%h.%h%h%h%h%h%h.%h%h\r\n"
.AS " %h%h.%h%h%h%h%h%h.%h%h%h%h %d.%d.%d.%d %d.%d.%d.%d\r\n"
.AZ " %h%h%h%h%h%h%h%h.%h%h%h%h%h%h%h%h\r\n"
MSG.DBG.REJECT .AZ "Rejected"
.FIN
*--------------------------------------
DevID .BS 1

View File

@ -486,16 +486,19 @@ CPU.Init.6502 >PUSHWI MSG.CPU
bmi .2
.21 ldx #2 A = LOW
ldy A2osX.HZ
*--------------------------------------
.20 pha (3)
pla (4)
pha (3)
pla (4)
.20 tya
.22 nop (2)
nop (2)
nop (2)
nop (2)
nop (2)
dec
bne .22
inc A2osX.RANDOM16 (6)
bne .5 (2*)