Updated the cx16 library to the Commander X16 Kernal's prerelease 35.
This commit is contained in:
@@ -1,53 +1,63 @@
|
||||
;
|
||||
; Default mouse callbacks for the CX16
|
||||
;
|
||||
; 2019-11-09, Greg King
|
||||
; 2019-12-25, Greg King
|
||||
;
|
||||
; All functions in this module should be interrupt safe
|
||||
; All functions in this module should be interrupt-safe
|
||||
; because they might be called from an interrupt handler.
|
||||
;
|
||||
|
||||
.export _mouse_def_callbacks
|
||||
|
||||
.include "cbm_kernal.inc"
|
||||
.include "cx16.inc"
|
||||
|
||||
; --------------------------------------------------------------------------
|
||||
; Hide the mouse pointer. Always called with interrupts disabled.
|
||||
|
||||
.code
|
||||
|
||||
hide: ldx #$00 ; Don't change sprite's scale
|
||||
lda #$00 ; Disable sprite
|
||||
jmp MOUSE
|
||||
msprite:
|
||||
stz VERA::CTRL ; set address for VERA's data port zero
|
||||
lda #<(VERA::SPRITE::ATTRIB::Z_FLIP + 0 * 8)
|
||||
ldx #>(VERA::SPRITE::ATTRIB::Z_FLIP + 0 * 8)
|
||||
ldy #^(VERA::SPRITE::ATTRIB::Z_FLIP + 0 * 8) | VERA::INC0
|
||||
sta VERA::ADDR
|
||||
stx VERA::ADDR+1
|
||||
sty VERA::ADDR+2
|
||||
rts
|
||||
|
||||
; --------------------------------------------------------------------------
|
||||
; Show the mouse pointer. Always called with interrupts disabled.
|
||||
; Hide the mouse pointer.
|
||||
|
||||
show: ldx #$00
|
||||
lda #<-$01 ; Enable sprite
|
||||
jmp MOUSE
|
||||
hide: jsr msprite
|
||||
lda VERA::DATA0
|
||||
and #<~VERA::SPRITE::DEPTH::LAYER1
|
||||
sta VERA::DATA0
|
||||
rts
|
||||
|
||||
; --------------------------------------------------------------------------
|
||||
; Prepare to move the mouse pointer. Always called with interrupts disabled.
|
||||
; Show the mouse pointer.
|
||||
|
||||
show: jsr msprite
|
||||
lda VERA::DATA0
|
||||
ora #VERA::SPRITE::DEPTH::LAYER1
|
||||
sta VERA::DATA0
|
||||
rts
|
||||
|
||||
; --------------------------------------------------------------------------
|
||||
; Prepare to move the mouse pointer.
|
||||
|
||||
prep: ; Fall through
|
||||
|
||||
; --------------------------------------------------------------------------
|
||||
; Draw the mouse pointer. Always called with interrupts disabled.
|
||||
; Draw the mouse pointer.
|
||||
|
||||
draw: ; Fall through
|
||||
|
||||
; --------------------------------------------------------------------------
|
||||
; Move the mouse pointer X position to the value in .XA . Always called with
|
||||
; interrupts disabled.
|
||||
; Move the mouse pointer X position to the value in .XA .
|
||||
|
||||
movex: ; Already set by drivers
|
||||
; Fall through
|
||||
|
||||
; --------------------------------------------------------------------------
|
||||
; Move the mouse pointer Y position to the value in .XA . Always called with
|
||||
; interrupts disabled.
|
||||
; Move the mouse pointer Y position to the value in .XA .
|
||||
|
||||
movey: rts ; Already set by drivers
|
||||
|
||||
|
||||
Reference in New Issue
Block a user