-; --------------------------------------------------------------------------
-;
-; Move the mouse sprite to the current mouse position. Must be called
-; with interrupts off. MoveSprite1 is an entry without checking.
-;
-
-MoveSprite:
-
- lda Invisible ; Mouse visible?
- bne MoveSpriteDone ; Jump if no
-
-; Set the high X bit
-
-MoveSprite1:
- lda VIC_SPR_HI_X ; Get high X bits of all sprites
- and #$FE ; Clear bit for sprite #0
- ldy XPos+1 ; Test Y position
- beq @L1
- ora #$01 ; Set high X bit
-@L1: sta VIC_SPR_HI_X ; Set hi X sprite values
-
-; Set the low X byte
-
- lda XPos
- sta VIC_SPR0_X ; Set low byte
-
-; Set the Y position
-
- ldy YPos+1 ; Negative or too large?
- bne MoveSpriteDone ; Jump if yes
- lda YPos
- sta VIC_SPR0_Y ; Set Y position
-
-; Done
-
-MoveSpriteDone:
- rts