comparison src/audio/mint/SDL_mintaudio_dma8.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
221 int i, masterprediv; 221 int i, masterprediv;
222 unsigned long masterclock; 222 unsigned long masterclock;
223 223
224 DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff)); 224 DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff));
225 DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); 225 DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
226 DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x8000)!=0))); 226 DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
227 DEBUG_PRINT(("channels=%d, ", spec->channels)); 227 DEBUG_PRINT(("channels=%d, ", spec->channels));
228 DEBUG_PRINT(("freq=%d\n", spec->freq)); 228 DEBUG_PRINT(("freq=%d\n", spec->freq));
229 229
230 /* Check formats available */ 230 /* Check formats available */
231 spec->format = AUDIO_S8; 231 spec->format = AUDIO_S8;
261 MINTAUDIO_numfreq=SDL_MintAudio_SearchFrequency(this, 0, spec->freq); 261 MINTAUDIO_numfreq=SDL_MintAudio_SearchFrequency(this, 0, 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 }
325 } 325 }
326 326
327 SDL_CalculateAudioSpec(spec); 327 SDL_CalculateAudioSpec(spec);
328 328
329 /* Allocate memory for audio buffers in DMA-able RAM */ 329 /* Allocate memory for audio buffers in DMA-able RAM */
330 spec->size = spec->samples;
331 spec->size *= spec->channels;
332 spec->size *= (spec->format & 0xFF)/8;
333
334 DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size)); 330 DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size));
335 331
336 SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM); 332 SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM);
337 if (SDL_MintAudio_audiobuf[0]==NULL) { 333 if (SDL_MintAudio_audiobuf[0]==NULL) {
338 SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer"); 334 SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer");