A2osX/LIB/LIBGUI.S.CB.txt
2022-11-03 07:59:03 +01:00

246 lines
4.0 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
*--------------------------------------
CB.InitCacheA sta CB.Cache+S.CB.CMD
ldx #S.CB-1
.1 stz CB.Cache,x
dex
bne .1
rts
*--------------------------------------
CB.GetInCache >STYA .1+1
ldx #S.CB-1
.1 lda $ffff,x SELF MODIFIED
sta CB.Cache,x
dex
bpl .1
rts
*--------------------------------------
CB.GetWndYCacheX
lda (ZPWNDPtr),y
sta CB.Cache,x
iny
lda (ZPWNDPtr),y
sta CB.Cache+1,x
rts
*--------------------------------------
CB.BorderLineH lda #S.CB.CMD.HLINE
sta CB.Cache+S.CB.CMD
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
rts
*--------------------------------------
CB.FillRectMonoA
sta CB.Cache+S.CB.COLOR
lda #S.CB.CMD.FILLRECT
sta CB.Cache+S.CB.CMD
lda #S.CB.OP.SET
sta CB.Cache+S.CB.OP
lda #S.CB.M.MONO
sta CB.Cache+S.CB.M
rts
*--------------------------------------
CB.GetBuf clc
ldx hCBBuf
bne .9
>LDYAI 512
>SYSCALL2 GetMem
bcs .9
stx hCBBuf
>STYA ZPCBBufPtr
.9 rts
*--------------------------------------
CB.Cache2CBBuf
lda CB.Cache
lsr
tax
ldy CB.CmdLen-1,x
ldx #0
.1 lda CB.Cache,x
sta (ZPCBBufPtr)
inc ZPCBBufPtr
bne .2
inc ZPCBBufPtr+1
.2 inx
dey
bpl .1
rts
*--------------------------------------
* Y,A = Target Object
*--------------------------------------
CB.FlushBufToYA jsr CLIP.GetRect
lda hCBBuf
beq .8
lda #0
sta (ZPCBBufPtr)
lda hCBBuf
>SYSCALL2 GetMemPtr
>STYA ZPCBBufPtr
jsr PTR.Disable
*--------------------------------------
.2 lda (ZPCBBufPtr)
beq .7
>LDYA ZPCBBufPtr
jsr CB.GetInCache A = CB.CMD
cmp #S.CB.CMD.DRAWTEXT2
bne .4
lda #S.CB.CMD.DRAWTEXT+S.CB.CMD.OSD
sta CB.Cache+S.CB.CMD
jsr CB.GFXWrite
bcs .9
jsr CLIP.CB.Cache
bcs .3
jsr CB.GFXWrite
.3 lda CB.Cache+S.CB.SrcPtr
>SYSCALL2 FreeStkObj
bra .5
.4 jsr CLIP.CB.Cache
bcs .5
jsr CB.GFXWrite
.5 lda (ZPCBBufPtr) Get Cmd
lsr
tax
lda CB.CmdLen-1,x
sec +1
adc ZPCBBufPtr
sta ZPCBBufPtr
bcc .2
inc ZPCBBufPtr+1
bra .2
.7 lda hCBBuf
stz hCBBuf
>SYSCALL2 FreeMem
jmp PTR.Enable
.8 clc
.9 rts
*--------------------------------------
CB.GFXWrite >PUSHB WND.Screen+S.OBJ.hPARENT
>PUSHBI IOCTL.WRITE
>PUSHW L.CB.Cache
>SYSCALL2 IOCTL
rts
*--------------------------------------
CB.SetX2Y2 lda CB.Cache+S.CB.SrcW
clc
adc CB.Cache+S.CB.X1
pha
lda CB.Cache+S.CB.SrcW+1
adc CB.Cache+S.CB.X1+1
tax
pla
bne .2
dex
.2 dec
sta CB.Cache+S.CB.X2
stx CB.Cache+S.CB.X2+1
lda CB.Cache+S.CB.SrcH
clc
adc CB.Cache+S.CB.Y1
pha
lda CB.Cache+S.CB.SrcH+1
adc CB.Cache+S.CB.Y1+1
tax
pla
bne .3
dex
.3 dec
sta CB.Cache+S.CB.Y2
stx CB.Cache+S.CB.Y2+1
rts
*--------------------------------------
CB.ToGlobal >STYA ZPPtr1
.1 ldy #S.OBJ.X1
ldx #S.CB.X1
jsr CB.AddPtr1YtoCBX
ldy #S.WND.InnerY1
ldx #S.CB.Y1
jsr CB.AddPtr1YtoCBX
ldy #S.OBJ.X1
ldx #S.CB.X2
jsr CB.AddPtr1YtoCBX
ldy #S.WND.InnerY1
ldx #S.CB.Y2
jsr CB.AddPtr1YtoCBX
ldy #S.OBJ.hPARENT+1
lda (ZPPtr1),y
beq .8 00xx = hDev
tax
dey
lda (ZPPtr1),y
sta ZPPtr1
stx ZPPtr1+1
bra .1
.8 clc
rts
*--------------------------------------
CB.AddPtr1YtoCBX
lda (ZPPtr1),y
clc
adc CB.Cache,x
sta CB.Cache,x
iny
lda (ZPPtr1),y
adc CB.Cache+1,x
sta CB.Cache+1,x
rts
*--------------------------------------
MAN
SAVE usr/src/lib/libgui.s.cb
LOAD usr/src/lib/libgui.s
ASM