2019-11-16 19:51:24 +00:00
|
|
|
;
|
|
|
|
; Default mouse callbacks for the CX16
|
|
|
|
;
|
2020-01-10 20:17:23 +00:00
|
|
|
; 2020-01-10, Greg King
|
2019-11-16 19:51:24 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
.export _mouse_def_callbacks
|
|
|
|
|
2020-01-10 20:17:23 +00:00
|
|
|
.import MOUSE_GET, SPRITE_SET_POSITION
|
2019-11-16 19:51:24 +00:00
|
|
|
.include "cx16.inc"
|
|
|
|
|
|
|
|
|
2019-12-25 15:56:32 +00:00
|
|
|
; --------------------------------------------------------------------------
|
|
|
|
; Hide the mouse pointer.
|
2019-11-16 19:51:24 +00:00
|
|
|
|
2020-01-10 20:17:23 +00:00
|
|
|
hide: ldx #%10000000
|
|
|
|
stx gREG::r0H
|
|
|
|
bra mse
|
2019-11-16 19:51:24 +00:00
|
|
|
|
|
|
|
; --------------------------------------------------------------------------
|
2019-12-25 15:56:32 +00:00
|
|
|
; Show the mouse pointer.
|
2019-11-16 19:51:24 +00:00
|
|
|
|
2020-01-10 20:17:23 +00:00
|
|
|
show: ldx #gREG::r0
|
|
|
|
jsr MOUSE_GET
|
|
|
|
mse: lda #$00 ; mouse sprite
|
|
|
|
jmp SPRITE_SET_POSITION
|
2019-11-16 19:51:24 +00:00
|
|
|
|
|
|
|
; --------------------------------------------------------------------------
|
2019-12-25 15:56:32 +00:00
|
|
|
; Prepare to move the mouse pointer.
|
2019-11-16 19:51:24 +00:00
|
|
|
|
|
|
|
prep: ; Fall through
|
|
|
|
|
|
|
|
; --------------------------------------------------------------------------
|
2019-12-25 15:56:32 +00:00
|
|
|
; Draw the mouse pointer.
|
2019-11-16 19:51:24 +00:00
|
|
|
|
|
|
|
draw: ; Fall through
|
|
|
|
|
|
|
|
; --------------------------------------------------------------------------
|
2019-12-25 15:56:32 +00:00
|
|
|
; Move the mouse pointer X position to the value in .XA .
|
2019-11-16 19:51:24 +00:00
|
|
|
|
2020-01-10 20:17:23 +00:00
|
|
|
movex: ; Already done by Kernal
|
2019-11-16 19:51:24 +00:00
|
|
|
; Fall through
|
|
|
|
|
|
|
|
; --------------------------------------------------------------------------
|
2019-12-25 15:56:32 +00:00
|
|
|
; Move the mouse pointer Y position to the value in .XA .
|
2019-11-16 19:51:24 +00:00
|
|
|
|
2020-01-10 20:17:23 +00:00
|
|
|
movey: rts ; Already done by Kernal
|
2019-11-16 19:51:24 +00:00
|
|
|
|
|
|
|
; --------------------------------------------------------------------------
|
|
|
|
; Callback structure
|
|
|
|
|
|
|
|
.rodata
|
|
|
|
|
|
|
|
_mouse_def_callbacks:
|
|
|
|
.addr hide
|
|
|
|
.addr show
|
|
|
|
.addr prep
|
|
|
|
.addr draw
|
|
|
|
.addr movex
|
|
|
|
.addr movey
|