A2osX/LIB/LIBGUI.S.MOU.txt
2019-01-04 13:17:31 +00:00

90 lines
1.5 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
PREFIX
AUTO 4,1
*--------------------------------------
MOU.Init
.1 >LDYA L.DEVNAME.MOUSE
>SYSCALL GetDevByName.YA
bcc .2
inc DEVNAME.MOUSE+3
lda DEVNAME.MOUSE+3
cmp #'8'
bne .1
clc
rts
.2 stx hDevMouse
txa
>PUSHA
>PUSHBI DEVMGR.OPEN
>PUSHWI 0
>SYSCALL IOCTL
lda GC.Screen+S.GC.X2+1
sta MouseClamp+3
lsr
sta CUR.Pos+S.POINT.X+1
lda GC.Screen+S.GC.X2
sta MouseClamp+2
ror
sta CUR.Pos+S.POINT.X
lda GC.Screen+S.GC.Y2+1
sta MouseClamp+7
lsr
sta CUR.Pos+S.POINT.Y+1
lda GC.Screen+S.GC.Y2
sta MouseClamp+6
ror
sta CUR.Pos+S.POINT.Y
>PUSHB.G hDevMouse
>PUSHBI DEVMGR.CONTROL
>PUSHWI L.MouseClamp
>SYSCALL IOCTL
>LDYA L.CUR.SaveBuf
>STYA CUR.CB+S.CB.DstPtr
lda #CUR.T.ARROW
jsr SetCursor.A
bra .8
sec
.9 rts
*--------------------------------------
MOU.Quit lda hDevMouse
beq .8
>PUSHA
>PUSHBI DEVMGR.CLOSE
>PUSHWI 0
>SYSCALL IOCTL
.8 clc
rts
*--------------------------------------
MOU.Read >STYA ZPPtr1
lda hDevMouse
beq .9
>PUSHA
>PUSHBI DEVMGR.READBLOCK
>PUSHW ZPPtr1
>SYSCALL IOCTL
bcs .9
.8 sec
.9 rts
*--------------------------------------
MAN
SAVE USR/SRC/LIB/LIBGUI.S.MOU
LOAD USR/SRC/LIB/LIBGUI.S
ASM