-
Notifications
You must be signed in to change notification settings - Fork 1
/
incSPRITECommand.asm
78 lines (67 loc) · 2.2 KB
/
incSPRITECommand.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
;*******************************************************************************
;* SPRITE Command *
;* This BASIC function to set up a sprite on the system *
;* *****************************************************************************
;* Syntax : SPRITE or sp Shifted R *
;* Inputs : Sprite No *
;* : Sprite Pointer # *
;* : Expanded X Enable / Disable *
;* : Expanded Y Enable / Disable *
;* : Background Priority Enable / Disable *
;* : MultiColour Enable / Disable *
;*******************************************************************************
; sprite : sprite no, xX, yY, background, multiCol
COM_SPRITE
jsr GETSpriteNo
stx COMM_AXLO
jsr bas_CHKCOM$ ; Checks For a Comma
jsr bas_GETBYTC$; Get Sprite Poointer#
txa
ldx COMM_AXLO ; Sprite #
sta SPRITE_POINTERS,x ; Normal Text Mode
sta SPRITE_POINTERS + $8000,x ; Hi-Res Mode
lda VICII_XXPAND
jsr MOBPARAMGET
sta VICII_XXPAND
lda VICII_YXPAND
jsr MOBPARAMGET
sta VICII_YXPAND
lda VICII_SPBGPR
jsr MOBPARAMGET
sta VICII_SPBGPR
lda VICII_SPMC
jsr MOBPARAMGET
sta VICII_SPMC
rts
MOBPARAMGET
sta COMM_AY
jsr bas_CHRGOT$
jsr bas_CHKCOM$ ; Get Comma
jsr bas_GETBYTC$ ; Get # 0->255
cpx #2
bcc @ValueOK
jmp bas_IQERR$
@ValueOK
cpx #0
beq @Disable
jsr WorkOutSpriteBit
lda COMM_AY
ora BYTEMASK,x
rts
@Disable
jsr WorkOutSpriteBit
lda BYTEMASK,x
eor #%11111111
and COMM_AY
rts
;==============================================================================
; Get Sprite Number Bit Index
; Input : COMM_AXLO
; Output : x Reg = Sprite Bit Number
;==============================================================================
WorkOutSpriteBit
lda #7
sec
sbc COMM_AXLO
tax
rts