2017-12-22 21:24:30 +00:00
|
|
|
|
NEW
|
2018-11-17 17:17:13 +00:00
|
|
|
|
PREFIX
|
2017-12-22 21:24:30 +00:00
|
|
|
|
AUTO 4,1
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2018-07-19 15:33:55 +00:00
|
|
|
|
.TF DRV/CONSOLE.DRV
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-19 15:33:55 +00:00
|
|
|
|
.INB INC/MACROS.I
|
|
|
|
|
.INB INC/A2OSX.I
|
2018-10-02 15:52:30 +00:00
|
|
|
|
.INB INC/MLI.E.I
|
2018-07-19 15:33:55 +00:00
|
|
|
|
.INB INC/IO.I
|
|
|
|
|
.INB INC/NET.TELNET.I
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
* File Header (16 Bytes)
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
CS.START cld
|
|
|
|
|
jmp Dev.Detect cld,jmp abs=DRV
|
|
|
|
|
.DA #$61 6502,Level 1 (65c02)
|
|
|
|
|
.DA #1 DRV Layout Version 1
|
|
|
|
|
.DA 0
|
2018-06-29 14:16:40 +00:00
|
|
|
|
.DA CS.END-CS.START Code Length To Relocate
|
2018-06-28 15:26:34 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA 0
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
* Relocation Table
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
L.MSG.DETECT .DA MSG.DETECT
|
2018-07-17 15:45:59 +00:00
|
|
|
|
L.DRV.CS.START .DA DRV.CS.START
|
|
|
|
|
L.FD.DEV .DA FD.DEV
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.DA 0 End Of Reloc Table
|
|
|
|
|
*--------------------------------------
|
2016-10-04 16:01:07 +00:00
|
|
|
|
Dev.Detect >LDYA L.MSG.DETECT
|
2018-08-22 15:23:27 +00:00
|
|
|
|
>SYSCALL puts
|
2018-07-16 15:29:18 +00:00
|
|
|
|
|
2018-07-17 15:45:59 +00:00
|
|
|
|
>PUSHWI DRV.END
|
|
|
|
|
>PUSHWI DRV.CS.END
|
|
|
|
|
>PUSHWI DRV.CS.START
|
|
|
|
|
>LDYA L.DRV.CS.START
|
2018-06-28 15:26:34 +00:00
|
|
|
|
>SYSCALL InsDrv
|
|
|
|
|
bcs .9
|
2018-07-17 15:45:59 +00:00
|
|
|
|
>STYA FD.DEV+S.FD.DEV.DRVPTR
|
2018-06-28 15:26:34 +00:00
|
|
|
|
|
2018-07-17 15:45:59 +00:00
|
|
|
|
>LDYA L.FD.DEV
|
|
|
|
|
>SYSCALL MKDEV
|
2018-06-28 15:26:34 +00:00
|
|
|
|
|
|
|
|
|
.9 rts
|
2018-10-08 05:55:28 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
CS.END
|
2018-08-22 15:23:27 +00:00
|
|
|
|
MSG.DETECT .AZ "Apple IIe/IIc 80 Col Driver."
|
2018-07-17 15:45:59 +00:00
|
|
|
|
FD.DEV .DA #S.FD.T.CDEV
|
2018-06-25 15:34:03 +00:00
|
|
|
|
.DA #0 HANDLER
|
|
|
|
|
.DA #0 BUSID
|
|
|
|
|
.DA #0 DEVID
|
2018-07-13 14:38:24 +00:00
|
|
|
|
.DA 0 BUSPTR
|
2018-06-29 14:16:40 +00:00
|
|
|
|
.BS 2 DRVPTR
|
2018-04-11 15:35:51 +00:00
|
|
|
|
.AZ "CON" NAME
|
2018-06-25 15:34:03 +00:00
|
|
|
|
.HS 00000000
|
2015-06-03 18:30:57 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Driver Code
|
|
|
|
|
*--------------------------------------
|
2018-06-29 14:16:40 +00:00
|
|
|
|
CURSOR.BLINK.SPEED .EQ 2
|
|
|
|
|
ESCSEQ.MAXLEN .EQ 16
|
2018-09-09 08:11:42 +00:00
|
|
|
|
OUTBUF.MAXLEN .EQ 32
|
|
|
|
|
IACBUF.MAXLEN .EQ 32
|
2018-06-29 14:16:40 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
ZPBaseL1 .EQ ZPDRV
|
|
|
|
|
ZPBaseL2 .EQ ZPDRV+2
|
|
|
|
|
ZPTmpWord .EQ ZPDRV+4
|
|
|
|
|
ZPTmpBool .EQ ZPDRV+6
|
2018-09-09 08:11:42 +00:00
|
|
|
|
ZPIOCTL .EQ ZPDRV+8
|
|
|
|
|
ZPBufPtr .EQ ZPDRV+10
|
|
|
|
|
ZPCount .EQ ZPDRV+12
|
2018-06-29 14:16:40 +00:00
|
|
|
|
*--------------------------------------
|
2018-06-25 15:34:03 +00:00
|
|
|
|
DRV.CS.START cld
|
|
|
|
|
jmp (.1,x)
|
|
|
|
|
.1 .DA STATUS
|
2017-07-01 13:45:53 +00:00
|
|
|
|
.DA A2osX.BADCALL
|
|
|
|
|
.DA A2osX.BADCALL
|
|
|
|
|
.DA A2osX.BADCALL
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.DA CONTROL
|
2017-07-01 13:45:53 +00:00
|
|
|
|
.DA A2osX.BADCALL
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.DA OPEN
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.DA CLOSE
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.DA READ
|
|
|
|
|
.DA WRITE
|
2018-07-05 15:39:36 +00:00
|
|
|
|
.DA A2osX.BADCALL IRQ
|
2016-01-04 07:22:28 +00:00
|
|
|
|
*--------------------------------------
|
2017-02-03 16:58:13 +00:00
|
|
|
|
J.CtrlChars .DA ENQ 5
|
|
|
|
|
.DA BS 8
|
2016-01-04 07:22:28 +00:00
|
|
|
|
.DA LF 10
|
2017-03-06 16:58:05 +00:00
|
|
|
|
.DA CLRSCR 12
|
2016-01-04 07:22:28 +00:00
|
|
|
|
.DA CROUT 13
|
2017-09-27 06:14:13 +00:00
|
|
|
|
.DA FS 21
|
2016-01-04 07:22:28 +00:00
|
|
|
|
.DA ESC 27
|
|
|
|
|
*--------------------------------------
|
2017-03-06 16:58:05 +00:00
|
|
|
|
J.EscCodes .DA Scroll.Dn M
|
|
|
|
|
.DA Scroll.Up D
|
2016-01-04 07:22:28 +00:00
|
|
|
|
.DA RESET c
|
|
|
|
|
*--------------------------------------
|
2018-09-13 15:29:02 +00:00
|
|
|
|
J.EscSequences .DA Esc.LWEnable h
|
|
|
|
|
.DA Esc.LWDisable l
|
|
|
|
|
.DA Esc.DispAttr m
|
2016-01-04 07:22:28 +00:00
|
|
|
|
.DA Esc.Query n
|
2015-11-29 22:19:10 +00:00
|
|
|
|
.DA Esc.Scroll r
|
2016-01-04 07:22:28 +00:00
|
|
|
|
.DA Esc.Erase K
|
2015-11-29 22:19:10 +00:00
|
|
|
|
.DA Esc.Home H
|
2018-09-09 08:11:42 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
J.COUT.IAC.CMDS .DA COUT.IAC.SB
|
|
|
|
|
.DA COUT.IAC.WILL
|
|
|
|
|
.DA COUT.IAC.WONT
|
|
|
|
|
.DA COUT.IAC.DO
|
|
|
|
|
.DA COUT.IAC.DONT
|
2015-11-29 22:19:10 +00:00
|
|
|
|
.DA 0 end of relocation
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-19 15:33:55 +00:00
|
|
|
|
STATUS >STYA ZPIOCTL
|
|
|
|
|
|
|
|
|
|
ldy #S.IOCTL.STATCODE
|
|
|
|
|
lda (ZPIOCTL),y
|
|
|
|
|
beq .1
|
|
|
|
|
|
|
|
|
|
cmp #S.IOCTL.STATCODE.GETDIB
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
ldx #S.DIB-1
|
|
|
|
|
.HS 2C bit abs
|
|
|
|
|
.1 ldx #3
|
|
|
|
|
|
|
|
|
|
ldy #S.IOCTL.BUFPTR
|
|
|
|
|
lda (ZPIOCTL),y
|
|
|
|
|
sta .3+1
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPIOCTL),y
|
|
|
|
|
sta .3+2
|
|
|
|
|
|
|
|
|
|
.2 lda DIB,x
|
|
|
|
|
.3 sta $ffff,x SELF MODIFIED
|
|
|
|
|
dex
|
|
|
|
|
bpl .2
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2018-07-19 15:33:55 +00:00
|
|
|
|
|
|
|
|
|
.9 lda #MLI.E.BADCTL
|
|
|
|
|
sec
|
|
|
|
|
rts
|
2017-01-12 17:43:45 +00:00
|
|
|
|
*--------------------------------------
|
2018-12-10 16:45:37 +00:00
|
|
|
|
OPEN ldx #0
|
2017-11-21 16:27:07 +00:00
|
|
|
|
|
2018-12-10 16:45:37 +00:00
|
|
|
|
.1 ldy A2osX.SCRNDEVS,x
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
inx
|
|
|
|
|
cpx #K.SCR.MAX
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
lda #E.OOH
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.2 sta A2osX.SCRNDEVS,x DEV.ID in A
|
|
|
|
|
sta DEVID
|
2018-07-19 15:33:55 +00:00
|
|
|
|
lda #S.DIB.S.OPENED
|
2018-12-03 13:56:52 +00:00
|
|
|
|
tsb DIB+S.DIB.S
|
2017-11-21 16:27:07 +00:00
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
stz OutPtr
|
|
|
|
|
stz OutCnt
|
|
|
|
|
|
2015-11-29 22:19:10 +00:00
|
|
|
|
jsr RESET
|
2017-01-12 17:43:45 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CONTROL sta SETTEXT
|
|
|
|
|
sta SETALTCHAR
|
|
|
|
|
sta SET80DISP
|
|
|
|
|
sta CLR80STORE
|
2018-06-20 15:02:09 +00:00
|
|
|
|
sta CLRPAGE2
|
2018-12-10 16:45:37 +00:00
|
|
|
|
lda DEVID
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta A2osX.ASCREEN
|
2018-12-03 13:56:52 +00:00
|
|
|
|
|
2015-03-14 21:48:35 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2018-07-19 15:33:55 +00:00
|
|
|
|
CLOSE lda #S.DIB.S.OPENED
|
|
|
|
|
trb DIB+S.DIB.S
|
|
|
|
|
|
2018-07-20 05:43:11 +00:00
|
|
|
|
stz A2osX.SCRNDEVS
|
2017-01-12 17:43:45 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2018-07-18 15:30:42 +00:00
|
|
|
|
READ >STYA ZPIOCTL
|
|
|
|
|
|
2016-10-06 06:23:20 +00:00
|
|
|
|
lda A2osX.ASCREEN
|
2018-12-11 06:44:57 +00:00
|
|
|
|
cmp DEVID is screen active?
|
2018-09-09 08:11:42 +00:00
|
|
|
|
bne .6 no....go check flush...
|
2016-10-06 06:23:20 +00:00
|
|
|
|
|
|
|
|
|
lda A2osX.TIMER16
|
2015-03-14 21:48:35 +00:00
|
|
|
|
and #CURSOR.BLINK.SPEED
|
|
|
|
|
eor CURON
|
2015-10-19 20:35:00 +00:00
|
|
|
|
beq .1
|
2015-03-14 21:48:35 +00:00
|
|
|
|
jsr CURBLNK
|
2015-10-19 20:35:00 +00:00
|
|
|
|
|
2016-10-06 06:23:20 +00:00
|
|
|
|
.1 lda OPENAPPLE
|
2018-09-09 08:11:42 +00:00
|
|
|
|
bmi .6 Open apple key, not for us...
|
2016-03-13 21:52:57 +00:00
|
|
|
|
|
2016-10-06 06:23:20 +00:00
|
|
|
|
lda KBD
|
2018-09-09 08:11:42 +00:00
|
|
|
|
bpl .6
|
2016-10-06 06:23:20 +00:00
|
|
|
|
sta KBDSTROBE
|
2016-10-06 15:50:20 +00:00
|
|
|
|
|
2016-10-06 06:23:20 +00:00
|
|
|
|
and #$7F
|
2015-12-12 10:13:14 +00:00
|
|
|
|
|
|
|
|
|
ldx KeyRemapped
|
|
|
|
|
.2 cmp KeyRemapped,x
|
|
|
|
|
beq .3
|
|
|
|
|
dex
|
|
|
|
|
bne .2
|
2018-09-09 08:11:42 +00:00
|
|
|
|
jsr Char.Out.Put no remap....send char....
|
|
|
|
|
bra .7 and flush
|
2015-12-12 10:13:14 +00:00
|
|
|
|
|
|
|
|
|
.3 lda KeyRemappedIdx,x
|
2016-01-04 07:22:28 +00:00
|
|
|
|
tay
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
.4 lda KeyRemappedTbl,y
|
2018-09-09 08:11:42 +00:00
|
|
|
|
beq .7 end of remap....flush
|
2016-10-06 06:23:20 +00:00
|
|
|
|
jsr Char.Out.Put
|
2016-01-04 07:22:28 +00:00
|
|
|
|
iny
|
|
|
|
|
bra .4
|
|
|
|
|
|
2018-09-09 08:11:42 +00:00
|
|
|
|
.6 lda OutCnt
|
|
|
|
|
beq .9 no char in output buffer...
|
2018-07-18 15:30:42 +00:00
|
|
|
|
|
2018-09-09 08:11:42 +00:00
|
|
|
|
.7 stz .8+1
|
|
|
|
|
jsr GetPtrsAndCnt
|
2018-07-18 15:30:42 +00:00
|
|
|
|
|
2018-09-09 08:11:42 +00:00
|
|
|
|
.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
|
2018-07-18 15:30:42 +00:00
|
|
|
|
ldy #S.IOCTL.BYTECNT
|
|
|
|
|
sta (ZPIOCTL),y
|
|
|
|
|
iny
|
2018-09-09 08:11:42 +00:00
|
|
|
|
lda #0
|
2018-07-18 15:30:42 +00:00
|
|
|
|
sta (ZPIOCTL),y
|
|
|
|
|
|
|
|
|
|
clc
|
2016-01-04 07:22:28 +00:00
|
|
|
|
rts
|
2015-12-12 10:13:14 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.9 lda #0 Error = char
|
2015-03-14 21:48:35 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2018-07-18 15:30:42 +00:00
|
|
|
|
WRITE >STYA ZPIOCTL
|
|
|
|
|
|
2018-09-09 08:11:42 +00:00
|
|
|
|
jsr GetPtrsAndCnt
|
2018-07-18 15:30:42 +00:00
|
|
|
|
|
|
|
|
|
.2 inc ZPCount
|
|
|
|
|
bne .3
|
|
|
|
|
inc ZPCount+1
|
2018-09-09 08:11:42 +00:00
|
|
|
|
beq .8
|
2018-07-18 15:30:42 +00:00
|
|
|
|
|
|
|
|
|
.3 lda (ZPBufPtr)
|
|
|
|
|
inc ZPBufPtr
|
|
|
|
|
bne .4
|
|
|
|
|
inc ZPBufPtr+1
|
|
|
|
|
|
|
|
|
|
.4 jsr WRITE.COUT
|
|
|
|
|
|
2018-09-09 08:11:42 +00:00
|
|
|
|
bra .2
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
2018-07-18 15:30:42 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
WRITE.COUT bit bEscMode
|
2016-01-04 07:22:28 +00:00
|
|
|
|
bmi COUT.EscMode
|
2017-06-14 09:51:59 +00:00
|
|
|
|
bit bIACMode
|
2017-10-05 15:39:17 +00:00
|
|
|
|
bpl .10
|
2015-11-29 22:19:10 +00:00
|
|
|
|
|
2018-09-09 08:11:42 +00:00
|
|
|
|
jmp COUT.IAC
|
2017-10-05 15:39:17 +00:00
|
|
|
|
|
|
|
|
|
.10 cmp #IAC
|
2017-06-14 09:51:59 +00:00
|
|
|
|
bne .1
|
|
|
|
|
sta bIACMode
|
2017-10-05 15:39:17 +00:00
|
|
|
|
stz IACBuf
|
2017-06-14 09:51:59 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.1 pha
|
2015-08-05 20:38:05 +00:00
|
|
|
|
jsr CUROFF
|
|
|
|
|
pla
|
2018-11-06 16:31:13 +00:00
|
|
|
|
cmp #C.DEL
|
2017-09-27 15:40:31 +00:00
|
|
|
|
beq DEL
|
2018-11-06 16:31:13 +00:00
|
|
|
|
cmp #C.SPACE
|
2016-01-04 07:22:28 +00:00
|
|
|
|
bcc COUT.Ctrl
|
2015-11-29 22:19:10 +00:00
|
|
|
|
|
|
|
|
|
ora INVFLG
|
2017-11-23 16:51:52 +00:00
|
|
|
|
jsr SetCharAtCurPos
|
2017-03-06 20:08:38 +00:00
|
|
|
|
*--------------------------------------
|
2017-09-27 06:14:13 +00:00
|
|
|
|
FS ldx CH
|
2017-03-06 20:08:38 +00:00
|
|
|
|
cpx #79
|
2018-09-13 15:29:02 +00:00
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
bit LWFLG
|
|
|
|
|
bpl FS.8
|
2017-03-06 20:08:38 +00:00
|
|
|
|
|
2018-09-13 15:29:02 +00:00
|
|
|
|
stz CH
|
|
|
|
|
jmp LF
|
|
|
|
|
|
|
|
|
|
.1 inc CH
|
2017-10-05 15:39:17 +00:00
|
|
|
|
|
|
|
|
|
FS.8 clc
|
2017-09-15 15:16:04 +00:00
|
|
|
|
rts
|
2016-01-04 07:22:28 +00:00
|
|
|
|
*--------------------------------------
|
2017-09-27 15:40:31 +00:00
|
|
|
|
DEL ldx CH
|
|
|
|
|
beq .1
|
|
|
|
|
dec CH
|
|
|
|
|
bra .3
|
|
|
|
|
|
|
|
|
|
.1 ldy CV
|
2017-10-05 15:39:17 +00:00
|
|
|
|
beq FS.8
|
2017-09-27 15:40:31 +00:00
|
|
|
|
|
|
|
|
|
lda #79
|
|
|
|
|
sta CH
|
|
|
|
|
dec CV
|
|
|
|
|
|
|
|
|
|
.3 lda #$20
|
|
|
|
|
ora INVFLG
|
2017-11-23 16:51:52 +00:00
|
|
|
|
jmp SetCharAtCurPos
|
2017-09-27 15:40:31 +00:00
|
|
|
|
*--------------------------------------
|
2017-02-28 16:58:36 +00:00
|
|
|
|
COUT.Ctrl ldx #CtrlChars.Cnt-1
|
2016-01-04 07:22:28 +00:00
|
|
|
|
|
2017-02-28 16:58:36 +00:00
|
|
|
|
.1 cmp CtrlChars,x
|
|
|
|
|
beq .2
|
|
|
|
|
dex
|
|
|
|
|
bpl .1
|
2016-01-04 07:22:28 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
2017-02-28 16:58:36 +00:00
|
|
|
|
.2 txa
|
|
|
|
|
asl
|
|
|
|
|
tax
|
|
|
|
|
jmp (J.CtrlChars,x)
|
2016-01-04 07:22:28 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
COUT.EscMode bit bEscModeCSI
|
|
|
|
|
bmi COUT.EscModeCSI
|
|
|
|
|
cmp #'['
|
|
|
|
|
bne .1
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
dec bEscModeCSI
|
|
|
|
|
stz EscSeq
|
2015-11-29 22:19:10 +00:00
|
|
|
|
clc
|
2015-03-14 21:48:35 +00:00
|
|
|
|
rts
|
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
.1 stz bEscMode
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
2018-09-13 15:29:02 +00:00
|
|
|
|
ldx #EscCodes.Cnt-1
|
2016-01-04 07:22:28 +00:00
|
|
|
|
|
2018-09-13 15:29:02 +00:00
|
|
|
|
.2 cmp EscCodes,x
|
2016-01-04 07:22:28 +00:00
|
|
|
|
beq .3
|
2018-09-13 15:29:02 +00:00
|
|
|
|
dex
|
2018-10-29 08:41:10 +00:00
|
|
|
|
bpl .2
|
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2018-09-13 15:29:02 +00:00
|
|
|
|
.3 txa
|
|
|
|
|
asl
|
|
|
|
|
tax
|
|
|
|
|
jmp (J.EscCodes,x)
|
2016-01-04 07:22:28 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
COUT.EscModeCSI inc EscSeq
|
|
|
|
|
ldx EscSeq
|
|
|
|
|
sta EscSeq,x
|
|
|
|
|
cmp #64 End of Seq ?
|
|
|
|
|
bcs COUT.ExecEscSeq
|
|
|
|
|
cpx #ESCSEQ.MAXLEN too long?
|
|
|
|
|
bne .1
|
|
|
|
|
stz bEscModeCSI
|
|
|
|
|
stz bEscMode
|
|
|
|
|
.1 clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
COUT.ExecEscSeq stz EscSeqParamCnt
|
|
|
|
|
stz bEscSeqInNum
|
2015-08-05 20:38:05 +00:00
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
ldx #0 EscSeq Ptr
|
|
|
|
|
|
2018-05-04 14:55:29 +00:00
|
|
|
|
.10 stz ZPTmpWord
|
|
|
|
|
stz ZPTmpWord+1
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
.1 inx
|
|
|
|
|
lda EscSeq,x
|
2017-11-23 16:51:52 +00:00
|
|
|
|
|
|
|
|
|
cmp #'0'
|
|
|
|
|
bcc .2
|
|
|
|
|
cmp #'9'+1
|
2016-01-04 07:22:28 +00:00
|
|
|
|
bcs .2
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
dec bEscSeqInNum
|
|
|
|
|
and #$0F
|
|
|
|
|
pha
|
2018-05-04 14:55:29 +00:00
|
|
|
|
lda ZPTmpWord
|
|
|
|
|
ldy ZPTmpWord+1
|
|
|
|
|
asl ZPTmpWord param=param*10
|
|
|
|
|
rol ZPTmpWord+1
|
|
|
|
|
asl ZPTmpWord
|
|
|
|
|
rol ZPTmpWord+1
|
2016-01-04 07:22:28 +00:00
|
|
|
|
clc
|
2018-05-04 14:55:29 +00:00
|
|
|
|
adc ZPTmpWord
|
|
|
|
|
sta ZPTmpWord
|
2016-01-04 07:22:28 +00:00
|
|
|
|
tya
|
2018-05-04 14:55:29 +00:00
|
|
|
|
adc ZPTmpWord+1
|
|
|
|
|
sta ZPTmpWord+1
|
|
|
|
|
asl ZPTmpWord
|
|
|
|
|
rol ZPTmpWord+1
|
2016-01-04 07:22:28 +00:00
|
|
|
|
|
|
|
|
|
pla
|
|
|
|
|
clc
|
2018-05-04 14:55:29 +00:00
|
|
|
|
adc ZPTmpWord
|
|
|
|
|
sta ZPTmpWord
|
2016-01-04 07:22:28 +00:00
|
|
|
|
bcc .1
|
2018-05-04 14:55:29 +00:00
|
|
|
|
inc ZPTmpWord+1
|
2016-01-04 07:22:28 +00:00
|
|
|
|
bra .1
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
.2 bit bEscSeqInNum
|
|
|
|
|
bpl .3
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
stz bEscSeqInNum
|
|
|
|
|
lda #255
|
2018-05-04 14:55:29 +00:00
|
|
|
|
ldy ZPTmpWord+1
|
2016-01-04 07:22:28 +00:00
|
|
|
|
bne .21
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2018-05-04 14:55:29 +00:00
|
|
|
|
lda ZPTmpWord
|
2016-01-04 07:22:28 +00:00
|
|
|
|
.21 ldy EscSeqParamCnt
|
|
|
|
|
sta EscSeqParam,y
|
|
|
|
|
inc EscSeqParamCnt
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
.3 lda EscSeq,x
|
|
|
|
|
cmp #';'
|
|
|
|
|
beq .10
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
stz bEscModeCSI
|
|
|
|
|
stz bEscMode
|
|
|
|
|
|
2018-09-13 15:29:02 +00:00
|
|
|
|
ldx #EscSeqCmds.Cnt-1
|
2016-01-04 07:22:28 +00:00
|
|
|
|
|
2018-09-13 15:29:02 +00:00
|
|
|
|
.4 cmp EscSeqCmds,x
|
2016-01-04 07:22:28 +00:00
|
|
|
|
beq .5
|
2018-09-13 15:29:02 +00:00
|
|
|
|
dex
|
2016-01-04 07:22:28 +00:00
|
|
|
|
bne .4
|
2018-09-13 15:29:02 +00:00
|
|
|
|
|
2015-11-29 22:19:10 +00:00
|
|
|
|
clc
|
2015-08-05 20:38:05 +00:00
|
|
|
|
rts
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2018-09-13 15:29:02 +00:00
|
|
|
|
.5 txa
|
|
|
|
|
asl
|
|
|
|
|
tax
|
|
|
|
|
jmp (J.EscSequences,x)
|
2015-11-29 22:19:10 +00:00
|
|
|
|
*--------------------------------------
|
2018-09-09 08:11:42 +00:00
|
|
|
|
COUT.IAC inc IACBuf
|
2017-10-05 15:39:17 +00:00
|
|
|
|
ldx IACBuf
|
2018-09-09 08:11:42 +00:00
|
|
|
|
cpx #IACBUF.MAXLEN
|
|
|
|
|
beq *
|
2017-10-05 15:39:17 +00:00
|
|
|
|
sta IACBuf,x
|
|
|
|
|
|
2018-09-09 08:11:42 +00:00
|
|
|
|
cpx #1 CMD ?
|
2017-10-05 15:39:17 +00:00
|
|
|
|
beq .8 yes, wait for additional bytes
|
|
|
|
|
|
2018-09-09 08:11:42 +00:00
|
|
|
|
ldy IACBuf+1 get back CMD
|
2017-10-05 15:39:17 +00:00
|
|
|
|
cpy #SB
|
2018-09-09 08:11:42 +00:00
|
|
|
|
bne .1 not a SB/SE....stop with CMD/SUBCMD
|
2017-10-05 15:39:17 +00:00
|
|
|
|
|
|
|
|
|
cmp #SE
|
|
|
|
|
bne .8 wait for ending SE....keep bIACMode
|
|
|
|
|
|
2018-09-09 08:11:42 +00:00
|
|
|
|
.1 cpy #IAC
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
tya
|
|
|
|
|
sec
|
|
|
|
|
sbc #SB
|
|
|
|
|
bcc .9
|
|
|
|
|
asl
|
|
|
|
|
tax
|
|
|
|
|
lda IACBuf+2 Get SUBCMD in A
|
|
|
|
|
|
|
|
|
|
cpx #10
|
|
|
|
|
bcs *
|
|
|
|
|
jmp (J.COUT.IAC.CMDS,x)
|
|
|
|
|
|
|
|
|
|
.9 stz bIACMode
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
COUT.IAC.SB cmp #TELOPT.TTYPE
|
|
|
|
|
bne .9
|
2017-10-05 15:39:17 +00:00
|
|
|
|
|
|
|
|
|
lda IACBuf+3
|
|
|
|
|
cmp #SB.SEND
|
2018-09-09 08:11:42 +00:00
|
|
|
|
bne .9
|
2017-10-05 15:39:17 +00:00
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
.1 lda SB.IS.TTYPE,y
|
|
|
|
|
jsr Char.Out.Put
|
|
|
|
|
iny
|
|
|
|
|
cpy #SB.IS.TTYPE.LEN
|
|
|
|
|
bne .1
|
2018-09-09 08:11:42 +00:00
|
|
|
|
|
|
|
|
|
.9 stz bIACMode
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
bra .9
|
2017-10-05 15:39:17 +00:00
|
|
|
|
|
2018-09-09 08:11:42 +00:00
|
|
|
|
.7 ldx #DO
|
|
|
|
|
.HS 2C BIT ABS
|
2018-09-03 15:24:54 +00:00
|
|
|
|
|
2018-09-09 08:11:42 +00:00
|
|
|
|
.8 ldx #DONT
|
|
|
|
|
|
|
|
|
|
bra COUT.IAC.SendAX
|
|
|
|
|
|
|
|
|
|
.9 stz bIACMode
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
COUT.IAC.WONT
|
|
|
|
|
.9 stz bIACMode
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
bra COUT.IAC.SendAX.9
|
|
|
|
|
|
|
|
|
|
.7 ldx #WILL
|
|
|
|
|
.HS 2C BIT ABS
|
|
|
|
|
|
|
|
|
|
.8 ldx #WONT
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
COUT.IAC.SendAX
|
|
|
|
|
pha push CMD
|
|
|
|
|
phx
|
2018-09-03 15:24:54 +00:00
|
|
|
|
lda #IAC
|
|
|
|
|
jsr Char.Out.Put
|
2018-09-09 08:11:42 +00:00
|
|
|
|
pla
|
2018-09-03 15:24:54 +00:00
|
|
|
|
jsr Char.Out.Put
|
2018-09-09 08:11:42 +00:00
|
|
|
|
pla
|
2018-09-03 15:24:54 +00:00
|
|
|
|
jsr Char.Out.Put
|
|
|
|
|
|
2018-09-09 08:11:42 +00:00
|
|
|
|
COUT.IAC.SendAX.9
|
|
|
|
|
stz bIACMode
|
2017-10-05 15:39:17 +00:00
|
|
|
|
|
2018-09-09 08:11:42 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
COUT.IAC.DONT
|
|
|
|
|
.9 stz bIACMode
|
|
|
|
|
|
|
|
|
|
clc
|
2017-10-05 15:39:17 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2018-10-29 08:41:10 +00:00
|
|
|
|
RESET stz CURON
|
|
|
|
|
|
|
|
|
|
stz bEscMode
|
|
|
|
|
stz bEscModeCSI
|
|
|
|
|
|
|
|
|
|
jsr CLRSCR
|
|
|
|
|
|
2015-11-29 22:19:10 +00:00
|
|
|
|
lda #23
|
|
|
|
|
sta SCROLLBOT
|
2018-09-13 15:29:02 +00:00
|
|
|
|
lda #0
|
|
|
|
|
sta SCROLLTOP
|
|
|
|
|
dec
|
|
|
|
|
sta LWFLG
|
2015-11-29 22:19:10 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
RESETATTR lda #$80
|
|
|
|
|
sta INVFLG
|
|
|
|
|
clc
|
2016-01-04 07:22:28 +00:00
|
|
|
|
rts
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2016-01-04 07:22:28 +00:00
|
|
|
|
ESC lda #$80
|
|
|
|
|
sta bEscMode
|
2015-12-10 18:53:30 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2015-06-03 18:30:57 +00:00
|
|
|
|
*--------------------------------------
|
2017-02-03 16:58:13 +00:00
|
|
|
|
ENQ ldy #0
|
|
|
|
|
|
|
|
|
|
.1 lda ENQ.String,y
|
|
|
|
|
beq .8
|
|
|
|
|
jsr Char.Out.Put
|
|
|
|
|
iny
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-01-04 07:22:28 +00:00
|
|
|
|
BS ldx CH
|
|
|
|
|
beq .1
|
|
|
|
|
dec CH
|
|
|
|
|
bra .3
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
.1 ldy CV
|
|
|
|
|
bne .2
|
2015-11-29 22:19:10 +00:00
|
|
|
|
clc
|
2015-03-14 21:48:35 +00:00
|
|
|
|
rts
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
.2 lda #79
|
|
|
|
|
sta CH
|
|
|
|
|
dec CV
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2017-09-26 15:55:25 +00:00
|
|
|
|
.3 clc
|
|
|
|
|
rts
|
2015-06-03 18:30:57 +00:00
|
|
|
|
*--------------------------------------
|
2018-11-28 11:39:33 +00:00
|
|
|
|
ClrScr ldx #23
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2017-11-22 16:27:50 +00:00
|
|
|
|
.1 jsr SETUP.L1X
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2017-03-06 16:58:05 +00:00
|
|
|
|
lda #" "
|
2015-11-29 22:19:10 +00:00
|
|
|
|
|
2015-11-23 14:54:30 +00:00
|
|
|
|
sta SETWRITEAUX
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2015-11-29 22:19:10 +00:00
|
|
|
|
ldy #39
|
2018-10-29 08:41:10 +00:00
|
|
|
|
|
2015-11-29 22:19:10 +00:00
|
|
|
|
.2 sta (ZPBaseL1),y
|
2015-03-14 21:48:35 +00:00
|
|
|
|
dey
|
|
|
|
|
bpl .2
|
2017-02-07 07:27:27 +00:00
|
|
|
|
|
2015-11-23 14:54:30 +00:00
|
|
|
|
sta CLRWRITEAUX
|
2015-11-29 22:19:10 +00:00
|
|
|
|
|
|
|
|
|
ldy #39
|
2018-11-28 11:39:33 +00:00
|
|
|
|
|
2015-11-29 22:19:10 +00:00
|
|
|
|
.3 sta (ZPBaseL1),y
|
2015-03-14 21:48:35 +00:00
|
|
|
|
dey
|
|
|
|
|
bpl .3
|
|
|
|
|
|
2015-11-29 22:19:10 +00:00
|
|
|
|
dex
|
|
|
|
|
bpl .1
|
|
|
|
|
|
2018-11-28 11:39:33 +00:00
|
|
|
|
stz CV
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2018-11-28 11:39:33 +00:00
|
|
|
|
CROUT stz CH
|
2017-02-28 16:58:36 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-01-04 07:22:28 +00:00
|
|
|
|
LF ldy CV
|
2018-09-13 15:29:02 +00:00
|
|
|
|
cpy SCROLLBOT
|
2016-01-04 07:22:28 +00:00
|
|
|
|
beq SCROLL.UP
|
|
|
|
|
inc CV
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2015-11-29 22:19:10 +00:00
|
|
|
|
SCROLL.UP ldx SCROLLTOP
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2017-11-22 16:27:50 +00:00
|
|
|
|
.1 jsr SETUP.L1X
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2017-11-22 16:27:50 +00:00
|
|
|
|
inx
|
|
|
|
|
|
2017-11-23 16:51:52 +00:00
|
|
|
|
jsr COPY.XtoL1
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
2015-11-29 22:19:10 +00:00
|
|
|
|
cpx SCROLLBOT
|
|
|
|
|
bne .1
|
|
|
|
|
*--------------------------------------
|
2017-11-23 16:51:52 +00:00
|
|
|
|
CLREOL ldy CH Start
|
|
|
|
|
ldx #80 End
|
2015-11-29 22:19:10 +00:00
|
|
|
|
bra CLR
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2017-11-23 16:51:52 +00:00
|
|
|
|
CLRLINE ldy #0 Start
|
|
|
|
|
ldx #80 End
|
2015-11-29 22:19:10 +00:00
|
|
|
|
bra CLR
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2017-11-23 16:51:52 +00:00
|
|
|
|
CLRSOL ldy #0 Start
|
|
|
|
|
ldx CH End
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2017-11-23 16:51:52 +00:00
|
|
|
|
CLR stx .2+1
|
|
|
|
|
|
|
|
|
|
ldx CV
|
|
|
|
|
|
2017-03-06 20:08:38 +00:00
|
|
|
|
.1 lda #" "
|
|
|
|
|
|
2017-11-23 16:51:52 +00:00
|
|
|
|
phy
|
|
|
|
|
jsr SetCharAtYX X unmodified
|
|
|
|
|
ply
|
|
|
|
|
iny
|
|
|
|
|
.2 cpy #$ff Self Modified
|
2015-11-29 22:19:10 +00:00
|
|
|
|
bne .1
|
2017-11-23 16:51:52 +00:00
|
|
|
|
|
2015-11-29 22:19:10 +00:00
|
|
|
|
clc
|
2015-11-23 14:54:30 +00:00
|
|
|
|
rts
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2016-01-04 07:22:28 +00:00
|
|
|
|
SCROLL.DN ldx SCROLLBOT
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2017-11-22 16:27:50 +00:00
|
|
|
|
.1 jsr SETUP.L1X
|
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
dex
|
2017-11-22 16:27:50 +00:00
|
|
|
|
|
2017-11-23 16:51:52 +00:00
|
|
|
|
jsr COPY.XtoL1
|
2016-01-04 07:22:28 +00:00
|
|
|
|
|
|
|
|
|
cpx SCROLLTOP
|
2016-11-04 15:11:37 +00:00
|
|
|
|
bne .1
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2018-09-13 15:29:02 +00:00
|
|
|
|
Esc.LWEnable sec
|
|
|
|
|
.HS 90 BCC
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
Esc.LWDisable clc
|
|
|
|
|
ldx EscSeqParamCnt
|
|
|
|
|
beq .8
|
|
|
|
|
dex
|
|
|
|
|
bne .8
|
|
|
|
|
|
|
|
|
|
lda EscSeqParam
|
|
|
|
|
eor #7
|
|
|
|
|
bne .8
|
|
|
|
|
|
|
|
|
|
ror LWFLG
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-01-04 07:22:28 +00:00
|
|
|
|
Esc.DispAttr ldx EscSeqParamCnt
|
|
|
|
|
beq .8
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
.1 lda EscSeqParam-1,x
|
|
|
|
|
bne .2
|
|
|
|
|
jsr RESETATTR
|
|
|
|
|
bra .7
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
.2 cmp #7
|
|
|
|
|
bne .8
|
|
|
|
|
stz INVFLG
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
.7 dex
|
|
|
|
|
bne .1
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
Esc.Query ldx EscSeqParamCnt
|
|
|
|
|
beq .8
|
|
|
|
|
dex
|
|
|
|
|
bne .8
|
|
|
|
|
|
|
|
|
|
lda EscSeqParam
|
|
|
|
|
cmp #6
|
|
|
|
|
bne .8
|
|
|
|
|
|
2018-11-06 16:31:13 +00:00
|
|
|
|
lda #C.ESC
|
2016-10-06 06:23:20 +00:00
|
|
|
|
jsr Char.Out.Put
|
2018-11-06 16:31:13 +00:00
|
|
|
|
lda #'['
|
2016-10-06 06:23:20 +00:00
|
|
|
|
jsr Char.Out.Put
|
2016-01-04 07:22:28 +00:00
|
|
|
|
lda CV
|
|
|
|
|
inc
|
2016-10-06 06:23:20 +00:00
|
|
|
|
jsr Decimal.Out
|
2016-01-04 07:22:28 +00:00
|
|
|
|
lda #';'
|
2016-10-06 06:23:20 +00:00
|
|
|
|
jsr Char.Out.Put
|
2016-01-04 07:22:28 +00:00
|
|
|
|
lda CH
|
|
|
|
|
inc
|
|
|
|
|
jsr Decimal.Out
|
|
|
|
|
lda #'R'
|
2016-10-06 06:23:20 +00:00
|
|
|
|
jsr Char.Out.Put
|
2016-01-04 07:22:28 +00:00
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
Esc.Scroll ldx EscSeqParamCnt
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
ldy #23
|
|
|
|
|
bra .8
|
|
|
|
|
|
|
|
|
|
.1 cpx #2
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
lda EscSeqParam
|
|
|
|
|
dec
|
|
|
|
|
ldy EscSeqParam+1
|
|
|
|
|
dey
|
|
|
|
|
|
|
|
|
|
.8 sta SCROLLTOP
|
|
|
|
|
sty SCROLLBOT
|
|
|
|
|
.9 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
Esc.Erase ldx EscSeqParamCnt
|
|
|
|
|
|
|
|
|
|
bne .1
|
|
|
|
|
jmp CLREOL
|
|
|
|
|
|
|
|
|
|
.1 lda EscSeqParam
|
|
|
|
|
cmp #1
|
|
|
|
|
bne .2
|
|
|
|
|
jmp CLRSOL
|
|
|
|
|
|
|
|
|
|
.2 cmp #2
|
|
|
|
|
bne .9
|
|
|
|
|
jmp CLRLINE
|
|
|
|
|
|
|
|
|
|
.9 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
Esc.Home ldx EscSeqParamCnt
|
|
|
|
|
bne .1
|
|
|
|
|
stz CH
|
|
|
|
|
stz CV
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.1 ldx #1
|
|
|
|
|
lda EscSeqParam
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
ldx #24
|
|
|
|
|
cmp #24
|
|
|
|
|
bcs .2
|
|
|
|
|
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
.2 dex
|
|
|
|
|
stx CV
|
|
|
|
|
|
|
|
|
|
dec EscSeqParamCnt
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
ldx #1
|
|
|
|
|
lda EscSeqParam+1
|
|
|
|
|
beq .3
|
|
|
|
|
|
|
|
|
|
ldx #80
|
|
|
|
|
cmp #80
|
|
|
|
|
|
|
|
|
|
bcs .3
|
|
|
|
|
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
.3 dex
|
|
|
|
|
stx CH
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2015-03-14 21:48:35 +00:00
|
|
|
|
CUROFF lda CURON
|
|
|
|
|
beq CUREXIT.RTS
|
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
CURBLNK lda A2osX.ASCREEN
|
2018-12-11 06:44:57 +00:00
|
|
|
|
cmp DEVID
|
2016-06-07 06:10:18 +00:00
|
|
|
|
beq CURBLNK1
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
|
|
|
|
lda CURON
|
|
|
|
|
bne CURBLNK.OFF
|
|
|
|
|
rts do not Light if screen is not active
|
|
|
|
|
|
|
|
|
|
CURBLNK1 lda CURON
|
|
|
|
|
bne CURBLNK.OFF
|
2017-11-23 16:51:52 +00:00
|
|
|
|
|
|
|
|
|
jsr GetCharAtCurPos
|
2015-03-14 21:48:35 +00:00
|
|
|
|
sta CURCHAR
|
2015-11-29 22:19:10 +00:00
|
|
|
|
and #$80
|
|
|
|
|
eor #" "
|
2015-03-14 21:48:35 +00:00
|
|
|
|
bra CUREXIT
|
|
|
|
|
|
2017-11-23 16:51:52 +00:00
|
|
|
|
CURBLNK.OFF lda CURCHAR
|
|
|
|
|
|
|
|
|
|
CUREXIT jsr SetCharAtCurPos
|
|
|
|
|
|
|
|
|
|
lda CURON
|
2015-03-14 21:48:35 +00:00
|
|
|
|
eor #CURSOR.BLINK.SPEED
|
|
|
|
|
sta CURON
|
|
|
|
|
CUREXIT.RTS rts
|
|
|
|
|
*--------------------------------------
|
2017-11-23 16:51:52 +00:00
|
|
|
|
SetCharAtCurPos ldy CH
|
|
|
|
|
ldx CV
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SetCharAtYX cmp #$40
|
2015-11-29 22:19:10 +00:00
|
|
|
|
bcc .10
|
|
|
|
|
cmp #$5F
|
|
|
|
|
bcs .10
|
|
|
|
|
and #$3F
|
|
|
|
|
|
2017-11-23 16:51:52 +00:00
|
|
|
|
.10 pha
|
|
|
|
|
|
|
|
|
|
jsr SETUP.L1X
|
|
|
|
|
|
|
|
|
|
tya
|
2015-03-14 21:48:35 +00:00
|
|
|
|
lsr
|
2017-11-23 16:51:52 +00:00
|
|
|
|
tay
|
2017-02-07 07:27:27 +00:00
|
|
|
|
|
2017-11-23 16:51:52 +00:00
|
|
|
|
pla
|
2015-11-23 14:54:30 +00:00
|
|
|
|
bcs .1
|
2017-02-07 07:27:27 +00:00
|
|
|
|
|
2018-05-04 14:55:29 +00:00
|
|
|
|
* php
|
|
|
|
|
* sei
|
2015-11-23 14:54:30 +00:00
|
|
|
|
sta SETWRITEAUX
|
2018-05-04 14:55:29 +00:00
|
|
|
|
.1 sta (ZPBaseL1),y
|
2015-11-23 14:54:30 +00:00
|
|
|
|
sta CLRWRITEAUX
|
2018-05-04 14:55:29 +00:00
|
|
|
|
* plp
|
2017-11-23 16:51:52 +00:00
|
|
|
|
rts
|
|
|
|
|
|
2018-05-04 14:55:29 +00:00
|
|
|
|
*.1 sta (ZPBaseL1),y
|
|
|
|
|
* rts
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2017-11-23 16:51:52 +00:00
|
|
|
|
GetCharAtCurPos ldy CH
|
|
|
|
|
ldx CV
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
GetCharAtYX jsr SETUP.L1X
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
2017-11-23 16:51:52 +00:00
|
|
|
|
tya
|
|
|
|
|
lsr
|
|
|
|
|
tay
|
2017-02-07 07:27:27 +00:00
|
|
|
|
|
2017-11-23 16:51:52 +00:00
|
|
|
|
bcs .1
|
|
|
|
|
|
2018-05-04 14:55:29 +00:00
|
|
|
|
* php
|
|
|
|
|
* sei
|
2015-11-23 14:54:30 +00:00
|
|
|
|
sta SETREADAUX
|
2018-05-04 14:55:29 +00:00
|
|
|
|
.1 lda (ZPBaseL1),y
|
2015-11-23 14:54:30 +00:00
|
|
|
|
sta CLRREADAUX
|
2018-05-04 14:55:29 +00:00
|
|
|
|
* plp
|
2017-11-23 16:51:52 +00:00
|
|
|
|
rts
|
|
|
|
|
|
2018-05-04 14:55:29 +00:00
|
|
|
|
*.1 lda (ZPBaseL1),y
|
|
|
|
|
* rts
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2017-11-22 16:27:50 +00:00
|
|
|
|
SETUP.L1X lda BASEL,x
|
|
|
|
|
sta ZPBaseL1
|
|
|
|
|
lda BASEH,x
|
|
|
|
|
sta ZPBaseL1+1
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-11-23 16:51:52 +00:00
|
|
|
|
COPY.XtoL1 lda BASEL,x
|
2017-11-22 16:27:50 +00:00
|
|
|
|
sta ZPBaseL2
|
|
|
|
|
lda BASEH,x
|
|
|
|
|
sta ZPBaseL2+1
|
2017-11-23 16:51:52 +00:00
|
|
|
|
|
2018-05-04 14:55:29 +00:00
|
|
|
|
* php
|
|
|
|
|
* sei
|
2017-02-07 07:27:27 +00:00
|
|
|
|
sta SETWRITEAUX
|
|
|
|
|
sta SETREADAUX
|
|
|
|
|
|
2017-11-23 16:51:52 +00:00
|
|
|
|
jsr .1
|
2017-02-07 07:27:27 +00:00
|
|
|
|
|
|
|
|
|
sta CLRWRITEAUX
|
|
|
|
|
sta CLRREADAUX
|
2018-05-04 14:55:29 +00:00
|
|
|
|
* plp
|
2017-02-07 07:27:27 +00:00
|
|
|
|
|
2017-11-23 16:51:52 +00:00
|
|
|
|
.1 ldy #39
|
2017-02-07 07:27:27 +00:00
|
|
|
|
|
|
|
|
|
.2 lda (ZPBaseL2),y
|
|
|
|
|
sta (ZPBaseL1),y
|
|
|
|
|
dey
|
|
|
|
|
bpl .2
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2018-05-04 14:55:29 +00:00
|
|
|
|
Decimal.Out stz ZPTmpWord
|
|
|
|
|
stz ZPTmpWord+1
|
2015-11-29 22:19:10 +00:00
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
ldx #8
|
|
|
|
|
sed
|
2015-11-29 22:19:10 +00:00
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
tay
|
2015-11-29 22:19:10 +00:00
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
.1 tya
|
|
|
|
|
asl
|
|
|
|
|
tay
|
2018-05-04 14:55:29 +00:00
|
|
|
|
lda ZPTmpWord
|
|
|
|
|
adc ZPTmpWord
|
|
|
|
|
sta ZPTmpWord
|
|
|
|
|
lda ZPTmpWord+1
|
|
|
|
|
adc ZPTmpWord+1
|
|
|
|
|
sta ZPTmpWord+1
|
2016-01-04 07:22:28 +00:00
|
|
|
|
dex
|
2015-11-29 22:19:10 +00:00
|
|
|
|
bne .1
|
2018-05-04 14:55:29 +00:00
|
|
|
|
|
2016-01-04 07:22:28 +00:00
|
|
|
|
cld
|
2015-11-29 22:19:10 +00:00
|
|
|
|
|
2018-05-04 14:55:29 +00:00
|
|
|
|
stz ZPTmpBool No leading 0
|
2018-05-09 06:02:05 +00:00
|
|
|
|
|
2018-05-04 14:55:29 +00:00
|
|
|
|
lda ZPTmpWord+1
|
2016-01-04 07:22:28 +00:00
|
|
|
|
and #$0f
|
|
|
|
|
beq .2
|
2018-05-04 14:55:29 +00:00
|
|
|
|
|
|
|
|
|
dec ZPTmpBool non zero, print everything
|
2018-05-09 06:02:05 +00:00
|
|
|
|
|
|
|
|
|
jsr Char.Out.Put30
|
2015-11-29 22:19:10 +00:00
|
|
|
|
|
2018-05-04 14:55:29 +00:00
|
|
|
|
.2 lda ZPTmpWord
|
2016-01-04 07:22:28 +00:00
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
bne .3
|
2018-05-04 14:55:29 +00:00
|
|
|
|
|
|
|
|
|
bit ZPTmpBool Print this digit ?
|
2016-01-04 07:22:28 +00:00
|
|
|
|
bpl .4
|
2018-05-04 14:55:29 +00:00
|
|
|
|
|
2018-05-09 06:02:05 +00:00
|
|
|
|
.3 jsr Char.Out.Put30
|
2018-05-04 14:55:29 +00:00
|
|
|
|
|
|
|
|
|
.4 lda ZPTmpWord
|
2016-01-04 07:22:28 +00:00
|
|
|
|
and #$0f
|
|
|
|
|
*--------------------------------------
|
2018-05-09 06:02:05 +00:00
|
|
|
|
Char.Out.Put30 ora #$30
|
2016-10-06 06:23:20 +00:00
|
|
|
|
Char.Out.Put pha
|
2016-01-04 07:22:28 +00:00
|
|
|
|
lda OutPtr
|
|
|
|
|
clc
|
|
|
|
|
adc OutCnt
|
2018-09-09 08:11:42 +00:00
|
|
|
|
and #OUTBUF.MAXLEN-1
|
2016-01-04 07:22:28 +00:00
|
|
|
|
tax
|
|
|
|
|
pla
|
|
|
|
|
sta OutBuffer,x
|
|
|
|
|
inc OutCnt
|
2015-11-29 22:19:10 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-01-04 07:22:28 +00:00
|
|
|
|
Char.Out.Get sec
|
|
|
|
|
lda OutCnt
|
|
|
|
|
beq .9
|
|
|
|
|
dec OutCnt
|
|
|
|
|
ldx OutPtr
|
|
|
|
|
lda OutBuffer,x
|
|
|
|
|
pha
|
|
|
|
|
txa
|
|
|
|
|
inc
|
2018-09-09 08:11:42 +00:00
|
|
|
|
and #OUTBUF.MAXLEN-1
|
2016-01-04 07:22:28 +00:00
|
|
|
|
sta OutPtr
|
|
|
|
|
pla
|
2015-11-29 22:19:10 +00:00
|
|
|
|
clc
|
2016-01-04 07:22:28 +00:00
|
|
|
|
.9 rts
|
2015-11-29 22:19:10 +00:00
|
|
|
|
*--------------------------------------
|
2018-09-09 08:11:42 +00:00
|
|
|
|
GetPtrsAndCnt ldy #S.IOCTL.BUFPTR
|
|
|
|
|
lda (ZPIOCTL),y
|
|
|
|
|
sta ZPBufPtr
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPIOCTL),y
|
|
|
|
|
sta ZPBufPtr+1
|
|
|
|
|
|
|
|
|
|
* ldy #S.IOCTL.BYTECNT
|
|
|
|
|
iny
|
|
|
|
|
|
|
|
|
|
lda (ZPIOCTL),y
|
|
|
|
|
eor #$ff
|
|
|
|
|
sta ZPCount
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPIOCTL),y
|
|
|
|
|
eor #$ff
|
|
|
|
|
sta ZPCount+1
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
DRV.CS.END
|
2018-09-10 05:48:35 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
BASEL .HS 00.80.00.80.00.80.00.80.28.A8.28.A8.28.A8.28.A8.50.D0.50.D0.50.D0.50.D0
|
|
|
|
|
BASEH .HS 04.04.05.05.06.06.07.07.04.04.05.05.06.06.07.07.04.04.05.05.06.06.07.07
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CtrlChars .HS 05080A0C0D151B
|
|
|
|
|
CtrlChars.Cnt .EQ *-CtrlChars
|
|
|
|
|
*--------------------------------------
|
2018-09-13 15:29:02 +00:00
|
|
|
|
EscCodes .AZ "MDc"
|
|
|
|
|
EscCodes.Cnt .EQ *-EscCodes
|
|
|
|
|
EscSeqCmds .AS "hlmnrKH"
|
|
|
|
|
EscSeqCmds.Cnt .EQ *-EscSeqCmds
|
2018-05-04 14:55:29 +00:00
|
|
|
|
ENQ.String .AZ "XTERM"
|
|
|
|
|
*--------------------------------------
|
2015-12-13 21:29:51 +00:00
|
|
|
|
KeyRemapped .HS 05080A0B0D15 L,D,U,CR,R
|
2015-12-12 10:13:14 +00:00
|
|
|
|
KeyRemappedIdx .HS 050004080C0F
|
2016-01-04 07:22:28 +00:00
|
|
|
|
KeyRemappedTbl .EQ *
|
2015-12-12 10:13:14 +00:00
|
|
|
|
KeyRemappedLEFT .HS 1B5B4400 esc[D
|
|
|
|
|
KeyRemappedDOWN .HS 1B5B4200 esc[B
|
|
|
|
|
KeyRemappedUP .HS 1B5B4100 esc[A
|
|
|
|
|
KeyRemappedCR .HS 0D0A00 crlf
|
|
|
|
|
KeyRemappedRGHT .HS 1B5B4300 esc[C
|
2018-09-10 05:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2018-09-12 15:27:00 +00:00
|
|
|
|
TELOPS.STATUS
|
|
|
|
|
*--------------------------------------
|
2018-09-11 21:15:15 +00:00
|
|
|
|
WILLDO .DA #TELOPT.BINARY,#TELOPT.SGA
|
2018-09-09 08:11:42 +00:00
|
|
|
|
WILLDO.CNT .EQ *-WILLDO
|
2018-09-11 21:15:15 +00:00
|
|
|
|
WILLDONT .DA #TELOPT.TSPEED,#TELOPT.LINEMODE,#TELOPT.STATUS
|
2018-09-09 08:11:42 +00:00
|
|
|
|
WILLDONT.CNT .EQ *-WILLDONT
|
2018-09-13 15:29:02 +00:00
|
|
|
|
DOWILL .DA #TELOPT.BINARY,#TELOPT.SGA,#TELOPT.TTYPE,#TELOPT.NAWS
|
2018-09-09 08:11:42 +00:00
|
|
|
|
DOWILL.CNT .EQ *-DOWILL
|
2018-09-13 15:29:02 +00:00
|
|
|
|
DOWONT .DA #TELOPT.ECHO,#TELOPT.NEWENVIRON,#TELOPT.XDISPLOC,#TELOPT.TSPEED,#TELOPT.LFLOW
|
2018-09-09 08:11:42 +00:00
|
|
|
|
DOWONT.CNT .EQ *-DOWONT
|
2018-09-10 05:48:35 +00:00
|
|
|
|
SB.IS.TTYPE .DA #IAC,#SB,#TELOPT.TTYPE,#SB.IS
|
|
|
|
|
.AS 'XTERM'
|
|
|
|
|
.DA #IAC,#SE
|
|
|
|
|
SB.IS.TTYPE.LEN .EQ *-SB.IS.TTYPE
|
2018-09-12 15:27:00 +00:00
|
|
|
|
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
|
2018-09-09 08:11:42 +00:00
|
|
|
|
*--------------------------------------
|
2018-12-10 16:45:37 +00:00
|
|
|
|
DEVID .BS 1
|
2018-09-09 08:11:42 +00:00
|
|
|
|
CH .BS 1
|
|
|
|
|
CV .BS 1
|
2018-09-13 15:29:02 +00:00
|
|
|
|
LWFLG .BS 1
|
2018-09-09 08:11:42 +00:00
|
|
|
|
INVFLG .BS 1
|
|
|
|
|
SCROLLTOP .BS 1
|
|
|
|
|
SCROLLBOT .BS 1
|
|
|
|
|
CURON .BS 1
|
|
|
|
|
CURCHAR .BS 1
|
|
|
|
|
OutBuffer .BS OUTBUF.MAXLEN
|
|
|
|
|
OutPtr .BS 1
|
|
|
|
|
OutCnt .BS 1
|
2017-06-14 09:51:59 +00:00
|
|
|
|
bIACMode .BS 1
|
2018-09-09 08:11:42 +00:00
|
|
|
|
IACBuf .BS OUTBUF.MAXLEN+1
|
2015-11-29 22:19:10 +00:00
|
|
|
|
bEscMode .BS 1
|
|
|
|
|
bEscModeCSI .BS 1
|
2016-01-04 07:22:28 +00:00
|
|
|
|
bEscSeqInNum .BS 1
|
2015-11-29 22:19:10 +00:00
|
|
|
|
EscSeq .BS ESCSEQ.MAXLEN+1
|
|
|
|
|
EscSeqParamCnt .BS 1
|
|
|
|
|
EscSeqParam .BS 4
|
2015-12-12 10:13:14 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-19 15:33:55 +00:00
|
|
|
|
DIB .DA #S.DIB.S.WRITE+S.DIB.S.READ
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.DA #0,#0,#0
|
|
|
|
|
>PSTR "ANSI 80c Console"
|
2018-07-19 15:33:55 +00:00
|
|
|
|
.DA #S.DIB.T.CHAR
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.DA #0
|
2018-08-25 11:23:59 +00:00
|
|
|
|
.DA K.VER
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2018-06-28 15:26:34 +00:00
|
|
|
|
DRV.END
|
2015-03-14 21:48:35 +00:00
|
|
|
|
MAN
|
2018-11-28 11:39:33 +00:00
|
|
|
|
SAVE USR/SRC/DRV/CONSOLE.DRV.S
|
2015-03-14 21:48:35 +00:00
|
|
|
|
ASM
|