CHIDE: jmp $0000 ; Hide the cursor
CSHOW: jmp $0000 ; Show the cursor
+CPREP: jmp $0000 ; Prepare to move the cursor
+CDRAW: jmp $0000 ; Draw the cursor
CMOVEX: jmp $0000 ; Move the cursor to X coord
CMOVEY: jmp $0000 ; Move the cursor to Y coord
Temp: .res 1 ; Temporary value used in the int handler
-visible: .res 1
; Default values for above variables
dex
bpl @L1
-; Be sure the mouse cursor is invisible and at the default location.
+; Make sure the mouse cursor is at the default location.
- jsr CHIDE
lda XPos
ldx XPos+1
jsr CMOVEX
; no special action is required besides hiding the mouse cursor.
; No return code required.
-HIDE: dec visible
- php
+HIDE: php
sei
jsr CHIDE
plp
; no special action is required besides enabling the mouse cursor.
; No return code required.
-SHOW: inc visible
- php
+SHOW: php
sei
jsr CSHOW
plp
pha
txa
pha
- jsr CHIDE
+ jsr CPREP
pla
tax
pla
dey
lda (sp),y
sta XPos ; New X position
-
jsr CMOVEX ; Move the cursor
- lda visible
- beq @Ret
-
- jsr CSHOW
+ jsr CDRAW
-@Ret: plp ; Restore interrupt flag
+ plp ; Restore interrupt flag
rts
;----------------------------------------------------------------------------
eor #15
sta Temp
- jsr CHIDE
+ jsr CPREP
; Check left/right
; Done
-@SkipY: lda visible
- beq @Done
-
- jsr CSHOW
-
-@Done: clc ; Interrupt not "handled"
+@SkipY: jsr CDRAW
+ clc ; Interrupt not "handled"
rts