A2osX/LIB/LIBGUI.S.OBJ.txt

253 lines
4.0 KiB
Plaintext
Raw Normal View History

2020-10-26 06:38:50 +00:00
NEW
AUTO 3,1
*--------------------------------------
* A = Object Class
*--------------------------------------
OBJ.New pha
tax
ldy OBJ.SizeOf,x
lda #0
>SYSCALL GetMem
bcs .9
>STYA ZPObjPtr
pla
sta (ZPObjPtr)
phx hObj
tax
ldy OBJ.SizeOf,x
dey
lda #0
.1 sta (ZPObjPtr),y
dey
bne .1
>LDYA ZPObjPtr
* clc
.9 plx
rts
*--------------------------------------
2020-10-26 06:38:50 +00:00
* hOBJ, Prop8, Value16
*--------------------------------------
OBJ.SetProp ldy #3
lda (pStack),y hOBJ
>SYSCALL2 GetMemPtr
>STYA ZPObjPtr
ldy #2
lda (pStack),y
tay
lda (ZPObjPtr),y
pha old value
>PULLA
sta (ZPObjPtr),y
iny
lda (ZPObjPtr),y
tax
>PULLA
sta (ZPObjPtr),y
txa
ply
>RET 2
*--------------------------------------
* hOBJ, Prop8
*--------------------------------------
OBJ.GetProp >PULLA
pha
>PULLA
>SYSCALL2 GetMemPtr
>STYA ZPObjPtr
ply
lda (ZPObjPtr),y
pha
iny
lda (ZPObjPtr),y
ply
rts
*--------------------------------------
OBJ.SetX2Y2 >STYA ZPPtr1
ldy #S.OBJ.W
lda (ZPPtr1),y
clc
sbc #0
pha
iny
lda (ZPPtr1),y
sbc #0
tax
pla
clc
ldy #S.OBJ.X1
adc (ZPPtr1),y
pha
txa
iny
adc (ZPPtr1),y
ldy #S.OBJ.X2+1
sta (ZPPtr1),y
dey
pla
sta (ZPPtr1),y
ldy #S.OBJ.H
lda (ZPPtr1),y
clc
sbc #0
pha
iny
lda (ZPPtr1),y
sbc #0
tax
pla
clc
ldy #S.OBJ.Y1
adc (ZPPtr1),y
pha
txa
iny
adc (ZPPtr1),y
ldy #S.OBJ.Y2+1
sta (ZPPtr1),y
2022-10-25 06:05:54 +00:00
tax
dey
pla
2022-10-25 06:05:54 +00:00
sta (ZPPtr1),y A,X = Y2
rts
*--------------------------------------
OBJ.GetInCache >STYA .1+1
ldx #S.OBJ-1
.1 lda $ffff,x SELF MODIFIED
sta OBJ.Cache,x
dex
bpl .1
rts
2022-10-25 06:05:54 +00:00
*--------------------------------------
OBJ.DrawBorders >STYA ZPObjPtr
stx IY
lda #S.CB.CMD.HLINE
jsr CB.InitCacheA
lda #S.CB.OP.SET
sta CB.Cache+S.CB.OP
lda #S.CB.M.MONO
sta CB.Cache+S.CB.M
lda PREFS.BorderColor
sta CB.Cache+S.CB.COLOR
ldy #S.OBJ.X1
lda (ZPObjPtr),y
sec
sbc IY
sta CB.Cache+S.CB.X1
iny
lda (ZPObjPtr),y
sbc #0
sta CB.Cache+S.CB.X1+1
iny #S.OBJ.Y1
lda (ZPObjPtr),y
sec
sbc IY
sta CB.Cache+S.CB.Y1
sta CB.Cache+S.CB.Y2
iny
lda (ZPObjPtr),y
sbc #0
sta CB.Cache+S.CB.Y1+1
sta CB.Cache+S.CB.Y2+1 top X1-1,Y1-1,X2+1,Y1-1
iny #S.OBJ.X2
lda (ZPObjPtr),y
clc
adc IY
sta CB.Cache+S.CB.X2
iny
lda (ZPObjPtr),y
adc #0
sta CB.Cache+S.CB.X2+1
jsr CB.Cache2CBBuf
ldy #S.OBJ.Y2
lda (ZPObjPtr),y
clc
adc IY
sta CB.Cache+S.CB.Y1
sta CB.Cache+S.CB.Y2
iny
lda (ZPObjPtr),y
adc #0
sta CB.Cache+S.CB.Y1+1
sta CB.Cache+S.CB.Y2+1 bottom X1-1,Y2+1,X2+1,Y2+1
jsr CB.Cache2CBBuf
lda #S.CB.CMD.VLINE
sta CB.Cache+S.CB.CMD
ldy #S.OBJ.Y1
lda (ZPObjPtr),y
sec
sbc IY
sta CB.Cache+S.CB.Y1
iny
lda (ZPObjPtr),y
sbc #0
sta CB.Cache+S.CB.Y1+1
lda CB.Cache+S.CB.X1
sta CB.Cache+S.CB.X2
lda CB.Cache+S.CB.X1+1
sta CB.Cache+S.CB.X2+1 left X1-1,Y1-1,X1-1,Y2+1
jsr CB.Cache2CBBuf
ldy #S.OBJ.X2
lda (ZPObjPtr),y
clc
adc IY
sta CB.Cache+S.CB.X1
sta CB.Cache+S.CB.X2
iny
lda (ZPObjPtr),y
adc #0
sta CB.Cache+S.CB.X1+1
sta CB.Cache+S.CB.X2+1 right X2+1,Y1-1,X2+1,Y2+1
jmp CB.Cache2CBBuf
*-------------------------------------
*--------------------------------------
2020-10-26 06:38:50 +00:00
MAN
SAVE usr/src/lib/libgui.s.obj
LOAD usr/src/lib/libgui.s
ASM