cd: rewrite pcm
[picodrive.git] / pico / sound / sound.c
index 236a483..ec0e205 100644 (file)
@@ -11,7 +11,6 @@
 #include "ym2612.h"\r
 #include "sn76496.h"\r
 #include "../pico_int.h"\r
-#include "../cd/pcm.h"\r
 #include "../cd/cue.h"\r
 #include "mix.h"\r
 \r
@@ -161,9 +160,6 @@ void PsndRerate(int preserve_state)
   // recalculate dac info\r
   dac_recalculate();\r
 \r
-  if (PicoAHW & PAHW_MCD)\r
-    pcm_set_rate(PsndRate);\r
-\r
   // clear all buffers\r
   memset32(PsndBuffer, 0, sizeof(PsndBuffer)/4);\r
   memset(cdda_out_buffer, 0, sizeof(cdda_out_buffer));\r
@@ -201,14 +197,6 @@ PICO_INTERNAL void PsndDoDAC(int line_to)
     short *d = PsndOut + pos;\r
     for (; len > 0; len--, d++)  *d = dout;\r
   }\r
-\r
-#if 0\r
-  if (do_pcm) {\r
-    int *d = PsndBuffer;\r
-    d += (PicoOpt&8) ? pos*2 : pos;\r
-    pcm_update(d, len, 1);\r
-  }\r
-#endif\r
 }\r
 \r
 // cdda\r
@@ -309,9 +297,7 @@ static int PsndRender(int offset, int length)
   int  buf32_updated = 0;\r
   int *buf32 = PsndBuffer+offset;\r
   int stereo = (PicoOpt & 8) >> 3;\r
-  // emulating CD && PCM option enabled && PCM chip on && have enabled channels\r
-  int do_pcm = (PicoAHW & PAHW_MCD) && (PicoOpt&POPT_EN_MCD_PCM) &&\r
-               (Pico_mcd->pcm.control & 0x80) && Pico_mcd->pcm.enabled;\r
+\r
   offset <<= stereo;\r
 \r
   pprof_start(sound);\r
@@ -346,8 +332,8 @@ static int PsndRender(int offset, int length)
   (void)buf32_updated;\r
 \r
   // CD: PCM sound\r
-  if (do_pcm) {\r
-    pcm_update(buf32, length, stereo);\r
+  if (PicoAHW & PAHW_MCD) {\r
+    pcd_pcm_update(buf32, length, stereo);\r
     //buf32_updated = 1;\r
   }\r
 \r