From: notaz Date: Sun, 4 Sep 2022 21:02:28 +0000 (+0300) Subject: spu: remove some strange rounding X-Git-Tag: r24~329 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3fa20c2fc7cff9352b5bcbe23e8b682bdcf0b2c;p=pcsx_rearmed.git spu: remove some strange rounding Seems wrong. Also deal with now possible div by 0 in scan_for_irq(). --- diff --git a/plugins/dfsound/registers.c b/plugins/dfsound/registers.c index e0693064..61d0b810 100644 --- a/plugins/dfsound/registers.c +++ b/plugins/dfsound/registers.c @@ -484,11 +484,10 @@ static void SetPitch(int ch,unsigned short val) // SET PITCH if(val>0x3fff) NP=0x3fff; // get pitch val else NP=val; - spu.s_chan[ch].iRawPitch=NP; - spu.s_chan[ch].sinc=(NP<<4)|8; - spu.s_chan[ch].sinc_inv=0; - if (spu_config.iUseInterpolation == 1) - spu.SB[ch * SB_SIZE + 32] = 1; // -> freq change in simple interpolation mode: set flag + spu.s_chan[ch].iRawPitch = NP; + spu.s_chan[ch].sinc = NP << 4; + spu.s_chan[ch].sinc_inv = 0; + spu.SB[ch * SB_SIZE + 32] = 1; // -> freq change in simple interpolation mode: set flag } //////////////////////////////////////////////////////////////////////// diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c index b0b083dd..35d890d9 100644 --- a/plugins/dfsound/spu.c +++ b/plugins/dfsound/spu.c @@ -1230,6 +1230,8 @@ void schedule_next_irq(void) if ((unsigned long)(spu.pSpuIrq - spu.s_chan[ch].pCurr) > IRQ_NEAR_BLOCKS * 16 && (unsigned long)(spu.pSpuIrq - spu.s_chan[ch].pLoop) > IRQ_NEAR_BLOCKS * 16) continue; + if (spu.s_chan[ch].sinc == 0) + continue; scan_for_irq(ch, &upd_samples); }