diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2021-07-31 13:30:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-31 13:30:40 -0400 |
commit | 3e60a7840653e50845abf10bb02cd1b519dcd80f (patch) | |
tree | cb4a0d227a238ebdeb3b6cb9fdb92781bcc4f5e7 /src/m4a.c | |
parent | 602855ea99d8015ef5b7709f6fb1e9fd167239e2 (diff) | |
parent | d391486247cc9f29d85787d6711f7cb993cf6585 (diff) |
Merge branch 'master' into doc-frontierpass2
Diffstat (limited to 'src/m4a.c')
-rw-r--r-- | src/m4a.c | 28 |
1 files changed, 16 insertions, 12 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; } @@ -1530,6 +1525,10 @@ void ply_xwave(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track { u32 wav; +#ifdef UBFIX + wav = 0; +#endif + READ_XCMD_BYTE(wav, 0) // UB: uninitialized variable READ_XCMD_BYTE(wav, 1) READ_XCMD_BYTE(wav, 2) @@ -1597,6 +1596,10 @@ void ply_xcmd_0C(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *tra { u32 unk; +#ifdef UBFIX + unk = 0; +#endif + READ_XCMD_BYTE(unk, 0) // UB: uninitialized variable READ_XCMD_BYTE(unk, 1) @@ -1616,6 +1619,7 @@ void ply_xcmd_0C(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *tra void ply_xcmd_0D(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track) { u32 unk; + #ifdef UBFIX unk = 0; #endif @@ -1708,14 +1712,14 @@ void SetPokemonCryProgress(u32 val) gPokemonCrySong.unkCmd0DParam = val; } -int IsPokemonCryPlaying(struct MusicPlayerInfo *mplayInfo) +bool32 IsPokemonCryPlaying(struct MusicPlayerInfo *mplayInfo) { struct MusicPlayerTrack *track = mplayInfo->tracks; if (track->chan && track->chan->track == track) - return 1; + return TRUE; else - return 0; + return FALSE; } void SetPokemonCryChorus(s8 val) |