2 ; Default mouse callbacks for the C64
4 ; Ullrich von Bassewitz, 2004-03-20
7 .export _mouse_def_callbacks
9 .include "mouse-kernel.inc"
13 ; Sprite definitions. The first value can be changed to adjust the number
14 ; of the sprite used for the mouse.
15 MOUSE_SPR = 0 ; Sprite used for the mouse
16 MOUSE_SPR_MASK = $01 .shl MOUSE_SPR ; Positive mask
17 MOUSE_SPR_NMASK = .lobyte(.not MOUSE_SPR_MASK) ; Negative mask
18 VIC_SPR_X = (VIC_SPR0_X + 2*MOUSE_SPR) ; Sprite X register
19 VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
24 ; --------------------------------------------------------------------------
25 ; Hide the mouse pointer
38 ; --------------------------------------------------------------------------
39 ; Show the mouse pointer
52 ; --------------------------------------------------------------------------
53 ; Move the mouse pointer X position to the value in a/x
57 ; Set the low byte, this frees A
63 txa ; Test high byte of X coord
66 lda VIC_SPR_HI_X ; Get high X bits of all sprites
67 and #MOUSE_SPR_NMASK ; Clear high bit for sprite
73 lda VIC_SPR_HI_X ; Get high X bits of all sprites
74 ora #MOUSE_SPR_NMASK ; Set high bit for sprite
81 ; --------------------------------------------------------------------------
82 ; Move the mouse pointer Y position to the value in a/x
86 sta VIC_SPR_Y ; Set Y position
91 ; --------------------------------------------------------------------------