A2osX/LIB/LIBTUI.S.OBJ.txt

586 lines
8.3 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NEW
AUTO 3,1
.LIST OFF
*--------------------------------------
OBJ.New >PULLW ZPPtr1 Params
>PULLB TempW hParent
>SYSCALL2 GetMemPtr
>STYA ZPPtr2
ldy #S.OBJ.Childs
.10 lda (ZPPtr2),y
beq .11
iny
cpy #S.OBJ
bcc .10
lda #E.OOH
* sec
rts
.11 sty TempW+1
lda (ZPPtr1) S.OBJ.T
tax
ldy OBJ.SIZES,x
lda #0
>SYSCALL2 GetMem
bcs .9
>STYA ZPObjPtr
phx
ldy #0
.1 lda (ZPPtr1),y
sta (ZPObjPtr),y
iny
cpy #S.OBJ.H+1
bne .1
lda (ZPPtr1) S.OBJ.T
tax
ldy OBJ.SIZES,x
lda #0
.2 dey
sta (ZPObjPtr),y
cpy #S.OBJ.pTITLE
bne .2
lda TempW
ldy #S.OBJ.P
sta (ZPObjPtr),y
>LDYA ZPObjPtr
jsr LIB.SetObjX2Y2
pla
ldy TempW+1
sta (ZPPtr2),y
pha
jsr .7
bcs .99
pla
rts
.7 lda (ZPObjPtr) S.OBJ.T
tax
jmp (J.ObjNew,x)
.99 plx
.9 rts
*--------------------------------------
OBJ.Destroy ldx ZPObjPtr
phx
ldx ZPObjPtr+1
phx
pha
jsr LIB.GetObj
ldy #S.OBJ.Childs
.1 lda (ZPObjPtr),y
beq .2
phy
jsr OBJ.Destroy
ply
.2 iny
cpy #S.OBJ
bcc .1
pla
pha
jsr LIB.GetObj
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
jsr LIB.GetObj
ldy #S.OBJ.S
lda (ZPObjPtr),y
bpl .9 S.OBJ.S.bACTIVE
ldy #1
lda (pStack),y hOBJ
>PUSHA
lda (pStack),y Event
>PUSHA
jsr .80
bcc .8
ldy #S.OBJ.Childs
.1 lda (ZPObjPtr),y
beq .5
phy
>PUSHA hChild
ldy #1
lda (pStack),y Event
>PUSHA
jsr OBJ.Run
ply
bcc .8
.5 iny
cpy #S.OBJ
bne .1
.9 sec
.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
jsr LIB.GetObj
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)
jsr LIB.GetObj
ldy #S.OBJ.F
lda (ZPObjPtr),y
and #S.OBJ.F.bTITLE+S.OBJ.F.bHBorder
* clc
beq OBJ.Draw.RTS
jsr LIB.LineBufInit
ldy #S.OBJ.X1
lda (ZPObjPtr),y
tax
ldy #S.OBJ.Y1
lda (ZPObjPtr),y
tay
jsr LIB.GotoXY
ldy #S.OBJ.F
lda (ZPObjPtr),y
and #S.OBJ.F.bVBorder
beq .1
lda (ZPObjPtr)
jsr LIB.SetColor
ldx #SEQ.BORDERTL-SEQS
jsr LIB.LineBufSeqOut
.1 ldy #S.OBJ.F
lda (ZPObjPtr),y
bpl .4
ldx #SEQ.BAR-SEQS
jsr LIB.LineBufSeqOut
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
jsr LIB.LineBufCOut
ldy #0
.2 lda (ZPPtr1),y
beq .3
jsr LIB.LineBufCOut
iny
dex
bne .2
.3 txa
beq .31
lda #C.SPACE
.30 jsr LIB.LineBufCOut
dex
bne .30
.31 ldx #SEQ.BAREND-SEQS
jsr LIB.LineBufSeqOut
bra .6
.4 ldy #S.OBJ.InnerW
lda (ZPObjPtr),y
tax
lda #'q'
.5 jsr LIB.LineBufCOut
dex
bne .5
.6 ldy #S.OBJ.F
lda (ZPObjPtr),y
and #S.OBJ.F.bVBorder
beq .7
lda (ZPObjPtr)
jsr LIB.SetColor
ldx #SEQ.BORDERTR-SEQS
jsr LIB.LineBufSeqOut
.7 jmp LIB.LineBufOut
*--------------------------------------
OBJ.Draw.Body lda (pStack)
jsr LIB.GetObj
ldy #S.OBJ.InnerY
lda (ZPObjPtr),y
>PUSHA
ldy #S.OBJ.InnerH
lda (ZPObjPtr),y
>PUSHA Count
>PUSHBI 0 Relative Y
.1 jsr LIB.LineBufInit
ldy #3 hObj
lda (pStack),y
jsr LIB.GetObj
ldy #S.OBJ.X1
lda (ZPObjPtr),y
tax
ldy #2 InnerY
lda (pStack),y
tay
jsr LIB.GotoXY
lda (ZPObjPtr)
jsr LIB.SetColor
ldy #S.OBJ.F
lda (ZPObjPtr),y
and #S.OBJ.F.bVBorder
php
beq .2
ldx #SEQ.BORDERV-SEQS
jsr LIB.LineBufSeqOut
.2 jsr OBJ.Draw.Body.JMP
ldx #SEQ.NORMAL-SEQS
jsr LIB.LineBufSeqOut
plp
beq .4
ldy #S.OBJ.X2
lda (ZPObjPtr),y
tax
ldy #2 InnerY
lda (pStack),y
tay
jsr LIB.GotoXY
lda (ZPObjPtr)
jsr LIB.SetColor
ldx #SEQ.BORDERV-SEQS
jsr LIB.LineBufSeqOut
.4 jsr LIB.LineBufOut
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
* clc
.9 >POP 3
OBJ.Draw.Body.RTS
rts
*--------------------------------------
OBJ.Draw.Body.JMP
lda (ZPObjPtr)
tax
jmp (J.ObjDraw,x)
*--------------------------------------
OBJ.Draw.Bottom lda (pStack)
jsr LIB.GetObj
ldy #S.OBJ.F
lda (ZPObjPtr),y
and #S.OBJ.F.bSTATUS+S.OBJ.F.bHBorder
* clc
beq OBJ.Draw.Body.RTS
jsr LIB.LineBufInit
ldy #S.OBJ.X1
lda (ZPObjPtr),y
tax
ldy #S.OBJ.Y2
lda (ZPObjPtr),y
tay
jsr LIB.GotoXY
ldy #S.OBJ.F
lda (ZPObjPtr),y
and #S.OBJ.F.bVBorder
beq .1
lda (ZPObjPtr)
jsr LIB.SetColor
ldx #SEQ.BORDERBL-SEQS
jsr LIB.LineBufSeqOut
.1 ldy #S.OBJ.F
lda (ZPObjPtr),y
and #S.OBJ.F.bSTATUS
beq .4
ldx #SEQ.BAR-SEQS
jsr LIB.LineBufSeqOut
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
jsr LIB.LineBufCOut
ldy #0
.2 lda (ZPPtr1),y
beq .3
jsr LIB.LineBufCOut
iny
dex
bne .2
.3 txa
beq .31
lda #C.SPACE
.30 jsr LIB.LineBufCOut
dex
bne .30
.31 ldx #SEQ.BAREND-SEQS
jsr LIB.LineBufSeqOut
bra .6
.4 ldy #S.OBJ.InnerW
lda (ZPObjPtr),y
tax
lda #'q'
.5 jsr LIB.LineBufCOut
dex
bne .5
.6 ldy #S.OBJ.F
lda (ZPObjPtr),y
and #S.OBJ.F.bVBorder
beq .7
lda (ZPObjPtr)
jsr LIB.SetColor
ldx #SEQ.BORDERBR-SEQS
jsr LIB.LineBufSeqOut
.7 jmp LIB.LineBufOut
*--------------------------------------
OBJ.GetProp ldy #1 hObj
lda (pStack),y
jsr LIB.GetObj
>PULLA
tay prop
lda (ZPObjPtr),y
pha
iny
lda (ZPObjPtr),y
ply
inc pStack
* clc
rts
*--------------------------------------
OBJ.SetProp ldy #3 hObj
lda (pStack),y
jsr LIB.GetObj
ldy #2
lda (pStack),y
tay prop
>PULLA
sta (ZPObjPtr),y
iny
>PULLA
sta (ZPObjPtr),y
inc pStack
inc pStack
* clc
rts
*--------------------------------------
OBJ.Activate pha
jsr LIB.FindActive
bcs .1
jsr OBJ.Deactivate
.1 pla
*--------------------------------------
OBJ.Activate2 jsr LIB.GetObj
ldy #S.OBJ.S
lda (ZPObjPtr),y
ora #S.OBJ.S.bACTIVE
sta (ZPObjPtr),y
lda (ZPObjPtr)
tax
jmp (J.ObjActivate,x)
*--------------------------------------
OBJ.Deactivate jsr LIB.GetObj
ldy #S.OBJ.S
lda (ZPObjPtr),y
and #S.OBJ.S.bACTIVE^$ff
sta (ZPObjPtr),y
lda (ZPObjPtr)
tax
jmp (J.ObjDeactivate,x)
*--------------------------------------
MAN
SAVE usr/src/lib/libtui.s.obj
LOAD usr/src/lib/libtui.s
ASM