A2osX/LIB/LIBGUI.S.CB.txt
2022-10-26 08:12:16 +02:00

169 lines
2.6 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
*--------------------------------------
CB.ClearCache 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.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
*--------------------------------------
CB.FlushBufToYA ldx hCBBuf
beq .8
pha
phy
bit PTR.bVisible
bpl .1
jsr PTR.Hide.I
.1 lda #0
sta (ZPCBBufPtr)
lda hCBBuf
>SYSCALL2 GetMemPtr
>STYA ZPCBBufPtr
ply
pla
jsr OBJ.GetInCache
.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
bit PTR.bVisible
bpl .8
jmp PTR.Show.I
.8 clc
.9 rts
*--------------------------------------
CB.GFXWrite >PUSHB WND.Screen+S.OBJ.hPARENT
>PUSHBI IOCTL.WRITE
>PUSHW L.CB.Cache
>SYSCALL2 IOCTL
rts
*--------------------------------------
*--------------------------------------
MAN
SAVE usr/src/lib/libgui.s.cb
LOAD usr/src/lib/libgui.s
ASM