dex
bpl @L1
-; Be sure the mouse cursor is invisible and at the default location. We
-; need to do that here, because our mouse interrupt handler doesn't set the
-; mouse position if it hasn't changed.
+; Be sure the mouse cursor is invisible and at the default location.
- php
- sei
jsr CHIDE
lda XPos
ldx XPos+1
lda YPos
ldx YPos+1
jsr CMOVEY
- plp
; Done, return zero (= MOUSE_ERR_OK)
IOCTL: lda #<MOUSE_ERR_INV_IOCTL ; We don't support ioclts for now
ldx #>MOUSE_ERR_INV_IOCTL
-hlprts: rts
+ rts
;----------------------------------------------------------------------------
; IRQ: Irq handler entry point. Called as a subroutine but in IRQ context
and #15 ; clear joystick #1 bits
eor #15
sta Temp
- clc
- beq hlprts ; no movement, do nothing
jsr CHIDE
dex
bpl @L1
-; Be sure the mouse cursor is invisible and at the default location. We
-; need to do that here, because our mouse interrupt handler doesn't set the
-; mouse position if it hasn't changed.
+; Be sure the mouse cursor is invisible and at the default location.
- sei
jsr CHIDE
lda XPos
sta XPosWrk
ldx YPos+1
stx YPosWrk+1
jsr CMOVEY
- cli
; Install timer irq routine to poll mouse.
ldx #MOUSE_BTN_LEFT
@L0: stx Buttons
-; Update coordinates if needed
-
- lda XPosWrk
- cmp XPos
- bne @Update
- lda XPosWrk+1
- cmp XPos+1
- bne @Update
- lda YPosWrk
- cmp YPos
- bne @Update
- lda YPosWrk+1
- cmp YPos+1
- beq @Done
-
-@Update:ldx visible
+ ldx visible
beq @L1
jsr CHIDE