comparison src/audio/mint/SDL_mintaudio_mcsn.c @ 2043:adf732f1f016

Formatting update
author Sam Lantinga <slouken@libsdl.org>
date Sun, 24 Sep 2006 15:56:55 +0000
parents d48ead2d2ba5
children 5f6550e5184f b19680c84cdf
comparison
equal deleted inserted replaced
2042:3908e1f808e1 2043:adf732f1f016
223 Mint_CheckAudio(_THIS, SDL_AudioSpec * spec) 223 Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
224 { 224 {
225 int i; 225 int i;
226 unsigned long masterclock, masterprediv; 226 unsigned long masterclock, masterprediv;
227 227
228 DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ", SDL_AUDIO_BITSIZE(spec->format))); 228 DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",
229 SDL_AUDIO_BITSIZE(spec->format)));
229 DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format))); 230 DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
230 DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format))); 231 DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
231 DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format))); 232 DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));
232 DEBUG_PRINT(("channels=%d, ", spec->channels)); 233 DEBUG_PRINT(("channels=%d, ", spec->channels));
233 DEBUG_PRINT(("freq=%d\n", spec->freq)); 234 DEBUG_PRINT(("freq=%d\n", spec->freq));
234 235
235 if (spec->channels > 2) { 236 if (spec->channels > 2) {
236 spec->channels = 2; /* no more than stereo! */ 237 spec->channels = 2; /* no more than stereo! */
237 } 238 }
238 239
239 /* Check formats available */ 240 /* Check formats available */
240 MINTAUDIO_freqcount = 0; 241 MINTAUDIO_freqcount = 0;
241 switch (cookie_mcsn->play) { 242 switch (cookie_mcsn->play) {
242 case MCSN_ST: 243 case MCSN_ST:
243 spec->channels = 1; 244 spec->channels = 1;
244 spec->format = AUDIO_S8; /* FIXME: is it signed or unsigned ? */ 245 spec->format = AUDIO_S8; /* FIXME: is it signed or unsigned ? */
245 SDL_MintAudio_AddFrequency(this, 12500, 0, 0, -1); 246 SDL_MintAudio_AddFrequency(this, 12500, 0, 0, -1);
246 break; 247 break;
247 case MCSN_TT: /* Also STE, Mega STE */ 248 case MCSN_TT: /* Also STE, Mega STE */
248 spec->format = AUDIO_S8; 249 spec->format = AUDIO_S8;
249 masterclock = MASTERCLOCK_STE; 250 masterclock = MASTERCLOCK_STE;
277 (MASTERPREDIV_FALCON * 278 (MASTERPREDIV_FALCON *
278 (1 << i)), CLKEXT, 279 (1 << i)), CLKEXT,
279 (1 << i) - 1, -1); 280 (1 << i) - 1, -1);
280 } 281 }
281 } 282 }
282 spec->format |= SDL_AUDIO_MASK_SIGNED; /* Audio is always signed */ 283 spec->format |= SDL_AUDIO_MASK_SIGNED; /* Audio is always signed */
283 if ((SDL_AUDIO_BITSIZE(spec->format)) == 16) { 284 if ((SDL_AUDIO_BITSIZE(spec->format)) == 16) {
284 spec->format |= SDL_AUDIO_MASK_ENDIAN; /* Audio is always big endian */ 285 spec->format |= SDL_AUDIO_MASK_ENDIAN; /* Audio is always big endian */
285 spec->channels = 2; /* 16 bits always stereo */ 286 spec->channels = 2; /* 16 bits always stereo */
286 } 287 }
287 break; 288 break;
288 } 289 }
289 290
297 #endif 298 #endif
298 299
299 MINTAUDIO_numfreq = SDL_MintAudio_SearchFrequency(this, spec->freq); 300 MINTAUDIO_numfreq = SDL_MintAudio_SearchFrequency(this, spec->freq);
300 spec->freq = MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency; 301 spec->freq = MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
301 302
302 DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ", SDL_AUDIO_BITSIZE(spec->format))); 303 DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",
304 SDL_AUDIO_BITSIZE(spec->format)));
303 DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format))); 305 DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
304 DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format))); 306 DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
305 DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format))); 307 DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));
306 DEBUG_PRINT(("channels=%d, ", spec->channels)); 308 DEBUG_PRINT(("channels=%d, ", spec->channels));
307 DEBUG_PRINT(("freq=%d\n", spec->freq)); 309 DEBUG_PRINT(("freq=%d\n", spec->freq));