mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
cd: rewrite pcm
This commit is contained in:
parent
d0132772f7
commit
33be04ca5f
7 changed files with 171 additions and 160 deletions
|
@ -11,7 +11,6 @@
|
|||
#include "ym2612.h"
|
||||
#include "sn76496.h"
|
||||
#include "../pico_int.h"
|
||||
#include "../cd/pcm.h"
|
||||
#include "../cd/cue.h"
|
||||
#include "mix.h"
|
||||
|
||||
|
@ -161,9 +160,6 @@ void PsndRerate(int preserve_state)
|
|||
// recalculate dac info
|
||||
dac_recalculate();
|
||||
|
||||
if (PicoAHW & PAHW_MCD)
|
||||
pcm_set_rate(PsndRate);
|
||||
|
||||
// clear all buffers
|
||||
memset32(PsndBuffer, 0, sizeof(PsndBuffer)/4);
|
||||
memset(cdda_out_buffer, 0, sizeof(cdda_out_buffer));
|
||||
|
@ -201,14 +197,6 @@ PICO_INTERNAL void PsndDoDAC(int line_to)
|
|||
short *d = PsndOut + pos;
|
||||
for (; len > 0; len--, d++) *d = dout;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (do_pcm) {
|
||||
int *d = PsndBuffer;
|
||||
d += (PicoOpt&8) ? pos*2 : pos;
|
||||
pcm_update(d, len, 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// cdda
|
||||
|
@ -309,9 +297,7 @@ static int PsndRender(int offset, int length)
|
|||
int buf32_updated = 0;
|
||||
int *buf32 = PsndBuffer+offset;
|
||||
int stereo = (PicoOpt & 8) >> 3;
|
||||
// emulating CD && PCM option enabled && PCM chip on && have enabled channels
|
||||
int do_pcm = (PicoAHW & PAHW_MCD) && (PicoOpt&POPT_EN_MCD_PCM) &&
|
||||
(Pico_mcd->pcm.control & 0x80) && Pico_mcd->pcm.enabled;
|
||||
|
||||
offset <<= stereo;
|
||||
|
||||
pprof_start(sound);
|
||||
|
@ -346,8 +332,8 @@ static int PsndRender(int offset, int length)
|
|||
(void)buf32_updated;
|
||||
|
||||
// CD: PCM sound
|
||||
if (do_pcm) {
|
||||
pcm_update(buf32, length, stereo);
|
||||
if (PicoAHW & PAHW_MCD) {
|
||||
pcd_pcm_update(buf32, length, stereo);
|
||||
//buf32_updated = 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue