mirror of
https://github.com/cc65/cc65.git
synced 2025-01-10 19:29:45 +00:00
Allow to override mouse sprite location data.
This commit is contained in:
parent
c4966ac6a6
commit
08efc299ff
@ -11,6 +11,8 @@
|
|||||||
.export _mouse_def_callbacks
|
.export _mouse_def_callbacks
|
||||||
.import _mouse_def_pointershape
|
.import _mouse_def_pointershape
|
||||||
.import _mouse_def_pointercolor
|
.import _mouse_def_pointercolor
|
||||||
|
.import mcb_spritememory
|
||||||
|
.import mcb_spritepointer
|
||||||
|
|
||||||
.include "mouse-kernel.inc"
|
.include "mouse-kernel.inc"
|
||||||
.include "c64.inc"
|
.include "c64.inc"
|
||||||
@ -20,7 +22,6 @@
|
|||||||
; Sprite definitions. The first value can be changed to adjust the number
|
; 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.
|
; of the sprite used for the mouse. All others depend on this value.
|
||||||
MOUSE_SPR = 0 ; Sprite used for the mouse
|
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_MASK = $01 .shl MOUSE_SPR ; Positive mask
|
||||||
MOUSE_SPR_NMASK = .lobyte(.not MOUSE_SPR_MASK) ; Negative mask
|
MOUSE_SPR_NMASK = .lobyte(.not MOUSE_SPR_MASK) ; Negative mask
|
||||||
VIC_SPR_X = (VIC_SPR0_X + 2*MOUSE_SPR) ; Sprite X register
|
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:
|
initmcb:
|
||||||
|
|
||||||
|
; Make all RAM accessible
|
||||||
|
|
||||||
|
lda #$30
|
||||||
|
ldy $01
|
||||||
|
sei
|
||||||
|
sta $01
|
||||||
|
|
||||||
; Copy the mouse sprite data
|
; Copy the mouse sprite data
|
||||||
|
|
||||||
ldx #64 - 1
|
ldx #64 - 1
|
||||||
@L0: lda _mouse_def_pointershape,x
|
@L0: lda _mouse_def_pointershape,x
|
||||||
sta MOUSE_SPR_MEM,x
|
sta mcb_spritememory,x
|
||||||
dex
|
dex
|
||||||
bpl @L0
|
bpl @L0
|
||||||
|
|
||||||
; Set the mouse sprite pointer
|
; Set the mouse sprite pointer
|
||||||
|
|
||||||
lda #<(MOUSE_SPR_MEM / 64)
|
lda #<(mcb_spritememory / 64)
|
||||||
sta $07F8 + MOUSE_SPR
|
sta mcb_spritepointer + MOUSE_SPR
|
||||||
|
|
||||||
|
; Restore memory configuration
|
||||||
|
|
||||||
|
sty $01
|
||||||
|
cli
|
||||||
|
|
||||||
; Set the mouse sprite color
|
; Set the mouse sprite color
|
||||||
|
|
||||||
|
4
libsrc/c64/mcbspritedata.s
Normal file
4
libsrc/c64/mcbspritedata.s
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
; VIC sprite data for the mouse pointer
|
||||||
|
|
||||||
|
.export mcb_spritememory := $0340
|
||||||
|
.export mcb_spritepointer := $07F8
|
Loading…
x
Reference in New Issue
Block a user