A2osX/LIB/LIBGUI.S.CB.txt

333 lines
6.3 KiB
Plaintext
Raw Permalink Normal View History

2022-10-20 06:07:40 +00:00
NEW
AUTO 3,1
*--------------------------------------
CB.GetWndYCacheX
lda (ZPWNDPtr),y
sta CB.Cache,x
iny
lda (ZPWNDPtr),y
sta CB.Cache+1,x
rts
*--------------------------------------
CB.SwapX1X2 ldx CB.Cache+S.CB.X1
ldy CB.Cache+S.CB.X1+1
2022-11-02 06:54:30 +00:00
lda CB.Cache+S.CB.X2
sta CB.Cache+S.CB.X1
lda CB.Cache+S.CB.X2+1
sta CB.Cache+S.CB.X1+1
2022-10-20 06:07:40 +00:00
stx CB.Cache+S.CB.X2
sty CB.Cache+S.CB.X2+1
2022-10-20 06:07:40 +00:00
rts
*--------------------------------------
CB.SwapY1Y2 ldx CB.Cache+S.CB.Y1
ldy CB.Cache+S.CB.Y1+1
2022-10-20 06:07:40 +00:00
lda CB.Cache+S.CB.Y2
sta CB.Cache+S.CB.Y1
lda CB.Cache+S.CB.Y2+1
sta CB.Cache+S.CB.Y1+1
2022-10-20 06:07:40 +00:00
stx CB.Cache+S.CB.Y2
sty CB.Cache+S.CB.Y2+1
2022-10-20 06:07:40 +00:00
rts
*--------------------------------------
2022-10-27 15:14:06 +00:00
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
*--------------------------------------
2022-10-26 06:12:16 +00:00
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.PullY2X2Y1X1 ldx #7
bra CB.PullX
CB.PullY1X1 ldx #3
CB.PullX >PULLA
sta CB.Cache+S.CB.X1-1,x
>PULLA
sta CB.Cache+S.CB.X1,x
dex
dex
bpl CB.PullX
rts
**--------------------------------------
CB.X2ToX1 ldy CB.Cache+S.CB.X2
lda CB.Cache+S.CB.X2+1
sty CB.Cache+S.CB.X1
sta CB.Cache+S.CB.X1+1
rts
*--------------------------------------
CB.AddA2X1 clc
adc CB.Cache+S.CB.X1
sta CB.Cache+S.CB.X1
bcc .1
inc CB.Cache+S.CB.X1+1
.1 rts
*--------------------------------------
CB.IncY1 inc CB.Cache+S.CB.Y1
bne .1
inc CB.Cache+S.CB.Y1+1
.1 rts
*--------------------------------------
CB.DecY2 lda CB.Cache+S.CB.Y2
bne .1
dec CB.Cache+S.CB.Y2+1
.1 dec CB.Cache+S.CB.Y2
rts
*--------------------------------------
CB.GetObjX1Y1 ldy #S.OBJ.X1+3
ldx #3
bra CB.GetObjXY
*--------------------------------------
CB.GetObjX1Y1X2Y2
ldy #S.OBJ.X1+7
ldx #7
CB.GetObjXY lda (ZPObjPtr),y
sta CB.Cache+S.CB.X1,x
dey
dex
bpl CB.GetObjXY
rts
*--------------------------------------
CB.GetObjSrcWH ldy #S.OBJ.W+3 W,H
ldx #3
.1 lda (ZPObjPtr),y
sta CB.Cache+S.CB.SrcW,x
dey
dex
bpl .1
rts
*--------------------------------------
CB.ResetSrcXY ldx #4
.1 stz CB.Cache+S.CB.SrcX-1,x
dex
bne .1
rts
*--------------------------------------
CB.SrcWCenterH ldy #S.OBJ.W
lda (ZPObjPtr),y
sec
sbc CB.Cache+S.CB.SrcW
pha
iny
lda (ZPObjPtr),y
sbc CB.Cache+S.CB.SrcW+1
lsr
tax
pla
ror
*--------------------------------------
CB.AddAX2X1 clc
adc CB.Cache+S.CB.X1
sta CB.Cache+S.CB.X1
txa
adc CB.Cache+S.CB.X1+1
sta CB.Cache+S.CB.X1+1
rts
*--------------------------------------
2022-10-20 06:07:40 +00:00
CB.GetBuf clc
ldx hCBBuf
bne .9
>LDYAI 1024
2022-10-20 06:07:40 +00:00
>SYSCALL2 GetMem
bcs .9
stx hCBBuf
>STYA ZPCBBufPtr
.9 rts
*--------------------------------------
CB.Cache2CBBufG jsr CB.ToGlobal
*--------------------------------------
CB.Cache2CBBuf lda CB.Cache
2022-10-20 06:07:40 +00:00
lsr
tax
ldy CB.CmdLen-1,x
.1 lda CB.Cache,y
sta (ZPCBBufPtr),y
2022-10-20 06:07:40 +00:00
dey
bpl .1
*--------------------------------------
CB.BufNext lda (ZPCBBufPtr) Get Cmd
lsr
tax
lda CB.CmdLen-1,x
sec +1
adc ZPCBBufPtr
sta ZPCBBufPtr
bcc .1
2022-10-20 06:07:40 +00:00
inc ZPCBBufPtr+1
.1 rts
*--------------------------------------
* CLIP.Rect = Target Object
*--------------------------------------
CB.Write jsr PTR.Disable
jsr CB.GFXWriteClip
.8 jmp PTR.Enable
2022-10-20 06:07:40 +00:00
*--------------------------------------
2022-11-03 06:59:03 +00:00
* Y,A = Target Object
*--------------------------------------
CB.FlushBufToYA jsr CLIP.GetRect
2022-10-20 06:07:40 +00:00
CB.FlushBuf ldx hCBBuf
2022-11-02 16:00:52 +00:00
beq .8
2022-10-20 06:07:40 +00:00
jsr PTR.Disable
2022-11-02 16:00:52 +00:00
lda #0
2022-10-20 06:07:40 +00:00
sta (ZPCBBufPtr)
2022-10-25 06:05:54 +00:00
lda hCBBuf
>SYSCALL2 GetMemPtr
>STYA ZPCBBufPtr
2022-11-02 16:00:52 +00:00
*--------------------------------------
.1 lda (ZPCBBufPtr) Get Cmd
2022-10-20 06:07:40 +00:00
beq .7
lsr
tax
ldy CB.CmdLen-1,x
.2 lda (ZPCBBufPtr),y
sta CB.Cache,y
dey
bpl .2
* lda (ZPCBBufPtr) A = CB.CMD
2022-10-20 06:07:40 +00:00
cmp #S.CB.CMD.DRAWTEXT2
bne .4
lda #S.CB.CMD.DRAWTEXT+S.CB.CMD.OSD
sta CB.Cache+S.CB.CMD
ldx #0 Select CB.Cache
jsr CB.GFXWriteX Direct Write (no clip)
2022-10-20 06:07:40 +00:00
bcs .9
jsr CB.GFXWriteClip
2022-10-20 06:07:40 +00:00
lda CB.Cache+S.CB.SrcPtr
2022-10-20 06:07:40 +00:00
>SYSCALL2 FreeStkObj
bra .5
*--------------------------------------
.4 jsr CB.GFXWriteClip
2022-10-20 06:07:40 +00:00
.5 jsr CB.BufNext
bra .1
2022-10-20 06:07:40 +00:00
.7 lda hCBBuf
stz hCBBuf
>SYSCALL2 FreeMem
2022-11-02 06:54:30 +00:00
jmp PTR.Enable
2022-10-20 06:07:40 +00:00
.8 clc
.9 rts
*--------------------------------------
CB.ToGlobal lda ZPWNDPtr
ldx ZPWNDPtr+1
2022-11-02 16:00:52 +00:00
.1 sta ZPPtr1
stx ZPPtr1+1
2022-11-02 16:00:52 +00:00
ldy #S.WND.InnerX1
2022-11-02 16:00:52 +00:00
ldx #S.CB.X1
jsr CB.AddPtr1YtoCBX
ldy #S.WND.InnerY1
ldx #S.CB.Y1
jsr CB.AddPtr1YtoCBX
ldy #S.WND.InnerX1
2022-11-02 16:00:52 +00:00
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
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
2022-10-20 06:07:40 +00:00
*--------------------------------------
* CB.Cache -> CLIP.Cache
*--------------------------------------
CB.GFXWriteClip jsr CLIP.CB.Cache
bcs CB.GFXWrite.9
CB.GFXWrite ldx #2 Select CLIP.Cache
*--------------------------------------
* X=0:CB.Cache, X=2:CLIP.Cache
*--------------------------------------
CB.GFXWriteX >PUSHB WND.Screen+S.OBJ.hPARENT
>PUSHBI IOCTL.WRITE
>PUSHW L.CB.Cache,x
>SYSCALL2 IOCTL
CB.GFXWrite.9 rts
*--------------------------------------
2022-10-20 06:07:40 +00:00
MAN
SAVE usr/src/lib/libgui.s.cb
LOAD usr/src/lib/libgui.s
ASM