-
Notifications
You must be signed in to change notification settings - Fork 1
/
incSPLACECommand.asm
70 lines (57 loc) · 1.65 KB
/
incSPLACECommand.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
;*******************************************************************************
;* SPLACE Command *
;* This BASIC function to move a sprite around the screen *
;* *****************************************************************************
;* Syntax : SPLACE or sp Shifted L *
;* Inputs : Sprite No *
;* : X (0->319) and Y (0 ->199) *
;* : Sprite Colour *
;*******************************************************************************
; sprite : sprite no,x,y,col
COM_SPLACE
jsr GETSpriteNo
stx COMM_AXLO
jsr bas_CHKCOM$ ; Checks For a Comma
jsr GetNo2 ; Get X
cpy #1
bcc @StoreXPos
beq @TestingXLo
@IllegalError
jmp bas_IQERR$
@TestingXLo
cmp #144
bcs @IllegalError
@StoreXPos
sta COMM_XLO
sty COMM_XHI
jsr bas_CHKCOM$ ; Checks For a Comma
jsr bas_GETBYTC$; Get Sprite Y
stx COMM_Y1
lda COMM_AXLO
asl
tay
lda COMM_XLO
sta VICII_SP0X,y
lda COMM_Y1
sta VICII_SP0Y,y
jsr WorkOutSpriteBit
lda BYTEMASK,x
eor #%11111111
and VICII_MSIGX
sta VICII_MSIGX
lda COMM_XHI
beq @SpriteColour
lda VICII_MSIGX
ora BYTEMASK,x
sta VICII_MSIGX
@SpriteColour
jsr bas_CHKCOM$ ; Checks For a Comma
jsr bas_GETBYTC$; Get Sprite Colour
cpx #16
bcc @SetColour
jmp bas_IQERR$
@SetColour
txa
ldx COMM_AXLO
sta VICII_SP0COL,x
rts