diff --git a/libaesnd/aesndlib.c b/libaesnd/aesndlib.c index 29b7c1a..f9b9a83 100644 --- a/libaesnd/aesndlib.c +++ b/libaesnd/aesndlib.c @@ -84,16 +84,6 @@ static u8 __dspdram[DSP_DRAMSIZE] ATTRIBUTE_ALIGN(32); static u8 mute_buffer[SND_BUFFERSIZE] ATTRIBUTE_ALIGN(32); static u8 audio_buffer[2][SND_BUFFERSIZE] ATTRIBUTE_ALIGN(32); -static __inline__ void snd_set0b(char *p,int n) -{ - while(n>0) { *p++ = 0; n--; } -} - -static __inline__ void snd_set0w(int *p,int n) -{ - while(n>0) { *p++ = 0; n--; } -} - static __inline__ void __aesndcopycommand(AESNDPB *dst,AESNDPB *src) { dst->buf_start = src->buf_start; @@ -445,16 +435,16 @@ void AESND_Init(void) #if defined(HW_DOL) for(i=0;i>2); - snd_set0w((int*)audio_buffer[0],SND_BUFFERSIZE>>2); - snd_set0w((int*)audio_buffer[1],SND_BUFFERSIZE>>2); + memset(mute_buffer,0,SND_BUFFERSIZE); + memset(audio_buffer[0],0,SND_BUFFERSIZE); + memset(audio_buffer[1],0,SND_BUFFERSIZE); DCFlushRange(mute_buffer,SND_BUFFERSIZE); DCFlushRange(audio_buffer[0],SND_BUFFERSIZE); DCFlushRange(audio_buffer[1],SND_BUFFERSIZE); - snd_set0w((int*)&__aesndcommand,sizeof(struct aesndpb_t)>>2); + memset(&__aesndcommand,0,sizeof(struct aesndpb_t)); for(i=0;i>2); + memset(&__aesndvoicepb[i],0,sizeof(struct aesndpb_t)); __aesndloaddsptask(&__aesnddsptask,aesnddspmixer,aesnddspmixer_size,__dspdram,DSP_DRAMSIZE); } @@ -575,7 +565,7 @@ void AESND_FreeVoice(AESNDPB *pb) if(pb==NULL) return; _CPU_ISR_Disable(level); - snd_set0w((int*)pb,sizeof(struct aesndpb_t)>>2); + memset(pb,0,sizeof(struct aesndpb_t)); _CPU_ISR_Restore(level); } diff --git a/libasnd/asndlib.c b/libasnd/asndlib.c index 8636ac1..eb2d7af 100644 --- a/libasnd/asndlib.c +++ b/libasnd/asndlib.c @@ -28,7 +28,7 @@ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include - +#include #include #include #include @@ -95,20 +95,8 @@ static u32 asnd_inited = 0; static t_sound_data sound_data[MAX_VOICES]; static t_sound_data sound_data_dma ATTRIBUTE_ALIGN(32); -static s16 mute_buf[SND_BUFFERSIZE] ATTRIBUTE_ALIGN(32); -static s16 audio_buf[2][SND_BUFFERSIZE] ATTRIBUTE_ALIGN(32); - -static __inline__ char* snd_set0b( char *p, int n) -{ - while(n>0) {*p++=0;n--;} - return p; -} - -static __inline__ s32* snd_set0w( s32 *p, int n) -{ - while(n>0) {*p++=0;n--;} - return p; -} +static u8 mute_buf[SND_BUFFERSIZE] ATTRIBUTE_ALIGN(32); +static u8 audio_buf[2][SND_BUFFERSIZE] ATTRIBUTE_ALIGN(32); static void __dsp_initcallback(dsptask_t *task) { @@ -359,15 +347,15 @@ void ASND_Init(void) dsp_complete = 0; dsp_done = 0; - snd_set0w((s32*)mute_buf, SND_BUFFERSIZE>>2); - snd_set0w((s32*)audio_buf[0], SND_BUFFERSIZE>>2); - snd_set0w((s32*)audio_buf[1], SND_BUFFERSIZE>>2); + memset(mute_buf,0,SND_BUFFERSIZE); + memset(audio_buf[0],0,SND_BUFFERSIZE); + memset(audio_buf[1],0,SND_BUFFERSIZE); DCFlushRange(mute_buf,SND_BUFFERSIZE); DCFlushRange(audio_buf[0],SND_BUFFERSIZE); DCFlushRange(audio_buf[1],SND_BUFFERSIZE); for(i=0;i