2021-12-02 21:28:26 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
2024-01-20 13:13:22 +00:00
|
|
|
|
* CBOX.New hParent,X1,Y1,HK,EV,pLabel,pVar,F 10
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
2022-09-04 20:12:49 +00:00
|
|
|
|
CBOX.New lda #S.OBJ.T.CBOX
|
|
|
|
|
jsr OBJ.Create
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2024-01-20 13:13:22 +00:00
|
|
|
|
>PULLA
|
|
|
|
|
ldy #S.OBJ.F
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
ldy #S.OBJ.pVar
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr OBJ.PullWordY
|
|
|
|
|
|
|
|
|
|
ldy #S.CBOX.pLabel
|
|
|
|
|
jsr OBJ.PullWordY
|
|
|
|
|
stx ZPPtr1
|
|
|
|
|
sta ZPPtr1+1
|
|
|
|
|
|
|
|
|
|
>PULLA
|
|
|
|
|
ldy #S.CBOX.EV
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
>PULLA
|
|
|
|
|
ldy #S.CBOX.HotKey
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
ldy #$ff
|
|
|
|
|
|
|
|
|
|
.1 iny
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
tya
|
|
|
|
|
inc
|
|
|
|
|
inc
|
|
|
|
|
inc
|
|
|
|
|
inc
|
|
|
|
|
inc
|
|
|
|
|
ldy #S.OBJ.W
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.H
|
|
|
|
|
lda #1
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
jsr OBJ.PullY1X1hParent
|
|
|
|
|
|
2023-02-10 18:19:29 +00:00
|
|
|
|
jsr CONT.Insert
|
2022-09-04 20:12:49 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
lda hObj
|
|
|
|
|
* clc
|
|
|
|
|
rts
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2024-01-20 13:13:22 +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
|
|
|
|
*--------------------------------------
|
|
|
|
|
CBOX.Run ldy #S.BUT.HotKey
|
|
|
|
|
cmp (ZPObjPtr),y
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.S
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
bpl .9
|
|
|
|
|
|
|
|
|
|
lda (pStack) Event
|
|
|
|
|
|
|
|
|
|
cmp #C.SPACE
|
|
|
|
|
bne .9
|
|
|
|
|
|
2024-01-25 18:44:59 +00:00
|
|
|
|
.8 jsr OBJ.GetpVarPtr2
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2024-01-25 18:44:59 +00:00
|
|
|
|
lda (ZPPtr2)
|
2021-12-02 21:28:26 +00:00
|
|
|
|
eor #$ff
|
2024-01-25 18:44:59 +00:00
|
|
|
|
sta (ZPPtr2)
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
ldy #1 hObj
|
|
|
|
|
lda (pStack),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
jsr OBJ.Draw.Body
|
|
|
|
|
inc pStack
|
2024-01-20 13:13:22 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
ldy #S.CBOX.EV
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
* clc
|
2021-12-02 21:28:26 +00:00
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 lda #0
|
|
|
|
|
sec
|
2024-01-20 13:13:22 +00:00
|
|
|
|
.99 rts
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
2024-01-17 21:04:13 +00:00
|
|
|
|
CBOX.Draw ldx #'<'
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.S
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
php
|
|
|
|
|
bpl .10
|
|
|
|
|
|
|
|
|
|
ldx #'['
|
|
|
|
|
|
|
|
|
|
.10 txa
|
|
|
|
|
jsr LB.COut
|
|
|
|
|
|
2024-01-25 18:44:59 +00:00
|
|
|
|
jsr OBJ.GetpVarPtr2
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
ldx #C.SPACE
|
|
|
|
|
|
2024-01-25 18:44:59 +00:00
|
|
|
|
lda (ZPPtr2)
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bpl .11
|
|
|
|
|
|
|
|
|
|
ldx #'X'
|
|
|
|
|
|
|
|
|
|
.11 txa
|
|
|
|
|
jsr LB.COut
|
|
|
|
|
|
2024-01-17 21:04:13 +00:00
|
|
|
|
ldx #'>'
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
plp
|
|
|
|
|
bpl .12
|
|
|
|
|
|
|
|
|
|
ldx #']'
|
|
|
|
|
|
|
|
|
|
.12 txa
|
|
|
|
|
jsr LB.COut
|
|
|
|
|
|
|
|
|
|
lda #C.SPACE
|
|
|
|
|
jsr LB.COut
|
|
|
|
|
|
|
|
|
|
ldy #S.BUT.pLabel
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
sta ZPPtr1
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
sta ZPPtr1+1
|
|
|
|
|
|
|
|
|
|
.1 ldy #S.OBJ.InnerW
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
dex
|
|
|
|
|
dex
|
|
|
|
|
dex
|
|
|
|
|
dex
|
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
.2 lda (ZPPtr1),y
|
|
|
|
|
beq .3
|
|
|
|
|
|
|
|
|
|
jsr LB.COut
|
|
|
|
|
iny
|
|
|
|
|
dex
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
.3 txa
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
bra .6
|
|
|
|
|
|
|
|
|
|
.5 ldy #S.OBJ.InnerW
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
.6 lda #C.SPACE
|
|
|
|
|
|
|
|
|
|
.7 jsr LB.COut
|
|
|
|
|
dex
|
|
|
|
|
bne .7
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE usr/src/lib/libtui.s.cbox
|
|
|
|
|
LOAD usr/src/lib/libtui.s
|
|
|
|
|
ASM
|