A2osX/LIB/LIBGUI.S.CUR.txt
2017-12-01 07:52:55 +01:00

126 lines
2.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.

PR#3
PREFIX /A2OSX.BUILD
NEW
INC 1
AUTO 6
.LIST OFF
*--------------------------------------
* Set X2,Y2,SrcPtr
*--------------------------------------
SetCursor.A sta CUR.T
lda CUR.bVisible
bpl .1
jsr HideCursor
.1 ldx CUR.T
lda L.Cursors,x
sta CUR.CB+S.CB.SrcPtr
sta ZPPtr1
lda L.Cursors+1,x
sta CUR.CB+S.CB.SrcPtr+1
sta ZPPtr1+1
ldy #S.BM.W
lda #-1
clc
adc (ZPPtr1),y
sta CUR.CB+S.CB.X2
iny
lda /-1
adc (ZPPtr1),y
sta CUR.CB+S.CB.X2+1
iny S.BM.H
lda #-1
clc
adc (ZPPtr1),y
sta CUR.CB+S.CB.Y2
iny
lda /-1
adc (ZPPtr1),y
sta CUR.CB+S.CB.Y2+1
lda CUR.bVisible
bmi ShowCursor
rts
*--------------------------------------
* Set DestX,DestY
*--------------------------------------
SetCursorPos >PULLW ZPPtr1
lda CUR.bVisible
bpl .1
jsr HideCursor
.1 ldy #S.RECT-1
.2 lda (ZPPtr1),y
sta CUR.Pos,y
dey
bpl .2
ldx CUR.T
lda CUR.Pos+S.RECT.X1
sec
sbc CUR.HotPoints,x
sta CUR.CB+S.CB.DestX
lda CUR.Pos+S.RECT.X1+1
sbc #0
sta CUR.CB+S.CB.DestX+1
lda CUR.Pos+S.RECT.Y1
sec
sbc CUR.HotPoints+1,x
sta CUR.CB+S.CB.DestY
lda CUR.Pos+S.RECT.Y1+1
sbc #0
sta CUR.CB+S.CB.DestY+1
lda CUR.bVisible
bmi ShowCursor
rts
*--------------------------------------
HideCursor lda CUR.bVisible
bpl .9
lda #S.CB.OP.RESTORE
sta CUR.CB+S.CB.OP
stz CUR.bVisible
.9 rts
*--------------------------------------
ShowCursor lda CUR.bVisible
bmi .9
lda #S.CB.OP.ORA+S.CB.OP.MASK+S.CB.OP.SAVE
sta CUR.CB+S.CB.OP
>LDYA L.CUR.CB
jsr GoDevGfx.YA
dec CUR.bVisible
.9 rts
*--------------------------------------
MAN
SAVE /A2OSX.SRC/LIB/LIBGUI.S.CUR
LOAD /A2OSX.SRC/LIB/LIBGUI.S
ASM