A2osX/LIB/LIBGUI.S.PTR.txt

207 lines
3.5 KiB
Plaintext
Raw Normal View History

NEW
AUTO 3,1
*--------------------------------------
PTR.Update lda PTR.T
cmp #PTR.T.WAIT
bcc PTR.Set.RTS
inc
inc
cmp #PTR.T.WAIT+12
bne PTR.Set
lda #PTR.T.WAIT
*--------------------------------------
* Set SrcPtr, SrcW, SrcH
*--------------------------------------
PTR.Set sta PTR.T
2022-11-03 16:21:26 +00:00
jsr PTR.Disable
2022-11-03 16:21:26 +00:00
ldx PTR.T
lda L.Cursors,x
sta CB.PTR+S.CB.SrcPtr
sta ZPPtr1
lda L.Cursors+1,x
sta CB.PTR+S.CB.SrcPtr+1
sta ZPPtr1+1
ldy #S.BM.W+3
ldx #3
.1 lda (ZPPtr1),y
sta CB.PTR+S.CB.SrcW,x
dey
dex
bpl .1
bra PTR.Enable
PTR.Set.RTS rts
*--------------------------------------
PTR.SetRect >STYA ZPPtr1
jsr PTR.Disable
sec
ror PTR.T
ldy #7
.1 lda (ZPPtr1),y
sta PTR.Rect,y
dey
bpl .1
2022-11-03 16:21:26 +00:00
bra PTR.Enable
*--------------------------------------
* SetPos DestX,DestY
*--------------------------------------
PTR.SetPos >PULLW ZPPtr1
jsr PTR.Disable
.1 ldy #S.POINT-1
.2 lda (ZPPtr1),y
sta PTR.Pos,y
dey
bpl .2
2022-11-03 16:21:26 +00:00
*--------------------------------------
PTR.Enable bit PTR.bVisible
bmi PTR.Show.I
clc
rts
*--------------------------------------
2022-11-02 06:54:30 +00:00
PTR.Disable bit PTR.bVisible
bmi PTR.Hide.I
2022-11-03 16:21:26 +00:00
PTR.Disable.8 clc
2022-11-02 06:54:30 +00:00
rts
*--------------------------------------
PTR.Hide lda PTR.bVisible
2022-11-03 16:21:26 +00:00
bpl PTR.Disable.8
stz PTR.bVisible
2022-11-03 16:21:26 +00:00
*--------------------------------------
PTR.Hide.I bit PTR.T
bpl .1
jmp PTR.ShowRect.I
.1 lda #S.CB.OP.RESTORE
2022-11-03 16:21:26 +00:00
bra PTR.Draw.I
*--------------------------------------
PTR.Show lda PTR.bVisible
2022-11-03 16:21:26 +00:00
bmi PTR.Disable.8
dec PTR.bVisible
*--------------------------------------
PTR.Show.I ldx PTR.T
bpl .10
jmp PTR.ShowRect.I
.10 lda PTR.Pos+S.POINT.X
sec
sbc PTR.HotPoints,x
sta CB.PTR+S.CB.X1
lda PTR.Pos+S.POINT.X+1
sbc #0
sta CB.PTR+S.CB.X1+1
lda PTR.Pos+S.POINT.Y
sec
sbc PTR.HotPoints+1,x
sta CB.PTR+S.CB.Y1
lda PTR.Pos+S.POINT.Y+1
sbc #0
sta CB.PTR+S.CB.Y1+1
ldx CB.PTR+S.CB.SrcW+1
lda CB.PTR+S.CB.SrcW
bne .1
dex
.1 dec
clc
adc CB.PTR+S.CB.X1
sta CB.PTR+S.CB.X2
txa
adc CB.PTR+S.CB.X1+1
sta CB.PTR+S.CB.X2+1
ldx CB.PTR+S.CB.SrcH+1
lda CB.PTR+S.CB.SrcH
bne .2
dex
.2 dec
clc
adc CB.PTR+S.CB.Y1
sta CB.PTR+S.CB.Y2
txa
adc CB.PTR+S.CB.Y1+1
sta CB.PTR+S.CB.Y2+1
lda #S.CB.OP.ORA+S.CB.OP.MASK+S.CB.OP.SAVE
*--------------------------------------
PTR.Draw.I sta CB.PTR+S.CB.OP
ldx #S.CB
.1 lda CB.PTR-1,x
sta CLIP.Cache-1,x
dex
bne .1
* ldx #0 select CLIP.Sreen
jsr CLIP.BitBltX
bcs .8
jsr CB.GFXWrite
.8 clc
rts
*--------------------------------------
PTR.ShowRect.I lda #S.CB.CMD.HLINE
sta CLIP.Cache+S.CB.CMD
lda #S.CB.OP.XOR
sta CLIP.Cache+S.CB.OP
lda #S.CB.M.MONO
sta CLIP.Cache+S.CB.M
lda #C.WHITE
sta CLIP.Cache+S.CB.COLOR
>DEBUG
ldx #5 X1,Y1,X2
.1 lda PTR.Rect+S.RECT.X1,x
sta CLIP.Cache+S.CB.X1,x
dex
bpl .1
jsr .7
>LDYA PTR.Rect+S.RECT.Y2
>STYA CLIP.Cache+S.CB.Y1
.7
* ldx #0 select CLIP.Sreen
* jsr CLIP.HLine
2022-11-03 16:21:26 +00:00
* bcs .8
jsr CB.GFXWrite
.8 clc
rts
*--------------------------------------
MAN
SAVE usr/src/lib/libgui.s.ptr
LOAD usr/src/lib/libgui.s
ASM