2021-12-02 21:28:26 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* CONT.New hCTX,F 2
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CONT.New jsr OBJ.Create A = Class
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>PULLA
|
|
|
|
|
ldy #S.OBJ.F
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
>PULLA
|
|
|
|
|
ldy #S.OBJ.hParent
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
>SYSCALL2 GetMemPtr
|
|
|
|
|
>STYA ZPPtr2
|
|
|
|
|
|
|
|
|
|
ldy #S.CTX.W
|
|
|
|
|
lda (ZPPtr2),y
|
|
|
|
|
ldy #S.OBJ.W
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
ldy #S.CTX.H
|
|
|
|
|
lda (ZPPtr2),y
|
|
|
|
|
ldy #S.OBJ.H
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
jmp OBJ.SetX2Y2
|
|
|
|
|
|
|
|
|
|
.9 >POP 2
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2023-02-10 18:19:29 +00:00
|
|
|
|
CONT.Insert >SYSCALL2 GetMemPtr A = hParent
|
|
|
|
|
>STYA ZPPtr2
|
2023-07-14 10:24:49 +00:00
|
|
|
|
|
2023-02-10 18:19:29 +00:00
|
|
|
|
ldy #S.OBJ.Childs
|
|
|
|
|
|
|
|
|
|
.1 lda (ZPPtr2),y
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
cpy #S.OBJ
|
|
|
|
|
bcc .1
|
|
|
|
|
|
|
|
|
|
lda #E.OOH
|
|
|
|
|
* sec
|
2021-12-02 21:28:26 +00:00
|
|
|
|
rts
|
2023-07-14 10:24:49 +00:00
|
|
|
|
|
|
|
|
|
.2 lda hObj
|
2023-02-10 18:19:29 +00:00
|
|
|
|
sta (ZPPtr2),y
|
2023-07-14 10:24:49 +00:00
|
|
|
|
|
2023-02-10 18:19:29 +00:00
|
|
|
|
ldy #S.OBJ.S
|
|
|
|
|
lda (ZPPtr2),y
|
|
|
|
|
ora #S.OBJ.S.bHasChilds
|
2023-07-14 10:24:49 +00:00
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
|
2023-02-10 18:19:29 +00:00
|
|
|
|
ldy #S.OBJ.InnerX
|
|
|
|
|
lda (ZPPtr2),y
|
2023-07-14 10:24:49 +00:00
|
|
|
|
|
2023-02-10 18:19:29 +00:00
|
|
|
|
ldy #S.OBJ.X1
|
|
|
|
|
clc
|
|
|
|
|
adc (ZPObjPtr),y
|
|
|
|
|
sta (ZPObjPtr),y
|
2023-07-14 10:24:49 +00:00
|
|
|
|
|
2023-02-10 18:19:29 +00:00
|
|
|
|
ldy #S.OBJ.InnerY
|
|
|
|
|
lda (ZPPtr2),y
|
2023-07-14 10:24:49 +00:00
|
|
|
|
|
2023-02-10 18:19:29 +00:00
|
|
|
|
ldy #S.OBJ.Y1
|
|
|
|
|
clc
|
|
|
|
|
adc (ZPObjPtr),y
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
jmp OBJ.SetX2Y2
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CONT.Run lda (pStack) Event
|
|
|
|
|
cmp #C.TAB
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
ldy #1
|
|
|
|
|
lda (pStack),y hObj
|
|
|
|
|
jsr OBJ.FindActive
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>PUSHA hActive
|
|
|
|
|
|
|
|
|
|
phy index
|
|
|
|
|
|
|
|
|
|
ldy #2
|
|
|
|
|
lda (pStack),y hObj
|
|
|
|
|
>SYSCALL2 GetMemPtr
|
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
|
|
|
|
|
.10 ply
|
|
|
|
|
|
|
|
|
|
.1 iny
|
|
|
|
|
cpy #S.OBJ
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.Childs
|
|
|
|
|
|
|
|
|
|
.2 lda (ZPPtr1),y
|
|
|
|
|
beq .1
|
|
|
|
|
|
|
|
|
|
cmp (pStack) same as hActive ?
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
phy
|
|
|
|
|
|
|
|
|
|
>SYSCALL2 GetMemPtr
|
|
|
|
|
>STYA ZPPtr2
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.S
|
|
|
|
|
lda (ZPPtr2),y
|
|
|
|
|
and #S.OBJ.S.bDisabled
|
|
|
|
|
bne .10
|
|
|
|
|
|
|
|
|
|
ply
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
.3 lda (pStack)
|
|
|
|
|
jsr OBJ.Deactivate
|
|
|
|
|
inc pStack discard old hActive
|
|
|
|
|
|
|
|
|
|
pla
|
|
|
|
|
>PUSHA new hActive
|
|
|
|
|
jsr OBJ.Activate2
|
|
|
|
|
|
|
|
|
|
.8 inc pStack discard hActive
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 lda #0
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CONT.Draw ldy #S.OBJ.InnerW
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
tax
|
|
|
|
|
lda #C.SPACE
|
|
|
|
|
|
|
|
|
|
.1 jsr LB.COut
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
2023-02-10 18:19:29 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE usr/src/lib/libtui.s.cont
|
|
|
|
|
LOAD usr/src/lib/libtui.s
|
|
|
|
|
ASM
|