Kernel 0.94+

This commit is contained in:
Rémy GIBERT 2021-03-12 13:50:03 +01:00
parent 1e86624d74
commit f8551f41ed
5 changed files with 183 additions and 261 deletions

Binary file not shown.

Binary file not shown.

View File

@ -22,28 +22,13 @@ TEXTMAX .EQ 240
ZS.START
ZPPtr1 .BS 2
hSocket .BS 1
hLineBuf .BS 1
ZPLineBufPtr .BS 2
bEscMode .BS 1
bRegister .BS 1
bJoin .BS 1
TimeOut .BS 1
TextPtr .BS 1
TextLen .BS 1
ZPTextPtr .BS 2
hText .BS 1
bEscMode .BS 1
TimeOut .BS 1
bJoin .BS 1
hMsgBuf .BS 1
MsgLen .BS 1
ZPMsgPtr .BS 2
ZPMsgPfxPtr .BS 2
ZPMsgCmdPtr .BS 2
ZPMsgArgPtr .BS 2
ZPMsgExtPtr .BS 2
hReqBuf .BS 1
ReqPtr .BS 1
@ -52,6 +37,18 @@ hRespBuf .BS 1
ZPReqPtr .BS 2
ZPRespPtr .BS 2
hLineBuf .BS 1
hSocket .BS 1
hMsgBuf .BS 1
MsgLen .BS 1
ZPLineBufPtr .BS 2
ZPMsgPtr .BS 2
ZPMsgPfxPtr .BS 2
ZPMsgCmdPtr .BS 2
ZPMsgArgPtr .BS 2
ZPMsgExtPtr .BS 2
ZS.END .ED
*--------------------------------------
* File Header (16 Bytes)
@ -83,14 +80,13 @@ L.MSG.HOSTOK .DA MSG.HOSTOK
L.MSG.SKTKO .DA MSG.SKTKO
L.MSG.SKTOK .DA MSG.SKTOK
L.MSG.SKTERR .DA MSG.SKTERR
L.MSG.NICK .DA MSG.NICK
L.MSG.USER .DA MSG.USER
L.MSG.REGISTER .DA MSG.REGISTER
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.MSG.NULL .DA MSG.NULL
L.IRC.REGISTER .DA IRC.REGISTER
L.IRC.JOIN .DA IRC.JOIN
L.IRC.JOINKEY .DA IRC.JOINKEY
L.IRC.PONG .DA IRC.PONG
@ -105,11 +101,12 @@ L.SEQ.INFOMSG .DA SEQ.INFOMSG
L.SEQ.DUMPMSG .DA SEQ.DUMPMSG
L.SEQ.RESET .DA SEQ.RESET
L.IRC.CMDS .DA IRC.CMDS
J.IRC.CMDS .DA CS.RUN.CMD.JOIN
J.IRC.CMDS .DA CS.RUN.CMD.PING
.DA CS.RUN.CMD.JOIN
.DA CS.RUN.CMD.PART
.DA CS.RUN.CMD.PING
.DA CS.RUN.CMD.PRIVMSG
.DA CS.RUN.CMD.MODE
.DA CS.RUN.CMD.001
.DA CS.RUN.CMD.353
.DA CS.RUN.CMD.375
.DA CS.RUN.CMD.372
@ -134,7 +131,7 @@ CS.RUN jsr CS.RUN.CheckTCPIP
jsr CS.RUN.CheckArgs
bcs CS.INIT.RTS
jsr CS.RUN.Connect
bcs CS.INIT.RTS
@ -144,18 +141,9 @@ CS.RUN jsr CS.RUN.CheckTCPIP
jsr CS.RUN.SCRSETUP
bcs CS.INIT.RTS
jsr CS.RUN.NICK
jsr CS.RUN.REGISTER
bcs CS.INIT.RTS
jsr CS.RUN.USER
bcs CS.INIT.RTS
jsr CS.RUN.JOIN
bcs CS.INIT.RTS
>LDYA pData NULLSTRING
jsr CS.RUN.STATUSPDATE
CS.RUN.LOOP >SLEEP
jsr CS.RUN.GetMsg
@ -164,7 +152,7 @@ CS.RUN.LOOP >SLEEP
jsr CS.RUN.REQ
bcs .9
>SLEEP
.2 ldy #S.PS.hStdIn
@ -194,11 +182,11 @@ CS.RUN.LOOP >SLEEP
CS.RUN.CheckTCPIP
>LIBCALL hLIBTCPIP,LIBTCPIP.GETCFG is TCPIP loaded ?
bcs .9
>STYA ZPPtr1
lda (ZPPtr1) Configured ?
bpl .99
ldy #S.IPCFG.IP+3
ldx #3
@ -207,7 +195,7 @@ CS.RUN.CheckTCPIP
dey
dex
bpl .1
rts
.99 >LDYA L.MSG.IPKO
@ -252,7 +240,7 @@ CS.RUN.CheckArgs
>SYSCALL PrintF
lda #ERR.SKT.NOCONN
sec
rts
rts
.3 lda #2
>SYSCALL ArgV
@ -292,7 +280,7 @@ CS.RUN.Connect >PUSHBI 0 no protocol
sta TimeOut
.1 >SLEEP
>PUSHW L.SA.REMOTE
lda hSocket
>LIBCALL hLIBTCPIP,LIBTCPIP.Connect
@ -338,15 +326,9 @@ CS.RUN.GETBUF >LDYAI 256
>SYSCALL GetMem
bcs .9
stx hText
>STYA ZPTextPtr
>LDYAI 256
>SYSCALL GetMem
bcs .9
stx hLineBuf
>STYA ZPLineBufPtr
.9 rts
*--------------------------------------
CS.RUN.SCRSETUP >PUSHW L.SEQ.INIT
@ -414,7 +396,7 @@ CS.RUN.STATUSMSG
pla
>PUSHYA
>PUSHBI 2
CS.RUN.STATUS >SYSCALL SPrintF
>PUSHW L.SEQ.BAR
@ -425,7 +407,7 @@ CS.RUN.STATUS >SYSCALL SPrintF
rts
*--------------------------------------
CS.RUN.TXTCLR lda #0
sta (ZPTextPtr)
sta (pData)
stz TextPtr
stz TextLen
@ -436,134 +418,36 @@ CS.RUN.TXTCLR lda #0
>SYSCALL PrintF
rts
*--------------------------------------
CS.RUN.NICK >LDYA L.MSG.NICK
CS.RUN.REGISTER >LDYA L.MSG.REGISTER
jsr CS.RUN.STATUSMSG
>PUSHW ZPRespPtr
>PUSHW L.IRC.NICK
>PUSHW L.IRC.REGISTER
lda #3 nickname
>SYSCALL ArgV
>PUSHYA
>PUSHBI 2
lda #3 nickname
>SYSCALL ArgV
>PUSHYA
lda #3 nickname
>SYSCALL ArgV
>PUSHYA
lda #3 nickname
>SYSCALL ArgV
>PUSHYA
>PUSHBI 8
>SYSCALL SPrintF
bcs .9
jsr CS.RUN.SendMsg
bcs .9
.1 >SLEEP
jsr CS.RUN.GetMsg
bcs .9
beq .1
jsr CS.RUN.SplitMsg
jsr CS.RUN.DUMPMSG
ldy #$ff
.3 iny
lda IRC.REP.NOIDENT,y
beq .8
cmp (ZPMsgExtPtr),y
beq .3
jsr CS.RUN.REQ1
bcc .1
rts
.8 clc
.9 rts
*--------------------------------------
CS.RUN.USER >LDYA L.MSG.USER
jsr CS.RUN.STATUSMSG
>PUSHW ZPRespPtr
>PUSHW L.IRC.USER
lda #3 nickname
>SYSCALL ArgV
>PUSHYA
lda #3 nickname
>SYSCALL ArgV
>PUSHYA
>PUSHBI 4
>SYSCALL SPrintF
bcs .9
jsr CS.RUN.SendMsg
bcs .9
.1 >SLEEP
jsr CS.RUN.GetMsg
bcs .9
beq .1
.2 jsr CS.RUN.SplitMsg
jsr CS.RUN.DUMPMSG
ldy #$ff
.3 iny
lda IRC.REP.001,y
beq .8
cmp (ZPMsgCmdPtr),y
beq .3
jsr CS.RUN.REQ1
bcc .1
rts
.8 clc
.9 rts
*--------------------------------------
CS.RUN.JOIN >LDYA L.MSG.JOIN
jsr CS.RUN.STATUSMSG
>PUSHW ZPRespPtr
lda #5 key
>SYSCALL ArgV
bcs .1
>PUSHW L.IRC.JOINKEY
lda #4 channel
>SYSCALL ArgV
>PUSHYA
lda #5 key
>SYSCALL ArgV
>PUSHYA
>PUSHBI 4
bra .2
.1 >PUSHW L.IRC.JOIN
lda #4 channel
>SYSCALL ArgV
>PUSHYA
>PUSHBI 2
.2 >SYSCALL SPrintF
bcs .9
jsr CS.RUN.SendMsg
.9 rts
*--------------------------------------
CS.RUN.REQ jsr CS.RUN.SplitMsg
bcc CS.RUN.REQ1
clc
rts
bcs .9
CS.RUN.REQ1 >LDYA L.IRC.CMDS
>LDYA L.IRC.CMDS
>STYA ZPPtr1
ldx #0
@ -604,14 +488,22 @@ CS.RUN.REQ1 >LDYA L.IRC.CMDS
.8 clc
.9 rts
*--------------------------------------
CS.RUN.CMD.JOIN lda bJoin
bmi .1
sec
CS.RUN.CMD.PING >PUSHW ZPRespPtr
>PUSHW L.IRC.PONG
>PUSHW ZPMsgExtPtr
>PUSHBI 2
>SYSCALL SPrintF
bcs .9
jsr CS.RUN.SendMsg
.9 rts
*--------------------------------------
CS.RUN.CMD.JOIN sec
ror bJoin
clc
rts
.1
>LDYA L.MSG.NULL
jsr CS.RUN.STATUSPDATE
*--------------------------------------
CS.RUN.CMD.PART >PUSHW ZPRespPtr
>PUSHW L.IRC.NAMES
@ -623,37 +515,18 @@ CS.RUN.CMD.PART >PUSHW ZPRespPtr
bcs .9
jsr CS.RUN.SendMsg
.9 rts
*--------------------------------------
CS.RUN.CMD.PING >PUSHW ZPRespPtr
>PUSHW L.IRC.PONG
>PUSHW ZPMsgExtPtr
>PUSHBI 2
* lda #1 server name
* >SYSCALL ArgV
* >PUSHYA
>PUSHW ZPMsgExtPtr
>PUSHBI 2
>SYSCALL SPrintF
bcs .9
jsr CS.RUN.SendMsg
.9 rts
*--------------------------------------
CS.RUN.CMD.PRIVMSG
ldy #0
.1 iny
lda (ZPMsgPfxPtr),y
beq .2
eor #'!'
bne .1
sta (ZPMsgPfxPtr),y
.2 >PUSHW L.SEQ.PRIVMSG
@ -669,13 +542,54 @@ CS.RUN.CMD.MODE
clc
rts
*--------------------------------------
CS.RUN.CMD.001 jsr CS.RUN.CMD.INFO
sec
ror bRegister
>LDYA L.MSG.JOIN
jsr CS.RUN.STATUSMSG
>PUSHW ZPRespPtr
lda #5 key
>SYSCALL ArgV
bcs .1
>PUSHW L.IRC.JOINKEY
lda #4 channel
>SYSCALL ArgV
>PUSHYA
lda #5 key
>SYSCALL ArgV
>PUSHYA
>PUSHBI 4
bra .2
.1 >PUSHW L.IRC.JOIN
lda #4 channel
>SYSCALL ArgV
>PUSHYA
>PUSHBI 2
.2 >SYSCALL SPrintF
bcs .9
jsr CS.RUN.SendMsg
.9 rts
*--------------------------------------
CS.RUN.CMD.353 >LDYA ZPMsgExtPtr RPL_NAMREPLY
jmp CS.RUN.STATUSPDATE
CS.RUN.CMD.375
*--------------------------------------
CS.RUN.CMD.372
CS.RUN.CMD.375
CS.RUN.CMD.376
>PUSHW L.SEQ.INFOMSG
CS.RUN.CMD.INFO >PUSHW L.SEQ.INFOMSG
>PUSHW ZPMsgExtPtr
>PUSHBI 2
>SYSCALL PrintF
@ -683,13 +597,13 @@ CS.RUN.CMD.376
*--------------------------------------
CS.RUN.GetMsg ldy ReqLen
bne .2
.1 >PUSHWI 255
>PUSHW ZPReqPtr
lda hSocket
>LIBCALL hLIBTCPIP,LIBTCPIP.Read
bcs .7
sty ReqLen
stz ReqPtr
@ -698,42 +612,42 @@ CS.RUN.GetMsg ldy ReqLen
lda (ZPReqPtr),y
cmp #C.CR
beq .6
cmp #C.LF
beq .3
ldy MsgLen
sta (ZPMsgPtr),y
inc MsgLen
.3 inc ReqPtr
dec ReqLen
bne .2
bra .1
.6 inc ReqPtr Skip CR
dec ReqLen
lda #0
ldy MsgLen will exit with NZ
stz MsgLen
sta (ZPMsgPtr),y
clc
rts
.7 cmp #E.NODATA
bne .9
.8 clc will exit with NZ
.9 rts
*--------------------------------------
CS.RUN.SplitMsg >LDYA pData
CS.RUN.SplitMsg >LDYA L.MSG.NULL
>STYA ZPMsgPfxPtr
>STYA ZPMsgCmdPtr
>STYA ZPMsgArgPtr
@ -765,10 +679,10 @@ CS.RUN.SplitMsg >LDYA pData
sta (ZPMsgPtr),y End Of prefix
iny Skip blank
tya
tax Save CMD start pos
.2 iny
lda (ZPMsgPtr),y
@ -813,7 +727,7 @@ CS.RUN.SplitMsg >LDYA pData
lda #0
sta (ZPMsgPtr),y
iny Skip :
.7 php
@ -829,12 +743,12 @@ CS.RUN.SplitMsg >LDYA pData
plp
beq .80
lda (ZPMsgPtr),y
cmp #':'
bne .8
.71 iny Skip blank
.71 iny Skip blank
.8 tya
clc
@ -919,13 +833,13 @@ CS.RUN.CHARIN.INS
inc TextLen
ldy TextPtr
sta (ZPTextPtr),y
sta (pData),y
iny
sty TextPtr
pha
lda #0
sta (ZPTextPtr),y
sta (pData),y
pla
>SYSCALL PutChar
rts
@ -938,12 +852,12 @@ CS.RUN.CHARIN.INS.8
CS.RUN.CHARIN.CTRL
cmp #C.CR
bne .1
jmp CS.RUN.CHARIN.CR
.1 cmp #$14 Ctrl-T
bne .8
>PUSHW ZPRespPtr
>PUSHW L.IRC.PART
lda #4 channel
@ -966,7 +880,7 @@ CS.RUN.CHARIN.CTRL
CS.RUN.CHARIN.CR
bit bJoin
bpl CS.RUN.CHARIN.INS.8
lda TextLen
beq CS.RUN.CHARIN.INS.8
@ -976,7 +890,7 @@ CS.RUN.CHARIN.CR
lda #4 channel
>SYSCALL ArgV
>PUSHYA
>PUSHW ZPTextPtr
>PUSHW pData
>PUSHBI 4
>SYSCALL SPrintF
@ -990,24 +904,24 @@ CS.RUN.CHARIN.CR
lda #3 nickname
>SYSCALL ArgV
>PUSHYA
>PUSHW ZPTextPtr
>PUSHW pData
>PUSHBI 4
>SYSCALL PrintF
bcs .9
jmp CS.RUN.TXTCLR
.9 rts
.9 rts
*--------------------------------------
CS.RUN.CHARIN.LEFT
clc
lda TextPtr
beq .9
dec TextPtr
lda #C.BS
>SYSCALL PutChar
.9 rts
@ -1019,12 +933,12 @@ CS.RUN.CHARIN.RIGHT
lda TextPtr
cmp TextLen
clc
beq .9
inc
sta TextPtr
lda #C.FS
>SYSCALL PutChar
.9 rts
@ -1051,22 +965,32 @@ CS.DOEVENT lda (pEvent)
.9 sec do not discard TIMER event
rts
*--------------------------------------
CS.QUIT lda hSocket
CS.QUIT lda hRespBuf
beq .1
>SYSCALL FreeMem
.1 lda hReqBuf
beq .2
>LIBCALL hLIBTCPIP,LIBTCPIP.Shutdown
>SYSCALL FreeMem
.2 lda hLineBuf
beq .3
>SYSCALL FreeMem
.3 lda hText
.3 lda hMsgBuf
beq .4
>SYSCALL FreeMem
.4 lda hLIBTCPIP
.4 lda hSocket
beq .5
>LIBCALL hLIBTCPIP,LIBTCPIP.Shutdown
.5 lda hLIBTCPIP
beq .8
>SYSCALL UnloadLib
@ -1084,38 +1008,37 @@ 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 "Registering User..."
MSG.USER .AZ "Connecting User..."
MSG.REGISTER .AZ "Registering User..."
MSG.JOIN .AZ "Joining Channel..."
MSG.TOPBAR .AZ "A2osX IRC %d.%d Server:%s:%s Nick:%s"
MSG.STATUSBAR .AZ "%s:%s"
MSG.STATUSBARMSG .AZ "STATUS:%s"
MSG.STATUSBARMSG .AS "STATUS:%s"
MSG.NULL .HS 00
*--------------------------------------
EscChars .AS 'DBAC'
EscChars.Cnt .EQ *-EscChars
EscChars.Remap .DA #C.BS,#C.VT,#C.LF,#C.FS
*--------------------------------------
IRC.REP.NOIDENT .AZ "*** No Ident response"
IRC.REP.001 .AZ "001"
IRC.REP.JOIN .AZ "JOIN"
*--------------------------------------
IRC.CMDS .AZ "JOIN"
IRC.CMDS .AZ "PING"
.AZ "JOIN"
.AZ "PART"
.AZ "PING"
.AZ "PRIVMSG"
.AZ "MODE"
.AZ "001"
.AZ "353"
.AZ "375"
.AZ "372"
.AZ "375"
.AZ "376"
.DA #0
*--------------------------------------
IRC.NICK .AZ "NICK %s\r\n"
IRC.USER .AZ "USER %s 0 * :%s\r\n"
IRC.REGISTER .AS "NICK %s\r\n"
.AZ "USER %s %s %s :A2osX IRC\r\n"
IRC.JOIN .AZ "JOIN %s\r\n"
IRC.JOINKEY .AZ "JOIN %s %s\r\n"
IRC.PONG .AZ "PONG :%s\r\n"
*IRC.PONG .AZ "PONG %s:%s\r\n"
IRC.PART .AS "PART %s\r\n"
.AZ "QUIT :Pfff\r\n"
IRC.NAMES .AZ "NAMES %s\r\n"
@ -1141,8 +1064,7 @@ SA.REMOTE .DA #AF.INET S.SOCKADDR.AF
*--------------------------------------
.DUMMY
.OR 0
DS.START
NULLSTRING .BS 1
DS.START .BS TEXTMAX+1
DS.END .ED
*--------------------------------------
MAN

View File

@ -378,7 +378,17 @@ XRW.Seek ldx XRW.UnitIndex
inc
inc
.3 jsr XRW.SEEK2QTY
.3 and #6
ora A2L
bcc .30
phx
tay
pla
.30 tay
jsr XRW.SEEK2QT
lda XRW.SeekTime
.4 jsr XRW.Wait100usecA
@ -947,19 +957,19 @@ XRW.SEEK2QTXY pha
pla
inc
XRW.SEEK2QTY and #6
and #6
ora A2L
tay
lda A2L
XRW.SEEK2QT lda A2L
ora #IO.D2.RData
sta .1+1
sta .2+1
lda IO.D2.Ph0On,y
lda IO.D2.Ph0On,x
.1 lda IO.D2.RData SELF MODIFIED
lda IO.D2.Ph0On,x
lda IO.D2.Ph0On,y
.2 lda IO.D2.RData SELF MODIFIED
rts
*--------------------------------------

View File

@ -245,23 +245,15 @@ CS.RUN.Connect >PUSHBI 0 no protocol
>LIBCALL hLIBTCPIP,LIBTCPIP.Bind
bcs .9
>PUSHEA.G SA.REMOTE
lda hSocket
>LIBCALL hLIBTCPIP,LIBTCPIP.Connect
bcs .9
lda #TIMEOUT.MAX
sta TimeOut
.1 >SLEEP
>PUSHEA.G SA.REMOTE
lda hSocket
>LIBCALL hLIBTCPIP,LIBTCPIP.Recv
bcc .7
cmp #E.NODATA
beq .8
>LIBCALL hLIBTCPIP,LIBTCPIP.Connect
bcc .8
ldx TimeOut
bne .1
@ -278,8 +270,6 @@ CS.RUN.Connect >PUSHBI 0 no protocol
sec
rts
.7 >SYSCALL Freemem
.8 >PUSHW L.MSG.CONNECTED
lda #1
>SYSCALL ArgV