A2osX/LIB/LIBGUI.S.MOU.txt

373 lines
5.4 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
*--------------------------------------
2021-06-03 17:43:28 +00:00
MOU.Init >PUSHW L.DEVNAME.MOUSE
>PUSHBI 0
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
sta PTR.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
sta PTR.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
sta PTR.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
sta PTR.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
>LDYA L.PTR.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
*--------------------------------------
MOU.ReadMouse >PULLW ZPPtr1 pS.XY
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
>PUSHW L.XY
2019-05-05 17:15:37 +00:00
>SYSCALL2 IOCTL
2020-10-06 06:27:35 +00:00
bcs .99
ldy #S.XY-1
2020-10-26 06:38:50 +00:00
.1 lda XY,y
2020-10-15 15:19:13 +00:00
sta (ZPPtr1),y
dey
bpl .1
* 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
.1 ldx MENU.Stack.Cnt
2020-10-20 06:01:04 +00:00
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
.2 phx
2021-02-22 17:17:37 +00:00
>SYSCALL2 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
bcc .3
2020-10-26 06:38:50 +00:00
plx
dex
bne .2
.9 sec
2020-10-27 16:33:10 +00:00
rts
2020-10-20 06:01:04 +00:00
.3 plx
cpx MENU.Stack.Cnt
beq .7
2020-10-13 15:54:55 +00:00
* TODO:destroy from TOP to current, then enter current
2020-10-26 06:38:50 +00:00
2022-10-20 06:07:40 +00:00
* inx
* phx
2022-10-20 06:07:40 +00:00
* jsr MENU.Destroy
* bra .3
2020-10-26 06:38:50 +00:00
.7 jmp MENU.Enter
2020-10-26 06:38:50 +00:00
.8 clc
rts
2020-10-20 06:01:04 +00:00
*--------------------------------------
MOU.CheckOverSysBut
>LDYA L.RECT.SysBut
jsr MOU.InRectYA
bcs .9
2020-10-20 06:01:04 +00:00
jmp SYSBUT.Enter
2020-10-26 06:38:50 +00:00
2020-10-22 15:33:10 +00:00
.9 jsr SYSBUT.Leave
sec
MOU.CheckOverSysBut.RTS
2020-10-22 15:33:10 +00:00
rts
2020-10-16 06:10:02 +00:00
*--------------------------------------
MOU.CheckOverWND
ldx WND.Stack.Top
beq MOU.CheckOverSysBut.RTS
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
2021-02-22 17:17:37 +00:00
>SYSCALL2 GetMemPtr
2020-10-16 06:10:02 +00:00
>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 MSG+S.MSG.S
bit #S.MSG.S.CLK
2020-10-26 06:38:50 +00:00
beq .22
jsr WND.Bring2Front
.22 ldy #S.WND.TBarY2
2020-10-23 15:23:19 +00:00
lda (ZPWNDPtr),y
cmp MSG+S.MSG.Y1
2020-10-23 15:23:19 +00:00
iny
lda (ZPWNDPtr),y
sbc MSG+S.MSG.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 MSG+S.MSG.Y1
2020-10-23 15:23:19 +00:00
iny
lda (ZPWNDPtr),y
sbc MSG+S.MSG.Y1+1
2020-10-26 06:38:50 +00:00
bcc .4 not in MBAR
jsr MBAR.Enter
2021-02-22 17:17:37 +00:00
2020-10-26 06:38:50 +00:00
bra .5
.4 iny #S.WND.SBarY1
lda (ZPWNDPtr),y
cmp MSG+S.MSG.Y1
2020-10-26 06:38:50 +00:00
iny
lda (ZPWNDPtr),y
sbc MSG+S.MSG.Y1+1
2021-02-22 17:17:37 +00:00
bcs .6 not in SBAR
2020-10-26 06:38:50 +00:00
.5 lda #PTR.T.ARROW
jsr PTR.Set
2020-10-23 15:23:19 +00:00
clc
rts
2020-10-26 06:38:50 +00:00
.6 lda #PTR.T.WAIT
jsr PTR.Set
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 #PTR.T.ARROW
jsr PTR.Set
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 MSG+S.MSG.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 MSG+S.MSG.X1+1
2020-10-22 15:33:10 +00:00
bne .1
lda #PTR.T.RESIZEX
2020-10-22 15:33:10 +00:00
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 MSG+S.MSG.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
eor MSG+S.MSG.Y1+1
2020-10-22 15:33:10 +00:00
bne .3
lda IY
beq .2
lda #PTR.T.RESIZEXY1
jmp PTR.Set
2020-10-26 06:38:50 +00:00
.2 lda #PTR.T.RESIZEY
2020-10-22 15:33:10 +00:00
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 MSG+S.MSG.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 MSG+S.MSG.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
lda #PTR.T.RESIZEXY2
jmp PTR.Set
2020-10-22 15:33:10 +00:00
.4 lda #PTR.T.RESIZEX
2020-10-22 15:33:10 +00:00
sta IY
.5 ldy #S.OBJ.Y2
2020-10-23 06:03:23 +00:00
lda (ZPWNDPtr),y
clc
adc #1
eor MSG+S.MSG.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 MSG+S.MSG.Y2+1
2020-10-22 15:33:10 +00:00
bne .7
lda #PTR.T.RESIZEXY1
.6 jmp PTR.Set
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
lda MSG+S.MSG.X1
2020-10-15 15:19:13 +00:00
cmp (ZPRECTPtr),y
iny
lda MSG+S.MSG.X1+1
2020-10-15 15:19:13 +00:00
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
lda MSG+S.MSG.Y1
2020-10-15 15:19:13 +00:00
cmp (ZPRECTPtr),y
iny
lda MSG+S.MSG.Y1+1
2020-10-15 15:19:13 +00:00
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 MSG+S.MSG.X1
2020-10-15 15:19:13 +00:00
iny
2020-10-16 06:10:02 +00:00
lda (ZPRECTPtr),y
sbc MSG+S.MSG.X1+1
2020-10-16 06:10:02 +00:00
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 MSG+S.MSG.Y1
2020-10-15 15:19:13 +00:00
iny
2020-10-16 06:10:02 +00:00
lda (ZPRECTPtr),y
sbc MSG+S.MSG.Y1+1
2020-10-16 06:10:02 +00:00
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