Commit f9ec6072 authored by Patrice Mandin's avatar Patrice Mandin

Small bugfixes

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40705
parent d5e201c8
...@@ -38,9 +38,9 @@ ...@@ -38,9 +38,9 @@
SDL_AudioDevice *SDL_MintAudio_device; SDL_AudioDevice *SDL_MintAudio_device;
Uint8 *SDL_MintAudio_audiobuf[2]; /* Pointers to buffers */ Uint8 *SDL_MintAudio_audiobuf[2]; /* Pointers to buffers */
long SDL_MintAudio_audiosize; /* Length of audio buffer=spec->size */ unsigned long SDL_MintAudio_audiosize; /* Length of audio buffer=spec->size */
long SDL_MintAudio_numbuf; /* Buffer to play */ unsigned short SDL_MintAudio_numbuf; /* Buffer to play */
long SDL_MintAudio_mutex; unsigned short SDL_MintAudio_mutex;
cookie_stfa_t *SDL_MintAudio_stfa; cookie_stfa_t *SDL_MintAudio_stfa;
/* The callback function, called by each driver whenever needed */ /* The callback function, called by each driver whenever needed */
......
...@@ -106,9 +106,9 @@ enum { ...@@ -106,9 +106,9 @@ enum {
/* Variables */ /* Variables */
extern SDL_AudioDevice *SDL_MintAudio_device; extern SDL_AudioDevice *SDL_MintAudio_device;
extern Uint8 *SDL_MintAudio_audiobuf[2]; /* Pointers to buffers */ extern Uint8 *SDL_MintAudio_audiobuf[2]; /* Pointers to buffers */
extern long SDL_MintAudio_audiosize; /* Length of audio buffer=spec->size */ extern unsigned long SDL_MintAudio_audiosize; /* Length of audio buffer=spec->size */
extern long SDL_MintAudio_numbuf; /* Buffer to play */ extern unsigned short SDL_MintAudio_numbuf; /* Buffer to play */
extern long SDL_MintAudio_mutex; extern unsigned short SDL_MintAudio_mutex;
extern cookie_stfa_t *SDL_MintAudio_stfa; extern cookie_stfa_t *SDL_MintAudio_stfa;
/* Functions */ /* Functions */
......
...@@ -223,7 +223,7 @@ static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec) ...@@ -223,7 +223,7 @@ static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff)); DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff));
DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x8000)!=0))); DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
DEBUG_PRINT(("channels=%d, ", spec->channels)); DEBUG_PRINT(("channels=%d, ", spec->channels));
DEBUG_PRINT(("freq=%d\n", spec->freq)); DEBUG_PRINT(("freq=%d\n", spec->freq));
...@@ -263,7 +263,7 @@ static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec) ...@@ -263,7 +263,7 @@ static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff)); DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff));
DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x8000)!=0))); DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
DEBUG_PRINT(("channels=%d, ", spec->channels)); DEBUG_PRINT(("channels=%d, ", spec->channels));
DEBUG_PRINT(("freq=%d\n", spec->freq)); DEBUG_PRINT(("freq=%d\n", spec->freq));
...@@ -327,10 +327,6 @@ static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec) ...@@ -327,10 +327,6 @@ static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec)
SDL_CalculateAudioSpec(spec); SDL_CalculateAudioSpec(spec);
/* Allocate memory for audio buffers in DMA-able RAM */ /* Allocate memory for audio buffers in DMA-able RAM */
spec->size = spec->samples;
spec->size *= spec->channels;
spec->size *= (spec->format & 0xFF)/8;
DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size)); DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size));
SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM); SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM);
......
...@@ -214,9 +214,10 @@ static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec) ...@@ -214,9 +214,10 @@ static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
resolution = spec->format & 0x00ff; resolution = spec->format & 0x00ff;
format_signed = ((spec->format & 0x8000)!=0); format_signed = ((spec->format & 0x8000)!=0);
format_bigendian = ((spec->format & 0x1000)!=0); format_bigendian = ((spec->format & 0x1000)!=0);
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",resolution));
DEBUG_PRINT(("signed=%d, ", format_signed)); DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff));
DEBUG_PRINT(("big endian=%d, ", format_bigendian)); DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
DEBUG_PRINT(("channels=%d, ", spec->channels)); DEBUG_PRINT(("channels=%d, ", spec->channels));
DEBUG_PRINT(("freq=%d\n", spec->freq)); DEBUG_PRINT(("freq=%d\n", spec->freq));
...@@ -268,9 +269,9 @@ static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec) ...@@ -268,9 +269,9 @@ static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
spec->format = spec->format & (~0x1000); spec->format = spec->format & (~0x1000);
} }
} else { } else {
if (snd_format & SND_FORMATBIGENDIAN) { if (snd_format & SND_FORMATLITTLEENDIAN) {
/* Ok */ /* Ok */
} else if (snd_format & SND_FORMATLITTLEENDIAN) { } else if (snd_format & SND_FORMATBIGENDIAN) {
/* Give big endian format */ /* Give big endian format */
spec->format |= 0x1000; spec->format |= 0x1000;
} }
...@@ -289,7 +290,7 @@ static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec) ...@@ -289,7 +290,7 @@ static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff)); DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff));
DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x8000)!=0))); DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
DEBUG_PRINT(("channels=%d, ", spec->channels)); DEBUG_PRINT(("channels=%d, ", spec->channels));
DEBUG_PRINT(("freq=%d\n", spec->freq)); DEBUG_PRINT(("freq=%d\n", spec->freq));
...@@ -368,10 +369,6 @@ static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec) ...@@ -368,10 +369,6 @@ static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec)
SDL_CalculateAudioSpec(spec); SDL_CalculateAudioSpec(spec);
/* Allocate memory for audio buffers in DMA-able RAM */ /* Allocate memory for audio buffers in DMA-able RAM */
spec->size = spec->samples;
spec->size *= spec->channels;
spec->size *= (spec->format & 0xFF)/8;
DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size)); DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size));
SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM); SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM);
......
...@@ -62,27 +62,27 @@ _SDL_MintAudio_GsxbInterrupt: ...@@ -62,27 +62,27 @@ _SDL_MintAudio_GsxbInterrupt:
notw _SDL_MintAudio_mutex notw _SDL_MintAudio_mutex
/* Swap buffers */ /* Swap buffers */
moveml d0-d2/a0-a2,sp@- eorw #1,_SDL_MintAudio_numbuf
movel _SDL_MintAudio_numbuf,d0 moveml d0-d2/a0-a2,sp@-
movel _SDL_MintAudio_audiobuf,a0
eorl #1,d0
beqs SDL_MintAudio_GsxbBuffer0
movel _SDL_MintAudio_audiobuf+4,a0
SDL_MintAudio_GsxbBuffer0:
movel d0,_SDL_MintAudio_numbuf
/* Callback */ /* Callback */
movel a0,sp@-
jsr _SDL_MintAudio_Callback jsr _SDL_MintAudio_Callback
movel sp@+,a0
/* Setbuffer xbios function */ /* Set new buffer */
moveq #0,d0
movel _SDL_MintAudio_audiosize,d1 movel _SDL_MintAudio_audiosize,d1
lea a0@(0,d1:l),a1
movew _SDL_MintAudio_numbuf,d0
lsll #2,d0
lea _SDL_MintAudio_audiobuf,a0
movel a0@(d0:l),a1
lea a1@(d1:l),a2
movel a2,sp@-
movel a1,sp@- movel a1,sp@-
movel a0,sp@-
clrw sp@- clrw sp@-
movew #131,sp@- movew #131,sp@-
trap #14 trap #14
...@@ -110,27 +110,27 @@ _SDL_MintAudio_XbiosInterrupt: ...@@ -110,27 +110,27 @@ _SDL_MintAudio_XbiosInterrupt:
notw _SDL_MintAudio_mutex notw _SDL_MintAudio_mutex
/* Swap buffers */ /* Swap buffers */
moveml d0-d2/a0-a2,sp@- eorw #1,_SDL_MintAudio_numbuf
movel _SDL_MintAudio_numbuf,d0 moveml d0-d2/a0-a2,sp@-
movel _SDL_MintAudio_audiobuf,a0
eorl #1,d0
beqs SDL_MintAudio_XbiosBuffer0
movel _SDL_MintAudio_audiobuf+4,a0
SDL_MintAudio_XbiosBuffer0:
movel d0,_SDL_MintAudio_numbuf
/* Callback */ /* Callback */
movel a0,sp@-
jsr _SDL_MintAudio_Callback jsr _SDL_MintAudio_Callback
movel sp@+,a0
/* Setbuffer xbios function */ /* Set new buffer */
moveq #0,d0
movel _SDL_MintAudio_audiosize,d1 movel _SDL_MintAudio_audiosize,d1
lea a0@(0,d1:l),a1
movew _SDL_MintAudio_numbuf,d0
lsll #2,d0
lea _SDL_MintAudio_audiobuf,a0
movel a0@(d0:l),a1
lea a1@(d1:l),a2
movel a2,sp@-
movel a1,sp@- movel a1,sp@-
movel a0,sp@-
clrw sp@- clrw sp@-
movew #131,sp@- movew #131,sp@-
trap #14 trap #14
...@@ -158,20 +158,21 @@ _SDL_MintAudio_Dma8Interrupt: ...@@ -158,20 +158,21 @@ _SDL_MintAudio_Dma8Interrupt:
notw _SDL_MintAudio_mutex notw _SDL_MintAudio_mutex
/* Swap buffers */ /* Swap buffers */
moveml d0-d1/a0-a1,sp@- eorw #1,_SDL_MintAudio_numbuf
movel _SDL_MintAudio_numbuf,d0 moveml d0-d1/a0-a1,sp@-
movel _SDL_MintAudio_audiobuf,d1
eorl #1,d0
beqs SDL_MintAudio_Dma8Buffer0
movel _SDL_MintAudio_audiobuf+4,d1
SDL_MintAudio_Dma8Buffer0:
movel d0,_SDL_MintAudio_numbuf
/* Callback */ /* Callback */
movel d1,sp@-
jsr _SDL_MintAudio_Callback jsr _SDL_MintAudio_Callback
movel sp@+,d1
/* Set new buffer */
moveq #0,d0
movew _SDL_MintAudio_numbuf,d0
lslw #2,d0
lea _SDL_MintAudio_audiobuf,a0
movel a0@(d0:w),d1
/* Modify DMA addresses */ /* Modify DMA addresses */
lea 0xffff8900:w,a0 lea 0xffff8900:w,a0
...@@ -213,30 +214,30 @@ _SDL_MintAudio_StfaInterrupt: ...@@ -213,30 +214,30 @@ _SDL_MintAudio_StfaInterrupt:
notw _SDL_MintAudio_mutex notw _SDL_MintAudio_mutex
/* Swap buffers */ /* Swap buffers */
moveml d0-d1/a0-a1,sp@- eorw #1,_SDL_MintAudio_numbuf
movel _SDL_MintAudio_numbuf,d0 moveml d0-d1/a0-a1,sp@-
movel _SDL_MintAudio_audiobuf,d1
eorl #1,d0
beqs SDL_MintAudio_StfaBuffer0
movel _SDL_MintAudio_audiobuf+4,d1
SDL_MintAudio_StfaBuffer0:
movel d0,_SDL_MintAudio_numbuf
/* Callback */ /* Callback */
movel d1,sp@-
jsr _SDL_MintAudio_Callback jsr _SDL_MintAudio_Callback
movel sp@+,d1
/* Set new buffer */
moveq #0,d0
movel _SDL_MintAudio_stfa,a1
movew _SDL_MintAudio_numbuf,d0
lslw #2,d0
lea _SDL_MintAudio_audiobuf,a0
movel a0@(d0:w),d1
/* Modify STFA replay buffers */ /* Modify STFA replay buffers */
movel _SDL_MintAudio_stfa,a0 movel d1,a1@(STFA_SOUND_START)
movel d1,a0@(STFA_SOUND_START)
addl _SDL_MintAudio_audiosize,d1 addl _SDL_MintAudio_audiosize,d1
movel d1,a0@(STFA_SOUND_END) movel d1,a1@(STFA_SOUND_END)
moveml sp@+,d0-d1/a0-a1 moveml sp@+,d0-d1/a0-a1
clrw _SDL_MintAudio_mutex clrw _SDL_MintAudio_mutex
SDL_MintAudio_StfaEnd: SDL_MintAudio_StfaEnd:
rte rte
...@@ -212,7 +212,7 @@ static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec) ...@@ -212,7 +212,7 @@ static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff)); DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff));
DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x8000)!=0))); DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
DEBUG_PRINT(("channels=%d, ", spec->channels)); DEBUG_PRINT(("channels=%d, ", spec->channels));
DEBUG_PRINT(("freq=%d\n", spec->freq)); DEBUG_PRINT(("freq=%d\n", spec->freq));
...@@ -263,7 +263,7 @@ static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec) ...@@ -263,7 +263,7 @@ static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff)); DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff));
DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x8000)!=0))); DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
DEBUG_PRINT(("channels=%d, ", spec->channels)); DEBUG_PRINT(("channels=%d, ", spec->channels));
DEBUG_PRINT(("freq=%d\n", spec->freq)); DEBUG_PRINT(("freq=%d\n", spec->freq));
...@@ -352,10 +352,6 @@ static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec) ...@@ -352,10 +352,6 @@ static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec)
SDL_CalculateAudioSpec(spec); SDL_CalculateAudioSpec(spec);
/* Allocate memory for audio buffers in DMA-able RAM */ /* Allocate memory for audio buffers in DMA-able RAM */
spec->size = spec->samples;
spec->size *= spec->channels;
spec->size *= (spec->format & 0xFF)/8;
DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size)); DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size));
SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM); SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM);
......
...@@ -206,7 +206,7 @@ static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec) ...@@ -206,7 +206,7 @@ static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff)); DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff));
DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x8000)!=0))); DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
DEBUG_PRINT(("channels=%d, ", spec->channels)); DEBUG_PRINT(("channels=%d, ", spec->channels));
DEBUG_PRINT(("freq=%d\n", spec->freq)); DEBUG_PRINT(("freq=%d\n", spec->freq));
...@@ -223,7 +223,7 @@ static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec) ...@@ -223,7 +223,7 @@ static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff)); DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff));
DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x8000)!=0))); DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
DEBUG_PRINT(("channels=%d, ", spec->channels)); DEBUG_PRINT(("channels=%d, ", spec->channels));
DEBUG_PRINT(("freq=%d\n", spec->freq)); DEBUG_PRINT(("freq=%d\n", spec->freq));
...@@ -254,15 +254,15 @@ static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec) ...@@ -254,15 +254,15 @@ static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec)
} else { } else {
cookie_stfa->sound_control |= STFA_FORMAT_MONO; cookie_stfa->sound_control |= STFA_FORMAT_MONO;
} }
if (spec->format & 0x8000) { if ((spec->format & 0x8000)!=0) {
cookie_stfa->sound_control |= STFA_FORMAT_SIGNED; cookie_stfa->sound_control |= STFA_FORMAT_SIGNED;
} else { } else {
cookie_stfa->sound_control |= STFA_FORMAT_UNSIGNED; cookie_stfa->sound_control |= STFA_FORMAT_UNSIGNED;
} }
if (spec->format & 0x1000) { if ((spec->format & 0x1000)!=0) {
cookie_stfa->sound_control |= STFA_FORMAT_LITENDIAN;
} else {
cookie_stfa->sound_control |= STFA_FORMAT_BIGENDIAN; cookie_stfa->sound_control |= STFA_FORMAT_BIGENDIAN;
} else {
cookie_stfa->sound_control |= STFA_FORMAT_LITENDIAN;
} }
/* Set buffer */ /* Set buffer */
...@@ -292,10 +292,6 @@ static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec) ...@@ -292,10 +292,6 @@ static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec)
SDL_CalculateAudioSpec(spec); SDL_CalculateAudioSpec(spec);
/* Allocate memory for audio buffers in DMA-able RAM */ /* Allocate memory for audio buffers in DMA-able RAM */
spec->size = spec->samples;
spec->size *= spec->channels;
spec->size *= (spec->format & 0xFF)/8;
DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size)); DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size));
SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM); SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM);
......
...@@ -192,7 +192,7 @@ static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec) ...@@ -192,7 +192,7 @@ static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff)); DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff));
DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x8000)!=0))); DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
DEBUG_PRINT(("channels=%d, ", spec->channels)); DEBUG_PRINT(("channels=%d, ", spec->channels));
DEBUG_PRINT(("freq=%d\n", spec->freq)); DEBUG_PRINT(("freq=%d\n", spec->freq));
...@@ -215,7 +215,7 @@ static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec) ...@@ -215,7 +215,7 @@ static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff)); DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff));
DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x8000)!=0))); DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
DEBUG_PRINT(("channels=%d, ", spec->channels)); DEBUG_PRINT(("channels=%d, ", spec->channels));
DEBUG_PRINT(("freq=%d\n", spec->freq)); DEBUG_PRINT(("freq=%d\n", spec->freq));
...@@ -292,10 +292,6 @@ static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec) ...@@ -292,10 +292,6 @@ static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec)
SDL_CalculateAudioSpec(spec); SDL_CalculateAudioSpec(spec);
/* Allocate memory for audio buffers in DMA-able RAM */ /* Allocate memory for audio buffers in DMA-able RAM */
spec->size = spec->samples;
spec->size *= spec->channels;
spec->size *= (spec->format & 0xFF)/8;
DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size)); DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size));
SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM); SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment