Formatting update

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402120
This commit is contained in:
Sam Lantinga 2006-09-24 15:56:55 +00:00
parent d0a80f6b53
commit 4ecb44b166
27 changed files with 310 additions and 282 deletions

View file

@ -523,7 +523,7 @@ ALSA_OpenAudio(_THIS, SDL_AudioSpec * spec)
status = -1;
for (test_format = SDL_FirstAudioFormat(spec->format);
test_format && (status < 0);) {
status = 0; /* if we can't support a format, it'll become -1. */
status = 0; /* if we can't support a format, it'll become -1. */
switch (test_format) {
case AUDIO_U8:
format = SND_PCM_FORMAT_U8;

View file

@ -235,50 +235,50 @@ AHI_OpenAudio(_THIS, SDL_AudioSpec * spec)
while ((!valid_datatype) && (test_format)) {
valid_datatype = 1;
switch (test_format) {
case AUDIO_S8:
D(bug("AUDIO_S8...\n"));
spec->format = AUDIO_S8;
this->hidden->bytespersample = 1;
if (spec->channels < 2)
this->hidden->type = AHIST_M8S;
else
this->hidden->type = AHIST_S8S;
break;
case AUDIO_S8:
D(bug("AUDIO_S8...\n"));
spec->format = AUDIO_S8;
this->hidden->bytespersample = 1;
if (spec->channels < 2)
this->hidden->type = AHIST_M8S;
else
this->hidden->type = AHIST_S8S;
break;
case AUDIO_S16MSB:
D(bug("AUDIO_S16MSB...\n"));
spec->format = AUDIO_S16MSB;
this->hidden->bytespersample = 2;
if (spec->channels < 2)
this->hidden->type = AHIST_M16S;
else
this->hidden->type = AHIST_S16S;
break;
case AUDIO_S16MSB:
D(bug("AUDIO_S16MSB...\n"));
spec->format = AUDIO_S16MSB;
this->hidden->bytespersample = 2;
if (spec->channels < 2)
this->hidden->type = AHIST_M16S;
else
this->hidden->type = AHIST_S16S;
break;
case AUDIO_S32MSB:
D(bug("AUDIO_S32MSB...\n"));
spec->format = AUDIO_S32MSB;
this->hidden->bytespersample = 4;
if (spec->channels < 2)
this->hidden->type = AHIST_M32S;
else
this->hidden->type = AHIST_S32S;
break;
case AUDIO_S32MSB:
D(bug("AUDIO_S32MSB...\n"));
spec->format = AUDIO_S32MSB;
this->hidden->bytespersample = 4;
if (spec->channels < 2)
this->hidden->type = AHIST_M32S;
else
this->hidden->type = AHIST_S32S;
break;
default:
valid_datatype = 0;
test_format = SDL_NextAudioFormat();
break;
default:
valid_datatype = 0;
test_format = SDL_NextAudioFormat();
break;
}
}
if (!valid_datatype) { /* shouldn't happen, but just in case... */
if (!valid_datatype) { /* shouldn't happen, but just in case... */
SDL_SetError("Unsupported audio format");
return (-1);
}
if (spec->channels > 2) {
spec->channels = 2; /* will convert at higher level. */
spec->channels = 2; /* will convert at higher level. */
}
D(bug("Before CalculateAudioSpec\n"));

View file

@ -160,7 +160,7 @@ extern "C"
SDL_AudioFormat test_format = SDL_FirstAudioFormat(spec->format);
/* Parse the audio format and fill the Be raw audio format */
memset(&format, '\0', sizeof (media_raw_audio_format));
memset(&format, '\0', sizeof(media_raw_audio_format));
format.byte_order = B_MEDIA_LITTLE_ENDIAN;
format.frame_rate = (float) spec->freq;
format.channel_count = spec->channels; /* !!! FIXME: support > 2? */
@ -168,51 +168,51 @@ extern "C"
valid_datatype = 1;
spec->format = test_format;
switch (test_format) {
case AUDIO_S8:
format.format = media_raw_audio_format::B_AUDIO_CHAR;
break;
case AUDIO_S8:
format.format = media_raw_audio_format::B_AUDIO_CHAR;
break;
case AUDIO_U8:
format.format = media_raw_audio_format::B_AUDIO_UCHAR;
break;
case AUDIO_U8:
format.format = media_raw_audio_format::B_AUDIO_UCHAR;
break;
case AUDIO_S16LSB:
format.format = media_raw_audio_format::B_AUDIO_SHORT;
break;
case AUDIO_S16LSB:
format.format = media_raw_audio_format::B_AUDIO_SHORT;
break;
case AUDIO_S16MSB:
format.format = media_raw_audio_format::B_AUDIO_SHORT;
format.byte_order = B_MEDIA_BIG_ENDIAN;
break;
case AUDIO_S16MSB:
format.format = media_raw_audio_format::B_AUDIO_SHORT;
format.byte_order = B_MEDIA_BIG_ENDIAN;
break;
case AUDIO_S32LSB:
format.format = media_raw_audio_format::B_AUDIO_INT;
break;
case AUDIO_S32LSB:
format.format = media_raw_audio_format::B_AUDIO_INT;
break;
case AUDIO_S32MSB:
format.format = media_raw_audio_format::B_AUDIO_INT;
format.byte_order = B_MEDIA_BIG_ENDIAN;
break;
case AUDIO_S32MSB:
format.format = media_raw_audio_format::B_AUDIO_INT;
format.byte_order = B_MEDIA_BIG_ENDIAN;
break;
case AUDIO_F32LSB:
format.format = media_raw_audio_format::B_AUDIO_FLOAT;
break;
case AUDIO_F32LSB:
format.format = media_raw_audio_format::B_AUDIO_FLOAT;
break;
case AUDIO_F32MSB:
format.format = media_raw_audio_format::B_AUDIO_FLOAT;
format.byte_order = B_MEDIA_BIG_ENDIAN;
break;
case AUDIO_F32MSB:
format.format = media_raw_audio_format::B_AUDIO_FLOAT;
format.byte_order = B_MEDIA_BIG_ENDIAN;
break;
default:
valid_datatype = 0;
test_format = SDL_NextAudioFormat();
break;
default:
valid_datatype = 0;
test_format = SDL_NextAudioFormat();
break;
}
}
format.buffer_size = spec->samples;
if (!valid_datatype) { /* shouldn't happen, but just in case... */
if (!valid_datatype) { /* shouldn't happen, but just in case... */
SDL_SetError("Unsupported audio format");
return (-1);
}

View file

@ -108,34 +108,34 @@ DART_OpenAudio(_THIS, SDL_AudioSpec * spec)
// Determine the audio parameters from the AudioSpec
if (spec->channels > 2)
spec->channels = 2; // !!! FIXME: more than stereo support in OS/2?
spec->channels = 2; // !!! FIXME: more than stereo support in OS/2?
while ((!valid_datatype) && (test_format)) {
spec->format = test_format;
valid_datatype = 1;
switch (test_format) {
case AUDIO_U8:
// Unsigned 8 bit audio data
iSilence = 0x80;
iBits = 8;
break;
case AUDIO_U8:
// Unsigned 8 bit audio data
iSilence = 0x80;
iBits = 8;
break;
case AUDIO_S16LSB:
// Signed 16 bit audio data
iSilence = 0x00;
iBits = 16;
break;
case AUDIO_S16LSB:
// Signed 16 bit audio data
iSilence = 0x00;
iBits = 16;
break;
// !!! FIXME: int32?
default:
valid_datatype = 0;
test_format = SDL_NextAudioFormat();
break;
default:
valid_datatype = 0;
test_format = SDL_NextAudioFormat();
break;
}
}
if (!valid_datatype) { // shouldn't happen, but just in case...
if (!valid_datatype) { // shouldn't happen, but just in case...
// Close DART, and exit with error code!
mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0);
SDL_SetError("Unsupported audio format");

View file

@ -226,24 +226,24 @@ DCAUD_OpenAudio(_THIS, SDL_AudioSpec * spec)
spec->format = test_format;
switch (test_format) {
/* only formats Dreamcast accepts... */
case AUDIO_S8:
case AUDIO_S16LSB:
valid_datatype = 1;
break;
case AUDIO_S8:
case AUDIO_S16LSB:
valid_datatype = 1;
break;
default:
test_format = SDL_NextAudioFormat();
break;
default:
test_format = SDL_NextAudioFormat();
break;
}
}
if (!valid_datatype) { /* shouldn't happen, but just in case... */
if (!valid_datatype) { /* shouldn't happen, but just in case... */
SDL_SetError("Unsupported audio format");
return (-1);
}
if (spec->channels > 2)
spec->channels = 2; /* no more than stereo on the Dreamcast. */
spec->channels = 2; /* no more than stereo on the Dreamcast. */
/* Update the fragment size as size in bytes */
SDL_CalculateAudioSpec(spec);

View file

@ -176,27 +176,27 @@ AL_OpenAudio(_THIS, SDL_AudioSpec * spec)
spec->format = test_format;
switch (test_format) {
case AUDIO_S8:
width = AL_SAMPLE_8;
fmt = AL_SAMPFMT_TWOSCOMP;
break;
case AUDIO_S8:
width = AL_SAMPLE_8;
fmt = AL_SAMPFMT_TWOSCOMP;
break;
case AUDIO_S16SYS:
width = AL_SAMPLE_16;
fmt = AL_SAMPFMT_TWOSCOMP;
break;
case AUDIO_S16SYS:
width = AL_SAMPLE_16;
fmt = AL_SAMPFMT_TWOSCOMP;
break;
case AUDIO_F32SYS:
width = 0; /* not used here... */
fmt = AL_SAMPFMT_FLOAT;
break;
case AUDIO_F32SYS:
width = 0; /* not used here... */
fmt = AL_SAMPFMT_FLOAT;
break;
/* Docs say there is int24, but not int32.... */
default:
valid = 0;
test_format = SDL_NextAudioFormat();
break;
default:
valid = 0;
test_format = SDL_NextAudioFormat();
break;
}
if (valid) {
@ -204,8 +204,8 @@ AL_OpenAudio(_THIS, SDL_AudioSpec * spec)
valid = 0;
if (audio_config) {
if (alSetChannels(audio_config, spec->channels) < 0) {
if (spec->channels > 2) { /* can't handle > stereo? */
spec->channels = 2; /* try again below. */
if (spec->channels > 2) { /* can't handle > stereo? */
spec->channels = 2; /* try again below. */
}
}

View file

@ -212,7 +212,7 @@ Core_OpenAudio(_THIS, SDL_AudioSpec * spec)
int valid_datatype = 0;
/* Setup a AudioStreamBasicDescription with the requested format */
memset(&strdesc, '\0', sizeof (AudioStreamBasicDescription));
memset(&strdesc, '\0', sizeof(AudioStreamBasicDescription));
strdesc.mFormatID = kAudioFormatLinearPCM;
strdesc.mFormatFlags = kLinearPCMFormatFlagIsPacked;
strdesc.mChannelsPerFrame = spec->channels;
@ -223,30 +223,30 @@ Core_OpenAudio(_THIS, SDL_AudioSpec * spec)
spec->format = test_format;
/* Just a list of valid SDL formats, so people don't pass junk here. */
switch (test_format) {
case AUDIO_U8:
case AUDIO_S8:
case AUDIO_U16LSB:
case AUDIO_S16LSB:
case AUDIO_U16MSB:
case AUDIO_S16MSB:
case AUDIO_S32LSB:
case AUDIO_S32MSB:
case AUDIO_F32LSB:
case AUDIO_F32MSB:
valid_datatype = 1;
strdesc.mBitsPerChannel = SDL_AUDIO_BITSIZE(spec->format);
if (SDL_AUDIO_ISBIGENDIAN(spec->format))
strdesc.mFormatFlags |= kLinearPCMFormatFlagIsBigEndian;
case AUDIO_U8:
case AUDIO_S8:
case AUDIO_U16LSB:
case AUDIO_S16LSB:
case AUDIO_U16MSB:
case AUDIO_S16MSB:
case AUDIO_S32LSB:
case AUDIO_S32MSB:
case AUDIO_F32LSB:
case AUDIO_F32MSB:
valid_datatype = 1;
strdesc.mBitsPerChannel = SDL_AUDIO_BITSIZE(spec->format);
if (SDL_AUDIO_ISBIGENDIAN(spec->format))
strdesc.mFormatFlags |= kLinearPCMFormatFlagIsBigEndian;
if (SDL_AUDIO_ISFLOAT(spec->format))
strdesc.mFormatFlags |= kLinearPCMFormatFlagIsFloat;
else if (SDL_AUDIO_ISSIGNED(spec->format))
strdesc.mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger;
break;
if (SDL_AUDIO_ISFLOAT(spec->format))
strdesc.mFormatFlags |= kLinearPCMFormatFlagIsFloat;
else if (SDL_AUDIO_ISSIGNED(spec->format))
strdesc.mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger;
break;
}
}
if (!valid_datatype) { /* shouldn't happen, but just in case... */
if (!valid_datatype) { /* shouldn't happen, but just in case... */
SDL_SetError("Unsupported audio format");
return (-1);
}
@ -257,7 +257,7 @@ Core_OpenAudio(_THIS, SDL_AudioSpec * spec)
strdesc.mBytesPerFrame * strdesc.mFramesPerPacket;
/* Locate the default output audio unit */
memset(&desc, '\0', sizeof (ComponentDescription));
memset(&desc, '\0', sizeof(ComponentDescription));
desc.componentType = kAudioUnitComponentType;
desc.componentSubType = kAudioUnitSubType_Output;
desc.componentManufacturer = kAudioUnitID_DefaultOutput;
@ -280,8 +280,7 @@ Core_OpenAudio(_THIS, SDL_AudioSpec * spec)
result = AudioUnitSetProperty(outputAudioUnit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Input,
0,
&strdesc, sizeof (strdesc));
0, &strdesc, sizeof(strdesc));
CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_StreamFormat)")
/* Set the audio callback */
callback.inputProc = audioCallback;

View file

@ -146,23 +146,24 @@ SDL_MintAudio_SearchFrequency(_THIS, int desired_freq)
}
/* Check if FPU is present */
void SDL_MintAudio_CheckFpu(void)
void
SDL_MintAudio_CheckFpu(void)
{
unsigned long cookie_fpu;
unsigned long cookie_fpu;
SDL_MintAudio_hasfpu = 0;
if (Getcookie(C__FPU, &cookie_fpu) != C_FOUND) {
return;
}
switch ((cookie_fpu>>16)&0xfffe) {
case 2:
case 4:
case 6:
case 8:
case 16:
SDL_MintAudio_hasfpu = 1;
break;
}
SDL_MintAudio_hasfpu = 0;
if (Getcookie(C__FPU, &cookie_fpu) != C_FOUND) {
return;
}
switch ((cookie_fpu >> 16) & 0xfffe) {
case 2:
case 4:
case 6:
case 8:
case 16:
SDL_MintAudio_hasfpu = 1;
break;
}
}
/* The thread function, used under MiNT with xbios */

View file

@ -128,7 +128,7 @@ extern volatile unsigned short SDL_MintAudio_numbuf; /* Buffer to play */
extern volatile unsigned short SDL_MintAudio_mutex;
extern cookie_stfa_t *SDL_MintAudio_stfa;
extern volatile unsigned long SDL_MintAudio_clocktics;
extern unsigned short SDL_MintAudio_hasfpu; /* To preserve fpu registers if needed */
extern unsigned short SDL_MintAudio_hasfpu; /* To preserve fpu registers if needed */
/* MiNT thread variables */
extern SDL_bool SDL_MintAudio_mint_present;

View file

@ -218,7 +218,8 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
int i, masterprediv, sfreq;
unsigned long masterclock;
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ", SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",
SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));
@ -226,7 +227,7 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
DEBUG_PRINT(("freq=%d\n", spec->freq));
if (spec->channels > 2) {
spec->channels = 2; /* no more than stereo! */
spec->channels = 2; /* no more than stereo! */
}
/* Check formats available */
@ -274,7 +275,8 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
MINTAUDIO_numfreq = SDL_MintAudio_SearchFrequency(this, spec->freq);
spec->freq = MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ", SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",
SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));

View file

@ -223,49 +223,49 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
DEBUG_PRINT(("freq=%d\n", spec->freq));
if (spec->channels > 2) {
spec->channels = 2; /* no more than stereo! */
spec->channels = 2; /* no more than stereo! */
}
while ((!valid_datatype) && (test_format)) {
spec->format = test_format;
switch (test_format) {
case AUDIO_U8:
case AUDIO_S8:
case AUDIO_U16LSB:
case AUDIO_S16LSB:
case AUDIO_U16MSB:
case AUDIO_S16MSB:
case AUDIO_S32LSB:
case AUDIO_S32MSB:
case AUDIO_U8:
case AUDIO_S8:
case AUDIO_U16LSB:
case AUDIO_S16LSB:
case AUDIO_U16MSB:
case AUDIO_S16MSB:
case AUDIO_S32LSB:
case AUDIO_S32MSB:
/* no float support... */
resolution = SDL_AUDIO_BITSIZE(spec->format);
format_signed = SDL_AUDIO_ISSIGNED(spec->format);
format_bigendian = SDL_AUDIO_ISBIGENDIAN(spec->format);
resolution = SDL_AUDIO_BITSIZE(spec->format);
format_signed = SDL_AUDIO_ISSIGNED(spec->format);
format_bigendian = SDL_AUDIO_ISBIGENDIAN(spec->format);
/* Check formats available */
snd_format = Sndstatus(SND_QUERYFORMATS);
switch (resolution) {
case 8:
if (snd_format & SND_FORMAT8) {
valid_datatype = 1;
snd_format = Sndstatus(SND_QUERY8BIT);
}
break;
case 16:
if (snd_format & SND_FORMAT16) {
valid_datatype = 1;
snd_format = Sndstatus(SND_QUERY16BIT);
}
break;
case 32:
if (snd_format & SND_FORMAT32) {
valid_datatype = 1;
snd_format = Sndstatus(SND_QUERY32BIT);
}
break;
/* Check formats available */
snd_format = Sndstatus(SND_QUERYFORMATS);
switch (resolution) {
case 8:
if (snd_format & SND_FORMAT8) {
valid_datatype = 1;
snd_format = Sndstatus(SND_QUERY8BIT);
}
break;
case 16:
if (snd_format & SND_FORMAT16) {
valid_datatype = 1;
snd_format = Sndstatus(SND_QUERY16BIT);
}
break;
case 32:
if (snd_format & SND_FORMAT32) {
valid_datatype = 1;
snd_format = Sndstatus(SND_QUERY32BIT);
}
break;
}
break;
}
}
@ -328,7 +328,8 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
MINTAUDIO_numfreq = SDL_MintAudio_SearchFrequency(this, spec->freq);
spec->freq = MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ", SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",
SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));

View file

@ -225,7 +225,8 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
int i;
unsigned long masterclock, masterprediv;
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ", SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",
SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));
@ -233,7 +234,7 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
DEBUG_PRINT(("freq=%d\n", spec->freq));
if (spec->channels > 2) {
spec->channels = 2; /* no more than stereo! */
spec->channels = 2; /* no more than stereo! */
}
/* Check formats available */
@ -241,7 +242,7 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
switch (cookie_mcsn->play) {
case MCSN_ST:
spec->channels = 1;
spec->format = AUDIO_S8; /* FIXME: is it signed or unsigned ? */
spec->format = AUDIO_S8; /* FIXME: is it signed or unsigned ? */
SDL_MintAudio_AddFrequency(this, 12500, 0, 0, -1);
break;
case MCSN_TT: /* Also STE, Mega STE */
@ -279,9 +280,9 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
(1 << i) - 1, -1);
}
}
spec->format |= SDL_AUDIO_MASK_SIGNED; /* Audio is always signed */
spec->format |= SDL_AUDIO_MASK_SIGNED; /* Audio is always signed */
if ((SDL_AUDIO_BITSIZE(spec->format)) == 16) {
spec->format |= SDL_AUDIO_MASK_ENDIAN; /* Audio is always big endian */
spec->format |= SDL_AUDIO_MASK_ENDIAN; /* Audio is always big endian */
spec->channels = 2; /* 16 bits always stereo */
}
break;
@ -299,7 +300,8 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
MINTAUDIO_numfreq = SDL_MintAudio_SearchFrequency(this, spec->freq);
spec->freq = MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ", SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",
SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));

View file

@ -206,7 +206,8 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
{
int i;
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ", SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",
SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));
@ -214,11 +215,11 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
DEBUG_PRINT(("freq=%d\n", spec->freq));
if (SDL_AUDIO_BITSIZE(spec->format) > 16) {
spec->format = AUDIO_S16SYS; /* clamp out int32/float32 ... */
spec->format = AUDIO_S16SYS; /* clamp out int32/float32 ... */
}
if (spec->channels > 2) {
spec->channels = 2; /* no more than stereo! */
spec->channels = 2; /* no more than stereo! */
}
/* Check formats available */
@ -239,7 +240,8 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
MINTAUDIO_numfreq = SDL_MintAudio_SearchFrequency(this, spec->freq);
spec->freq = MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ", SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",
SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));

View file

@ -83,7 +83,7 @@ Audio_Available(void)
unsigned long dummy;
const char *envr = SDL_getenv("SDL_AUDIODRIVER");
/*SDL_MintAudio_mint_present = (Getcookie(C_MiNT, &dummy) == C_FOUND);*/
/*SDL_MintAudio_mint_present = (Getcookie(C_MiNT, &dummy) == C_FOUND); */
SDL_MintAudio_mint_present = SDL_FALSE;
/* We can't use XBIOS in interrupt with Magic, don't know about thread */
@ -360,21 +360,22 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
int i;
Uint32 extclock;
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ", SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",
SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));
DEBUG_PRINT(("channels=%d, ", spec->channels));
DEBUG_PRINT(("freq=%d\n", spec->freq));
spec->format |= SDL_AUDIO_MASK_SIGNED; /* Audio is always signed */
spec->format |= SDL_AUDIO_MASK_SIGNED; /* Audio is always signed */
/* clamp out int32/float32 */
if (SDL_AUDIO_BITSIZE(spec->format) >= 16) {
spec->format = AUDIO_S16MSB; /* Audio is always big endian */
spec->format = AUDIO_S16MSB; /* Audio is always big endian */
spec->channels = 2; /* 16 bits always stereo */
} else if (spec->channels > 2) {
spec->channels = 2; /* no more than stereo! */
spec->channels = 2; /* no more than stereo! */
}
MINTAUDIO_freqcount = 0;
@ -406,7 +407,8 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
MINTAUDIO_numfreq = SDL_MintAudio_SearchFrequency(this, spec->freq);
spec->freq = MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ", SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",
SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));
@ -468,7 +470,7 @@ Mint_InitAudio(_THIS, SDL_AudioSpec * spec)
} else {
/* Install interrupt */
Jdisint(MFP_DMASOUND);
/*Xbtimer(XB_TIMERA, 8, 1, SDL_MintAudio_XbiosInterrupt);*/
/*Xbtimer(XB_TIMERA, 8, 1, SDL_MintAudio_XbiosInterrupt); */
Xbtimer(XB_TIMERA, 8, 1, SDL_MintAudio_Dma8Interrupt);
Jenabint(MFP_DMASOUND);