1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-17 16:29:32 +00:00

Allow to override mouse sprite location data.

This commit is contained in:
Oliver Schmidt 2015-10-12 20:18:13 +02:00
parent c4966ac6a6
commit 08efc299ff
2 changed files with 21 additions and 4 deletions

View File

@ -11,6 +11,8 @@
.export _mouse_def_callbacks
.import _mouse_def_pointershape
.import _mouse_def_pointercolor
.import mcb_spritememory
.import mcb_spritepointer
.include "mouse-kernel.inc"
.include "c64.inc"
@ -20,7 +22,6 @@
; Sprite definitions. The first value can be changed to adjust the number
; of the sprite used for the mouse. All others depend on this value.
MOUSE_SPR = 0 ; Sprite used for the mouse
MOUSE_SPR_MEM = $0340 ; Memory location
MOUSE_SPR_MASK = $01 .shl MOUSE_SPR ; Positive mask
MOUSE_SPR_NMASK = .lobyte(.not MOUSE_SPR_MASK) ; Negative mask
VIC_SPR_X = (VIC_SPR0_X + 2*MOUSE_SPR) ; Sprite X register
@ -33,18 +34,30 @@ VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
initmcb:
; Make all RAM accessible
lda #$30
ldy $01
sei
sta $01
; Copy the mouse sprite data
ldx #64 - 1
@L0: lda _mouse_def_pointershape,x
sta MOUSE_SPR_MEM,x
sta mcb_spritememory,x
dex
bpl @L0
; Set the mouse sprite pointer
lda #<(MOUSE_SPR_MEM / 64)
sta $07F8 + MOUSE_SPR
lda #<(mcb_spritememory / 64)
sta mcb_spritepointer + MOUSE_SPR
; Restore memory configuration
sty $01
cli
; Set the mouse sprite color

View File

@ -0,0 +1,4 @@
; VIC sprite data for the mouse pointer
.export mcb_spritememory := $0340
.export mcb_spritepointer := $07F8