mirror of
https://github.com/blondie7575/WeeGUI.git
synced 2024-09-28 21:54:56 +00:00
Mouse driver improvements
-Removed use of PARAMn from interrupt handler - Events now processed with location, not view ID
This commit is contained in:
parent
766072a3c2
commit
7feec071c1
@ -449,14 +449,15 @@ X: WGPendingViewAction
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
####WGPendingView
|
####WGPendingClick
|
||||||
Returns the currently pending view, if any. This is a way to peek into the state of the mouse event system, to see if the user is trying to do something with the mouse. Most programs shouldn't need this.
|
Returns the currently pending click, if any. This is a way to peek into the state of the mouse event system, to see if the user is trying to do something with the pointer. Most programs shouldn't need this, but you can use it to do your own low-level click handling if you wish.
|
||||||
|
|
||||||
<table width="100%">
|
<table width="100%">
|
||||||
<tr><th>Assembly</th><th>Applesoft</th></tr><tr><td><pre>
|
<tr><th>Assembly</th><th>Applesoft</th></tr><tr><td><pre>
|
||||||
X: WGPendingView
|
X: WGPendingClick
|
||||||
|
|
||||||
Returns in A: View ID
|
Returns in X: X coordinate of click, or $ff if none
|
||||||
|
Returns in Y: Y coordinate of click, if any
|
||||||
</td><td>
|
</td><td>
|
||||||
Not available
|
Not available
|
||||||
</td></tr>
|
</td></tr>
|
||||||
|
@ -848,7 +848,7 @@ WGAmpersand_MOUSEoff:
|
|||||||
; Performs any pending view action
|
; Performs any pending view action
|
||||||
; &PDACT
|
; &PDACT
|
||||||
WGAmpersand_PDACT:
|
WGAmpersand_PDACT:
|
||||||
lda WG_PENDINGACTIONVIEW
|
lda WG_MOUSECLICK_X
|
||||||
bmi WGAmpersand_PDACTdone
|
bmi WGAmpersand_PDACTdone
|
||||||
|
|
||||||
jsr WGPendingViewAction
|
jsr WGPendingViewAction
|
||||||
|
16
mouse.s
16
mouse.s
@ -339,15 +339,11 @@ WGMouseInterruptHandler_button:
|
|||||||
bit WG_MOUSE_STAT ; Check for rising edge of button state
|
bit WG_MOUSE_STAT ; Check for rising edge of button state
|
||||||
bpl WGMouseInterruptHandler_intDone
|
bpl WGMouseInterruptHandler_intDone
|
||||||
|
|
||||||
lda WG_MOUSEPOS_X ; Where did we click?
|
; Button was clicked, so make a note of location for later
|
||||||
sta PARAM0
|
lda WG_MOUSEPOS_X
|
||||||
|
sta WG_MOUSECLICK_X
|
||||||
lda WG_MOUSEPOS_Y
|
lda WG_MOUSEPOS_Y
|
||||||
sta PARAM1
|
sta WG_MOUSECLICK_Y
|
||||||
jsr WGViewFromPoint
|
|
||||||
bmi WGMouseInterruptHandler_intDone
|
|
||||||
|
|
||||||
; Button was clicked in a view, so make a note of it for later
|
|
||||||
sta WG_PENDINGACTIONVIEW
|
|
||||||
|
|
||||||
WGMouseInterruptHandler_intDone:
|
WGMouseInterruptHandler_intDone:
|
||||||
pla ; Restore text bank
|
pla ; Restore text bank
|
||||||
@ -542,6 +538,10 @@ WG_MOUSE_SLOT:
|
|||||||
WG_MOUSE_SLOTSHIFTED:
|
WG_MOUSE_SLOTSHIFTED:
|
||||||
.byte 0
|
.byte 0
|
||||||
|
|
||||||
|
WG_MOUSECLICK_X:
|
||||||
|
.byte $ff
|
||||||
|
WG_MOUSECLICK_Y:
|
||||||
|
.byte 0
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
; ProDOS system call parameter blocks
|
; ProDOS system call parameter blocks
|
||||||
|
27
views.s
27
views.s
@ -819,9 +819,17 @@ WGViewFocusAction_knownRTS:
|
|||||||
WGPendingViewAction:
|
WGPendingViewAction:
|
||||||
SAVE_AY
|
SAVE_AY
|
||||||
|
|
||||||
lda WG_PENDINGACTIONVIEW
|
lda WG_MOUSECLICK_X
|
||||||
bmi WGPendingViewAction_done
|
bmi WGPendingViewAction_done
|
||||||
|
|
||||||
|
sta PARAM0
|
||||||
|
lda WG_MOUSECLICK_Y
|
||||||
|
sta PARAM1
|
||||||
|
jsr WGViewFromPoint
|
||||||
|
sta WG_PENDINGACTIONVIEW
|
||||||
|
cmp #$ff
|
||||||
|
beq WGPendingViewAction_done
|
||||||
|
|
||||||
and #$f ; Select view in question
|
and #$f ; Select view in question
|
||||||
jsr WGSelectView
|
jsr WGSelectView
|
||||||
LDY_ACTIVEVIEW
|
LDY_ACTIVEVIEW
|
||||||
@ -859,9 +867,10 @@ WGPendingViewAction_hasCallback:
|
|||||||
jsr WGViewFocus
|
jsr WGViewFocus
|
||||||
jsr WGViewFocusAction ; Trigger application to redraw contents
|
jsr WGViewFocusAction ; Trigger application to redraw contents
|
||||||
|
|
||||||
WGPendingViewAction_done: ; Centralized for branch range
|
WGPendingViewAction_done: ; Located here for branch range
|
||||||
lda #$ff
|
lda #$ff
|
||||||
sta WG_PENDINGACTIONVIEW
|
sta WG_PENDINGACTIONVIEW
|
||||||
|
sta WG_MOUSECLICK_X
|
||||||
|
|
||||||
RESTORE_AY
|
RESTORE_AY
|
||||||
rts
|
rts
|
||||||
@ -900,12 +909,16 @@ WGPendingViewAction_content:
|
|||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
; WGPendingView
|
; WGPendingClick
|
||||||
; Returns the view that is currently pending
|
; Returns the mouse click that is currently pending
|
||||||
; OUT A : Pending view ID, or $ff if none
|
; OUT X,Y : Mouse coordinates, or $ff in X if none
|
||||||
;
|
;
|
||||||
WGPendingView:
|
WGPendingClick:
|
||||||
lda WG_PENDINGACTIONVIEW
|
ldx WG_MOUSECLICK_X
|
||||||
|
bmi WGPendingClick_done
|
||||||
|
ldy WG_MOUSECLICK_Y
|
||||||
|
|
||||||
|
WGPendingClick_done:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
BIN
weegui.dsk
BIN
weegui.dsk
Binary file not shown.
Loading…
Reference in New Issue
Block a user