comparison src/audio/mint/SDL_mintaudio_xbios.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
190 { 190 {
191 int i; 191 int i;
192 192
193 DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff)); 193 DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff));
194 DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); 194 DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
195 DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x8000)!=0))); 195 DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
196 DEBUG_PRINT(("channels=%d, ", spec->channels)); 196 DEBUG_PRINT(("channels=%d, ", spec->channels));
197 DEBUG_PRINT(("freq=%d\n", spec->freq)); 197 DEBUG_PRINT(("freq=%d\n", spec->freq));
198 198
199 spec->format |= 0x8000; /* Audio is always signed */ 199 spec->format |= 0x8000; /* Audio is always signed */
200 if ((spec->format & 0x00ff)==16) { 200 if ((spec->format & 0x00ff)==16) {
213 MINTAUDIO_numfreq=SDL_MintAudio_SearchFrequency(this, 1, spec->freq); 213 MINTAUDIO_numfreq=SDL_MintAudio_SearchFrequency(this, 1, spec->freq);
214 spec->freq=MINTAUDIO_hardfreq[MINTAUDIO_numfreq]; 214 spec->freq=MINTAUDIO_hardfreq[MINTAUDIO_numfreq];
215 215
216 DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff)); 216 DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff));
217 DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); 217 DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
218 DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x8000)!=0))); 218 DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
219 DEBUG_PRINT(("channels=%d, ", spec->channels)); 219 DEBUG_PRINT(("channels=%d, ", spec->channels));
220 DEBUG_PRINT(("freq=%d\n", spec->freq)); 220 DEBUG_PRINT(("freq=%d\n", spec->freq));
221 221
222 return 0; 222 return 0;
223 } 223 }
290 } 290 }
291 291
292 SDL_CalculateAudioSpec(spec); 292 SDL_CalculateAudioSpec(spec);
293 293
294 /* Allocate memory for audio buffers in DMA-able RAM */ 294 /* Allocate memory for audio buffers in DMA-able RAM */
295 spec->size = spec->samples;
296 spec->size *= spec->channels;
297 spec->size *= (spec->format & 0xFF)/8;
298
299 DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size)); 295 DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size));
300 296
301 SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM); 297 SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM);
302 if (SDL_MintAudio_audiobuf[0]==NULL) { 298 if (SDL_MintAudio_audiobuf[0]==NULL) {
303 SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer"); 299 SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer");