ldx #0
lda #1
- stx mouse_on
+ sta mouse_off
rts
;--------------------------------------------------------------------
ldx vbi_jmp+2
jsr SETVBV
- lda #0
- sta GRACTL
- sta HPOSP0
- sta mouse_on
+ ldx #0
+ stx GRACTL
+ stx HPOSP0
+ inx
+ stx mouse_off
rts
;--------------------------------------------------------------------
; void mouse_show(void)
_mouse_show:
- inc mouse_on
- rts
+ lda mouse_off ; Already on?
+ beq @L1
+ dec mouse_off
+@L1: rts
;--------------------------------------------------------------------
; Hide mouse arrow
; void mouse_hide(void)
_mouse_hide:
- lda mouse_on
- beq @L1
- dec mouse_on
-@L1: rts
+ inc mouse_off
+ rts
;--------------------------------------------------------------------
; Ask mouse button
ok4: jsr clrpm
- lda mouse_on
- bne mon
+ lda mouse_off
+ beq mon
lda #0
sta HPOSP0
beq moff
dumy: .res 1
omy: .res 1 ; old y pos
-mouse_on:
+mouse_off:
.res 1
port_nr:
.res 1
sta YMax
stx YMax+1 ; YMax = 250
inx ; X = 1
- stx Visible ; Mouse *not* visible
+ stx Invisible ; Mouse *not* visible
lda #<344
sta XMax
stx XMax+1 ; XMax = 344
;
_mouse_hide:
- lda Visible ; Get the flag
+ lda Invisible ; Get the flag
bne @L1 ; Jump if already invisible
ldx MouseSprite ; Sprite defined?
beq @L1 ; Jump if no
sta VIC_SPR_ENA ; Disable sprite
cli ; Enable interrupts
-@L1: inc Visible ; Set the flag to invisible
+@L1: inc Invisible ; Set the flag to invisible
rts
; --------------------------------------------------------------------------
;
_mouse_show:
- lda Visible ; Mouse already visible?
- beq @L1 ; Jump if yes
- dec Visible ; Get the flag
- bne @L1 ; Jump if still invisible
+ lda Invisible ; Mouse invisible?
+ beq @L1 ; Jump if no
+ dec Invisible ; Set the flag
+ bne @L1 ; Jump if still invisible
ldx MouseSprite ; Sprite defined?
beq @L1 ; Jump if no
MoveSprite:
- lda Visible ; Mouse visible?
+ lda Invisible ; Mouse visible?
bne MoveSpriteDone ; Jump if no
ldx MouseSprite ; Sprite defined?
beq MoveSpriteDone ; Jump if no
OldValue: .res 1 ; Temp for MoveCheck routine
NewValue: .res 1 ; Temp for MoveCheck routine
-Visible: .res 1 ; Is the mouse visible?
+Invisible: .res 1 ; Is the mouse invisible?
OldPotX: .res 1 ; Old hw counter values
OldPotY: .res 1
sta YMax
stx YMax+1 ; YMax = 250
inx ; X = 1
- stx Visible ; Mouse *not* visible
+ stx Invisible ; Mouse *not* visible
lda #<344
sta XMax
stx XMax+1 ; XMax = 344
; Set our own IRQ vector. We cheat here to save a few bytes of code:
; The function is expected to return a value not equal to zero on success,
; and since we know that the high byte of the IRQ handler address is never
-; zweo, we will return just this byte.
+; zero, we will return just this byte.
ldx #<MouseIRQ
lda #>MouseIRQ
;
_mouse_hide:
- lda Visible ; Get the flag
+ lda Invisible ; Get the flag
bne @L1 ; Jump if already invisible
ldx MouseSprite ; Sprite defined?
beq @L1 ; Jump if no
sta VIC_SPR_ENA ; Disable sprite
cli ; Enable interrupts
-@L1: inc Visible ; Set the flag to invisible
+@L1: inc Invisible ; Set the flag to invisible
rts
; --------------------------------------------------------------------------
;
_mouse_show:
- lda Visible ; Mouse already visible?
- beq @L1 ; Jump if yes
- dec Visible ; Get the flag
- bne @L1 ; Jump if still invisible
+ lda Invisible ; Mouse invisible?
+ beq @L1 ; Jump if no
+ dec Invisible ; Set the flag
+ bne @L1 ; Jump if still invisible
ldx MouseSprite ; Sprite defined?
beq @L1 ; Jump if no
MoveSprite:
- lda Visible ; Mouse visible?
+ lda Invisible ; Mouse visible?
bne MoveSpriteDone ; Jump if no
ldx MouseSprite ; Sprite defined?
beq MoveSpriteDone ; Jump if no
OldValue: .res 1 ; Temp for MoveCheck routine
NewValue: .res 1 ; Temp for MoveCheck routine
-Visible: .res 1 ; Is the mouse visible?
+Invisible: .res 1 ; Is the mouse invisible?
OldPotX: .res 1 ; Old hw counter values
OldPotY: .res 1