aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornotaz2014-12-09 04:11:36 +0200
committernotaz2014-12-20 02:57:25 +0200
commite391d21cdbf06afd68d137537b7e82585ecffa1a (patch)
treeb4ab7647cad79d02fd3a9fa6a23d65d7f942dfd9
parentb1ba08510c208685fda8a0a2d0e2b72d98db23b1 (diff)
downloadpcsx_rearmed-e391d21cdbf06afd68d137537b7e82585ecffa1a.tar.gz
pcsx_rearmed-e391d21cdbf06afd68d137537b7e82585ecffa1a.tar.bz2
pcsx_rearmed-e391d21cdbf06afd68d137537b7e82585ecffa1a.zip
spu: fix some fmod related breakage
-rw-r--r--plugins/dfsound/spu.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c
index 6cefd11..8f6ed13 100644
--- a/plugins/dfsound/spu.c
+++ b/plugins/dfsound/spu.c
@@ -692,7 +692,7 @@ static void noinline do_decode_bufs(int which, int start, int count)
static int do_samples(int forced_updates)
{
int volmult = iVolume;
- int ns,ns_from,ns_to;
+ int ns,ns_from,ns_to,ns_len;
int ch,d,silentch;
int bIRQReturn=0;
@@ -740,21 +740,22 @@ static int do_samples(int forced_updates)
lastch=ch;
lastns=ns_to=d;
}
+ ns_len = ns_to - ns_from;
MixADSR(ch, ns_from, ns_to);
if(ch==1 || ch==3)
{
- do_decode_bufs(ch/2, ns_from, ns_to-ns_from);
+ do_decode_bufs(ch/2, ns_from, ns_len);
decode_dirty_ch |= 1<<ch;
}
if(s_chan[ch].bFMod==2) // fmod freq channel
- memcpy(iFMod, ChanBuf, sizeof(iFMod));
- else if(s_chan[ch].bRVBActive)
- mix_chan_rvb(ns_from,ns_to-ns_from,s_chan[ch].iLeftVolume,s_chan[ch].iRightVolume);
+ memcpy(&iFMod[ns_from], &ChanBuf[ns_from], ns_len * sizeof(iFMod[0]));
+ if(s_chan[ch].bRVBActive)
+ mix_chan_rvb(ns_from, ns_len, s_chan[ch].iLeftVolume, s_chan[ch].iRightVolume);
else
- mix_chan(ns_from,ns_to-ns_from,s_chan[ch].iLeftVolume,s_chan[ch].iRightVolume);
+ mix_chan(ns_from, ns_len, s_chan[ch].iLeftVolume, s_chan[ch].iRightVolume);
}
}