Merge remote-tracking branch 'upstream/master' into soft80

This commit is contained in:
mrdudz
2015-10-12 20:43:19 +02:00
28 changed files with 278 additions and 116 deletions

View File

@@ -7,7 +7,12 @@
; be called from an interrupt handler
;
.constructor initmcb
.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"
@@ -22,9 +27,49 @@ MOUSE_SPR_NMASK = .lobyte(.not MOUSE_SPR_MASK) ; Negative mask
VIC_SPR_X = (VIC_SPR0_X + 2*MOUSE_SPR) ; Sprite X register
VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
; --------------------------------------------------------------------------
; Initialize the mouse sprite.
.segment "INIT"
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 mcb_spritememory,x
dex
bpl @L0
; Set the mouse sprite pointer
lda #<(mcb_spritememory / 64)
sta mcb_spritepointer + MOUSE_SPR
; Restore memory configuration
sty $01
cli
; Set the mouse sprite color
lda _mouse_def_pointercolor
sta VIC_SPR0_COLOR + MOUSE_SPR
rts
; --------------------------------------------------------------------------
; Hide the mouse pointer. Always called with interrupts disabled.
.code
hide:
lda #MOUSE_SPR_NMASK
and VIC_SPR_ENA

View File

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

View File

@@ -63,6 +63,7 @@ BCD2dec:tax
; Constructor that writes to the 1/10 sec register of the TOD to kick it
; into action. If this is not done, the clock hangs. We will read the register
; and write it again, ignoring a possible change in between.
.segment "INIT"
.proc initsystime
@@ -81,7 +82,6 @@ BCD2dec:tax
.endproc
;----------------------------------------------------------------------------
; TM struct with date set to 1970-01-01
.data
@@ -95,4 +95,3 @@ TM: .word 0 ; tm_sec
.word 0 ; tm_wday
.word 0 ; tm_yday
.word 0 ; tm_isdst