A2osX/SYS/KERNEL.S.TERM.txt

1340 lines
23 KiB
Plaintext
Raw Normal View History

2018-12-11 16:41:25 +00:00
NEW
2019-05-15 05:46:12 +00:00
AUTO 3,1
2018-12-11 16:41:25 +00:00
*--------------------------------------
CURSOR.BLINK.SPEED .EQ 2
*--------------------------------------
2018-12-14 16:19:05 +00:00
.DUMMY
.OR ZPDRV
ZPIOCTL .BS 2
ZPDCBPtr .BS 2
ZPBufPtr .BS 2
ZPCount .BS 2
ZPBufBaseL1 .BS 2
ZPBufBaseL2 .BS 2
ZPScrBaseL1 .BS 2
ZPScrBaseL2 .BS 2
2019-05-14 16:04:16 +00:00
2018-12-14 16:19:05 +00:00
ZPTmpWord .BS 2
ZPTmpBool .BS 1
2019-05-15 15:30:46 +00:00
ZPTmpChar .BS 1
2018-12-15 20:34:55 +00:00
*--------------------------------------
bActive .BS 1
bCsiInNum .BS 1
CsiParamCnt .BS 1
CsiParams .BS 4
2018-12-14 16:19:05 +00:00
.ED
2018-12-11 16:41:25 +00:00
*--------------------------------------
DRV.TERM cld
2018-12-14 16:19:05 +00:00
jmp (.1,x)
.1 .DA DRV.TERM.STATUS
2018-12-11 16:41:25 +00:00
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA DRV.TERM.CONTROL
.DA A2osX.BADCALL
.DA DRV.TERM.OPEN
.DA DRV.TERM.CLOSE
.DA DRV.TERM.READ
.DA DRV.TERM.WRITE
*--------------------------------------
2018-12-17 14:24:39 +00:00
DRV.TERM.STATUS jsr DRV.TERM.GetIOCTLBufCntDCB
2018-12-12 16:32:33 +00:00
ldy #S.IOCTL.STATCODE
2018-12-11 16:41:25 +00:00
lda (ZPIOCTL),y
beq .1
cmp #S.IOCTL.STATCODE.GETDIB
2019-02-20 16:07:43 +00:00
bne .3
2018-12-11 16:41:25 +00:00
2018-12-12 16:32:33 +00:00
ldy #S.DIB-1
2018-12-11 16:41:25 +00:00
.HS 2C bit abs
2018-12-12 16:32:33 +00:00
.1 ldy #3
2018-12-11 16:41:25 +00:00
2018-12-12 16:32:33 +00:00
.2 lda DRV.TERM.DIB,y
2018-12-17 14:24:39 +00:00
sta (ZPBufPtr),y
2018-12-12 16:32:33 +00:00
dey
bne .2
2018-12-11 16:41:25 +00:00
2018-12-13 16:39:24 +00:00
ldy #S.DCB.TTY.STATUS
lda (ZPDCBPtr),y
2018-12-14 07:32:20 +00:00
sta (ZPBufPtr)
2018-12-11 16:41:25 +00:00
clc
rts
2019-02-20 16:07:43 +00:00
2019-05-16 15:51:19 +00:00
.3 cmp #S.IOCTL.STATCODE.EOF
2019-02-20 16:07:43 +00:00
bne .9
2019-02-23 22:01:58 +00:00
ldy #S.DCB.TTY.STATUS
lda (ZPDCBPtr),y
and #S.DIB.S.OPENED
2019-05-16 15:51:19 +00:00
beq DRV.TERM.OPEN.E
2019-02-23 22:01:58 +00:00
jsr DRV.TERM.CURBLNK
2019-02-20 16:07:43 +00:00
ldy #S.DCB.TTY.OUTTAIL
lda (ZPDCBPtr),y
2019-02-21 06:29:41 +00:00
iny
sec
2019-05-16 15:51:19 +00:00
eor (ZPDCBPtr),y OUTHEAD
bne .8
2018-12-11 16:41:25 +00:00
2019-02-20 16:07:43 +00:00
bit bActive
2019-05-16 15:51:19 +00:00
bpl .7
2019-02-20 16:07:43 +00:00
bit OPENAPPLE
2019-05-16 15:51:19 +00:00
bmi .7
2019-02-20 16:07:43 +00:00
bit KBD
2019-05-16 15:51:19 +00:00
bmi .8
2019-02-20 16:07:43 +00:00
2019-05-16 15:51:19 +00:00
.7 lda #$ff
.HS 2C BIT ABS
.8 lda #0
2019-02-20 16:07:43 +00:00
clc
rts
2018-12-11 16:41:25 +00:00
.9 lda #MLI.E.BADCTL
sec
rts
*--------------------------------------
2019-03-19 16:52:08 +00:00
DRV.TERM.OPEN tax DEV.ID in A
2018-12-11 16:41:25 +00:00
2019-03-19 16:52:08 +00:00
jsr DRV.TERM.GetDCB
ldy #S.DCB.TTY.STATUS
lda (ZPDCBPtr),y
bit #S.DIB.S.OPENED
2019-05-16 15:51:19 +00:00
beq DRV.TERM.OPEN.1
2019-03-19 16:52:08 +00:00
2019-05-16 15:51:19 +00:00
DRV.TERM.OPEN.E lda #MLI.E.OPEN
2019-03-19 16:52:08 +00:00
sec
rts
2019-05-16 15:51:19 +00:00
DRV.TERM.OPEN.1 txa
2019-03-19 16:52:08 +00:00
ldx #0
.2 ldy A2osX.SCRNDEVS,x
beq .3
2018-12-11 16:41:25 +00:00
inx
cpx #K.SCR.MAX
2019-03-19 16:52:08 +00:00
bne .2
2018-12-11 16:41:25 +00:00
lda #E.OOH
sec
rts
2019-03-19 16:52:08 +00:00
.3 sta A2osX.SCRNDEVS,x
2018-12-14 16:19:05 +00:00
2018-12-13 16:39:24 +00:00
ldy #S.DCB.TTY.DEVID
sta (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
2018-12-13 16:39:24 +00:00
ldy #S.DCB.TTY.STATUS
lda (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
ora #S.DIB.S.OPENED
ora DRV.TERM.DIB+S.DIB.S
2018-12-13 16:39:24 +00:00
sta (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
jsr RESET
*--------------------------------------
DRV.TERM.CONTROL
2018-12-14 16:19:05 +00:00
jsr DRV.TERM.GetDCB
2018-12-13 16:39:24 +00:00
ldy #S.DCB.TTY.DEVID
lda (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
sta A2osX.ASCREEN
2018-12-17 14:24:39 +00:00
sta SETTEXT
2018-12-14 16:19:05 +00:00
jsr DRV.TERM.SCRCPY
2018-12-17 07:02:03 +00:00
lda #0
ldy #S.DCB.TTY.bCURON
sta (ZPDCBPtr),y
ldy #S.DCB.TTY.bTITLE
sta (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
clc
rts
*--------------------------------------
2018-12-14 16:19:05 +00:00
DRV.TERM.CLOSE jsr DRV.TERM.GetDCB
ldy #S.DCB.TTY.STATUS
2018-12-13 16:39:24 +00:00
lda (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
bit #S.DIB.S.OPENED
beq .9
lda DRV.TERM.DIB+S.DIB.S
2018-12-13 16:39:24 +00:00
sta (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
ldx #0
2018-12-13 16:39:24 +00:00
ldy #S.DCB.TTY.DEVID
2018-12-12 16:32:33 +00:00
2018-12-11 16:41:25 +00:00
.1 lda A2osX.SCRNDEVS,x
2018-12-13 16:39:24 +00:00
cmp (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
bne .2
stz A2osX.SCRNDEVS,x
.2 inx
cpx #K.SCR.MAX
bne .1
clc
rts
2018-12-14 16:19:05 +00:00
.9 lda #MLI.E.IO
2018-12-11 16:41:25 +00:00
sec
rts
*--------------------------------------
2018-12-17 14:24:39 +00:00
DRV.TERM.READ jsr DRV.TERM.GetIOCTLBufCntDCB
2018-12-14 16:19:05 +00:00
bit bActive is screen active?
bpl .6 no....go check flush...
2019-02-23 22:01:58 +00:00
2018-12-17 07:02:03 +00:00
jsr DRV.TERM.CURBLNK
2018-12-11 16:41:25 +00:00
2019-02-23 22:01:58 +00:00
lda OPENAPPLE
bpl .1
2018-12-17 07:02:03 +00:00
lda KBD
2018-12-11 16:41:25 +00:00
bmi .6 Open apple key, not for us...
2018-12-17 07:02:03 +00:00
jsr DRV.TERM.Title.ON
bra .6
2019-02-23 22:01:58 +00:00
.1 jsr DRV.TERM.Title.OFF
2018-12-17 07:02:03 +00:00
2018-12-11 16:41:25 +00:00
lda KBD
bpl .6
sta KBDSTROBE
and #$7F
2018-12-15 20:34:55 +00:00
2018-12-11 16:41:25 +00:00
ldx KeyRemapped
.2 cmp KeyRemapped,x
beq .3
dex
bne .2
jsr Char.Out.Put no remap....send char....
bra .7 and flush
.3 lda KeyRemappedIdx,x
2018-12-15 20:34:55 +00:00
tax
2018-12-11 16:41:25 +00:00
2018-12-15 20:34:55 +00:00
.4 lda KeyRemappedTbl,x
2018-12-11 16:41:25 +00:00
beq .7 end of remap....flush
jsr Char.Out.Put
2018-12-15 20:34:55 +00:00
inx
2018-12-11 16:41:25 +00:00
bra .4
2018-12-15 20:34:55 +00:00
.6 ldy #S.DCB.TTY.OUTTAIL
2018-12-13 16:39:24 +00:00
lda (ZPDCBPtr),y
2018-12-15 20:34:55 +00:00
iny
cmp (ZPDCBPtr),y OUTHEAD
2018-12-13 16:39:24 +00:00
2018-12-11 16:41:25 +00:00
beq .9 no char in output buffer...
.7 stz .8+1
.70 inc ZPCount
bne .71
inc ZPCount+1
beq .8
.71 jsr Char.Out.Get
bcs .8
ldy .8+1
sta (ZPBufPtr),y
iny
sty .8+1
bra .70
.8 lda #$ff SELF MODIFIED
ldy #S.IOCTL.BYTECNT
sta (ZPIOCTL),y
iny
lda #0
sta (ZPIOCTL),y
clc
rts
2019-05-12 20:45:11 +00:00
.9 lda #E.NODATA
* sec
2018-12-11 16:41:25 +00:00
rts
*--------------------------------------
2018-12-17 14:24:39 +00:00
DRV.TERM.WRITE jsr DRV.TERM.GetIOCTLBufCntDCB
jsr DRV.TERM.CUROFF
2018-12-11 16:41:25 +00:00
2018-12-12 16:32:33 +00:00
.1 inc ZPCount
bne .2
2018-12-11 16:41:25 +00:00
inc ZPCount+1
2018-12-17 07:02:03 +00:00
beq FS.8
2018-12-17 14:24:39 +00:00
.2 ldy #S.DCB.TTY.MODE
2018-12-13 16:39:24 +00:00
lda (ZPDCBPtr),y
2018-12-12 16:32:33 +00:00
tax
2018-12-11 16:41:25 +00:00
2018-12-12 16:32:33 +00:00
jsr .3
2018-12-11 16:41:25 +00:00
2018-12-12 16:32:33 +00:00
inc ZPBufPtr
bne .1
inc ZPBufPtr+1
bra .1
2018-12-11 16:41:25 +00:00
2018-12-12 16:32:33 +00:00
.3 jmp (.4,x)
2018-12-17 07:02:03 +00:00
2018-12-12 16:32:33 +00:00
.4 .DA DRV.TERM.COUT
.DA DRV.TERM.ESC
.DA DRV.TERM.CSI
.DA DRV.TERM.IAC
2019-05-12 20:45:11 +00:00
.DA DRV.TERM.G0
.DA DRV.TERM.G1
2018-12-11 16:41:25 +00:00
*--------------------------------------
2018-12-12 16:32:33 +00:00
DRV.TERM.COUT lda (ZPBufPtr)
cmp #IAC
2018-12-11 16:41:25 +00:00
bne .1
2018-12-12 16:32:33 +00:00
2018-12-13 16:39:24 +00:00
lda #S.DCB.TTY.MODE.IAC
2018-12-17 14:24:39 +00:00
jmp DRV.TERM.SETMODE
2018-12-13 16:39:24 +00:00
2018-12-17 07:02:03 +00:00
.1 cmp #C.DEL
beq DRV.TERM.COUT.DEL
2018-12-11 16:41:25 +00:00
cmp #C.SPACE
2018-12-17 14:24:39 +00:00
bcs .8
ldx #CtrlChars.Cnt-1
2018-12-11 16:41:25 +00:00
2018-12-17 14:24:39 +00:00
.2 cmp CtrlChars,x
beq .3
dex
bpl .2
clc
rts
.3 txa
asl
tax
jmp (.4,x)
2019-05-15 15:30:46 +00:00
.4 .DA ENQ
.DA BS
.DA LF
2018-12-17 14:24:39 +00:00
.DA DRV.TERM.COUT.FF
.DA DRV.TERM.COUT.CR
2019-05-15 15:30:46 +00:00
.DA DRV.TERM.COUT.SO
.DA DRV.TERM.COUT.SI
2018-12-17 14:24:39 +00:00
.DA DRV.TERM.COUT.FS
.DA DRV.TERM.COUT.ESC
2019-05-12 20:45:11 +00:00
.8 jsr SetCharAtCurPos
2018-12-11 16:41:25 +00:00
*--------------------------------------
2018-12-17 14:24:39 +00:00
DRV.TERM.COUT.FS
ldy #S.DCB.TTY.CH
2018-12-13 16:39:24 +00:00
lda (ZPDCBPtr),y
2018-12-12 16:32:33 +00:00
cmp #79
2018-12-11 16:41:25 +00:00
bne .1
2018-12-13 16:39:24 +00:00
ldy #S.DCB.TTY.bLINEWRAP
lda (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
bpl FS.8
2018-12-13 16:39:24 +00:00
ldy #S.DCB.TTY.CH
2018-12-12 16:32:33 +00:00
lda #0
2018-12-13 16:39:24 +00:00
sta (ZPDCBPtr),y
2018-12-12 16:32:33 +00:00
2018-12-11 16:41:25 +00:00
jmp LF
2018-12-12 16:32:33 +00:00
.1 inc
2018-12-13 16:39:24 +00:00
sta (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
FS.8 clc
rts
*--------------------------------------
2018-12-17 07:02:03 +00:00
DRV.TERM.COUT.DEL
ldy #S.DCB.TTY.CH
2018-12-13 16:39:24 +00:00
lda (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
beq .1
2018-12-12 16:32:33 +00:00
dec
2018-12-13 16:39:24 +00:00
sta (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
bra .3
2018-12-13 16:39:24 +00:00
.1 iny S.DCB.TTY.CV
lda (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
beq FS.8
2018-12-12 16:32:33 +00:00
dec
2018-12-13 16:39:24 +00:00
sta (ZPDCBPtr),y
2018-12-12 16:32:33 +00:00
dey
2018-12-11 16:41:25 +00:00
lda #79
2018-12-13 16:39:24 +00:00
sta (ZPDCBPtr),y S.DCB.TTY.CH
2018-12-11 16:41:25 +00:00
.3 lda #$20
jmp SetCharAtCurPos
*--------------------------------------
2018-12-17 14:24:39 +00:00
DRV.TERM.COUT.FF
lda #0
ldy #S.DCB.TTY.CV
sta (ZPDCBPtr),y
dey
sta (ZPDCBPtr),y
jmp DRV.TERM.CLRSCR
*--------------------------------------
DRV.TERM.COUT.CR
lda #0
ldy #S.DCB.TTY.CH
sta (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
clc
rts
2018-12-17 07:02:03 +00:00
*--------------------------------------
2019-05-15 15:30:46 +00:00
DRV.TERM.COUT.SO
sec
.HS 90 BCC
*--------------------------------------
DRV.TERM.COUT.SI
clc
ldy #S.DCB.TTY.bG0G1
ror
sta (ZPDCBPtr),y
clc
rts
*--------------------------------------
2018-12-17 14:24:39 +00:00
DRV.TERM.COUT.ESC
lda #S.DCB.TTY.MODE.ESC
2018-12-17 07:02:03 +00:00
bra DRV.TERM.SETMODE
2018-12-11 16:41:25 +00:00
*--------------------------------------
2019-05-15 15:30:46 +00:00
DRV.TERM.ESC lda (ZPBufPtr) y = #S.DCB.TTY.MODE
2018-12-12 16:32:33 +00:00
2018-12-11 16:41:25 +00:00
ldx #EscCodes.Cnt-1
2018-12-15 20:34:55 +00:00
2018-12-11 16:41:25 +00:00
.2 cmp EscCodes,x
beq .3
dex
bpl .2
2019-05-15 15:30:46 +00:00
lda #0
bra DRV.TERM.SETMODE
2018-12-11 16:41:25 +00:00
2019-05-15 15:30:46 +00:00
.3 phx
jsr .4
plx
lda EscModes,x
bra DRV.TERM.SETMODE
.4 txa
2018-12-11 16:41:25 +00:00
asl
tax
2019-05-15 15:30:46 +00:00
jmp (.5,x)
2018-12-15 20:34:55 +00:00
2019-05-15 15:30:46 +00:00
.5 .DA Scroll.Dn M
2018-12-11 16:41:25 +00:00
.DA Scroll.Up D
.DA RESET c
2019-05-15 15:30:46 +00:00
.DA DRV.TERM.SETMODE.RTS [
.DA DRV.TERM.SETMODE.RTS (
.DA DRV.TERM.SETMODE.RTS )
*--------------------------------------
DRV.TERM.SETMODE
ldy #S.DCB.TTY.MODE
sta (ZPDCBPtr),y
ldy #S.DCB.TTY.INBUFFER
lda #S.DCB.TTY.INBUFFER
sta (ZPDCBPtr),y
clc
DRV.TERM.SETMODE.RTS
rts
2018-12-11 16:41:25 +00:00
*--------------------------------------
2018-12-13 16:39:24 +00:00
DRV.TERM.CSI ldy #S.DCB.TTY.INBUFFER
lda (ZPDCBPtr),y
inc
sta (ZPDCBPtr),y
tay
2018-12-12 16:32:33 +00:00
lda (ZPBufPtr)
2018-12-13 16:39:24 +00:00
sta (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
cmp #64 End of Seq ?
2018-12-15 20:34:55 +00:00
bcs DRV.TERM.CSI.Exec
2018-12-12 16:32:33 +00:00
2018-12-13 16:39:24 +00:00
cpy #S.DCB.TTY.INBUFFER.MAX-1 buffer full?
2018-12-12 16:32:33 +00:00
bne .8
2019-05-12 20:45:11 +00:00
jmp RESET.MODE
2018-12-12 16:32:33 +00:00
.8 clc
2018-12-11 16:41:25 +00:00
rts
2018-12-15 20:34:55 +00:00
DRV.TERM.CSI.Exec
stz CsiParamCnt
stz bCsiInNum
2018-12-11 16:41:25 +00:00
2018-12-13 16:39:24 +00:00
ldy #S.DCB.TTY.INBUFFER EscSeq Ptr
2018-12-11 16:41:25 +00:00
.10 stz ZPTmpWord
stz ZPTmpWord+1
2018-12-13 16:39:24 +00:00
.1 iny
lda (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
cmp #'0'
bcc .2
cmp #'9'+1
bcs .2
2018-12-15 20:34:55 +00:00
dec bCsiInNum
2018-12-11 16:41:25 +00:00
and #$0F
pha
2018-12-15 20:34:55 +00:00
2018-12-11 16:41:25 +00:00
lda ZPTmpWord
2018-12-15 20:34:55 +00:00
ldx ZPTmpWord+1
2018-12-11 16:41:25 +00:00
asl ZPTmpWord param=param*10
rol ZPTmpWord+1
asl ZPTmpWord
rol ZPTmpWord+1
2018-12-15 20:34:55 +00:00
2018-12-11 16:41:25 +00:00
clc
adc ZPTmpWord
sta ZPTmpWord
2018-12-15 20:34:55 +00:00
txa
2018-12-11 16:41:25 +00:00
adc ZPTmpWord+1
sta ZPTmpWord+1
asl ZPTmpWord
rol ZPTmpWord+1
pla
clc
adc ZPTmpWord
sta ZPTmpWord
bcc .1
inc ZPTmpWord+1
bra .1
2018-12-15 20:34:55 +00:00
.2 bit bCsiInNum
2018-12-11 16:41:25 +00:00
bpl .3
2018-12-15 20:34:55 +00:00
stz bCsiInNum
2018-12-11 16:41:25 +00:00
lda #255
2018-12-13 16:39:24 +00:00
ldx ZPTmpWord+1
2018-12-11 16:41:25 +00:00
bne .21
lda ZPTmpWord
2018-12-15 20:34:55 +00:00
.21 ldx CsiParamCnt
sta CsiParams,x
inc CsiParamCnt
2018-12-11 16:41:25 +00:00
2018-12-13 16:39:24 +00:00
.3 lda (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
cmp #';'
beq .10
2018-12-15 20:34:55 +00:00
pha
2019-05-12 20:45:11 +00:00
jsr RESET.MODE
2018-12-11 16:41:25 +00:00
2018-12-15 20:34:55 +00:00
pla
ldx #CsiCodes.Cnt-1
2018-12-11 16:41:25 +00:00
2018-12-15 20:34:55 +00:00
.4 cmp CsiCodes,x
2018-12-11 16:41:25 +00:00
beq .5
dex
bne .4
clc
rts
.5 txa
asl
tax
2018-12-15 20:34:55 +00:00
jmp (.8,x)
.8 .DA Csi.LWEnable h
.DA Csi.LWDisable l
.DA Csi.DispAttr m
.DA Csi.Query n
.DA Csi.Scroll r
2019-05-14 16:04:16 +00:00
.DA Csi.EraseScreen J
.DA Csi.EraseLine K
2018-12-15 20:34:55 +00:00
.DA Csi.Home H
*--------------------------------------
Csi.LWEnable sec
.HS 90 BCC
*--------------------------------------
Csi.LWDisable clc
ldx CsiParamCnt
beq .8
dex
bne .8
lda CsiParams
eor #7
bne .8
ror
ldy #S.DCB.TTY.bLINEWRAP
sta (ZPDCBPtr),y
.8 clc
rts
2018-12-11 16:41:25 +00:00
*--------------------------------------
2018-12-15 20:34:55 +00:00
Csi.DispAttr ldx CsiParamCnt
2019-05-12 20:45:11 +00:00
bne .1
jmp RESETATTR
2018-12-15 20:34:55 +00:00
.1 lda CsiParams-1,x
bne .2
jsr RESETATTR
bra .7
.2 eor #7
2019-05-12 20:45:11 +00:00
bne .7
2018-12-15 20:34:55 +00:00
2019-05-15 15:30:46 +00:00
.3 ldy #S.DCB.TTY.bNORMAL
2018-12-15 20:34:55 +00:00
sta (ZPDCBPtr),y
.7 dex
bne .1
.8 clc
rts
*--------------------------------------
Csi.Query ldx CsiParamCnt
beq .8
dex
bne .8
lda CsiParams
cmp #6
bne .8
lda #C.ESC
jsr Char.Out.Put
lda #'['
jsr Char.Out.Put
ldy #S.DCB.TTY.CV
lda (ZPDCBPtr),y
inc
jsr Decimal.Out
lda #';'
jsr Char.Out.Put
ldy #S.DCB.TTY.CH
lda (ZPDCBPtr),y
inc
jsr Decimal.Out
lda #'R'
jsr Char.Out.Put
.8 clc
rts
*--------------------------------------
Csi.Scroll ldy CsiParamCnt
bne .1
lda #0
ldx #23
bra .8
.1 cpy #2
bne .9
lda CsiParams
dec
ldx CsiParams+1
dex
.8 ldy #S.DCB.TTY.SCROLLTOP
sta (ZPDCBPtr),y
iny S.DCB.TTY.SCROLLBOT
txa
sta (ZPDCBPtr),y
.9 clc
rts
*--------------------------------------
2019-05-14 16:04:16 +00:00
Csi.EraseScreen ldx CsiParamCnt
bne .1
jmp DRV.TERM.CLRSCR.DN
.1 lda CsiParams
cmp #1
bne .2
jmp DRV.TERM.CLRSCR.UP
.2 cmp #2
bne .9
jmp DRV.TERM.CLRSCR
.9 clc
rts
*--------------------------------------
Csi.EraseLine ldx CsiParamCnt
2018-12-15 20:34:55 +00:00
bne .1
jmp CLREOL
.1 lda CsiParams
cmp #1
bne .2
jmp CLRSOL
.2 cmp #2
bne .9
jmp CLRLINE
.9 clc
rts
*--------------------------------------
Csi.Home lda CsiParamCnt
bne .1
ldy #S.DCB.TTY.CH
sta (ZPDCBPtr),y
2019-05-12 20:45:11 +00:00
iny S.DCB.TTY.CV
2018-12-15 20:34:55 +00:00
sta (ZPDCBPtr),y
clc
rts
.1 ldx #1
lda CsiParams
beq .2
ldx #24
cmp #24
bcs .2
tax
.2 dex
txa
ldy #S.DCB.TTY.CV
sta (ZPDCBPtr),y
dec CsiParamCnt
2018-12-17 10:40:00 +00:00
beq Csi.Home.8
2018-12-15 20:34:55 +00:00
ldx #1
lda CsiParams+1
beq .3
ldx #80
cmp #80
bcs .3
tax
.3 dex
txa
ldy #S.DCB.TTY.CH
sta (ZPDCBPtr),y
2018-12-17 10:40:00 +00:00
Csi.Home.8 clc
2018-12-15 20:34:55 +00:00
rts
2018-12-11 16:41:25 +00:00
*--------------------------------------
2019-05-14 16:04:16 +00:00
DRV.TERM.G0 ldy #S.DCB.TTY.bG0ALT
.HS 2C BIT ABS
DRV.TERM.G1 ldy #S.DCB.TTY.bG1ALT
2019-05-12 20:45:11 +00:00
2019-05-14 16:04:16 +00:00
lda (ZPBufPtr)
cmp #'0'
beq .1
clc
.1 ror
sta (ZPDCBPtr),y
2019-05-16 15:51:19 +00:00
lda #0
jmp DRV.TERM.SETMODE
2019-05-12 20:45:11 +00:00
*--------------------------------------
2018-12-13 16:39:24 +00:00
DRV.TERM.IAC ldy #S.DCB.TTY.INBUFFER
lda (ZPDCBPtr),y
inc
sta (ZPDCBPtr),y
tay
2018-12-12 16:32:33 +00:00
lda (ZPBufPtr)
2018-12-13 16:39:24 +00:00
sta (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
2018-12-13 16:39:24 +00:00
cpy #S.DCB.TTY.INBUFFER+1 CMD ?
2018-12-17 10:40:00 +00:00
beq Csi.Home.8 yes, wait for additional bytes
2018-12-11 16:41:25 +00:00
2018-12-13 16:39:24 +00:00
ldy #S.DCB.TTY.INBUFFER+1
lda (ZPDCBPtr),y get back CMD
cmp #SB
2018-12-11 16:41:25 +00:00
bne .1 not a SB/SE....stop with CMD/SUBCMD
2018-12-13 16:39:24 +00:00
lda (ZPBufPtr)
2018-12-11 16:41:25 +00:00
cmp #SE
2018-12-17 10:40:00 +00:00
bne Csi.Home.8 wait for ending SE....keep bIACMode
2019-01-07 15:48:25 +00:00
bra COUT.IAC.SB
ldy #S.DCB.TTY.INBUFFER+1
lda (ZPDCBPtr),y get back CMD
2018-12-11 16:41:25 +00:00
2018-12-13 16:39:24 +00:00
.1 cmp #IAC
2018-12-18 14:37:07 +00:00
beq COUT.IAC.SB.9
2018-12-11 16:41:25 +00:00
sec
2019-01-07 15:48:25 +00:00
sbc #WILL
2018-12-18 14:37:07 +00:00
bcc COUT.IAC.SB.9
2018-12-11 16:41:25 +00:00
asl
tax
2019-01-07 15:48:25 +00:00
2018-12-13 16:39:24 +00:00
ldy #S.DCB.TTY.INBUFFER+2
lda (ZPDCBPtr),y Get SUBCMD in A
2018-12-11 16:41:25 +00:00
2018-12-18 14:37:07 +00:00
jmp (.8,x)
2018-12-17 10:40:00 +00:00
2019-01-07 15:48:25 +00:00
.8 .DA COUT.IAC.WILL
2018-12-11 16:41:25 +00:00
.DA COUT.IAC.WONT
.DA COUT.IAC.DO
.DA COUT.IAC.DONT
*--------------------------------------
2019-01-07 15:48:25 +00:00
COUT.IAC.SB ldy #S.DCB.TTY.INBUFFER+2
lda (ZPDCBPtr),y Get SUBCMD in A
cmp #TELOPT.TTYPE
2018-12-18 14:37:07 +00:00
bne COUT.IAC.SB.9
2018-12-11 16:41:25 +00:00
2019-01-07 15:48:25 +00:00
iny
2018-12-13 16:39:24 +00:00
lda (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
cmp #SB.SEND
2018-12-18 14:37:07 +00:00
bne COUT.IAC.SB.9
2018-12-11 16:41:25 +00:00
2018-12-15 20:34:55 +00:00
ldx #0
2018-12-11 16:41:25 +00:00
2018-12-15 20:34:55 +00:00
.1 lda SB.IS.TTYPE,x
2018-12-11 16:41:25 +00:00
jsr Char.Out.Put
2018-12-15 20:34:55 +00:00
inx
cpx #SB.IS.TTYPE.LEN
2018-12-11 16:41:25 +00:00
bne .1
2018-12-18 14:37:07 +00:00
COUT.IAC.SB.9 bra COUT.IAC.EXIT
2018-12-11 16:41:25 +00:00
*--------------------------------------
COUT.IAC.WILL ldx #WILLDO.CNT-1
.1 cmp WILLDO,x
beq .7
dex
bpl .1
ldx #WILLDONT.CNT-1
.2 cmp WILLDONT,x
beq .8
dex
bpl .2
2018-12-18 14:37:07 +00:00
bra COUT.IAC.EXIT
2018-12-11 16:41:25 +00:00
.7 ldx #DO
.HS 2C BIT ABS
.8 ldx #DONT
bra COUT.IAC.SendAX
*--------------------------------------
COUT.IAC.DO ldx #DOWILL.CNT-1
.1 cmp DOWILL,x
beq .7
dex
bpl .1
ldx #DOWONT.CNT-1
.2 cmp DOWONT,x
beq .8
dex
bpl .2
2018-12-18 14:37:07 +00:00
bra COUT.IAC.EXIT
2018-12-11 16:41:25 +00:00
.7 ldx #WILL
.HS 2C BIT ABS
.8 ldx #WONT
*--------------------------------------
COUT.IAC.SendAX
pha push CMD
phx
lda #IAC
jsr Char.Out.Put
pla
jsr Char.Out.Put
pla
jsr Char.Out.Put
2018-12-18 14:37:07 +00:00
COUT.IAC.WONT
2018-12-11 16:41:25 +00:00
COUT.IAC.DONT
2018-12-18 14:37:07 +00:00
COUT.IAC.EXIT
2018-12-12 16:32:33 +00:00
*--------------------------------------
RESET.MODE lda #0
2019-05-14 16:04:16 +00:00
ldy #S.DCB.TTY.MODE
2018-12-13 16:39:24 +00:00
sta (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
clc
rts
*--------------------------------------
2018-12-17 07:02:03 +00:00
RESET ldy #1
2018-12-15 20:34:55 +00:00
2018-12-17 07:02:03 +00:00
.1 iny
lda RESET.VALUES-2,y
2018-12-15 20:34:55 +00:00
sta (ZPDCBPtr),y
2018-12-17 07:02:03 +00:00
cpy #S.DCB.TTY.INBUFFER
bne .1
2018-12-15 20:34:55 +00:00
2018-12-17 07:02:03 +00:00
jmp DRV.TERM.CLRSCR
2018-12-11 16:41:25 +00:00
*--------------------------------------
RESETATTR lda #$80
2019-05-15 15:30:46 +00:00
ldy #S.DCB.TTY.bNORMAL
2019-05-14 16:04:16 +00:00
sta (ZPDCBPtr),y
clc
rts
2019-05-12 20:45:11 +00:00
*--------------------------------------
2018-12-15 20:34:55 +00:00
ENQ ldx #0
2018-12-11 16:41:25 +00:00
2018-12-15 20:34:55 +00:00
.1 lda ENQ.String,x
2019-05-15 15:30:46 +00:00
2018-12-11 16:41:25 +00:00
jsr Char.Out.Put
2018-12-15 20:34:55 +00:00
inx
2019-05-15 15:30:46 +00:00
cpx ENQ.String.Len
2018-12-11 16:41:25 +00:00
bne .1
.8 clc
rts
*--------------------------------------
2018-12-13 16:39:24 +00:00
BS ldy #S.DCB.TTY.CH
lda (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
beq .1
2018-12-12 16:32:33 +00:00
dec
2018-12-13 16:39:24 +00:00
sta (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
clc
rts
2018-12-13 16:39:24 +00:00
.1 ldy #S.DCB.TTY.CV
lda (ZPDCBPtr),y
2018-12-12 16:32:33 +00:00
beq .2
2018-12-11 16:41:25 +00:00
2018-12-12 16:32:33 +00:00
dec
2018-12-13 16:39:24 +00:00
sta (ZPDCBPtr),y
2018-12-12 07:05:29 +00:00
2018-12-12 16:32:33 +00:00
lda #79
2018-12-12 07:05:29 +00:00
dey
2018-12-13 16:39:24 +00:00
sta (ZPDCBPtr),y
2018-12-12 07:05:29 +00:00
2018-12-12 16:32:33 +00:00
.2 clc
rts
2018-12-11 16:41:25 +00:00
*--------------------------------------
2018-12-13 16:39:24 +00:00
LF ldy #S.DCB.TTY.CV
lda (ZPDCBPtr),y
ldy #S.DCB.TTY.SCROLLBOT
cmp (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
beq SCROLL.UP
2018-12-12 16:32:33 +00:00
inc
2018-12-13 16:39:24 +00:00
ldy #S.DCB.TTY.CV
sta (ZPDCBPtr),y
2018-12-12 16:32:33 +00:00
clc
rts
*--------------------------------------
2018-12-13 16:39:24 +00:00
SCROLL.UP ldy #S.DCB.TTY.SCROLLTOP
lda (ZPDCBPtr),y
2018-12-12 16:32:33 +00:00
tax
2018-12-11 16:41:25 +00:00
2018-12-15 20:34:55 +00:00
.1 jsr DRV.TERM.SETUP.L1X
2018-12-11 16:41:25 +00:00
inx
2018-12-17 07:02:03 +00:00
jsr DRV.TERM.COPY.XtoL1
2018-12-11 16:41:25 +00:00
2018-12-12 16:32:33 +00:00
txa
2018-12-13 16:39:24 +00:00
ldy #S.DCB.TTY.SCROLLBOT
cmp (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
bne .1
*--------------------------------------
CLRLINE ldy #0 Start
ldx #80 End
bra CLR
2019-03-11 15:43:33 +00:00
CLRSOL ldy #S.DCB.TTY.CH
lda (ZPDCBPtr),y
2018-12-12 16:32:33 +00:00
tax End
2019-03-11 15:43:33 +00:00
ldy #0 Start
2019-01-16 14:37:21 +00:00
bra CLR
CLREOL ldy #S.DCB.TTY.CH
lda (ZPDCBPtr),y
tay Start
ldx #80 End
2018-12-11 16:41:25 +00:00
2018-12-12 16:32:33 +00:00
CLR stx .3+1 Save End
2018-12-11 16:41:25 +00:00
phy
2018-12-12 16:32:33 +00:00
2018-12-13 16:39:24 +00:00
ldy #S.DCB.TTY.CV
lda (ZPDCBPtr),y
2018-12-12 16:32:33 +00:00
tax
ply
.1 phy
lda #" "
2018-12-11 16:41:25 +00:00
jsr SetCharAtYX X unmodified
2018-12-12 16:32:33 +00:00
2018-12-11 16:41:25 +00:00
ply
iny
2018-12-12 16:32:33 +00:00
.3 cpy #$ff Self Modified
2018-12-11 16:41:25 +00:00
bne .1
clc
rts
*--------------------------------------
2018-12-13 16:39:24 +00:00
SCROLL.DN ldy #S.DCB.TTY.SCROLLBOT
lda (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
2018-12-12 16:32:33 +00:00
tax
2018-12-15 20:34:55 +00:00
.1 jsr DRV.TERM.SETUP.L1X
2018-12-11 16:41:25 +00:00
dex
2018-12-17 07:02:03 +00:00
jsr DRV.TERM.COPY.XtoL1
2018-12-11 16:41:25 +00:00
2018-12-12 16:32:33 +00:00
txa
2018-12-13 16:39:24 +00:00
ldy #S.DCB.TTY.SCROLLTOP
cmp (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
bne .1
clc
rts
*--------------------------------------
2018-12-17 07:02:03 +00:00
DRV.TERM.CURBLNK
bit bActive
2019-02-23 22:01:58 +00:00
bpl .9
lda A2osX.TIMER16
and #CURSOR.BLINK.SPEED
ldy #S.DCB.TTY.bCURON
eor (ZPDCBPtr),y
bne DRV.TERM.CURBLNK.1
.9 rts
DRV.TERM.CUROFF bit bActive
bpl DRV.TERM.CURBLNK.RTS
2018-12-11 16:41:25 +00:00
2018-12-13 16:39:24 +00:00
ldy #S.DCB.TTY.bCURON
2019-02-23 22:01:58 +00:00
lda (ZPDCBPtr),y
beq DRV.TERM.CURBLNK.RTS
DRV.TERM.CURBLNK.1
2018-12-13 16:39:24 +00:00
lda (ZPDCBPtr),y
2018-12-17 07:02:03 +00:00
bne DRV.TERM.CURBLNK.OFF
2018-12-11 16:41:25 +00:00
jsr GetCharAtCurPos
and #$80
eor #" "
2018-12-17 07:02:03 +00:00
bra DRV.TERM.CURBLNK.SET
2018-12-11 16:41:25 +00:00
2018-12-17 07:02:03 +00:00
DRV.TERM.CURBLNK.OFF
2018-12-17 10:40:00 +00:00
jsr GetCharAtCurPos
2018-12-11 16:41:25 +00:00
2018-12-17 07:02:03 +00:00
DRV.TERM.CURBLNK.SET
2019-05-15 15:30:46 +00:00
pha
ldy #S.DCB.TTY.CV
lda (ZPDCBPtr),y
tax
dey
lda (ZPDCBPtr),y
tay CH
jsr DRV.TERM.SETUP.L1X.SCR
pla
jsr SetCharAtY.SCR
2018-12-11 16:41:25 +00:00
2018-12-13 16:39:24 +00:00
ldy #S.DCB.TTY.bCURON
lda (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
eor #CURSOR.BLINK.SPEED
2018-12-13 16:39:24 +00:00
sta (ZPDCBPtr),y
2018-12-17 07:02:03 +00:00
DRV.TERM.CURBLNK.RTS
rts
2018-12-11 16:41:25 +00:00
*--------------------------------------
Decimal.Out stz ZPTmpWord
stz ZPTmpWord+1
ldx #8
sed
tay
.1 tya
asl
tay
lda ZPTmpWord
adc ZPTmpWord
sta ZPTmpWord
lda ZPTmpWord+1
adc ZPTmpWord+1
sta ZPTmpWord+1
dex
bne .1
cld
stz ZPTmpBool No leading 0
lda ZPTmpWord+1
and #$0f
beq .2
dec ZPTmpBool non zero, print everything
jsr Char.Out.Put30
.2 lda ZPTmpWord
lsr
lsr
lsr
lsr
bne .3
bit ZPTmpBool Print this digit ?
bpl .4
.3 jsr Char.Out.Put30
.4 lda ZPTmpWord
and #$0f
*--------------------------------------
Char.Out.Put30 ora #$30
2018-12-13 16:39:24 +00:00
2018-12-15 20:34:55 +00:00
Char.Out.Put pha save char
2018-12-13 16:39:24 +00:00
ldy #S.DCB.TTY.OUTHEAD
lda (ZPDCBPtr),y
2018-12-15 20:34:55 +00:00
pha save actual HEAD
2018-12-13 16:39:24 +00:00
inc
cmp #S.DCB.TTY.OUTBUFFER.MAX
bne .1
lda #S.DCB.TTY.OUTBUFFER
2018-12-15 20:34:55 +00:00
.1 dey OUTTAIL
2018-12-13 16:39:24 +00:00
2018-12-15 20:34:55 +00:00
cmp (ZPDCBPtr),y HEAD+1 = TAIL ?
2018-12-13 16:39:24 +00:00
beq .9 CS, full!
iny
sta (ZPDCBPtr),y new head
ply old head
pla
sta (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
clc
2018-12-13 16:39:24 +00:00
rts
.9 pla
2018-12-11 16:41:25 +00:00
pla
rts
*--------------------------------------
2018-12-15 20:34:55 +00:00
Char.Out.Get ldy #S.DCB.TTY.OUTTAIL
2018-12-13 16:39:24 +00:00
lda (ZPDCBPtr),y
2018-12-15 20:34:55 +00:00
iny OUTHEAD
2018-12-13 16:39:24 +00:00
cmp (ZPDCBPtr),y
beq .9 CS
tay
lda (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
pha
2018-12-13 16:39:24 +00:00
tya
2018-12-11 16:41:25 +00:00
inc
2018-12-13 16:39:24 +00:00
cmp #S.DCB.TTY.OUTBUFFER.MAX
bne .1
lda #S.DCB.TTY.OUTBUFFER
.1 ldy #S.DCB.TTY.OUTTAIL
sta (ZPDCBPtr),y
2018-12-11 16:41:25 +00:00
pla
clc
2018-12-13 16:39:24 +00:00
2018-12-11 16:41:25 +00:00
.9 rts
*--------------------------------------
2018-12-17 14:24:39 +00:00
DRV.TERM.GetIOCTLBufCntDCB
2018-12-17 07:02:03 +00:00
>STYA ZPIOCTL
ldy #S.IOCTL.BUFPTR
lda (ZPIOCTL),y
sta ZPBufPtr
iny
lda (ZPIOCTL),y
sta ZPBufPtr+1
iny #S.IOCTL.BYTECNT
2018-12-11 16:41:25 +00:00
lda (ZPIOCTL),y
eor #$ff
sta ZPCount
iny
lda (ZPIOCTL),y
eor #$ff
sta ZPCount+1
2018-12-17 14:24:39 +00:00
*--------------------------------------
DRV.TERM.GetDCB ldy #S.FD.DEV.DCBPTR
lda (pFD),y
sta ZPDCBPtr
iny
lda (pFD),y
sta ZPDCBPtr+1
ldy #S.DCB.TTY.DEVID
lda (ZPDCBPtr),y
cmp A2osX.ASCREEN
beq .1 CS
2018-12-14 16:19:05 +00:00
2018-12-17 14:24:39 +00:00
clc
.1 ror bActive
2018-12-11 16:41:25 +00:00
rts
2018-12-17 07:02:03 +00:00
*--------------------------------------
DRV.TERM.Title.ON
ldy #S.DCB.TTY.bTITLE
lda (ZPDCBPtr),y
bmi DRV.TERM.Title.RTS
lda #$ff
sta (ZPDCBPtr),y
ldy #S.DCB.TTY.DEVID
lda (ZPDCBPtr),y
tax
2019-02-27 15:00:56 +00:00
lda Dev.Table-1,x
2019-01-13 13:10:14 +00:00
clc
adc #S.FD.DEV
tay
2019-02-27 15:00:56 +00:00
lda Dev.Table,x
2019-01-13 13:10:14 +00:00
adc /S.FD.DEV
2018-12-17 07:02:03 +00:00
>STYA ZPTmpWord
ldx #0
jsr DRV.TERM.SETUP.L1X.SCR
2018-12-14 07:32:20 +00:00
2018-12-17 07:02:03 +00:00
ldy #0
.1 lda (ZPTmpWord),y
beq .2
2018-12-17 14:24:39 +00:00
phy
2018-12-17 07:02:03 +00:00
jsr SetCharAtY.SCR
ply
2018-12-14 07:32:20 +00:00
iny
2018-12-17 07:02:03 +00:00
bne .1
2018-12-14 07:32:20 +00:00
2018-12-17 07:02:03 +00:00
.2 lda #C.SPACE
2018-12-14 07:32:20 +00:00
2018-12-17 07:02:03 +00:00
.3 phy
jsr SetCharAtY.SCR
ply
iny
cpy #80
bne .3
DRV.TERM.Title.RTS
rts
DRV.TERM.Title.OFF
ldy #S.DCB.TTY.bTITLE
lda (ZPDCBPtr),y
bpl DRV.TERM.Title.RTS
lda #$0
sta (ZPDCBPtr),y
jmp DRV.TERM.LINE0CPY
2018-12-11 16:41:25 +00:00
*--------------------------------------
2018-12-17 10:40:00 +00:00
RESET.VALUES .DA #0 S.DCB.TTY.MODE
.DA #0 S.DCB.TTY.CH
.DA #0 S.DCB.TTY.CV
.DA #0 S.DCB.TTY.SCROLLTOP
.DA #23 S.DCB.TTY.SCROLLBOT
.DA #0 S.DCB.TTY.bCURON
2019-05-15 15:30:46 +00:00
.DA #$80 S.DCB.TTY.bNORMAL
2018-12-17 10:40:00 +00:00
.DA #$80 S.DCB.TTY.bLINEWRAP
.DA #0 S.DCB.TTY.bTITLE
2019-05-15 15:30:46 +00:00
.DA #0 S.DCB.TTY.bG0G1
.DA #0 S.DCB.TTY.bG0ALT
.DA #$80 S.DCB.TTY.bG1ALT
2018-12-17 10:40:00 +00:00
.DA #S.DCB.TTY.OUTBUFFER S.DCB.TTY.OUTTAIL
.DA #S.DCB.TTY.OUTBUFFER S.DCB.TTY.OUTHEAD
.DA #S.DCB.TTY.INBUFFER S.DCB.TTY.INBUFFER
*--------------------------------------
2019-05-15 15:30:46 +00:00
CtrlChars .DA #C.ENQ,#C.BS,#C.LF,#C.FF,#C.CR,#C.SO,#C.SI,#C.FS,#C.ESC
2018-12-11 16:41:25 +00:00
CtrlChars.Cnt .EQ *-CtrlChars
*--------------------------------------
2019-05-15 15:30:46 +00:00
EscCodes .AZ "MDc[()"
2018-12-11 16:41:25 +00:00
EscCodes.Cnt .EQ *-EscCodes
2019-05-15 15:30:46 +00:00
EscModes .DA #0,#0,#0,#S.DCB.TTY.MODE.CSI,#S.DCB.TTY.MODE.G0,#S.DCB.TTY.MODE.G1
2019-05-14 16:04:16 +00:00
CsiCodes .AS "hlmnrJKH"
2018-12-15 20:34:55 +00:00
CsiCodes.Cnt .EQ *-CsiCodes
2018-12-11 16:41:25 +00:00
*--------------------------------------
KeyRemapped .HS 05080A0B0D15 L,D,U,CR,R
KeyRemappedIdx .HS 050004080C0F
KeyRemappedTbl .EQ *
KeyRemappedLEFT .HS 1B5B4400 esc[D
KeyRemappedDOWN .HS 1B5B4200 esc[B
KeyRemappedUP .HS 1B5B4100 esc[A
KeyRemappedCR .HS 0D0A00 crlf
KeyRemappedRGHT .HS 1B5B4300 esc[C
*--------------------------------------
WILLDO .DA #TELOPT.BINARY,#TELOPT.SGA
WILLDO.CNT .EQ *-WILLDO
WILLDONT .DA #TELOPT.TSPEED,#TELOPT.LINEMODE,#TELOPT.STATUS
WILLDONT.CNT .EQ *-WILLDONT
DOWILL .DA #TELOPT.BINARY,#TELOPT.SGA,#TELOPT.TTYPE,#TELOPT.NAWS
DOWILL.CNT .EQ *-DOWILL
DOWONT .DA #TELOPT.ECHO,#TELOPT.NEWENVIRON,#TELOPT.XDISPLOC,#TELOPT.TSPEED,#TELOPT.LFLOW
DOWONT.CNT .EQ *-DOWONT
SB.IS.TTYPE .DA #IAC,#SB,#TELOPT.TTYPE,#SB.IS
2019-05-15 15:30:46 +00:00
ENQ.String .AS "xterm"
ENQ.String.Len .EQ *-ENQ.String
2018-12-11 16:41:25 +00:00
.DA #IAC,#SE
SB.IS.TTYPE.LEN .EQ *-SB.IS.TTYPE
SB.IS.NAWS .DA #IAC,#SB,#TELOPT.NAWS,#SB.IS
.DA 80
.DA 24
.DA #IAC,#SE
SB.IS.NAWS.LEN .EQ *-SB.IS.NAWS
*--------------------------------------
DRV.TERM.DIB .DA #S.DIB.S.WRITE+S.DIB.S.READ
.DA #0,#0,#0
>PSTR "A2osX VT100 TERM"
.DA #S.DIB.T.CHAR
.DA #0
.DA K.VER
*--------------------------------------
MAN
SAVE USR/SRC/SYS/KERNEL.S.TERM
LOAD USR/SRC/SYS/KERNEL.S
ASM