2021-09-07 12:32:31 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
2021-12-02 21:28:26 +00:00
|
|
|
|
OBJ.New tax
|
|
|
|
|
jmp (J.ObjNew,x)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
OBJ.Create pha Type
|
|
|
|
|
tax
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
ldy OBJ.SIZES,x
|
|
|
|
|
lda #0
|
|
|
|
|
>SYSCALL2 GetMem
|
|
|
|
|
bcs .9
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
>STYA ZPObjPtr
|
|
|
|
|
|
|
|
|
|
stx hObj
|
|
|
|
|
|
|
|
|
|
pla
|
|
|
|
|
sta (ZPObjPtr)
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
ldy OBJ.SIZES,x
|
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
|
|
|
|
|
dey
|
|
|
|
|
|
|
|
|
|
.1 sta (ZPObjPtr),y
|
|
|
|
|
dey
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
lda hObj
|
|
|
|
|
* clc
|
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 plx
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
OBJ.PullWordY >PULLA
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
iny
|
|
|
|
|
>PULLA
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
OBJ.PullHW ldy #S.OBJ.H
|
|
|
|
|
>PULLA
|
|
|
|
|
sta (ZPObjPtr),y
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
dey
|
|
|
|
|
>PULLA
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
OBJ.PullY1X1hParent
|
|
|
|
|
>PULLA
|
|
|
|
|
ldy #S.OBJ.Y1
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
dey S.OBJ.X1
|
|
|
|
|
>PULLA
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
dey S.OBJ.hParent
|
|
|
|
|
>PULLA
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
OBJ.Insert >SYSCALL2 GetMemPtr A = hParent
|
|
|
|
|
>STYA ZPPtr2
|
|
|
|
|
|
2021-09-07 12:32:31 +00:00
|
|
|
|
ldy #S.OBJ.Childs
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.1 lda (ZPPtr2),y
|
|
|
|
|
beq .2
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
cpy #S.OBJ
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bcc .1
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
lda #E.OOH
|
|
|
|
|
* sec
|
|
|
|
|
rts
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
.2 lda hObj
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.InnerX
|
|
|
|
|
lda (ZPPtr2),y
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.X1
|
|
|
|
|
clc
|
|
|
|
|
adc (ZPObjPtr),y
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.InnerY
|
|
|
|
|
lda (ZPPtr2),y
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.Y1
|
|
|
|
|
clc
|
|
|
|
|
adc (ZPObjPtr),y
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
OBJ.SetX2Y2 ldy #S.OBJ.X1
|
|
|
|
|
jsr .7
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
ldy #S.OBJ.Y1
|
|
|
|
|
jsr .7
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
ldy #S.OBJ.F
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
and #S.OBJ.F.bHBorder
|
|
|
|
|
beq .1
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
ldy #S.OBJ.InnerX
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
inc
|
|
|
|
|
sta (ZPObjPtr),y
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
iny
|
|
|
|
|
iny
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
lda (ZPObjPtr),y S.OBJ.InnerW
|
|
|
|
|
dec
|
|
|
|
|
dec
|
|
|
|
|
sta (ZPObjPtr),y
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.1 ldx #0
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.F
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
bit #S.OBJ.F.bVBorder+S.OBJ.F.bTITLE
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
dex
|
|
|
|
|
|
|
|
|
|
.2 bit #S.OBJ.F.bVBorder+S.OBJ.F.bSTATUS
|
|
|
|
|
beq .3
|
|
|
|
|
|
|
|
|
|
dex
|
|
|
|
|
|
|
|
|
|
.3 txa
|
|
|
|
|
beq .4
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
ldy #S.OBJ.InnerY
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
inc
|
2021-09-07 12:32:31 +00:00
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
txa
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
iny
|
|
|
|
|
iny
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
clc
|
|
|
|
|
adc (ZPObjPtr),y S.OBJ.InnerH
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
.4 ldy #S.OBJ.F
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
bit #S.OBJ.F.bMENU
|
|
|
|
|
beq .8
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
ldy #S.OBJ.InnerY
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
inc
|
2021-09-07 12:32:31 +00:00
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
|
|
|
|
|
lda (ZPObjPtr),y S.OBJ.InnerH
|
|
|
|
|
dec
|
2021-09-07 12:32:31 +00:00
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.8 lda hOBJ
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.7 lda (ZPObjPtr),y S.OBJ.X1/Y1
|
|
|
|
|
tax
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
iny
|
|
|
|
|
iny S.OBJ.W/H
|
|
|
|
|
phy
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
clc
|
|
|
|
|
adc (ZPObjPtr),y
|
|
|
|
|
dec
|
|
|
|
|
iny
|
|
|
|
|
iny S.OBJ.X2/Y2
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
sta (ZPObjPtr),y S.OBJ.InnerX/Y
|
|
|
|
|
|
|
|
|
|
ply S.OBJ.W/H
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
sta (ZPObjPtr),y S.OBJ.InnerW/H
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
rts
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
OBJ.Exec >PUSHA hOBJ
|
|
|
|
|
jsr LIB.GetOBJ
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
ldy #S.OBJ.hParent
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
jsr LIB.GetCTX
|
|
|
|
|
|
|
|
|
|
.1 jsr CTX.GetC
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
cmp #EV.RESIZE
|
|
|
|
|
clc
|
|
|
|
|
beq .99
|
|
|
|
|
|
|
|
|
|
tay
|
|
|
|
|
beq .1
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
>PUSHA
|
|
|
|
|
jsr OBJ.Run
|
|
|
|
|
inc pStack
|
|
|
|
|
|
|
|
|
|
tay
|
|
|
|
|
beq .1 no event, no error
|
|
|
|
|
|
|
|
|
|
.9 inc pStack
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.99 rts
|
2021-09-07 12:32:31 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
OBJ.Destroy ldx ZPObjPtr
|
|
|
|
|
phx
|
|
|
|
|
ldx ZPObjPtr+1
|
|
|
|
|
phx
|
|
|
|
|
|
|
|
|
|
pha
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LIB.GetOBJ
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.Childs
|
|
|
|
|
|
|
|
|
|
.1 lda (ZPObjPtr),y
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
phy
|
|
|
|
|
jsr OBJ.Destroy
|
|
|
|
|
ply
|
|
|
|
|
|
|
|
|
|
.2 iny
|
|
|
|
|
cpy #S.OBJ
|
|
|
|
|
bcc .1
|
|
|
|
|
|
|
|
|
|
pla
|
|
|
|
|
pha
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LIB.GetOBJ
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
jsr .7
|
|
|
|
|
|
|
|
|
|
pla
|
|
|
|
|
>SYSCALL2 FreeMem
|
|
|
|
|
|
|
|
|
|
plx
|
|
|
|
|
stx ZPObjPtr+1
|
|
|
|
|
plx
|
|
|
|
|
stx ZPObjPtr
|
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.7 lda (ZPObjPtr) S.OBJ.T
|
|
|
|
|
tax
|
|
|
|
|
jmp (J.ObjDestroy,x)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
OBJ.Run ldx ZPObjPtr
|
|
|
|
|
phx
|
|
|
|
|
ldx ZPObjPtr+1
|
|
|
|
|
phx
|
|
|
|
|
|
|
|
|
|
ldy #1
|
|
|
|
|
lda (pStack),y
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LIB.GetOBJ
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.S
|
|
|
|
|
lda (ZPObjPtr),y
|
2021-12-02 21:28:26 +00:00
|
|
|
|
and #S.OBJ.S.bDisabled
|
|
|
|
|
bne .9
|
|
|
|
|
|
2021-09-07 12:32:31 +00:00
|
|
|
|
ldy #1
|
|
|
|
|
lda (pStack),y hOBJ
|
|
|
|
|
>PUSHA
|
|
|
|
|
lda (pStack),y Event
|
|
|
|
|
>PUSHA
|
|
|
|
|
jsr .80
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
inc pStack
|
|
|
|
|
inc pStack
|
|
|
|
|
|
|
|
|
|
tax
|
|
|
|
|
bne .8 error / event
|
|
|
|
|
|
2021-09-07 12:32:31 +00:00
|
|
|
|
bcc .8
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.Childs
|
|
|
|
|
|
|
|
|
|
.1 lda (ZPObjPtr),y
|
|
|
|
|
beq .5
|
|
|
|
|
|
|
|
|
|
phy
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2021-09-07 12:32:31 +00:00
|
|
|
|
>PUSHA hChild
|
|
|
|
|
ldy #1
|
|
|
|
|
lda (pStack),y Event
|
|
|
|
|
>PUSHA
|
|
|
|
|
jsr OBJ.Run
|
|
|
|
|
|
|
|
|
|
ply
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
inc pStack
|
|
|
|
|
inc pStack
|
|
|
|
|
|
2021-09-07 12:32:31 +00:00
|
|
|
|
bcc .8
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
tax
|
|
|
|
|
bne .8
|
|
|
|
|
|
2021-09-07 12:32:31 +00:00
|
|
|
|
.5 iny
|
|
|
|
|
cpy #S.OBJ
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
.9 sec
|
2021-12-02 21:28:26 +00:00
|
|
|
|
lda #0
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
.8 plx
|
|
|
|
|
stx ZPObjPtr+1
|
|
|
|
|
plx
|
|
|
|
|
stx ZPObjPtr
|
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.80 lda (ZPObjPtr) S.OBJ.T
|
|
|
|
|
tax
|
|
|
|
|
jmp (J.ObjRun,x)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
OBJ.Draw >PUSHA hObj
|
|
|
|
|
|
|
|
|
|
jsr OBJ.Draw.Top
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
jsr OBJ.Draw.Body
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
jsr OBJ.Draw.Bottom
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
lda #S.OBJ.Childs
|
|
|
|
|
>PUSHA
|
|
|
|
|
|
|
|
|
|
.6 ldy #1
|
|
|
|
|
lda (pStack),y
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LIB.GetOBJ
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
lda (pStack)
|
|
|
|
|
tay
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
beq .7
|
|
|
|
|
|
|
|
|
|
jsr OBJ.Draw
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
.7 lda (pStack)
|
|
|
|
|
inc
|
|
|
|
|
sta (pStack)
|
|
|
|
|
cmp #S.OBJ
|
|
|
|
|
bne .6
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
|
|
|
|
|
.99 inc pStack
|
|
|
|
|
|
|
|
|
|
.9 inc pStack
|
|
|
|
|
|
|
|
|
|
OBJ.Draw.RTS rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
OBJ.Draw.Top lda (pStack)
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LIB.GetOBJ
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.F
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
and #S.OBJ.F.bTITLE+S.OBJ.F.bHBorder
|
|
|
|
|
* clc
|
|
|
|
|
beq OBJ.Draw.RTS
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.Init
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.X1
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
ldy #S.OBJ.Y1
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tay
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.GotoXY
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.F
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
and #S.OBJ.F.bVBorder
|
|
|
|
|
beq .1
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.SetColor
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldx #SEQ.BORDERTL-SEQS
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.SeqOut
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
.1 ldy #S.OBJ.F
|
|
|
|
|
lda (ZPObjPtr),y
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bpl .4 S.OBJ.F.bTITLE
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldx #SEQ.BAR-SEQS
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.SeqOut
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.InnerW
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.pTITLE
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
sta ZPPtr1
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
sta ZPPtr1+1
|
|
|
|
|
beq .3
|
|
|
|
|
|
|
|
|
|
lda #C.SI
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.COut
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
.2 lda (ZPPtr1),y
|
|
|
|
|
beq .3
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.COut
|
2021-09-07 12:32:31 +00:00
|
|
|
|
iny
|
|
|
|
|
dex
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
.3 txa
|
|
|
|
|
beq .31
|
|
|
|
|
|
|
|
|
|
lda #C.SPACE
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.30 jsr LB.COut
|
2021-09-07 12:32:31 +00:00
|
|
|
|
dex
|
|
|
|
|
bne .30
|
|
|
|
|
|
|
|
|
|
.31 ldx #SEQ.BAREND-SEQS
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.SeqOut
|
2021-09-07 12:32:31 +00:00
|
|
|
|
bra .6
|
|
|
|
|
|
|
|
|
|
.4 ldy #S.OBJ.InnerW
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
lda #'q'
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.5 jsr LB.COut
|
2021-09-07 12:32:31 +00:00
|
|
|
|
dex
|
|
|
|
|
bne .5
|
|
|
|
|
|
|
|
|
|
.6 ldy #S.OBJ.F
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
and #S.OBJ.F.bVBorder
|
|
|
|
|
beq .7
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.SetColor
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldx #SEQ.BORDERTR-SEQS
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.SeqOut
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.7 jmp LB.Out
|
2021-09-07 12:32:31 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
OBJ.Draw.Body lda (pStack)
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LIB.GetOBJ
|
|
|
|
|
|
|
|
|
|
jsr OBJ.CurOff
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.InnerY
|
|
|
|
|
lda (ZPObjPtr),y
|
2021-12-02 21:28:26 +00:00
|
|
|
|
>PUSHA Start
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.InnerH
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
>PUSHA Count
|
|
|
|
|
|
|
|
|
|
>PUSHBI 0 Relative Y
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.1 jsr LB.Init
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.X1
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
ldy #2 InnerY
|
|
|
|
|
lda (pStack),y
|
|
|
|
|
tay
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.GotoXY
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.SetColor
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.F
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
and #S.OBJ.F.bVBorder
|
|
|
|
|
php
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
ldx #SEQ.BORDERV-SEQS
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.SeqOut
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
.2 jsr OBJ.Draw.Body.JMP
|
|
|
|
|
|
|
|
|
|
ldx #SEQ.NORMAL-SEQS
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.SeqOut
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
plp
|
|
|
|
|
beq .4
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.X2
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
ldy #2 InnerY
|
|
|
|
|
lda (pStack),y
|
|
|
|
|
tay
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.GotoXY
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.SetColor
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldx #SEQ.BORDERV-SEQS
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.SeqOut
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.4 jsr LB.Out
|
2021-09-07 12:32:31 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
lda (pStack) Relative Y
|
|
|
|
|
inc
|
|
|
|
|
sta (pStack)
|
|
|
|
|
|
|
|
|
|
ldy #2 InnerY
|
|
|
|
|
lda (pStack),y
|
|
|
|
|
inc
|
|
|
|
|
sta (pStack),y
|
|
|
|
|
|
|
|
|
|
dey
|
|
|
|
|
|
|
|
|
|
lda (pStack),y Count
|
|
|
|
|
dec
|
|
|
|
|
sta (pStack),y
|
|
|
|
|
bne .1
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr OBJ.CurOn
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
.9 >POP 3
|
|
|
|
|
|
|
|
|
|
OBJ.Draw.Body.RTS
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
OBJ.Draw.Body.JMP
|
|
|
|
|
lda (ZPObjPtr)
|
|
|
|
|
tax
|
|
|
|
|
jmp (J.ObjDraw,x)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
OBJ.Draw.Bottom lda (pStack)
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LIB.GetOBJ
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.F
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
and #S.OBJ.F.bSTATUS+S.OBJ.F.bHBorder
|
|
|
|
|
* clc
|
|
|
|
|
beq OBJ.Draw.Body.RTS
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.Init
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.X1
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
ldy #S.OBJ.Y2
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tay
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.GotoXY
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.F
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
and #S.OBJ.F.bVBorder
|
|
|
|
|
beq .1
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.SetColor
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldx #SEQ.BORDERBL-SEQS
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.SeqOut
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
.1 ldy #S.OBJ.F
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
and #S.OBJ.F.bSTATUS
|
|
|
|
|
beq .4
|
|
|
|
|
|
|
|
|
|
ldx #SEQ.BAR-SEQS
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.SeqOut
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.InnerW
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.pSTATUS
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
sta ZPPtr1
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
sta ZPPtr1+1
|
|
|
|
|
beq .3
|
|
|
|
|
|
|
|
|
|
lda #C.SI
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.COut
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
.2 lda (ZPPtr1),y
|
|
|
|
|
beq .3
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.COut
|
2021-09-07 12:32:31 +00:00
|
|
|
|
iny
|
|
|
|
|
dex
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
.3 txa
|
|
|
|
|
beq .31
|
|
|
|
|
|
|
|
|
|
lda #C.SPACE
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.30 jsr LB.COut
|
2021-09-07 12:32:31 +00:00
|
|
|
|
dex
|
|
|
|
|
bne .30
|
|
|
|
|
|
|
|
|
|
.31 ldx #SEQ.BAREND-SEQS
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.SeqOut
|
2021-09-07 12:32:31 +00:00
|
|
|
|
bra .6
|
|
|
|
|
|
|
|
|
|
.4 ldy #S.OBJ.InnerW
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
lda #'q'
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.5 jsr LB.COut
|
2021-09-07 12:32:31 +00:00
|
|
|
|
dex
|
|
|
|
|
bne .5
|
|
|
|
|
|
|
|
|
|
.6 ldy #S.OBJ.F
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
and #S.OBJ.F.bVBorder
|
|
|
|
|
beq .7
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.SetColor
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldx #SEQ.BORDERBR-SEQS
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LB.SeqOut
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.7 jmp LB.Out
|
2021-09-07 12:32:31 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
OBJ.GetProp ldy #1 hObj
|
|
|
|
|
lda (pStack),y
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LIB.GetOBJ
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
>PULLA
|
|
|
|
|
tay prop
|
|
|
|
|
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
pha
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
ply
|
|
|
|
|
|
|
|
|
|
inc pStack
|
|
|
|
|
* clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
OBJ.SetProp ldy #3 hObj
|
|
|
|
|
lda (pStack),y
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr LIB.GetOBJ
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldy #2
|
|
|
|
|
lda (pStack),y
|
|
|
|
|
tay prop
|
|
|
|
|
|
|
|
|
|
>PULLA
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
iny
|
|
|
|
|
>PULLA
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
inc pStack
|
|
|
|
|
inc pStack
|
|
|
|
|
* clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-12-02 21:28:26 +00:00
|
|
|
|
OBJ.Activate >PUSHA hObj
|
|
|
|
|
jsr OBJ.FindActive
|
2021-09-07 12:32:31 +00:00
|
|
|
|
bcs .1
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
>PUSHA hObj
|
|
|
|
|
|
2021-09-07 12:32:31 +00:00
|
|
|
|
jsr OBJ.Deactivate
|
2021-12-02 21:28:26 +00:00
|
|
|
|
inc pStack
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.1 lda (pStack)
|
|
|
|
|
jsr OBJ.Activate2
|
|
|
|
|
inc pStack
|
|
|
|
|
clc
|
|
|
|
|
rts
|
2021-09-07 12:32:31 +00:00
|
|
|
|
*--------------------------------------
|
2021-12-02 21:28:26 +00:00
|
|
|
|
OBJ.Activate2 jsr LIB.GetOBJ
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.S
|
|
|
|
|
lda (ZPObjPtr),y
|
2021-12-02 21:28:26 +00:00
|
|
|
|
ora #S.OBJ.S.bActive
|
2021-09-07 12:32:31 +00:00
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
jsr .1
|
|
|
|
|
|
|
|
|
|
jmp OBJ.CurOn
|
|
|
|
|
|
|
|
|
|
.1 lda (ZPObjPtr)
|
2021-09-07 12:32:31 +00:00
|
|
|
|
tax
|
|
|
|
|
jmp (J.ObjActivate,x)
|
|
|
|
|
*--------------------------------------
|
2021-12-02 21:28:26 +00:00
|
|
|
|
OBJ.Deactivate jsr LIB.GetOBJ
|
|
|
|
|
|
|
|
|
|
jsr OBJ.CurOff
|
2021-09-07 12:32:31 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.S
|
|
|
|
|
lda (ZPObjPtr),y
|
2021-12-02 21:28:26 +00:00
|
|
|
|
and #S.OBJ.S.bActive^$ff
|
2021-09-07 12:32:31 +00:00
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
lda (ZPObjPtr)
|
|
|
|
|
tax
|
|
|
|
|
jmp (J.ObjDeactivate,x)
|
|
|
|
|
*--------------------------------------
|
2021-12-02 21:28:26 +00:00
|
|
|
|
OBJ.FindActive ldx ZPObjPtr
|
|
|
|
|
phx
|
|
|
|
|
ldx ZPObjPtr+1
|
|
|
|
|
phx
|
|
|
|
|
|
|
|
|
|
jsr LIB.GetOBJ
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.Childs
|
|
|
|
|
|
|
|
|
|
.1 phy
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
beq .7
|
|
|
|
|
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
>SYSCALL2 GetMemPtr
|
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
ldy #S.OBJ.S
|
|
|
|
|
lda (ZPPtr1),y S.OBJ.S.bActive
|
|
|
|
|
bmi .8
|
|
|
|
|
|
|
|
|
|
pla
|
|
|
|
|
|
|
|
|
|
.7 ply
|
|
|
|
|
iny
|
|
|
|
|
cpy #S.OBJ
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
* sec
|
|
|
|
|
bra .80
|
|
|
|
|
|
|
|
|
|
.8 pla
|
|
|
|
|
ply
|
|
|
|
|
clc
|
|
|
|
|
|
|
|
|
|
.80 plx
|
|
|
|
|
stx ZPObjPtr+1
|
|
|
|
|
plx
|
|
|
|
|
stx ZPObjPtr
|
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
OBJ.CurOn ldy #S.OBJ.F
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
and #S.OBJ.F.bCursor
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.S
|
|
|
|
|
lda (ZPObjPtr),y S.OBJ.S.bActive
|
|
|
|
|
bpl .8
|
|
|
|
|
|
|
|
|
|
bit #S.OBJ.S.bCurOn
|
|
|
|
|
bne .8
|
|
|
|
|
|
|
|
|
|
ora #S.OBJ.S.bCurOn
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
jsr LB.Init
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.InnerX
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
clc
|
|
|
|
|
ldy #S.OBJ.CurX
|
|
|
|
|
adc (ZPObjPtr),y
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.InnerY
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
clc
|
|
|
|
|
ldy #S.OBJ.CurY
|
|
|
|
|
adc (ZPObjPtr),y
|
|
|
|
|
tay
|
|
|
|
|
jsr LB.GotoXY
|
|
|
|
|
|
|
|
|
|
ldx #SEQ.CURON-SEQS
|
|
|
|
|
jsr LB.SeqOut
|
|
|
|
|
|
|
|
|
|
jsr LB.Out
|
|
|
|
|
|
|
|
|
|
.8 lda #0
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
OBJ.CurOff ldy #S.OBJ.F
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
and #S.OBJ.F.bCursor
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.S
|
|
|
|
|
lda (ZPObjPtr),y S.OBJ.S.bActive
|
|
|
|
|
bpl .8
|
|
|
|
|
|
|
|
|
|
bit #S.OBJ.S.bCurOn
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
eor #S.OBJ.S.bCurOn
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
jsr LB.Init
|
|
|
|
|
|
|
|
|
|
ldx #SEQ.CUROFF-SEQS
|
|
|
|
|
jsr LB.SeqOut
|
|
|
|
|
|
|
|
|
|
jmp LB.Out
|
|
|
|
|
|
|
|
|
|
.8 lda #0
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
OBJ.IncWordAtY lda (ZPObjPtr),y
|
|
|
|
|
inc
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
bne .8
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
inc
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
.8 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
OBJ.DecWordAtY clc
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
sbc #0
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
sbc #0
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
OBJ.GetLineXAtY lda (ZPObjPtr),y
|
|
|
|
|
sta ZPPtr1
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
sta ZPPtr1+1
|
|
|
|
|
|
|
|
|
|
stz TempI
|
|
|
|
|
|
|
|
|
|
.1 lda (ZPPtr1)
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
cpx TempI
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
.2 inc TempI
|
|
|
|
|
|
|
|
|
|
ldy #$ff
|
|
|
|
|
|
|
|
|
|
.4 iny
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
bne .4
|
|
|
|
|
|
|
|
|
|
tya
|
|
|
|
|
sec
|
|
|
|
|
adc ZPPtr1
|
|
|
|
|
sta ZPPtr1
|
|
|
|
|
bcc .1
|
|
|
|
|
|
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
bra .1
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-09-07 12:32:31 +00:00
|
|
|
|
MAN
|
|
|
|
|
SAVE usr/src/lib/libtui.s.obj
|
|
|
|
|
LOAD usr/src/lib/libtui.s
|
|
|
|
|
ASM
|