mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-06 01:07:32 +00:00
88 lines
1.5 KiB
Plaintext
88 lines
1.5 KiB
Plaintext
NEW
|
||
AUTO 3,1
|
||
*--------------------------------------
|
||
MOU.Init
|
||
.1 >PUSHBI 0
|
||
>LDYA L.DEVNAME.MOUSE
|
||
>SYSCALL2 open
|
||
bcc .2
|
||
|
||
inc DEVNAME.MOUSE+8
|
||
lda DEVNAME.MOUSE+8
|
||
cmp #'8'
|
||
bne .1
|
||
|
||
rts
|
||
|
||
.2 sta hDevMouse
|
||
|
||
clc
|
||
rts
|
||
*--------------------------------------
|
||
MOU.Setup lda DCB.GFX+S.DCB.GFX.W+1
|
||
sta MouseClamp+3
|
||
lsr
|
||
sta CUR.Pos+S.POINT.X+1
|
||
lda DCB.GFX+S.DCB.GFX.W
|
||
sta MouseClamp+2
|
||
ror
|
||
sta CUR.Pos+S.POINT.X
|
||
lda DCB.GFX+S.DCB.GFX.H+1
|
||
sta MouseClamp+7
|
||
lsr
|
||
sta CUR.Pos+S.POINT.Y+1
|
||
lda DCB.GFX+S.DCB.GFX.H
|
||
sta MouseClamp+6
|
||
ror
|
||
sta CUR.Pos+S.POINT.Y
|
||
|
||
>PUSHB hDevMouse
|
||
>PUSHBI IOCTL.CONTROL
|
||
>PUSHW L.MouseClamp
|
||
>SYSCALL2 IOCTL
|
||
bcs .9
|
||
|
||
>LDYA L.CUR.SaveBuf
|
||
>STYA CUR.CB+S.CB.DstPtr
|
||
|
||
* clc
|
||
.9 rts
|
||
*--------------------------------------
|
||
MOU.Quit lda hDevMouse
|
||
beq .8
|
||
|
||
>PUSHA
|
||
>PUSHBI IOCTL.CLOSE
|
||
>PUSHWZ
|
||
>SYSCALL2 IOCTL
|
||
|
||
.8 clc
|
||
rts
|
||
*--------------------------------------
|
||
MOU.ReadMouse >PULLYA
|
||
|
||
ldx A2osX.ASCREEN GUI screen active ?
|
||
cpx DCB.GFX+S.DCB.GFX.DEVID
|
||
bne .9 no, exit....
|
||
|
||
ldx hDevMouse
|
||
beq .9
|
||
pha
|
||
|
||
txa
|
||
|
||
>PUSHA
|
||
>PUSHBI IOCTL.READ
|
||
pla
|
||
>PUSHYA
|
||
>SYSCALL2 IOCTL
|
||
rts
|
||
|
||
.9 sec
|
||
rts
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE usr/src/lib/libgui.s.mou
|
||
LOAD usr/src/lib/libgui.s
|
||
ASM
|