A2osX/LIB/LIBTUI.S.RADIO.txt

252 lines
3.3 KiB
Plaintext
Raw Normal View History

NEW
AUTO 3,1
.LIST OFF
*--------------------------------------
* RADIO.New hParent,X1,Y1,HK,EV,pList,pVar 9
*--------------------------------------
RADIO.New jsr OBJ.Create A = Class
bcs .9
ldy #S.RADIO.pVar
jsr OBJ.PullWordY
ldy #S.RADIO.pList
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
.2 iny
lda (ZPPtr1),y
bne .2
tya
sec
adc ZPPtr1
sta ZPPtr1
bcc .3
inc ZPPtr1+1
.3 tya
inc
inc
inc
inc
inc
ldy #S.OBJ.W
cmp (ZPObjPtr),y
bcc .4
sta (ZPObjPtr),y
.4 inx
lda (ZPPtr1)
bne .1
ldy #S.OBJ.H
txa
sta (ZPObjPtr),y
jsr OBJ.PullY1X1hParent
jmp OBJ.Insert
.9 >POP 9
rts
*--------------------------------------
RADIO.Destroy clc
rts
*--------------------------------------
RADIO.Run ldy #S.OBJ.S
lda (ZPObjPtr),y
bpl .9
lda (pStack) Event
cmp #C.SPACE
bne .2
ldy #S.RADIO.pVar
lda (ZPObjPtr),y
sta ZPPtr1
iny
lda (ZPObjPtr),y
sta ZPPtr1+1
ldy #S.RADIO.Idx
lda (ZPObjPtr),y
sta (ZPPtr1)
bra .7
.2 cmp #C.LF
bne .5
ldy #S.RADIO.Idx
lda (ZPObjPtr),y
inc
ldy #S.OBJ.InnerH
cmp (ZPObjPtr),y
bne .3
lda #0
.3 ldy #S.RADIO.Idx
sta (ZPObjPtr),y
bra .7
.5 cmp #C.VT
bne .9
ldy #S.RADIO.Idx
lda (ZPObjPtr),y
bne .6
ldy #S.OBJ.InnerH
lda (ZPObjPtr),y
.6 dec
ldy #S.RADIO.Idx
sta (ZPObjPtr),y
.7 ldy #1 hObj
lda (pStack),y
>PUSHA
jsr OBJ.Draw.Body
inc pStack
.8 clc
rts
.9 lda #0
sec
rts
*--------------------------------------
RADIO.Draw lda (pStack) Relative Y
tax
ldy #S.RADIO.pList
jsr OBJ.GetLineXAtY
bcs .8
ldy #S.RADIO.pVar
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
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
*--------------------------------------
RADIO.Activate
*--------------------------------------
RADIO.Deactivate
jmp OBJ.Draw.Body
*--------------------------------------
MAN
SAVE usr/src/lib/libtui.s.radio
LOAD usr/src/lib/libtui.s
ASM