aboutsummaryrefslogtreecommitdiff
path: root/src/SPU.cpp
diff options
context:
space:
mode:
authorNadia Holmquist Pedersen <nadia@nhp.sh>2024-03-08 16:59:31 +0100
committerNadia Holmquist Pedersen <nadia@nhp.sh>2024-03-08 16:59:31 +0100
commitb117bb8f58938edf3da1e348ca5ff32fa68b279e (patch)
tree82cc64c2a52eda1f49fb233fb8871b3087b68ca2 /src/SPU.cpp
parentfaf3c0f2e08c0aa199d817feddafb0f4ff67e64a (diff)
that should be 0x8000
Diffstat (limited to 'src/SPU.cpp')
-rw-r--r--src/SPU.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/SPU.cpp b/src/SPU.cpp
index 4e6fb13..69c0b9d 100644
--- a/src/SPU.cpp
+++ b/src/SPU.cpp
@@ -659,13 +659,13 @@ s32 SPUChannel::Run()
case AudioInterpolation::SNESGaussian: {
// Avoid clipping (from fullsnes)
- #define CLAMP(s) (std::clamp((s) >> 1, -0x3FFA, 0x3FF8))
+#define CLAMP(s) (std::clamp((s) >> 1, -0x3FFA, 0x3FF8))
s32 out = (InterpSNESGauss[0x0FF - samplepos] * CLAMP(PrevSample[2]) >> 10);
out = out + ((InterpSNESGauss[0x1FF - samplepos] * CLAMP(PrevSample[1])) >> 10);
out = out + ((InterpSNESGauss[0x100 + samplepos] * CLAMP(PrevSample[0])) >> 10);
out = out + ((InterpSNESGauss[0x000 + samplepos] * CLAMP(val)) >> 10);
- val = std::clamp(out, -0x7FFF, 0x7FFF);
- #undef CLAMP
+ val = std::clamp(out, -0x8000, 0x7FFF);
+#undef CLAMP
break;
}