diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2021-04-20 00:14:02 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-20 00:14:02 -0400 |
commit | b65d4eb910deec1a366cf117f2fa2c0418bb0595 (patch) | |
tree | 9660f23f92c3a89ff0dd4394708f8af37798de9e /src | |
parent | c1da6b29bc853df1a42f08adb9b141de747dae55 (diff) | |
parent | d542baf14bd38110389046e90dde40043d4e2b6a (diff) |
Merge pull request #1409 from Kurausukun/M4A_IS_DEAD
FIX CGBMODVOL FAKEMATCHING (WE DID IT REDDIT)
Diffstat (limited to 'src')
-rw-r--r-- | src/m4a.c | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -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; } |