From d542baf14bd38110389046e90dde40043d4e2b6a Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Mon, 19 Apr 2021 23:44:24 -0400 Subject: [PATCH] THE BEAST IS SLAIN --- src/m4a.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/m4a.c b/src/m4a.c index 7d7193334..3bb440f65 100644 --- a/src/m4a.c +++ b/src/m4a.c @@ -887,18 +887,13 @@ void CgbModVol(struct CgbChannel *chan) if ((soundInfo->mode & 1) || !CgbPan(chan)) { chan->pan = 0xFF; - chan->envelopeGoal = (u32)(chan->rightVolume + chan->leftVolume) >> 4; + chan->envelopeGoal = (u32)(chan->leftVolume + chan->rightVolume); + chan->envelopeGoal /= 16; } else { - // Force chan->rightVolume and chan->leftVolume to be read from memory again, - // even though there is no reason to do so. - // The command line option "-fno-gcse" achieves the same result as this. - #ifndef NONMATCHING - asm("" : : : "memory"); - #endif - - chan->envelopeGoal = (u32)(chan->rightVolume + chan->leftVolume) >> 4; + chan->envelopeGoal = (u32)(chan->leftVolume + chan->rightVolume); + chan->envelopeGoal /= 16; if (chan->envelopeGoal > 15) chan->envelopeGoal = 15; }