GP2X: low volume and fast forward
[picodrive.git] / Pico / sound / sound.c
index b966b1f..fbb81c8 100644 (file)
@@ -15,6 +15,8 @@
 #include "../cd/pcm.h"\r
 #include "mix.h"\r
 \r
+void (*PsndMix_32_to_16l)(short *dest, int *src, int count) = mix_32_to_16l_stereo;\r
+\r
 // master int buffer to mix to\r
 static int PsndBuffer[2*44100/50];\r
 \r
@@ -151,6 +153,9 @@ void PsndRerate(int preserve_state)
   memset32(PsndBuffer, 0, sizeof(PsndBuffer)/4);\r
   if (PsndOut)\r
     PsndClear();\r
+\r
+  // set mixer\r
+  PsndMix_32_to_16l = (PicoOpt & 8) ? mix_32_to_16l_stereo : mix_32_to_16_mono;\r
 }\r
 \r
 \r
@@ -260,9 +265,7 @@ PICO_INTERNAL int PsndRender(int offset, int length)
     mp3_update(buf32, length, stereo);\r
 \r
   // convert + limit to normal 16bit output\r
-  if (stereo)\r
-       mix_32_to_16l_stereo(PsndOut+offset, buf32, length);\r
-  else mix_32_to_16_mono   (PsndOut+offset, buf32, length);\r
+  PsndMix_32_to_16l(PsndOut+offset, buf32, length);\r
 \r
   return length;\r
 }\r