comparison src/audio/mint/SDL_mintaudio_mcsn.c @ 704:c4803992e09c

Small bugfixes
author Patrice Mandin <patmandin@gmail.com>
date Sat, 30 Aug 2003 20:00:11 +0000
parents 594422ab8f9f
children b8d311d90021
comparison
equal deleted inserted replaced
703:ca809c1b41ca 704:c4803992e09c
210 int i; 210 int i;
211 unsigned long masterclock, masterprediv; 211 unsigned long masterclock, masterprediv;
212 212
213 DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff)); 213 DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff));
214 DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); 214 DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
215 DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x8000)!=0))); 215 DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
216 DEBUG_PRINT(("channels=%d, ", spec->channels)); 216 DEBUG_PRINT(("channels=%d, ", spec->channels));
217 DEBUG_PRINT(("freq=%d\n", spec->freq)); 217 DEBUG_PRINT(("freq=%d\n", spec->freq));
218 218
219 /* Check formats available */ 219 /* Check formats available */
220 MINTAUDIO_nfreq=4; 220 MINTAUDIO_nfreq=4;
261 MINTAUDIO_numfreq=SDL_MintAudio_SearchFrequency(this, (cookie_mch>>16)==MCH_F30, spec->freq); 261 MINTAUDIO_numfreq=SDL_MintAudio_SearchFrequency(this, (cookie_mch>>16)==MCH_F30, spec->freq);
262 spec->freq=MINTAUDIO_hardfreq[MINTAUDIO_numfreq]; 262 spec->freq=MINTAUDIO_hardfreq[MINTAUDIO_numfreq];
263 263
264 DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff)); 264 DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff));
265 DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); 265 DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
266 DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x8000)!=0))); 266 DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
267 DEBUG_PRINT(("channels=%d, ", spec->channels)); 267 DEBUG_PRINT(("channels=%d, ", spec->channels));
268 DEBUG_PRINT(("freq=%d\n", spec->freq)); 268 DEBUG_PRINT(("freq=%d\n", spec->freq));
269 269
270 return 0; 270 return 0;
271 } 271 }
350 } 350 }
351 351
352 SDL_CalculateAudioSpec(spec); 352 SDL_CalculateAudioSpec(spec);
353 353
354 /* Allocate memory for audio buffers in DMA-able RAM */ 354 /* Allocate memory for audio buffers in DMA-able RAM */
355 spec->size = spec->samples;
356 spec->size *= spec->channels;
357 spec->size *= (spec->format & 0xFF)/8;
358
359 DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size)); 355 DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size));
360 356
361 SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM); 357 SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM);
362 if (SDL_MintAudio_audiobuf[0]==NULL) { 358 if (SDL_MintAudio_audiobuf[0]==NULL) {
363 SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer"); 359 SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer");