Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / devs / AHI / Test / asmtest / asmtest.s
blobe563e7b99d7c02361e72065595fa808b8ae51524
1 ; Run me to assemble with PhxAss
3 IF 0
4 PhxAss SYMDEBUG LINEDEBUG QUIET OPT NRQBPSMD __test.s
5 IF NOT WARN
6 __test
7 ENDIF
8 Quit
9 ENDC
11 incdir include:
12 include lvo/exec_lib.i
13 include dos/dos.i
14 include lvo/dos_lib.i
15 include hardware/all.i
16 include exec/io.i
17 include devices/ahi.i
18 include lvo/ahi_lib.i
19 include macros.i
21 start
22 base exec
23 moveq #-1,d0
24 moveq #0,d1
25 ; call AllocMem ;flushlibs
27 moveq #0,d0
28 lea dosname(pc),a1
29 call OpenLibrary
30 move.l d0,dosbase
31 beq.w nodos
34 OPENAHI 4
35 move.l d0,ahibase
36 beq.w noahi
37 move.l d0,a6
39 ; call AHI_KillAudio
40 lea tags(pc),a1
41 call AHI_AllocAudioA
42 move.l d0,ctrlblock
43 beq.w noctrlblock
45 move.l ctrlblock(pc),a2
47 moveq #0,d0
48 moveq #AHIST_SAMPLE,d1
49 lea Sound0Info,a0
50 call AHI_LoadSound
52 moveq #1,d0
53 moveq #AHIST_SAMPLE,d1
54 lea Sound1Info,a0
55 call AHI_LoadSound
57 ; moveq #2,d0
58 ; move.l #AHIST_INPUT,d1
59 ; suba.l a0,a0
60 ; call AHI_LoadSound
62 lea ctrltags(pc),a1
63 call AHI_ControlAudioA
65 *** S
66 moveq #0,d0 ;channel
67 moveq #1,d1 ;sound
68 ; move.l #samp2_len,d2 ;offset
69 ; move.l #-samp2_len,d3 ;length
70 move.l #0,d2 ;offset
71 move.l #0,d3 ;length
72 moveq #AHISF_IMM,d4 ;flags
73 call AHI_SetSound
75 moveq #0,d0
76 move.l #$10000,d1 ;volume
77 move.l #$10000,d2 ;panning
78 moveq #AHISF_IMM,d3
79 call AHI_SetVol
81 moveq #0,d0
82 move.l #17640,d1
83 moveq #AHISF_IMM,d2
84 call AHI_SetFreq
86 move.l sp,d7
87 move.l #TAG_DONE,-(sp)
88 move.l #50<<16,-(sp)
89 move.l #AHIA_PlayerFreq,-(sp)
90 move.l #TRUE,-(sp)
91 move.l #AHIC_Play,-(sp)
93 move.l sp,a1
94 jsr _LVOAHI_ControlAudioA(a6)
95 move.l d7,sp
97 *** L
98 ; moveq #1,d0 ;channel
99 ; moveq #1,d1 ;sound
100 ; moveq #0,d2 ;offset
101 ; moveq #0,d3 ;length
102 ; moveq #AHISF_IMM,d4 ;flags
103 ; call AHI_SetSound
105 ; moveq #1,d0
106 ; move.l #$10000,d1 ;volume
107 ; move.l #$c000,d2 ;panning
108 ; moveq #AHISF_IMM,d3
109 ; call AHI_SetVol
111 ; moveq #1,d0
112 ; move.l #17640,d1
113 ; moveq #AHISF_IMM,d2
114 ; call AHI_SetFreq
116 *** L Wave
117 ; lea mvstruct(pc),a0
118 ; call AHI_SetEffect
120 lea mask1struct(pc),a0
121 call AHI_SetEffect
123 lea echostruct(pc),a0
124 call AHI_SetEffect
126 lea mask2struct(pc),a0
127 call AHI_SetEffect
129 moveq #1,d0 ;channel
130 moveq #0,d1 ;sound
131 moveq #0,d2
132 moveq #0,d3
133 moveq #AHISF_IMM,d4 ;flags
134 call AHI_SetSound
136 moveq #1,d0
137 move.l #$10000,d1 ;volume
138 move.l #$f000,d2 ;panning
139 moveq #AHISF_IMM,d3
140 call AHI_SetVol
142 moveq #1,d0
143 move.l #8000,d1
144 moveq #AHISF_IMM,d2
145 call AHI_SetFreq
147 moveq #1,d0 ;channel
148 moveq #AHI_NOSOUND,d1 ;sound
149 moveq #0,d2
150 moveq #0,d3
151 moveq #0,d4 ;flags
152 call AHI_SetSound
154 ********** INPUT *************************
156 ; moveq #2,d0 ;channel
157 ; moveq #2,d1 ;sound
158 ; moveq #0,d2 ;offset
159 ; moveq #0,d3 ;length
160 ; moveq #AHISF_IMM,d4 ;flags
161 ; call AHI_SetSound
163 ; moveq #2,d0
164 ; move.l #$10000,d1 ;volume
165 ; move.l #$f000,d2 ;panning
166 ; moveq #AHISF_IMM,d3
167 ; call AHI_SetVol
169 ; moveq #2,d0
170 ; move.l #AHI_MIXFREQ,d1
171 ; moveq #AHISF_IMM,d2
172 ; call AHI_SetFreq
175 base dos
176 moveq #1,d1
177 call Delay
178 btst #7,$bfe001
179 bne.b .lp
180 exit:
181 base ahi
182 move.l ctrlblock(pc),a2
183 call AHI_FreeAudio
185 noctrlblock
186 noahi
187 CLOSEAHI
189 base exec
190 move.l dosbase(pc),a1
191 call CloseLibrary
192 nodos
195 Sound0Info:
196 dc.l AHIST_S8S
197 dc.l samp1
198 dc.l samp1_len
199 Sound1Info:
200 dc.l AHIST_M16S
201 dc.l samp2
202 dc.l samp2_len
204 mvstruct
205 dc.l AHIET_MASTERVOLUME
206 dc.l $10000
208 echostruct
209 dc.l AHIET_DSPECHO ; ahie_Effect
210 dc.l 6000 ; ahiede_Delay
211 dc.l $8000 ; ahiede_Feedback
212 dc.l $8000 ; ahiede_Mix
213 dc.l $10000 ; ahiede_Cross
215 mask1struct
216 dc.l AHIET_DSPMASK
217 dc.w 4
218 dc.b AHIEDM_DRY, AHIEDM_WET, AHIEDM_DRY, AHIEDM_DRY
220 mask2struct
221 dc.l AHIET_DSPMASK
222 dc.w 4
223 dc.b AHIEDM_WET, AHIEDM_DRY, AHIEDM_DRY, AHIEDM_DRY
225 tags
226 dc.l AHIA_MixFreq,17640
227 dc.l AHIA_AudioID,$00020018
228 dc.l AHIA_Channels,4
229 dc.l AHIA_Sounds,10
230 dc.l AHIA_PlayerFreq, 50<<16
231 dc.l AHIA_MinPlayerFreq, 20<<16
232 dc.l AHIA_MaxPlayerFreq, 70<<16
233 dc.l TAG_DONE
235 ctrltags
236 dc.l AHIC_Play,TRUE
237 dc.l TAG_DONE
239 port dc.l 0
240 ior dc.l 0
241 ctrlblock dc.l 0
242 ahibase dc.l 0
243 dosbase dc.l 0
244 ahiname AHINAME
245 dosname DOSNAME
247 section samples,data
248 incdir Projekt:ahi/samples/
250 dc.b $7f
251 samp1
252 ; DC.B $0D,$25,$3C,$51,$63,$71,$7A,$7F,$7F,$7A,$71,$63,$51,$3C,$25,$0D
253 ; DC.B $F3,$DB,$C4,$AF,$9D,$8F,$86,$81,$81,$86,$8F,$9D,$AF,$C4,$DB,$F3
254 ; incbin sine.sb
255 incbin ASS-14.sb
256 ; incbin stereo8.sb
257 samp1_len EQU (*-samp1)/2
258 dc.b $80
260 samp2
261 ; incbin cocacola.sw
262 incbin LouiseR.sw
263 samp2_len EQU (*-samp2)/2
264 incbin LouiseR.sw