mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-04 03:05:43 +00:00
379 lines
5.7 KiB
Plaintext
379 lines
5.7 KiB
Plaintext
NEW
|
||
AUTO 3,1
|
||
*--------------------------------------
|
||
MOU.Init >PUSHW L.DEVNAME.MOUSE
|
||
>PUSHBI 0
|
||
>SYSCALL2 open
|
||
bcc .2
|
||
|
||
inc DEVNAME.MOUSE+8
|
||
lda DEVNAME.MOUSE+8
|
||
cmp #'8'
|
||
bne MOU.Init
|
||
|
||
* sec
|
||
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 CB.PTR+S.CB.DstPtr
|
||
|
||
* clc
|
||
.9 rts
|
||
*--------------------------------------
|
||
MOU.Quit lda hDevMouse
|
||
beq .8
|
||
|
||
>PUSHA
|
||
>PUSHBI IOCTL.CLOSE
|
||
>PUSHWZ
|
||
>SYSCALL2 IOCTL
|
||
|
||
.8 clc
|
||
rts
|
||
*--------------------------------------
|
||
MOU.ReadMouse >PULLW ZPPtr1
|
||
|
||
lda A2osX.ASCREEN GUI screen active ?
|
||
cmp DCB.GFX+S.DCB.GFX.DEVID
|
||
bne .9 no, exit....
|
||
|
||
lda hDevMouse
|
||
beq .99 CS
|
||
|
||
>PUSHA
|
||
>PUSHBI IOCTL.READ
|
||
>PUSHW L.MouseData
|
||
>SYSCALL2 IOCTL
|
||
bcs .99
|
||
|
||
ldy #S.MOUSE-1
|
||
|
||
.1 lda MouseData,y
|
||
sta (ZPPtr1),y
|
||
dey
|
||
bpl .1
|
||
|
||
lda MouseData+S.MOUSE.S
|
||
bit #S.MOUSE.S.MOVE+S.MOUSE.S.CLK
|
||
beq .8
|
||
|
||
jsr MOU.CheckOverMenu
|
||
bcc .8
|
||
|
||
jsr MOU.CheckOverSysBut
|
||
bcc .8
|
||
|
||
jsr MOU.CheckOverWND
|
||
bcc .8
|
||
|
||
|
||
.8 clc
|
||
rts
|
||
|
||
.9 sec
|
||
.99 rts
|
||
*--------------------------------------
|
||
MOU.CheckOverMenu
|
||
.1 ldx MENU.Stack.Top
|
||
beq .9
|
||
|
||
lda MENU.Stack-1,x
|
||
|
||
>SYSCALL2 GetMemPtr
|
||
>STYA ZPMENUPtr
|
||
pha
|
||
tya
|
||
clc
|
||
adc #S.OBJ.X1
|
||
tay
|
||
pla
|
||
adc /S.OBJ.X1
|
||
jsr MOU.InRectYA
|
||
bcs .2
|
||
|
||
jsr MENU.Enter
|
||
clc
|
||
rts
|
||
|
||
.2 lda ZPMENUPtr
|
||
clc
|
||
adc #S.MENU.pX1
|
||
tay
|
||
lda ZPMENUPtr+1
|
||
adc /S.MENU.pX1
|
||
|
||
jsr MOU.InRectYA
|
||
bcc .8
|
||
|
||
jsr MENU.Destroy
|
||
|
||
bra .1
|
||
|
||
.9 sec
|
||
.8 rts
|
||
*--------------------------------------
|
||
MOU.CheckOverSysBut
|
||
>LDYA L.RECT.SysBut
|
||
jsr MOU.InRectYA
|
||
bcs .9
|
||
jmp SYSBUT.Enter
|
||
|
||
.9 jsr SYSBUT.Leave
|
||
sec
|
||
rts
|
||
*--------------------------------------
|
||
MOU.CheckOverWND
|
||
ldx WND.Stack.Top
|
||
beq .9
|
||
|
||
.1 stx WND.Stack.Idx
|
||
|
||
lda WND.Stack-1,x
|
||
>SYSCALL2 GetMemPtr
|
||
>STYA ZPWNDPtr
|
||
|
||
ldy #S.OBJ.F
|
||
lda (ZPWNDPtr),y
|
||
|
||
bit #S.WND.F.BORDER
|
||
beq .2
|
||
|
||
jsr MOU.ChkWNDBorders
|
||
bcc .99
|
||
|
||
.2 lda ZPWNDPtr
|
||
clc
|
||
adc #S.OBJ.X1
|
||
tay
|
||
lda ZPWNDPtr+1
|
||
adc #0
|
||
|
||
jsr MOU.InRectYA
|
||
bcs .7 not over this WND
|
||
|
||
lda MouseData+S.MOUSE.S
|
||
bit #S.MOUSE.S.CLK
|
||
beq .22
|
||
|
||
jsr WND.Bring2Front
|
||
|
||
.22 ldy #S.WND.TBarY2
|
||
lda (ZPWNDPtr),y
|
||
cmp MouseData+S.MOUSE.Y1
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sbc MouseData+S.MOUSE.Y1+1
|
||
bcc .3 not in TBAR
|
||
|
||
|
||
bra .5
|
||
|
||
.3 iny #S.WND.MBarY2
|
||
|
||
lda (ZPWNDPtr),y
|
||
cmp MouseData+S.MOUSE.Y1
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sbc MouseData+S.MOUSE.Y1+1
|
||
bcc .4 not in MBAR
|
||
|
||
|
||
|
||
bra .5
|
||
|
||
.4 iny #S.WND.SBarY1
|
||
|
||
lda (ZPWNDPtr),y
|
||
cmp MouseData+S.MOUSE.Y1
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sbc MouseData+S.MOUSE.Y1+1
|
||
bcs .6 not in SBAR
|
||
|
||
|
||
|
||
.5 lda #CUR.T.ARROW
|
||
jsr SetCursor
|
||
clc
|
||
rts
|
||
|
||
|
||
.6 lda #CUR.T.WAIT
|
||
jsr SetCursor
|
||
|
||
clc
|
||
rts
|
||
|
||
.7 ldx WND.Stack.Idx
|
||
|
||
dex
|
||
bne .1
|
||
|
||
lda #CUR.T.ARROW
|
||
jsr SetCursor
|
||
|
||
.9 sec
|
||
.99 rts
|
||
*--------------------------------------
|
||
MOU.ChkWNDBorders
|
||
stz IY
|
||
|
||
ldy #S.OBJ.X1
|
||
lda (ZPWNDPtr),y
|
||
sec
|
||
sbc #1
|
||
eor MouseData+S.MOUSE.X1
|
||
bne .1
|
||
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sbc #0
|
||
eor MouseData+S.MOUSE.X1+1
|
||
bne .1
|
||
|
||
lda #CUR.T.RESIZEX
|
||
sta IY
|
||
|
||
.1 ldy #S.OBJ.Y1
|
||
lda (ZPWNDPtr),y
|
||
sec
|
||
sbc #1
|
||
eor MouseData+S.MOUSE.Y1
|
||
bne .3
|
||
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
sbc #0
|
||
eor MouseData+S.MOUSE.Y1+1
|
||
bne .3
|
||
|
||
lda IY
|
||
beq .2
|
||
|
||
lda #CUR.T.RESIZEXY1
|
||
jmp SetCursor
|
||
|
||
.2 lda #CUR.T.RESIZEY
|
||
sta IY
|
||
|
||
.3 ldy #S.OBJ.X2
|
||
lda (ZPWNDPtr),y
|
||
clc
|
||
adc #1
|
||
eor MouseData+S.MOUSE.X2
|
||
bne .5
|
||
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
adc #0
|
||
eor MouseData+S.MOUSE.X2+1
|
||
bne .5
|
||
|
||
lda IY
|
||
beq .4
|
||
|
||
lda #CUR.T.RESIZEXY2
|
||
jmp SetCursor
|
||
|
||
.4 lda #CUR.T.RESIZEX
|
||
sta IY
|
||
|
||
.5 ldy #S.OBJ.Y2
|
||
lda (ZPWNDPtr),y
|
||
clc
|
||
adc #1
|
||
eor MouseData+S.MOUSE.Y2
|
||
bne .7
|
||
|
||
iny
|
||
lda (ZPWNDPtr),y
|
||
adc #0
|
||
eor MouseData+S.MOUSE.Y2+1
|
||
bne .7
|
||
|
||
lda #CUR.T.RESIZEXY1
|
||
.6 jmp SetCursor
|
||
|
||
.7 lda IY
|
||
bne .6
|
||
|
||
sec
|
||
rts
|
||
*--------------------------------------
|
||
MOU.InRectYA >STYA ZPRECTPtr
|
||
|
||
ldy #S.RECT.X1
|
||
|
||
lda MouseData+S.MOUSE.X1
|
||
cmp (ZPRECTPtr),y
|
||
iny
|
||
lda MouseData+S.MOUSE.X1+1
|
||
sbc (ZPRECTPtr),y
|
||
bcc .9
|
||
|
||
iny #S.RECT.Y1
|
||
|
||
lda MouseData+S.MOUSE.Y1
|
||
cmp (ZPRECTPtr),y
|
||
iny
|
||
lda MouseData+S.MOUSE.Y1+1
|
||
sbc (ZPRECTPtr),y
|
||
bcc .9
|
||
|
||
iny #S.RECT.X2
|
||
|
||
lda (ZPRECTPtr),y
|
||
cmp MouseData+S.MOUSE.X1
|
||
iny
|
||
lda (ZPRECTPtr),y
|
||
sbc MouseData+S.MOUSE.X1+1
|
||
bcc .9
|
||
|
||
iny #S.RECT.Y2
|
||
|
||
lda (ZPRECTPtr),y
|
||
cmp MouseData+S.MOUSE.Y1
|
||
iny
|
||
lda (ZPRECTPtr),y
|
||
sbc MouseData+S.MOUSE.Y1+1
|
||
bcc .9
|
||
|
||
clc
|
||
rts
|
||
|
||
.9 sec
|
||
.99 rts
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE usr/src/lib/libgui.s.mou
|
||
LOAD usr/src/lib/libgui.s
|
||
ASM
|