aboutsummaryrefslogtreecommitdiff
path: root/plugins/dfsound/xa.c
diff options
context:
space:
mode:
authornotaz2011-07-30 02:42:28 +0300
committernotaz2011-08-01 23:07:01 +0300
commit381ea10346ab85b2f2d46f33d28461211e239c0a (patch)
tree837f4eec4b1940ac940603793e6faf7eee993642 /plugins/dfsound/xa.c
parent1775933abd26d2e282c4e0b4093778d204a0038d (diff)
downloadpcsx_rearmed-381ea10346ab85b2f2d46f33d28461211e239c0a.tar.gz
pcsx_rearmed-381ea10346ab85b2f2d46f33d28461211e239c0a.tar.bz2
pcsx_rearmed-381ea10346ab85b2f2d46f33d28461211e239c0a.zip
spu: some misc refactoring/cleanup
Diffstat (limited to 'plugins/dfsound/xa.c')
-rw-r--r--plugins/dfsound/xa.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/plugins/dfsound/xa.c b/plugins/dfsound/xa.c
index bdea89a..b45aef2 100644
--- a/plugins/dfsound/xa.c
+++ b/plugins/dfsound/xa.c
@@ -95,8 +95,8 @@ INLINE void MixXA(void)
{
l=*CDDAPlay++;
if(CDDAPlay==CDDAEnd) CDDAPlay=CDDAStart;
- SSumLR[ns++]+=(((short)(l&0xffff)) * iLeftXAVol)/32767;
- SSumLR[ns++]+=(((short)((l>>16)&0xffff)) * iRightXAVol)/32767;
+ SSumLR[ns++]+=(((short)(l&0xffff)) * iLeftXAVol) >> 15;
+ SSumLR[ns++]+=(((short)((l>>16)&0xffff)) * iRightXAVol) >> 15;
}
}
@@ -222,13 +222,11 @@ INLINE void FeedXA(xa_decode_t *xap)
s=(short)LOWORD(l);
l1=s;
l1=(l1*iPlace)/iSize;
- if(l1<-32767) l1=-32767;
- if(l1> 32767) l1=32767;
+ ssat32_to_16(l1);
s=(short)HIWORD(l);
l2=s;
l2=(l2*iPlace)/iSize;
- if(l2<-32767) l2=-32767;
- if(l2> 32767) l2=32767;
+ ssat32_to_16(l2);
l=(l1&0xffff)|(l2<<16);
*XAFeed++=l;
@@ -328,8 +326,7 @@ INLINE void FeedXA(xa_decode_t *xap)
}
l1=(l1*iPlace)/iSize;
- if(l1<-32767) l1=-32767;
- if(l1> 32767) l1=32767;
+ ssat32_to_16(l1);
l=(l1&0xffff)|(l1<<16);
*XAFeed++=l;