mirror of
https://github.com/A2osX/A2osX.git
synced 2024-08-27 22:29:18 +00:00
90 lines
1.5 KiB
Plaintext
90 lines
1.5 KiB
Plaintext
NEW
|
||
PREFIX /A2OSX.BUILD
|
||
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
|
||
.9 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 /A2OSX.SRC/LIB/LIBGUI.S.MOU
|
||
LOAD /A2OSX.SRC/LIB/LIBGUI.S
|
||
ASM
|