-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathincVOICECommand.asm
96 lines (80 loc) · 1.9 KB
/
incVOICECommand.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
;*******************************************************************************
;* VOICE Command *
;* This BASIC function to set up the Voice Channel *
;* *****************************************************************************
;* Syntax : VOICE Voice#, Continue/Not, Volumn *
;* Inputs : *
;* : *
;*******************************************************************************
; sound : Voice# (0-3), (0-255), (0-15)
COM_VOICE
jsr bas_GETBYTC$
cpx #4
bcc @NotIllegal
@VOICE_Illegal
jmp bas_IQERR$
@NotIllegal
cpx #0
beq @VOICE_Illegal
stx COMM_AY ; VOICE Offset
stx COMM_CY ; VOICE No
lda #$F9
ldy #0
@VoiceLooper
clc
adc #$07
iny
cpy COMM_AY
bne @VoiceLooper
sta COMM_AY
jsr bas_CHRGOT$
cmp #44 ; Comma
bne VOICE_EXIT
jsr bas_CHRGET$
jsr GetVoiceType
; jsr bas_GETBYTC$
; cpx #2
; bcc @NotIllegal2
; jmp bas_IQERR$
;@NotIllegal2
txa
ldy COMM_CY
sta COMM_VOICEGATES,y
jsr bas_CHRGET$
cmp #44 ; Comma
bne VOICE_EXIT
jsr bas_CHRGET$
jsr bas_GETBYTC$
cpx #$10
bcc @NotIllegal3
jmp bas_IQERR$
@NotIllegal3
stx $D418
VOICE_EXIT
rts
GetVoiceType
cmp #TOKANISER_TRIANGLE
bne @IsItSAWTooth
ldx #$10
rts
@IsitSAWTooth
cmp #TOKANISER_SAW
bne @IsItPulse
ldx #$20
rts
@IsItPulse
cmp #TOKANISER_PULSE
bne @IsItNoise
ldx #$40
rts
@IsItNoise
cmp #TOKANISER_NOISE
bne @Error
ldx #$80
rts
@Error
pla ; Pull this JSR Return
pla
pla ; Pull Basic JSR Return
pla
jmp SYNTAX_ERROR