X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2Fsound%2Fsound.c;h=fbb81c8902ed98a0cbbda0f4daff8c98f9e3fac3;hb=4a32f01f5527929fe5feafd53937007dcfd64735;hp=b966b1f79f1bb20585430af11a42a9e110be48ee;hpb=53668ca0f8dae622f61c2b30000a27b80fd8ec6f;p=picodrive.git diff --git a/Pico/sound/sound.c b/Pico/sound/sound.c index b966b1f..fbb81c8 100644 --- a/Pico/sound/sound.c +++ b/Pico/sound/sound.c @@ -15,6 +15,8 @@ #include "../cd/pcm.h" #include "mix.h" +void (*PsndMix_32_to_16l)(short *dest, int *src, int count) = mix_32_to_16l_stereo; + // master int buffer to mix to static int PsndBuffer[2*44100/50]; @@ -151,6 +153,9 @@ void PsndRerate(int preserve_state) memset32(PsndBuffer, 0, sizeof(PsndBuffer)/4); if (PsndOut) PsndClear(); + + // set mixer + PsndMix_32_to_16l = (PicoOpt & 8) ? mix_32_to_16l_stereo : mix_32_to_16_mono; } @@ -260,9 +265,7 @@ PICO_INTERNAL int PsndRender(int offset, int length) mp3_update(buf32, length, stereo); // convert + limit to normal 16bit output - if (stereo) - mix_32_to_16l_stereo(PsndOut+offset, buf32, length); - else mix_32_to_16_mono (PsndOut+offset, buf32, length); + PsndMix_32_to_16l(PsndOut+offset, buf32, length); return length; }