Rev 374 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 374 | Rev 376 | ||
---|---|---|---|
Line 176... | Line 176... | ||
176 | ( int sfxVolume, |
176 | ( int sfxVolume, |
177 | int musicVolume ) |
177 | int musicVolume ) |
178 | { |
178 | { |
179 | int i; |
179 | int i; |
180 | char *thread_stack; |
180 | char *thread_stack; |
181 | int ver; |
- | |
Line 182... | Line 181... | ||
182 | 181 | ||
Line 183... | Line 182... | ||
183 | numChannels = NUM_CHANNELS; |
182 | numChannels = NUM_CHANNELS; |
184 | 183 | ||
Line 241... | Line 240... | ||
241 | extern signed short *mixbuffer; |
240 | extern signed short *mixbuffer; |
Line 242... | Line 241... | ||
242 | 241 | ||
243 | void sound_proc(void) |
242 | void sound_proc(void) |
244 | { |
243 | { |
- | 244 | int ver; |
|
245 | int ver; |
245 | int err; |
246 | SND_EVENT evnt; |
246 | SND_EVENT evnt; |
Line -... | Line 247... | ||
- | 247 | int i; |
|
- | 248 | ||
- | 249 | if(err = InitSound(&ver)) |
|
- | 250 | { |
|
- | 251 | printf("Error %x Sound service not installed\n\r", err); |
|
- | 252 | _asm |
|
- | 253 | { |
|
- | 254 | mov eax, -1 |
|
- | 255 | int 0x40 |
|
- | 256 | }; |
|
- | 257 | } |
|
247 | int i; |
258 | |
248 | 259 | ||
249 | if((ver = InitSound())< SOUND_VERSION ) |
260 | if(ver< SOUND_VERSION) |
250 | { |
261 | { |
251 | printf("Sound service version mismatch\n\r"); |
262 | printf("Sound service version mismatch\n\r"); |
- | 263 | printf("Installed version: %d, required version %d\n\r", |
|
- | 264 | ver, SOUND_VERSION); |
|
- | 265 | _asm |
|
- | 266 | { |
|
- | 267 | mov eax, -1 |
|
252 | printf("Installed version: %d, required version %d\n\r", |
268 | int 0x40 |
Line 253... | Line 269... | ||
253 | ver, SOUND_VERSION); |
269 | }; |
- | 270 | }; |
|
- | 271 | ||
- | 272 | if (err = CreateBuffer(PCM_2_16_11|PCM_RING,0, &hMixBuff)) |
|
- | 273 | { |
|
- | 274 | printf("Error %x sound not available\n\r", err); |
|
- | 275 | printf("handle = %x\n\r", hMixBuff); |
|
- | 276 | _asm |
|
- | 277 | { |
|
- | 278 | mov eax, -1 |
|
Line 254... | Line 279... | ||
254 | }; |
279 | int 0x40 |
255 | 280 | }; |
|
256 | hMixBuff=CreateBuffer(PCM_2_16_11|PCM_RING,0); |
281 | } |
- | 282 | ||
257 | 283 | if(err = GetBufferSize(hMixBuff, &mix_size)) |
|
258 | if(!hMixBuff) |
284 | { |
259 | { |
285 | printf("Error %x get buffer size\n\r", err); |
260 | printf("sound not available\n\r"); |
286 | printf("size = %x\n\r", mix_size); |
261 | _asm |
287 | _asm |
262 | { |
288 | { |
- | 289 | mov eax, -1 |
|
Line 263... | Line -... | ||
263 | mov eax, -1 |
- | |
264 | int 0x40 |
290 | int 0x40 |
Line -... | Line 291... | ||
- | 291 | }; |
|
- | 292 | }; |
|
- | 293 | mix_size= mix_size/2; |
|
- | 294 | ||
- | 295 | printf("mixer size %d\n\r", mix_size); |
|
- | 296 | ||
- | 297 | if(err=PlayBuffer(hMixBuff, 0)) |
|
- | 298 | { |
|
- | 299 | printf("Error %x play buffer\n\r", err); |
|
- | 300 | _asm |
|
265 | }; |
301 | { |
Line 266... | Line -... | ||
266 | }; |
- | |
267 | 302 | mov eax, -1 |
|
268 | mix_size=GetBufferSize(hMixBuff)/2; |
303 | int 0x40 |
269 | printf("mixer size %d\n\r", mix_size); |
304 | }; |
Line 270... | Line 305... | ||
270 | 305 | } |