A2osX/LIB/LIBGUI.S.MOU.txt

378 lines
5.7 KiB
Plaintext
Raw Normal View History

2018-05-16 06:02:57 +00:00
NEW
2019-07-30 08:57:25 +00:00
AUTO 3,1
2018-05-16 06:02:57 +00:00
*--------------------------------------
2020-10-20 06:01:04 +00:00
MOU.Init >PUSHBI 0
2019-01-08 16:29:26 +00:00
>LDYA L.DEVNAME.MOUSE
2019-05-05 17:15:37 +00:00
>SYSCALL2 open
2018-05-16 06:02:57 +00:00
bcc .2
2020-09-05 13:38:04 +00:00
2019-01-08 16:29:26 +00:00
inc DEVNAME.MOUSE+8
lda DEVNAME.MOUSE+8
2018-05-16 06:02:57 +00:00
cmp #'8'
2020-10-20 06:01:04 +00:00
bne MOU.Init
2020-09-05 13:38:04 +00:00
2020-10-20 06:01:04 +00:00
* sec
2020-10-26 06:38:50 +00:00
rts
2018-05-16 06:02:57 +00:00
2019-01-08 16:29:26 +00:00
.2 sta hDevMouse
2020-09-05 13:38:04 +00:00
2019-01-09 06:58:19 +00:00
clc
rts
*--------------------------------------
MOU.Setup lda DCB.GFX+S.DCB.GFX.W+1
2018-05-16 06:02:57 +00:00
sta MouseClamp+3
lsr
2019-10-03 06:25:27 +00:00
sta CUR.Pos+S.POINT.X+1
2019-01-09 06:58:19 +00:00
lda DCB.GFX+S.DCB.GFX.W
2018-05-16 06:02:57 +00:00
sta MouseClamp+2
ror
2019-10-03 06:25:27 +00:00
sta CUR.Pos+S.POINT.X
2019-01-09 06:58:19 +00:00
lda DCB.GFX+S.DCB.GFX.H+1
2018-05-16 06:02:57 +00:00
sta MouseClamp+7
lsr
2019-10-03 06:25:27 +00:00
sta CUR.Pos+S.POINT.Y+1
2019-01-09 06:58:19 +00:00
lda DCB.GFX+S.DCB.GFX.H
2018-05-16 06:02:57 +00:00
sta MouseClamp+6
ror
2019-10-03 06:25:27 +00:00
sta CUR.Pos+S.POINT.Y
2020-09-02 15:47:23 +00:00
>PUSHB hDevMouse
2019-01-08 16:29:26 +00:00
>PUSHBI IOCTL.CONTROL
2020-09-02 15:47:23 +00:00
>PUSHW L.MouseClamp
2019-05-05 17:15:37 +00:00
>SYSCALL2 IOCTL
2019-01-09 06:58:19 +00:00
bcs .9
2020-09-02 15:47:23 +00:00
2018-05-16 06:02:57 +00:00
>LDYA L.CUR.SaveBuf
2020-10-06 06:27:35 +00:00
>STYA CB.PTR+S.CB.DstPtr
2020-09-02 15:47:23 +00:00
2020-09-03 15:19:25 +00:00
* clc
2018-05-16 06:02:57 +00:00
.9 rts
*--------------------------------------
MOU.Quit lda hDevMouse
beq .8
2020-09-02 15:47:23 +00:00
>PUSHA
2019-01-08 16:29:26 +00:00
>PUSHBI IOCTL.CLOSE
2019-06-07 15:02:51 +00:00
>PUSHWZ
2019-05-05 17:15:37 +00:00
>SYSCALL2 IOCTL
2018-05-16 06:02:57 +00:00
.8 clc
rts
*--------------------------------------
2020-10-06 06:27:35 +00:00
MOU.ReadMouse >PULLW ZPPtr1
2020-10-26 06:38:50 +00:00
2020-10-06 06:27:35 +00:00
lda A2osX.ASCREEN GUI screen active ?
cmp DCB.GFX+S.DCB.GFX.DEVID
2019-01-09 16:42:20 +00:00
bne .9 no, exit....
2020-09-02 15:47:23 +00:00
2020-10-06 06:27:35 +00:00
lda hDevMouse
2020-10-20 06:01:04 +00:00
beq .99 CS
2020-10-26 06:38:50 +00:00
2020-09-02 15:47:23 +00:00
>PUSHA
2019-01-08 16:29:26 +00:00
>PUSHBI IOCTL.READ
2020-10-15 15:19:13 +00:00
>PUSHW L.MouseData
2019-05-05 17:15:37 +00:00
>SYSCALL2 IOCTL
2020-10-06 06:27:35 +00:00
bcs .99
2020-10-15 15:19:13 +00:00
ldy #S.MOUSE-1
2020-10-26 06:38:50 +00:00
2020-10-15 15:19:13 +00:00
.1 lda MouseData,y
sta (ZPPtr1),y
dey
bpl .1
2020-10-26 06:38:50 +00:00
lda MouseData+S.MOUSE.S
bit #S.MOUSE.S.MOVE+S.MOUSE.S.CLK
2020-10-06 06:27:35 +00:00
beq .8
2020-10-16 06:10:02 +00:00
jsr MOU.CheckOverMenu
2020-10-15 06:16:45 +00:00
bcc .8
2020-10-20 06:01:04 +00:00
jsr MOU.CheckOverSysBut
2020-10-16 06:10:02 +00:00
bcc .8
2020-10-13 15:54:55 +00:00
2020-10-20 06:01:04 +00:00
jsr MOU.CheckOverWND
bcc .8
2020-10-22 15:33:10 +00:00
2020-10-26 06:38:50 +00:00
2020-10-06 06:27:35 +00:00
.8 clc
2019-01-09 16:42:20 +00:00
rts
2020-10-26 06:38:50 +00:00
2020-10-20 06:01:04 +00:00
.9 sec
.99 rts
2020-10-13 15:54:55 +00:00
*--------------------------------------
2020-10-16 06:10:02 +00:00
MOU.CheckOverMenu
2020-10-20 06:01:04 +00:00
.1 ldx MENU.Stack.Top
beq .9
2020-10-26 06:38:50 +00:00
2020-10-20 06:01:04 +00:00
lda MENU.Stack-1,x
2020-10-26 06:38:50 +00:00
2020-10-16 06:10:02 +00:00
>SYSCALL GetMemPtr
2020-10-20 06:01:04 +00:00
>STYA ZPMENUPtr
2020-10-16 06:10:02 +00:00
pha
tya
clc
adc #S.OBJ.X1
tay
pla
adc /S.OBJ.X1
jsr MOU.InRectYA
2020-10-20 06:01:04 +00:00
bcs .2
2020-10-26 06:38:50 +00:00
2020-10-27 16:33:10 +00:00
jsr MENU.Enter
clc
rts
2020-10-20 06:01:04 +00:00
.2 lda ZPMENUPtr
2020-10-16 06:10:02 +00:00
clc
adc #S.MENU.pX1
tay
2020-10-20 06:01:04 +00:00
lda ZPMENUPtr+1
2020-10-16 06:10:02 +00:00
adc /S.MENU.pX1
2020-10-13 15:54:55 +00:00
2020-10-20 06:01:04 +00:00
jsr MOU.InRectYA
bcc .8
2020-10-26 06:38:50 +00:00
2020-10-20 06:01:04 +00:00
jsr MENU.Destroy
2020-10-26 06:38:50 +00:00
2020-10-20 06:01:04 +00:00
bra .1
2020-10-26 06:38:50 +00:00
2020-10-20 06:01:04 +00:00
.9 sec
.8 rts
*--------------------------------------
MOU.CheckOverSysBut
>LDYA L.RECT.SysBut
jsr MOU.InRectYA
bcs .9
jmp SYSBUT.Enter
2020-10-26 06:38:50 +00:00
2020-10-22 15:33:10 +00:00
.9 jsr SYSBUT.Leave
sec
rts
2020-10-16 06:10:02 +00:00
*--------------------------------------
MOU.CheckOverWND
ldx WND.Stack.Top
beq .9
2020-10-26 06:38:50 +00:00
2020-10-23 15:23:19 +00:00
.1 stx WND.Stack.Idx
2020-10-26 06:38:50 +00:00
2020-10-23 15:23:19 +00:00
lda WND.Stack-1,x
2020-10-16 06:10:02 +00:00
>SYSCALL GetMemPtr
>STYA ZPWNDPtr
2020-10-26 06:38:50 +00:00
2020-10-16 06:10:02 +00:00
ldy #S.OBJ.F
lda (ZPWNDPtr),y
2020-10-23 06:03:23 +00:00
2020-10-16 06:10:02 +00:00
bit #S.WND.F.BORDER
2020-10-23 06:03:23 +00:00
beq .2
2020-10-22 15:33:10 +00:00
jsr MOU.ChkWNDBorders
bcc .99
2020-10-26 06:38:50 +00:00
2020-10-23 06:03:23 +00:00
.2 lda ZPWNDPtr
2020-10-22 15:33:10 +00:00
clc
adc #S.OBJ.X1
tay
lda ZPWNDPtr+1
adc #0
jsr MOU.InRectYA
2020-10-26 06:38:50 +00:00
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
2020-10-23 15:23:19 +00:00
lda (ZPWNDPtr),y
cmp MouseData+S.MOUSE.Y1
iny
lda (ZPWNDPtr),y
sbc MouseData+S.MOUSE.Y1+1
2020-10-26 06:38:50 +00:00
bcc .3 not in TBAR
bra .5
2020-10-23 15:23:19 +00:00
.3 iny #S.WND.MBarY2
2020-10-22 15:33:10 +00:00
2020-10-23 15:23:19 +00:00
lda (ZPWNDPtr),y
cmp MouseData+S.MOUSE.Y1
iny
lda (ZPWNDPtr),y
sbc MouseData+S.MOUSE.Y1+1
2020-10-26 06:38:50 +00:00
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 TBAR
.5 lda #CUR.T.ARROW
2020-10-23 15:23:19 +00:00
jsr SetCursor
clc
rts
2020-10-26 06:38:50 +00:00
2020-10-23 15:23:19 +00:00
.6 lda #CUR.T.WAIT
jsr SetCursor
2020-10-26 06:38:50 +00:00
2020-10-23 15:23:19 +00:00
clc
rts
.7 ldx WND.Stack.Idx
dex
bne .1
lda #CUR.T.ARROW
jsr SetCursor
2020-10-15 15:19:13 +00:00
.9 sec
2020-10-22 15:33:10 +00:00
.99 rts
*--------------------------------------
MOU.ChkWNDBorders
stz IY
2020-10-26 06:38:50 +00:00
2020-10-22 15:33:10 +00:00
ldy #S.OBJ.X1
2020-10-23 06:03:23 +00:00
lda (ZPWNDPtr),y
sec
sbc #1
eor MouseData+S.MOUSE.X1
2020-10-22 15:33:10 +00:00
bne .1
iny
2020-10-23 06:03:23 +00:00
lda (ZPWNDPtr),y
sbc #0
eor MouseData+S.MOUSE.X1+1
2020-10-22 15:33:10 +00:00
bne .1
lda #CUR.T.RESIZEX
sta IY
2020-10-26 06:38:50 +00:00
2020-10-22 15:33:10 +00:00
.1 ldy #S.OBJ.Y1
2020-10-23 06:03:23 +00:00
lda (ZPWNDPtr),y
sec
sbc #1
eor MouseData+S.MOUSE.Y1
2020-10-22 15:33:10 +00:00
bne .3
iny
2020-10-23 06:03:23 +00:00
lda (ZPWNDPtr),y
sbc #0
2020-10-23 15:23:19 +00:00
eor MouseData+S.MOUSE.Y1+1
2020-10-22 15:33:10 +00:00
bne .3
lda IY
beq .2
lda #CUR.T.RESIZEXY1
jmp SetCursor
2020-10-26 06:38:50 +00:00
2020-10-22 15:33:10 +00:00
.2 lda #CUR.T.RESIZEY
sta IY
2020-10-26 06:38:50 +00:00
2020-10-22 15:33:10 +00:00
.3 ldy #S.OBJ.X2
2020-10-23 06:03:23 +00:00
lda (ZPWNDPtr),y
clc
adc #1
eor MouseData+S.MOUSE.X2
2020-10-22 15:33:10 +00:00
bne .5
iny
2020-10-23 06:03:23 +00:00
lda (ZPWNDPtr),y
adc #0
eor MouseData+S.MOUSE.X2+1
2020-10-22 15:33:10 +00:00
bne .5
2020-10-26 06:38:50 +00:00
2020-10-22 15:33:10 +00:00
lda IY
beq .4
2020-10-26 06:38:50 +00:00
2020-10-22 15:33:10 +00:00
lda #CUR.T.RESIZEXY2
2020-10-26 06:38:50 +00:00
jmp SetCursor
2020-10-22 15:33:10 +00:00
.4 lda #CUR.T.RESIZEX
sta IY
.5 ldy #S.OBJ.Y2
2020-10-23 06:03:23 +00:00
lda (ZPWNDPtr),y
clc
adc #1
eor MouseData+S.MOUSE.Y2
2020-10-22 15:33:10 +00:00
bne .7
iny
2020-10-23 06:03:23 +00:00
lda (ZPWNDPtr),y
adc #0
eor MouseData+S.MOUSE.Y2+1
2020-10-22 15:33:10 +00:00
bne .7
lda #CUR.T.RESIZEXY1
.6 jmp SetCursor
2020-10-26 06:38:50 +00:00
2020-10-22 15:33:10 +00:00
.7 lda IY
bne .6
sec
2020-10-16 06:10:02 +00:00
rts
2020-10-15 15:19:13 +00:00
*--------------------------------------
MOU.InRectYA >STYA ZPRECTPtr
ldy #S.RECT.X1
2020-10-26 06:38:50 +00:00
2020-10-15 15:19:13 +00:00
lda MouseData+S.MOUSE.X1
cmp (ZPRECTPtr),y
iny
lda MouseData+S.MOUSE.X1+1
sbc (ZPRECTPtr),y
bcc .9
2020-10-26 06:38:50 +00:00
2020-10-15 15:19:13 +00:00
iny #S.RECT.Y1
2020-10-26 06:38:50 +00:00
2020-10-15 15:19:13 +00:00
lda MouseData+S.MOUSE.Y1
cmp (ZPRECTPtr),y
iny
lda MouseData+S.MOUSE.Y1+1
sbc (ZPRECTPtr),y
bcc .9
2020-10-26 06:38:50 +00:00
2020-10-15 15:19:13 +00:00
iny #S.RECT.X2
2020-10-16 06:10:02 +00:00
lda (ZPRECTPtr),y
cmp MouseData+S.MOUSE.X1
2020-10-15 15:19:13 +00:00
iny
2020-10-16 06:10:02 +00:00
lda (ZPRECTPtr),y
sbc MouseData+S.MOUSE.X1+1
bcc .9
2020-10-26 06:38:50 +00:00
iny #S.RECT.Y2
2020-10-15 15:19:13 +00:00
2020-10-16 06:10:02 +00:00
lda (ZPRECTPtr),y
cmp MouseData+S.MOUSE.Y1
2020-10-15 15:19:13 +00:00
iny
2020-10-16 06:10:02 +00:00
lda (ZPRECTPtr),y
sbc MouseData+S.MOUSE.Y1+1
bcc .9
2020-10-26 06:38:50 +00:00
2020-10-16 06:10:02 +00:00
clc
2020-10-13 15:54:55 +00:00
rts
2019-01-09 16:42:20 +00:00
.9 sec
2020-10-26 06:38:50 +00:00
.99 rts
2020-10-06 06:27:35 +00:00
*--------------------------------------
2018-05-16 06:02:57 +00:00
MAN
2020-06-30 15:32:23 +00:00
SAVE usr/src/lib/libgui.s.mou
LOAD usr/src/lib/libgui.s
2018-05-16 06:02:57 +00:00
ASM