From fe8611f9affe3bd7cb22fffd89c3ebf8209215b0 Mon Sep 17 00:00:00 2001 From: kub Date: Sun, 31 Oct 2021 22:47:49 +0100 Subject: [PATCH] mcd, fix pcm looping (1st sample lost) --- pico/cd/pcm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pico/cd/pcm.c b/pico/cd/pcm.c index 795ec3b7..9d84ee89 100644 --- a/pico/cd/pcm.c +++ b/pico/cd/pcm.c @@ -92,7 +92,7 @@ void pcd_pcm_sync(unsigned int to) mul_l = (int)ch->regs[0] * (ch->regs[1] & 0xf); mul_r = (int)ch->regs[0] * (ch->regs[1] >> 4); - for (s = 0; s < steps; s++, addr = (addr + inc) & 0x07FFFFFF) + for (s = 0; s < steps; s++) { smp = Pico_mcd->pcm_ram[addr >> PCM_STEP_SHIFT]; @@ -104,7 +104,8 @@ void pcd_pcm_sync(unsigned int to) addr <<= PCM_STEP_SHIFT; if (smp == 0xff) break; - } + } else + addr = (addr + inc) & 0x07FFFFFF; if (smp & 0x80) smp = -(smp & 0x7f); -- 2.39.5