mirror of https://github.com/pret/pokeemerald.git
Merge pull request #1232 from Kurausukun/match_m4a
[LEAK INFORMED] Match FadeOutBody
This commit is contained in:
commit
585f313c64
20
src/m4a.c
20
src/m4a.c
|
@ -643,28 +643,17 @@ void FadeOutBody(struct MusicPlayerInfo *mplayInfo)
|
|||
s32 i;
|
||||
struct MusicPlayerTrack *track;
|
||||
u16 fadeOV;
|
||||
#ifdef NONMATCHING
|
||||
u16 mask;
|
||||
#else
|
||||
register u16 mask asm("r2");
|
||||
#endif // NONMATCHING
|
||||
|
||||
if (mplayInfo->fadeOI == 0)
|
||||
return;
|
||||
|
||||
mplayInfo->fadeOC--;
|
||||
mask = 0xFFFF;
|
||||
|
||||
if (mplayInfo->fadeOC != 0)
|
||||
if (--mplayInfo->fadeOC != 0)
|
||||
return;
|
||||
|
||||
mplayInfo->fadeOC = mplayInfo->fadeOI;
|
||||
|
||||
if (mplayInfo->fadeOV & FADE_IN)
|
||||
{
|
||||
mplayInfo->fadeOV += (4 << FADE_VOL_SHIFT);
|
||||
|
||||
if ((u16)(mplayInfo->fadeOV & mask) >= (64 << FADE_VOL_SHIFT))
|
||||
if ((u16)(mplayInfo->fadeOV += (4 << FADE_VOL_SHIFT)) >= (64 << FADE_VOL_SHIFT))
|
||||
{
|
||||
mplayInfo->fadeOV = (64 << FADE_VOL_SHIFT);
|
||||
mplayInfo->fadeOI = 0;
|
||||
|
@ -672,11 +661,8 @@ void FadeOutBody(struct MusicPlayerInfo *mplayInfo)
|
|||
}
|
||||
else
|
||||
{
|
||||
mplayInfo->fadeOV -= (4 << FADE_VOL_SHIFT);
|
||||
|
||||
if ((s16)(mplayInfo->fadeOV & mask) <= 0)
|
||||
if ((s16)(mplayInfo->fadeOV -= (4 << FADE_VOL_SHIFT)) <= 0)
|
||||
{
|
||||
|
||||
for (i = mplayInfo->trackCount, track = mplayInfo->tracks; i > 0; i--, track++)
|
||||
{
|
||||
u32 val;
|
||||
|
|
Loading…
Reference in New Issue