forked from OldSkoolCoder/OSKBasic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathincSPCommand.asm
64 lines (54 loc) · 1.52 KB
/
incSPCommand.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
;*******************************************************************************
;* SP Command *
;* This BASIC function to turn on and off a Sprite *
;* *****************************************************************************
;* Syntax : SP or sp Shifted O *
;* Inputs : ON / OFF Sprite # *
;*******************************************************************************
; sp : on/off #
COM_SP
;jsr bas_CHRGET$
pha
jsr bas_CHRGET$
jsr GETSpriteNo
pla
cmp #TOKANISER_OFF
bne @NextOption
;jsr bas_CHRGET$
;jsr GETSpriteNo
jsr WorkOutSpriteBit
lda BYTEMASK,x
eor #%11111111
and VICII_SPENA
sta VICII_SPENA
rts
@NextOption
cmp #TOKANISER_ON
bne @InvalidCommand
;jsr bas_CHRGET$
;jsr GETSpriteNo
jsr WorkOutSpriteBit
lda VICII_SPENA
ora BYTEMASK,x
sta VICII_SPENA
rts
@InvalidCommand
pla
pla
jmp SYNTAX_ERROR
;==============================================================================
; Get Sprite Number From Basic
; Output : x Reg = Sprite Number
; Error : Illegal Quantity
;==============================================================================
GETSpriteNo
jsr bas_GETBYTC$; Get Sprite Number
cpx #8
bcc @ValidSpriteNo
@IllegalError
pla
pla
; Illegal Qty Error
jmp bas_IQERR$
@ValidSpriteNo
rts