2021-12-02 21:28:26 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
2024-01-20 13:13:22 +00:00
|
|
|
|
* RADIO.New hParent,X1,Y1,HK,EV,pList,pVar,F 10
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
2022-09-04 20:12:49 +00:00
|
|
|
|
RADIO.New lda #S.OBJ.T.RADIO
|
|
|
|
|
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
|
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
ldy #S.OBJ.pBuf
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr OBJ.PullWordY
|
|
|
|
|
stx ZPPtr1
|
|
|
|
|
sta ZPPtr1+1
|
|
|
|
|
|
|
|
|
|
>PULLA
|
|
|
|
|
ldy #S.RADIO.EV
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
>PULLA
|
|
|
|
|
ldy #S.RADIO.HotKey
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
|
|
|
|
|
|
.1 ldy #$ff
|
2022-09-04 20:12:49 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.2 iny
|
|
|
|
|
lda (ZPPtr1),y
|
2022-09-04 20:12:49 +00:00
|
|
|
|
clc
|
|
|
|
|
beq .20
|
|
|
|
|
|
|
|
|
|
cmp #C.CR
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bne .2
|
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* sec
|
|
|
|
|
|
|
|
|
|
.20 tya
|
|
|
|
|
beq .5 empty line
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
adc ZPPtr1
|
|
|
|
|
sta ZPPtr1
|
|
|
|
|
bcc .3
|
|
|
|
|
|
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
|
|
|
|
|
.3 tya
|
2022-09-04 20:12:49 +00:00
|
|
|
|
clc
|
|
|
|
|
adc #5 room for " ( ) "
|
2021-12-02 21:28:26 +00:00
|
|
|
|
ldy #S.OBJ.W
|
|
|
|
|
cmp (ZPObjPtr),y
|
|
|
|
|
bcc .4
|
|
|
|
|
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
.4 inx
|
|
|
|
|
|
|
|
|
|
lda (ZPPtr1)
|
|
|
|
|
bne .1
|
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.5 ldy #S.OBJ.H
|
2021-12-02 21:28:26 +00:00
|
|
|
|
txa
|
|
|
|
|
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 .9
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
RADIO.Run ldy #S.OBJ.S
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
bpl .9
|
|
|
|
|
|
|
|
|
|
lda (pStack) Event
|
|
|
|
|
|
|
|
|
|
cmp #C.SPACE
|
|
|
|
|
bne .2
|
|
|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
|
.9 lda #0
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
RADIO.Draw lda (pStack) Relative Y
|
|
|
|
|
tax
|
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
ldy #S.OBJ.pBuf
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr OBJ.GetLineXAtY
|
|
|
|
|
bcs .8
|
|
|
|
|
|
2023-03-26 17:42:38 +00:00
|
|
|
|
ldy #S.OBJ.pVar
|
2021-12-02 21:28:26 +00:00
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
sta ZPPtr2
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
sta ZPPtr2+1
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
ldx #'('
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.S
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
bpl .10
|
|
|
|
|
|
|
|
|
|
ldy #S.RADIO.Idx
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
eor (pStack) Relative Y
|
|
|
|
|
bne .10
|
|
|
|
|
|
|
|
|
|
ldx #'['
|
|
|
|
|
sec
|
|
|
|
|
|
|
|
|
|
.10 php
|
|
|
|
|
txa
|
|
|
|
|
jsr LB.COut
|
|
|
|
|
|
|
|
|
|
lda (pStack)
|
|
|
|
|
cmp (ZPPtr2)
|
|
|
|
|
bne .11
|
|
|
|
|
|
|
|
|
|
lda #C.SO
|
|
|
|
|
jsr LB.COut
|
|
|
|
|
|
|
|
|
|
lda #'`'
|
|
|
|
|
jsr LB.COut
|
|
|
|
|
|
|
|
|
|
lda #C.SI
|
|
|
|
|
bra .13
|
|
|
|
|
|
|
|
|
|
.11 lda #C.SPACE
|
|
|
|
|
.13 jsr LB.COut
|
|
|
|
|
|
|
|
|
|
ldx #')'
|
|
|
|
|
|
|
|
|
|
plp
|
|
|
|
|
bcc .12
|
|
|
|
|
|
|
|
|
|
ldx #']'
|
|
|
|
|
|
|
|
|
|
.12 txa
|
|
|
|
|
jsr LB.COut
|
|
|
|
|
|
|
|
|
|
lda #C.SPACE
|
|
|
|
|
jsr LB.COut
|
|
|
|
|
|
|
|
|
|
.1 ldy #S.OBJ.InnerW
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
dex
|
|
|
|
|
dex
|
|
|
|
|
dex
|
|
|
|
|
dex
|
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
jsr LB.Ptr1OutEscMaxX
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
.3 txa
|
|
|
|
|
beq .8
|
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
lda #C.SPACE
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
.7 jsr LB.COut
|
|
|
|
|
dex
|
|
|
|
|
bne .7
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
RADIO.Activate
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
RADIO.Deactivate
|
|
|
|
|
jmp OBJ.Draw.Body
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE usr/src/lib/libtui.s.radio
|
|
|
|
|
LOAD usr/src/lib/libtui.s
|
|
|
|
|
ASM
|