2021-09-07 12:32:31 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* TBOX.New hParent,X1,Y1,W,H,F,pBuf,BufSize 10
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
2022-09-04 20:12:49 +00:00
|
|
|
|
TBOX.New lda #S.OBJ.T.TBOX
|
|
|
|
|
jsr OBJ.Create
|
2021-09-07 12:32:31 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
jsr OBJ.PullBuf
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
>PULLA
|
|
|
|
|
ldy #S.OBJ.F
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
jsr OBJ.PullHW
|
|
|
|
|
|
|
|
|
|
jsr OBJ.PullY1X1hParent
|
|
|
|
|
|
2023-02-10 18:19:29 +00:00
|
|
|
|
jsr CONT.Insert
|
2022-09-04 20:12:49 +00:00
|
|
|
|
bcs .99
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
lda hObj
|
|
|
|
|
* clc
|
|
|
|
|
rts
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.9 >POP 10
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.99 rts
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.Run ldy #S.OBJ.S
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
bpl TBOX.RUN.Ignore
|
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
ldy #S.OBJ.F
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
and #S.OBJ.F.bEdit
|
|
|
|
|
bne TBOX.Run.RW
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
lda (pStack) Event
|
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
cmp #C.SPACE
|
|
|
|
|
beq .1
|
|
|
|
|
|
|
|
|
|
cmp #27
|
|
|
|
|
bcs TBOX.RUN.Ignore
|
|
|
|
|
|
|
|
|
|
asl
|
|
|
|
|
tax
|
|
|
|
|
jmp (J.TBOX.RUN.RO,x)
|
|
|
|
|
|
|
|
|
|
.1 jmp TBOX.RUN.GetLink
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.Run.RW lda (pStack) Event
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
cmp #C.SPACE
|
2023-01-31 06:55:01 +00:00
|
|
|
|
bcs .1
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
cmp #27
|
|
|
|
|
bcs TBOX.RUN.Ignore
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
asl
|
|
|
|
|
tax
|
2023-03-26 17:42:38 +00:00
|
|
|
|
jmp (J.TBOX.RUN.RW,x)
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
.1 cmp #C.DEL
|
2023-03-26 17:42:38 +00:00
|
|
|
|
beq .2
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
jsr TBOX.GetBuf
|
|
|
|
|
jsr TBOX.ToBuf1
|
2023-03-26 17:42:38 +00:00
|
|
|
|
bcs TBOX.RUN.Ignore Buffer full
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
jsr TBOX.RUN.FS1
|
2023-03-26 17:42:38 +00:00
|
|
|
|
bra .3
|
|
|
|
|
|
|
|
|
|
.2 jsr TBOX.GetBuf
|
|
|
|
|
|
|
|
|
|
jsr TBOX.Delete1
|
|
|
|
|
bcs TBOX.RUN.Ignore Buffer Empty
|
|
|
|
|
|
|
|
|
|
.3 bit bRepaintAll
|
|
|
|
|
bmi .4
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
jsr OBJ.CurUpdPos
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
jmp TBOX.DrawCurLine
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
.4 jmp TBOX.DrawAllLines
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.RUN.Ignore lda #0
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.RUN.PrevLink
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
TBOX.RUN.PrevLink.9
|
|
|
|
|
lda #0
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.RUN.NextLink
|
|
|
|
|
jsr TBOX.GetDocYInAX
|
|
|
|
|
|
|
|
|
|
jsr TBOX.GetLineAX will do GetBuf
|
|
|
|
|
bcs TBOX.RUN.PrevLink.9
|
|
|
|
|
|
|
|
|
|
jsr TBOX.SetLineAtDocX
|
|
|
|
|
|
|
|
|
|
.1 ldx #$ff
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
.2 inx
|
|
|
|
|
|
|
|
|
|
jsr TBOX.GetChar
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
cmp #C.CR
|
|
|
|
|
beq .7
|
|
|
|
|
|
|
|
|
|
cmp #'['
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
cmp (ZPPtr1) "[["
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
jsr TBOX.RUN.SelectLink
|
|
|
|
|
|
|
|
|
|
.3 jsr TBOX.GetChar
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
cmp #C.CR
|
|
|
|
|
beq .7
|
|
|
|
|
|
|
|
|
|
cmp #']'
|
|
|
|
|
bne .3
|
|
|
|
|
|
|
|
|
|
jsr TBOX.RUN.Link2pVar
|
|
|
|
|
|
|
|
|
|
jsr TBOX.SetViewPort
|
2023-01-31 06:55:01 +00:00
|
|
|
|
bit bRepaintAll
|
2023-03-26 17:42:38 +00:00
|
|
|
|
bmi .6
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
jsr OBJ.CurUpdPos
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
jsr TBOX.DrawCurLine
|
|
|
|
|
bra .60
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
.6 jsr TBOX.DrawAllLines
|
|
|
|
|
|
|
|
|
|
.60 lda #EV.HL.SELECTED
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.7 ldy #S.TBOX.DocX
|
|
|
|
|
jsr OBJ.ZeroWordAtY
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.DocY
|
|
|
|
|
jsr OBJ.IncWordAtY
|
|
|
|
|
bra .1
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
.9 lda #0
|
|
|
|
|
sec
|
|
|
|
|
rts
|
2023-01-31 06:55:01 +00:00
|
|
|
|
*--------------------------------------
|
2023-03-26 17:42:38 +00:00
|
|
|
|
TBOX.RUN.SelectLink
|
|
|
|
|
txa
|
|
|
|
|
sec skip first [
|
|
|
|
|
ldy #S.TBOX.DocX
|
|
|
|
|
adc (ZPObjPtr),y
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
iny
|
|
|
|
|
lda #0
|
|
|
|
|
adc (ZPObjPtr),y
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.BufPtr
|
|
|
|
|
jsr TBOX.SetTempCAtY
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.SelBegin
|
|
|
|
|
jmp TBOX.SetTempCAtY
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.RUN.Link2pVar
|
|
|
|
|
ldy #S.TBOX.SelEnd
|
|
|
|
|
jsr TBOX.SetTempCAtY
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.pVar
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
sta ZPPtr2
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
sta ZPPtr2+1
|
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
.1 jsr TBOX.GetChar
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
cmp #C.CR
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
cmp #']'
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
iny
|
|
|
|
|
bra .1
|
|
|
|
|
|
|
|
|
|
.8 lda #0
|
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.RUN.GetLink
|
|
|
|
|
|
|
|
|
|
lda #EV.HL.PRESSED
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
lda #0
|
2023-01-31 06:55:01 +00:00
|
|
|
|
sec
|
2021-12-02 21:28:26 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2023-03-26 17:42:38 +00:00
|
|
|
|
TBOX.RUN.ScrollUp
|
|
|
|
|
jsr TBOX.GetBuf
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.VScroll
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
clc
|
|
|
|
|
ldy #S.OBJ.InnerH
|
|
|
|
|
adc (ZPObjPtr),y
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.VScroll+1
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
ldy #S.OBJ.InnerH+1
|
|
|
|
|
adc (ZPObjPtr),y
|
|
|
|
|
plx
|
|
|
|
|
|
|
|
|
|
jsr TBOX.GetLineAX
|
|
|
|
|
bcs .8
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.VScroll
|
|
|
|
|
jsr OBJ.IncWordAtY
|
|
|
|
|
|
|
|
|
|
jmp TBOX.DrawAllLines
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.RUN.ScrollDown
|
|
|
|
|
jsr TBOX.GetBuf
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.VScroll+1
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
dey
|
|
|
|
|
ora (ZPObjPtr),y
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
jsr OBJ.DecWordAtY
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.DocY
|
|
|
|
|
jsr OBJ.DecWordAtY
|
|
|
|
|
|
|
|
|
|
jmp TBOX.DrawAllLines
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-12-02 21:28:26 +00:00
|
|
|
|
TBOX.RUN.SelBegin
|
|
|
|
|
ldy #S.TBOX.BufPtr
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPObjPtr),y
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
ldy #S.TBOX.SelBegin+1
|
|
|
|
|
sta (ZPObjPtr),y
|
2021-09-07 12:32:31 +00:00
|
|
|
|
txa
|
2021-12-02 21:28:26 +00:00
|
|
|
|
dey
|
|
|
|
|
sta (ZPObjPtr),y
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
jmp TBOX.DrawAllLines
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.RUN.SelEnd ldy #S.TBOX.BufPtr
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPObjPtr),y
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
ldy #S.TBOX.SelEnd+1
|
2021-09-07 12:32:31 +00:00
|
|
|
|
sta (ZPObjPtr),y
|
2021-12-02 21:28:26 +00:00
|
|
|
|
txa
|
|
|
|
|
dey
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
jmp TBOX.DrawAllLines
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.RUN.BS ldy #S.TBOX.BufPtr+1
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
dey
|
|
|
|
|
ora (ZPObjPtr),y
|
|
|
|
|
beq .9
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr OBJ.DecWordAtY
|
|
|
|
|
|
|
|
|
|
jsr TBOX.GetBuf
|
|
|
|
|
|
|
|
|
|
lda (ZPPtr2)
|
|
|
|
|
cmp #C.CR
|
2023-01-31 06:55:01 +00:00
|
|
|
|
beq .2
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.DocX
|
|
|
|
|
jsr OBJ.DecWordAtY
|
2023-01-31 06:55:01 +00:00
|
|
|
|
jmp TBOX.CheckViewPort
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
.2 ldy #S.TBOX.DocY
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr OBJ.DecWordAtY
|
|
|
|
|
|
|
|
|
|
jmp TBOX.RUN.EOL
|
|
|
|
|
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
2021-09-07 12:32:31 +00:00
|
|
|
|
*--------------------------------------
|
2021-12-02 21:28:26 +00:00
|
|
|
|
TBOX.RUN.LF jsr TBOX.GetBuf
|
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
TBOX.RUN.LF1 jsr TBOX.GetDocYInAX
|
2021-12-02 21:28:26 +00:00
|
|
|
|
inx
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
inc
|
|
|
|
|
|
|
|
|
|
.1 jsr TBOX.GetLineAX
|
|
|
|
|
bcs TBOX.RUN.VT.8
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.DocY
|
|
|
|
|
jsr OBJ.IncWordAtY
|
|
|
|
|
bra TBOX.RUN.VT1
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.RUN.VT jsr TBOX.GetBuf
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.DocY+1
|
2021-09-07 12:32:31 +00:00
|
|
|
|
lda (ZPObjPtr),y
|
2021-12-02 21:28:26 +00:00
|
|
|
|
dey
|
|
|
|
|
ora (ZPObjPtr),y
|
|
|
|
|
beq TBOX.RUN.VT.8
|
|
|
|
|
|
|
|
|
|
jsr OBJ.DecWordAtY
|
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
TBOX.RUN.VT1 jsr TBOX.GetDocYInAX
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr TBOX.GetLineAX
|
|
|
|
|
|
|
|
|
|
jsr TBOX.GetLineLenInAXC
|
|
|
|
|
sta TempW
|
|
|
|
|
stx TempW+1
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.DocX
|
|
|
|
|
cmp (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
iny
|
|
|
|
|
sbc (ZPObjPtr),y
|
|
|
|
|
bcs .1
|
|
|
|
|
|
|
|
|
|
lda TempW+1
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
dey
|
|
|
|
|
lda TempW
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
.1 ldy #S.TBOX.DocX
|
|
|
|
|
|
|
|
|
|
lda TempC
|
|
|
|
|
clc
|
|
|
|
|
adc (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
iny
|
|
|
|
|
lda TempC+1
|
|
|
|
|
adc (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.BufPtr+1
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
dey
|
|
|
|
|
txa
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
jmp TBOX.CheckViewPort
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
TBOX.RUN.VT.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.RUN.FS jsr TBOX.GetBuf
|
|
|
|
|
|
|
|
|
|
TBOX.RUN.FS1 lda (ZPPtr2)
|
2021-09-07 12:32:31 +00:00
|
|
|
|
beq .8
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.BufPtr
|
|
|
|
|
jsr OBJ.IncWordAtY
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.DocX
|
2023-03-26 17:42:38 +00:00
|
|
|
|
cpx #C.CR
|
|
|
|
|
bne .7
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
.1 jsr OBJ.ZeroWordAtY
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.DocY
|
|
|
|
|
|
|
|
|
|
.7 jsr OBJ.IncWordAtY
|
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
jmp TBOX.CheckViewPort
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2021-09-07 12:32:31 +00:00
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2023-03-26 17:42:38 +00:00
|
|
|
|
TBOX.RUN.SOL ldy #S.TBOX.DocX
|
|
|
|
|
jsr OBJ.ZeroWordAtY
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
jsr TBOX.GetDocYInAX
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr TBOX.GetLineAX
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
ldy #S.TBOX.BufPtr
|
2023-03-26 17:42:38 +00:00
|
|
|
|
jsr TBOX.SetTempCAtY BufPtr at SOL
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
jmp TBOX.CheckViewPort
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
2023-03-26 17:42:38 +00:00
|
|
|
|
TBOX.RUN.EOL jsr TBOX.GetDocYInAX
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr TBOX.GetLineAX
|
|
|
|
|
jsr TBOX.GetLineLenInAXC
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
pha
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
ldy #S.TBOX.BufPtr
|
|
|
|
|
clc
|
2023-02-10 18:19:29 +00:00
|
|
|
|
adc TempC BufPtr at SOL+LineLen
|
2021-12-02 21:28:26 +00:00
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
iny
|
|
|
|
|
txa
|
|
|
|
|
adc TempC+1
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
pla
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
ldy #S.TBOX.DocX
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
iny
|
|
|
|
|
txa
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
jmp TBOX.CheckViewPort
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
2023-01-31 06:55:01 +00:00
|
|
|
|
TBOX.RUN.CR jsr TBOX.GetBuf
|
|
|
|
|
jsr TBOX.ToBuf1
|
|
|
|
|
bcs .8 Buffer full
|
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
ldy #S.TBOX.DocX
|
2023-03-26 17:42:38 +00:00
|
|
|
|
jsr OBJ.ZeroWordAtY
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
jsr TBOX.RUN.LF1
|
2023-02-10 18:19:29 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
jsr OBJ.CurUpdPos
|
|
|
|
|
|
|
|
|
|
bit bRepaintAll
|
|
|
|
|
bmi .1
|
|
|
|
|
|
|
|
|
|
jsr TBOX.DrawBottom
|
|
|
|
|
|
|
|
|
|
.1 jmp TBOX.DrawAllLines
|
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2023-02-07 07:04:23 +00:00
|
|
|
|
TBOX.RUN.PGUP
|
2023-01-31 06:55:01 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.RUN.PGDN lda #0
|
|
|
|
|
sec
|
2021-09-07 12:32:31 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2023-01-31 06:55:01 +00:00
|
|
|
|
TBOX.RUN.QUIT lda #3 User Interrupt
|
2023-02-07 07:04:23 +00:00
|
|
|
|
sec
|
2021-12-02 21:28:26 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.RUN.Home ldy #S.TBOX.DocX
|
2023-03-26 17:42:38 +00:00
|
|
|
|
jsr OBJ.ZeroWordAtY
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
ldy #S.TBOX.DocY
|
|
|
|
|
jsr OBJ.ZeroWordAtY
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.BufPtr
|
2023-03-26 17:42:38 +00:00
|
|
|
|
jsr OBJ.ZeroWordAtY
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
jmp TBOX.CheckViewPort
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.RUN.EraseCL
|
2023-03-26 17:42:38 +00:00
|
|
|
|
jsr TBOX.GetDocYInAX
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr TBOX.GetLineAX
|
|
|
|
|
jsr TBOX.GetLineLenInAXC
|
|
|
|
|
jsr TBOX.DeleteAXC
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jmp TBOX.RUN.VT1
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.RUN.EOF lda #$ff
|
|
|
|
|
tax
|
|
|
|
|
jsr TBOX.GetLineAX
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.DocY
|
|
|
|
|
lda TempI
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
tax
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
lda TempI+1
|
2023-02-07 07:04:23 +00:00
|
|
|
|
iny
|
2021-12-02 21:28:26 +00:00
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
jsr TBOX.GetLineAX
|
|
|
|
|
jsr TBOX.GetLineLenInAXC
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.DocX
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
iny
|
|
|
|
|
txa
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.BufCnt+1
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
dey
|
2021-09-07 12:32:31 +00:00
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
ldy #S.TBOX.BufPtr
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
iny
|
|
|
|
|
txa
|
2023-02-07 07:04:23 +00:00
|
|
|
|
sta (ZPObjPtr),y
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
jmp TBOX.CheckViewPort
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.DrawAllLines
|
|
|
|
|
ldy #1 hObj
|
|
|
|
|
lda (pStack),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
|
|
|
|
|
jsr OBJ.Draw.Body
|
|
|
|
|
inc pStack
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2023-02-07 07:04:23 +00:00
|
|
|
|
TBOX.DrawBottom ldy #S.OBJ.InnerY
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.CurY
|
|
|
|
|
adc (ZPObjPtr),y
|
|
|
|
|
>PUSHA Start
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.InnerH
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
sec
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.CurY
|
|
|
|
|
sbc (ZPObjPtr),y
|
|
|
|
|
>PUSHA Count
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.CurY
|
|
|
|
|
lda (ZPObjPtr),y Relative Y
|
|
|
|
|
>PUSHA
|
|
|
|
|
|
|
|
|
|
jmp OBJ.Draw.Lines
|
|
|
|
|
*--------------------------------------
|
2023-01-31 06:55:01 +00:00
|
|
|
|
TBOX.DrawCurLine
|
|
|
|
|
ldy #S.OBJ.InnerY
|
|
|
|
|
lda (ZPObjPtr),y
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
clc
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
ldy #S.OBJ.CurY
|
|
|
|
|
adc (ZPObjPtr),y
|
|
|
|
|
>PUSHA Start
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
lda #1
|
|
|
|
|
>PUSHA Count
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.CurY
|
|
|
|
|
lda (ZPObjPtr),y Relative Y
|
|
|
|
|
>PUSHA
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
jmp OBJ.Draw.Lines
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
2023-03-26 17:42:38 +00:00
|
|
|
|
* hyperlinks: [[text to show]targetUrl]
|
2023-02-10 18:19:29 +00:00
|
|
|
|
*--------------------------------------
|
2021-12-02 21:28:26 +00:00
|
|
|
|
TBOX.Draw ldy #S.TBOX.VScroll
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
clc
|
|
|
|
|
adc (pStack) Relative Y
|
2021-09-07 12:32:31 +00:00
|
|
|
|
tax
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
iny
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
adc #0
|
|
|
|
|
|
|
|
|
|
jsr TBOX.GetLineAX
|
|
|
|
|
bcs .5
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.HScroll
|
|
|
|
|
lda (ZPObjPtr),y
|
2023-02-07 07:04:23 +00:00
|
|
|
|
beq .12
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
.1 jsr TBOX.GetLineChar
|
2023-02-07 07:04:23 +00:00
|
|
|
|
beq .5
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
cmp #C.CR
|
2023-02-07 07:04:23 +00:00
|
|
|
|
beq .5
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2021-09-07 12:32:31 +00:00
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.12 ldy #S.OBJ.InnerW
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
stz bTemp1 reset selection
|
|
|
|
|
stz bTemp2 reset Hyperlink
|
2023-02-10 18:19:29 +00:00
|
|
|
|
|
|
|
|
|
.2 jsr TBOX.CheckSel
|
|
|
|
|
|
|
|
|
|
jsr TBOX.GetLineChar
|
2021-12-02 21:28:26 +00:00
|
|
|
|
beq .3
|
|
|
|
|
|
|
|
|
|
cmp #C.CR
|
|
|
|
|
beq .3
|
|
|
|
|
|
|
|
|
|
jsr LB.COut
|
|
|
|
|
dex
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
.3 txa
|
|
|
|
|
bne .6
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2021-09-07 12:32:31 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
.5 ldy #S.OBJ.InnerW
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
|
2023-02-10 18:19:29 +00:00
|
|
|
|
.6 jsr TBOX.ResetSel
|
|
|
|
|
|
|
|
|
|
lda #C.SPACE
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
.7 jsr LB.COut
|
|
|
|
|
dex
|
|
|
|
|
bne .7
|
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
2021-09-07 12:32:31 +00:00
|
|
|
|
*--------------------------------------
|
2023-02-07 07:04:23 +00:00
|
|
|
|
TBOX.Activate
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.Deactivate clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2023-03-26 17:42:38 +00:00
|
|
|
|
TBOX.SetProp jsr OBJ.SetProp
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
cpy #S.OBJ.pBuf
|
|
|
|
|
bne .8
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.DocX
|
|
|
|
|
lda #0
|
|
|
|
|
|
|
|
|
|
.1 sta (ZPObjPtr),y
|
|
|
|
|
iny
|
|
|
|
|
cpy #S.TBOX.BufPtr+2
|
|
|
|
|
bcc .1
|
|
|
|
|
|
|
|
|
|
jsr OBJ.GetBuf
|
|
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
.2 lda (ZPPtr1),y
|
|
|
|
|
beq .3
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
inx
|
|
|
|
|
bra .2
|
|
|
|
|
|
|
|
|
|
.3 tya
|
|
|
|
|
ldy #S.TBOX.BufCnt
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
iny
|
|
|
|
|
txa
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
jmp OBJ.Draw.Body.I
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2022-09-04 20:12:49 +00:00
|
|
|
|
TBOX.GetBuf jsr OBJ.GetBuf
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.BufPtr
|
2022-09-04 20:12:49 +00:00
|
|
|
|
lda ZPPtr1
|
2021-09-07 12:32:31 +00:00
|
|
|
|
clc
|
|
|
|
|
adc (ZPObjPtr),y
|
2021-12-02 21:28:26 +00:00
|
|
|
|
sta ZPPtr2
|
2022-09-04 20:12:49 +00:00
|
|
|
|
|
|
|
|
|
lda ZPPtr1+1
|
2021-12-02 21:28:26 +00:00
|
|
|
|
iny
|
|
|
|
|
adc (ZPObjPtr),y
|
|
|
|
|
sta ZPPtr2+1
|
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2023-03-26 17:42:38 +00:00
|
|
|
|
TBOX.GetDocYInAX
|
2021-12-02 21:28:26 +00:00
|
|
|
|
ldy #S.TBOX.DocY
|
|
|
|
|
lda (ZPObjPtr),y
|
2021-09-07 12:32:31 +00:00
|
|
|
|
tax
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
iny
|
2021-09-07 12:32:31 +00:00
|
|
|
|
lda (ZPObjPtr),y
|
2021-12-02 21:28:26 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.GetLineAX stx TempW
|
|
|
|
|
sta TempW+1 Req Line Num
|
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
jsr OBJ.GetBuf get pBuf in ZPPtr1
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
stz TempI Current Line Num
|
|
|
|
|
stz TempI+1
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
stz TempC Buffer Ofs
|
|
|
|
|
stz TempC+1
|
|
|
|
|
|
|
|
|
|
.1 lda TempI
|
|
|
|
|
eor TempW
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
lda TempI+1
|
|
|
|
|
eor TempW+1
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
.2 lda (ZPPtr1)
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
jsr TBOX.GetLineLenInAXC
|
|
|
|
|
bcc .9
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
* sec
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
adc TempC
|
|
|
|
|
sta TempC
|
|
|
|
|
txa
|
|
|
|
|
adc TempC+1
|
|
|
|
|
sta TempC+1
|
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
sec
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
pla
|
|
|
|
|
|
|
|
|
|
adc ZPPtr1
|
|
|
|
|
sta ZPPtr1
|
|
|
|
|
txa
|
|
|
|
|
adc ZPPtr1+1
|
|
|
|
|
sta ZPPtr1+1
|
|
|
|
|
|
|
|
|
|
inc TempI
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
inc TempI+1
|
|
|
|
|
bra .1
|
|
|
|
|
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
2021-09-07 12:32:31 +00:00
|
|
|
|
*--------------------------------------
|
2023-03-26 17:42:38 +00:00
|
|
|
|
TBOX.SetLineAtDocX
|
|
|
|
|
ldy #S.TBOX.DocX
|
2021-12-02 21:28:26 +00:00
|
|
|
|
lda (ZPObjPtr),y
|
2023-03-26 17:42:38 +00:00
|
|
|
|
clc
|
|
|
|
|
adc ZPPtr1
|
|
|
|
|
sta ZPPtr1
|
2023-02-10 18:19:29 +00:00
|
|
|
|
iny
|
|
|
|
|
lda (ZPObjPtr),y
|
2023-03-26 17:42:38 +00:00
|
|
|
|
adc ZPPtr1+1
|
|
|
|
|
sta ZPPtr1+1
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
* clc
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
dey #S.TBOX.DocX
|
2023-02-10 18:19:29 +00:00
|
|
|
|
lda (ZPObjPtr),y
|
2023-03-26 17:42:38 +00:00
|
|
|
|
adc TempC
|
|
|
|
|
sta TempC
|
2023-02-10 18:19:29 +00:00
|
|
|
|
iny
|
|
|
|
|
lda (ZPObjPtr),y
|
2023-03-26 17:42:38 +00:00
|
|
|
|
adc TempC+1
|
|
|
|
|
sta TempC+1
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* TempC charPos
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.CheckSel ldy #S.TBOX.SelBegin
|
|
|
|
|
jsr TBOX.CmpTempCAtY
|
|
|
|
|
bcc TBOX.ResetSel
|
|
|
|
|
|
|
|
|
|
iny #S.TBOX.SelEnd
|
|
|
|
|
jsr TBOX.CmpTempCAtY
|
|
|
|
|
bcs TBOX.ResetSel
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.SetSel bit bTemp1
|
|
|
|
|
bmi .8
|
2023-02-10 18:19:29 +00:00
|
|
|
|
|
|
|
|
|
phx
|
2023-03-26 17:42:38 +00:00
|
|
|
|
ldx #SEQ.INVERSE-SEQS
|
2023-02-10 18:19:29 +00:00
|
|
|
|
jsr LB.SeqOut
|
|
|
|
|
plx
|
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
dec bTemp1
|
|
|
|
|
|
2023-02-10 18:19:29 +00:00
|
|
|
|
.8 rts
|
|
|
|
|
*--------------------------------------
|
2023-03-26 17:42:38 +00:00
|
|
|
|
TBOX.ResetSel bit bTemp1
|
2023-02-10 18:19:29 +00:00
|
|
|
|
bpl .8
|
|
|
|
|
|
|
|
|
|
phx
|
|
|
|
|
ldx #SEQ.NORMAL-SEQS
|
|
|
|
|
jsr LB.SeqOut
|
|
|
|
|
plx
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
stz bTemp1
|
|
|
|
|
|
2023-02-10 18:19:29 +00:00
|
|
|
|
.8 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.GetLineChar
|
2023-03-26 17:42:38 +00:00
|
|
|
|
ldy #S.OBJ.F
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
and #S.OBJ.F.bEdit
|
|
|
|
|
bne TBOX.GetChar
|
|
|
|
|
|
|
|
|
|
bit bTemp2
|
|
|
|
|
bmi .1
|
|
|
|
|
|
|
|
|
|
jsr TBOX.GetChar
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
cmp #'['
|
|
|
|
|
bne .8 NZ
|
|
|
|
|
|
|
|
|
|
cmp (ZPPtr1) "[["
|
|
|
|
|
bne .8 NZ
|
|
|
|
|
|
|
|
|
|
dec bTemp2
|
|
|
|
|
rts NZ
|
|
|
|
|
|
|
|
|
|
.1 jsr TBOX.GetChar
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
cmp #'['
|
|
|
|
|
beq .1 skip 2nd [
|
|
|
|
|
|
|
|
|
|
cmp #']' "[[display]"
|
|
|
|
|
bne .8 NZ
|
|
|
|
|
|
|
|
|
|
stz bTemp2
|
|
|
|
|
|
|
|
|
|
.2 jsr TBOX.GetChar skip "link]"
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
cmp #']'
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
lda #']' NZ
|
|
|
|
|
|
|
|
|
|
.8 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.GetChar lda (ZPPtr1)
|
2021-12-02 21:28:26 +00:00
|
|
|
|
beq .8
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
inc ZPPtr1
|
2023-03-26 17:42:38 +00:00
|
|
|
|
bne .1
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
inc ZPPtr1+1
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
.1 inc TempC
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bne .8
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
inc TempC+1 NZ
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
.8 rts
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
2023-03-26 17:42:38 +00:00
|
|
|
|
TBOX.CmpTempCAtY
|
|
|
|
|
lda TempC
|
|
|
|
|
cmp (ZPObjPtr),y
|
|
|
|
|
lda TempC+1
|
|
|
|
|
iny
|
|
|
|
|
sbc (ZPObjPtr),y
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.SetTempCAtY
|
|
|
|
|
lda TempC
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
lda TempC+1
|
|
|
|
|
iny
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-12-02 21:28:26 +00:00
|
|
|
|
TBOX.GetLineLenInAXC
|
|
|
|
|
lda ZPPtr1+1
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
ldx #0
|
|
|
|
|
|
|
|
|
|
.1 lda (ZPPtr1),y
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
eor #C.CR
|
|
|
|
|
beq .7
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
inx
|
|
|
|
|
bra .1
|
|
|
|
|
|
|
|
|
|
.7 sec to skip CR
|
|
|
|
|
|
|
|
|
|
.8 pla
|
|
|
|
|
sta ZPPtr1+1
|
|
|
|
|
|
|
|
|
|
tya AX = len, CS if CR ended
|
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.ToBuf1 ldy #S.TBOX.BufCnt
|
|
|
|
|
lda (ZPObjPtr),y
|
2022-09-04 20:12:49 +00:00
|
|
|
|
ldy #S.OBJ.BufSize
|
2021-12-02 21:28:26 +00:00
|
|
|
|
cmp (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.BufCnt+1
|
|
|
|
|
lda (ZPObjPtr),y
|
2022-09-04 20:12:49 +00:00
|
|
|
|
ldy #S.OBJ.BufSize+1
|
2021-12-02 21:28:26 +00:00
|
|
|
|
sbc (ZPObjPtr),y
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
dey ldy #S.TBOX.BufCnt
|
|
|
|
|
|
|
|
|
|
jsr OBJ.IncWordAtY
|
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
jsr TBOX.GetBuf
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
jsr TBOX.Insert1
|
|
|
|
|
|
|
|
|
|
lda (pStack)
|
|
|
|
|
sta (ZPPtr2)
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.Insert1 lda #1
|
|
|
|
|
ldx #0
|
|
|
|
|
|
|
|
|
|
TBOX.InsertAX clc
|
|
|
|
|
adc ZPPtr2
|
|
|
|
|
sta ZPPtr3
|
|
|
|
|
txa
|
|
|
|
|
adc ZPPtr2+1
|
|
|
|
|
sta ZPPtr3+1
|
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
ldx #0
|
|
|
|
|
|
|
|
|
|
.1 lda (ZPPtr2),y
|
|
|
|
|
beq .4
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
inx
|
|
|
|
|
inc ZPPtr2+1
|
|
|
|
|
inc ZPPtr3+1
|
|
|
|
|
bra .1
|
|
|
|
|
|
|
|
|
|
.2 dex
|
|
|
|
|
|
|
|
|
|
.3 dey
|
|
|
|
|
|
|
|
|
|
lda (ZPPtr2),y
|
|
|
|
|
|
|
|
|
|
.4 sta (ZPPtr3),y
|
|
|
|
|
tya
|
|
|
|
|
bne .3
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
.8 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.Delete1 lda #1
|
|
|
|
|
ldx #0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
TBOX.DeleteAX clc
|
|
|
|
|
TBOX.DeleteAXC adc ZPPtr2
|
|
|
|
|
sta ZPPtr3
|
|
|
|
|
txa
|
|
|
|
|
adc ZPPtr2+1
|
|
|
|
|
sta ZPPtr3+1
|
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
.1 lda (ZPPtr3),y
|
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
inc ZPPtr3+1
|
|
|
|
|
inc ZPPtr2+1
|
|
|
|
|
bra .1
|
|
|
|
|
|
|
|
|
|
.8 rts
|
|
|
|
|
*--------------------------------------
|
2023-01-31 06:55:01 +00:00
|
|
|
|
TBOX.CheckViewPort
|
|
|
|
|
jsr TBOX.SetViewPort
|
|
|
|
|
bit bRepaintAll
|
|
|
|
|
bpl .8
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
jmp TBOX.DrawAllLines
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
.8 jmp OBJ.CurUpdPos
|
|
|
|
|
*--------------------------------------
|
2021-12-02 21:28:26 +00:00
|
|
|
|
TBOX.SetViewPort
|
2023-01-31 06:55:01 +00:00
|
|
|
|
stz bRepaintAll
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
ldy #S.TBOX.DocX+1
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.HScroll
|
|
|
|
|
sec
|
|
|
|
|
sbc (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.CurX set CurX = DocX - HScroll
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.HScroll+1
|
|
|
|
|
txa
|
|
|
|
|
sbc (ZPObjPtr),y DocX => HScroll ?
|
|
|
|
|
|
|
|
|
|
bcs .10 yes..
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.DocX+1 no, set HScroll = DocX
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.HScroll
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
iny
|
|
|
|
|
txa
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
lda #0 set CurX = 0
|
|
|
|
|
|
|
|
|
|
bra .20
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.10 ldy #S.TBOX.HScroll+1
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.InnerW
|
|
|
|
|
clc
|
|
|
|
|
adc (ZPObjPtr),y
|
|
|
|
|
bcc .11
|
|
|
|
|
|
|
|
|
|
inx
|
|
|
|
|
|
|
|
|
|
.11 ldy #S.TBOX.DocX (HScroll + InnerW) > (DocX + 1) ?
|
|
|
|
|
clc DocX+1
|
|
|
|
|
sbc (ZPObjPtr),y
|
|
|
|
|
iny
|
|
|
|
|
txa
|
|
|
|
|
sbc (ZPObjPtr),y
|
|
|
|
|
bcs .21 no...
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.InnerW yes, set HScroll = DocX - (InnerW - 1)
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
dec
|
|
|
|
|
sta TempW (InnerW - 1)
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.DocX
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
sec
|
|
|
|
|
sbc TempW
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
sbc #0
|
|
|
|
|
bcc .12 DocX - (InnerW - 1) < 0
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.HScroll+1
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
dey
|
|
|
|
|
txa
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
lda TempW set CurX = (InnerW - 1)
|
|
|
|
|
|
|
|
|
|
bra .20
|
|
|
|
|
|
|
|
|
|
.12 lda #0
|
|
|
|
|
ldy #S.TBOX.HScroll+1
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
dey
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
.20 ldy #S.OBJ.CurX
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
dec bRepaintAll
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.21 ldy #S.TBOX.DocY+1
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.VScroll
|
|
|
|
|
sec
|
|
|
|
|
sbc (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.CurY set CurY = DocY - VScroll
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.VScroll+1
|
|
|
|
|
txa
|
|
|
|
|
sbc (ZPObjPtr),y DocY => VScroll ?
|
|
|
|
|
bcs .30 yes..
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.DocY+1 no, set VScroll = DocY
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.VScroll
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
iny
|
|
|
|
|
txa
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
lda #0 set CurY = 0
|
|
|
|
|
|
|
|
|
|
bra .40
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.30 ldy #S.TBOX.VScroll+1
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.InnerH
|
|
|
|
|
clc
|
|
|
|
|
adc (ZPObjPtr),y
|
|
|
|
|
bcc .31
|
|
|
|
|
|
|
|
|
|
inx
|
|
|
|
|
|
|
|
|
|
.31 ldy #S.TBOX.DocY (VScroll + InnerH) > (DocY + 1) ?
|
|
|
|
|
clc DocY+1
|
|
|
|
|
sbc (ZPObjPtr),y
|
|
|
|
|
iny
|
|
|
|
|
txa
|
|
|
|
|
sbc (ZPObjPtr),y
|
|
|
|
|
bcs .41 no...
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.InnerH yes, set VScroll = DocY - (InnerH - 1)
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
dec
|
|
|
|
|
sta TempW (InnerH - 1)
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.DocY
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
sec
|
|
|
|
|
sbc TempW
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
sbc #0
|
|
|
|
|
bcc .32 DocY - (InnerH - 1) < 0
|
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.VScroll+1
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
dey
|
|
|
|
|
txa
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
lda TempW set CurY = (InnerH - 1)
|
|
|
|
|
|
|
|
|
|
bra .40
|
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
.32 ldy #S.TBOX.VScroll
|
|
|
|
|
jsr OBJ.ZeroWordAtY
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.TBOX.DocY
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
.40 ldy #S.OBJ.CurY
|
|
|
|
|
sta (ZPObjPtr),y
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2023-01-31 06:55:01 +00:00
|
|
|
|
dec bRepaintAll
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
.41 clc CLC RTS to jmp to
|
|
|
|
|
rts
|
2021-09-07 12:32:31 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE usr/src/lib/libtui.s.tbox
|
|
|
|
|
LOAD usr/src/lib/libtui.s
|
|
|
|
|
ASM
|