From: kub Date: Sun, 31 Oct 2021 21:47:49 +0000 (+0100) Subject: mcd, fix pcm looping (1st sample lost) X-Git-Tag: v2.00~437 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe8611f9affe3bd7cb22fffd89c3ebf8209215b0;p=picodrive.git mcd, fix pcm looping (1st sample lost) --- 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);