diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2021-04-20 00:14:20 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-20 00:14:20 -0400 |
commit | a005118d7f83a12b73361c3655812e437201146b (patch) | |
tree | 7d88f472613ac6d458855d697b8176d2f0329b48 | |
parent | 35cf80b7eac2f80d2bb97f0e52152c6c35939fd2 (diff) | |
parent | 60cbcaaa9b3d5ae5182ec26f7c7854c0c469bb94 (diff) |
Merge pull request #419 from Kurausukun/M4A_IS_DEAD
FIX CGBMODVOL FAKEMATCHING (WE DID IT REDDIT)
-rw-r--r-- | src/m4a.c | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -871,18 +871,13 @@ void CgbModVol(struct CgbChannel *chan) if ((soundInfo->mode & 1) || !CgbPan(chan)) { chan->pan = 0xFF; - chan->eg = (u32)(chan->rightVolume + chan->leftVolume) >> 4; + chan->eg = (u32)(chan->leftVolume + chan->rightVolume); + chan->eg /= 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->eg = (u32)(chan->rightVolume + chan->leftVolume) >> 4; + chan->eg = (u32)(chan->leftVolume + chan->rightVolume); + chan->eg /= 16; if (chan->eg > 15) chan->eg = 15; } |