sms wip: random tweaks, refactoring (palette, sound stuff, etc)
[picodrive.git] / pico / sound / sound.c
index 7f3fd8d..a7510db 100644 (file)
@@ -398,7 +398,6 @@ PICO_INTERNAL void PsndGetSamples(int y)
 \r
 PICO_INTERNAL void PsndGetSamplesMS(void)\r
 {\r
-  int *buf32 = PsndBuffer;\r
   int stereo = (PicoOpt & 8) >> 3;\r
   int length = PsndLen;\r
 \r
@@ -415,8 +414,12 @@ PICO_INTERNAL void PsndGetSamplesMS(void)
   if (PicoOpt & POPT_EN_PSG)\r
     SN76496Update(PsndOut, length, stereo);\r
 \r
-  // convert + limit to normal 16bit output\r
-  PsndMix_32_to_16l(PsndOut, buf32, length);\r
+  // upmix to "stereo" if needed\r
+  if (stereo) {\r
+    int i = length, *p = (void *)PsndOut;\r
+    while (i--)\r
+      *p |= *p << 16;\r
+  }\r
 \r
   if (PicoWriteSound != NULL)\r
     PicoWriteSound(length);\r