mirror of
https://github.com/YohannDR/mzm.git
synced 2025-02-12 16:48:16 +00:00
Match unk_55e60
This commit is contained in:
parent
f3ea4ea6aa
commit
05cdf6196c
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
This is a work in progress decompilation of Metroid - Zero Mission.
|
This is a work in progress decompilation of Metroid - Zero Mission.
|
||||||
|
|
||||||
2435/2721 functions decompiled (89.49%, 286 left)
|
2436/2721 functions decompiled (89.53%, 285 left)
|
||||||
Progress can be seen here : https://docs.google.com/spreadsheets/d/1X8XarD5evY8ZI7r_GQqh1pYmdVMbBcINYfRBUlogmKY/edit#gid=0
|
Progress can be seen here : https://docs.google.com/spreadsheets/d/1X8XarD5evY8ZI7r_GQqh1pYmdVMbBcINYfRBUlogmKY/edit#gid=0
|
||||||
|
|
||||||
**This decomp is not shiftable, don't use it as a base to work on anything**
|
**This decomp is not shiftable, don't use it as a base to work on anything**
|
||||||
|
@ -25,10 +25,10 @@ struct BldyData {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct TransparencyRelated {
|
struct TransparencyRelated {
|
||||||
u8 unknown_0;
|
u8 unk_0;
|
||||||
u8 unknown_1;
|
u8 unk_1;
|
||||||
u8 unknown_2;
|
u8 unk_2;
|
||||||
u8 unknown_3;
|
u8 unk_3;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DefaultTransparency {
|
struct DefaultTransparency {
|
||||||
|
@ -113,10 +113,10 @@ const struct WaterMovement sWaterMovement_Empty = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const struct TransparencyRelated sTransparencyRelated_Empty = {
|
const struct TransparencyRelated sTransparencyRelated_Empty = {
|
||||||
.unknown_0 = 0,
|
.unk_0 = 0,
|
||||||
.unknown_1 = 0,
|
.unk_1 = 0,
|
||||||
.unknown_2 = 0,
|
.unk_2 = 0,
|
||||||
.unknown_3 = 0
|
.unk_3 = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct LastElevatorUsed sLastElevatorUsed_Empty = {
|
const struct LastElevatorUsed sLastElevatorUsed_Empty = {
|
||||||
|
@ -456,7 +456,7 @@ void TransparencyApplyNewEffects(void)
|
|||||||
TransparencyApplyNewBLDALPHA(&gBldalphaData1);
|
TransparencyApplyNewBLDALPHA(&gBldalphaData1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gTransparencyRelated.unknown_0 != 0)
|
if (gTransparencyRelated.unk_0 != 0)
|
||||||
unk_55e60();
|
unk_55e60();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -604,9 +604,102 @@ void TransparencyApplyNewBLDY(struct BldyData* pBldy)
|
|||||||
pBldy->activeFlag = FALSE;
|
pBldy->activeFlag = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 55e60 | 108 | To document
|
||||||
|
*
|
||||||
|
*/
|
||||||
void unk_55e60(void)
|
void unk_55e60(void)
|
||||||
{
|
{
|
||||||
|
i32 coef;
|
||||||
|
i32 eva;
|
||||||
|
i32 evb;
|
||||||
|
|
||||||
|
switch (gCurrentPowerBomb.animationState)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
gTransparencyRelated.unk_2 = 0;
|
||||||
|
gTransparencyRelated.unk_1 = 2;
|
||||||
|
|
||||||
|
coef = gIoRegistersBackup.BLDALPHA_NonGameplay_EVB + 2;
|
||||||
|
gWrittenToBLDALPHA = coef << 8 | (16 - coef);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0:
|
||||||
|
gTransparencyRelated.unk_2++;
|
||||||
|
if (gTransparencyRelated.unk_0 != 2)
|
||||||
|
{
|
||||||
|
if (gTransparencyRelated.unk_2 < 20)
|
||||||
|
break;
|
||||||
|
|
||||||
|
gTransparencyRelated.unk_2 = 0;
|
||||||
|
gTransparencyRelated.unk_1++;
|
||||||
|
gTransparencyRelated.unk_1 &= 7;
|
||||||
|
|
||||||
|
coef = gTransparencyRelated.unk_1 & 3;
|
||||||
|
if (gTransparencyRelated.unk_1 & 3)
|
||||||
|
{
|
||||||
|
if (coef & 1)
|
||||||
|
coef = 1;
|
||||||
|
else
|
||||||
|
coef = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gTransparencyRelated.unk_1 & 4)
|
||||||
|
coef = -coef;
|
||||||
|
|
||||||
|
eva = gIoRegistersBackup.BLDALPHA_NonGameplay_EVA;
|
||||||
|
evb = gIoRegistersBackup.BLDALPHA_NonGameplay_EVB;
|
||||||
|
|
||||||
|
evb += coef;
|
||||||
|
if (evb < 0)
|
||||||
|
evb = 0;
|
||||||
|
else if (evb > 16)
|
||||||
|
evb = 16;
|
||||||
|
|
||||||
|
eva -= coef;
|
||||||
|
if (eva < 0)
|
||||||
|
eva = 0;
|
||||||
|
else if (eva > 16)
|
||||||
|
eva = 16;
|
||||||
|
|
||||||
|
gWrittenToBLDALPHA = evb << 8 | eva;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (gTransparencyRelated.unk_2 < 2)
|
||||||
|
break;
|
||||||
|
|
||||||
|
gTransparencyRelated.unk_2 = 0;
|
||||||
|
|
||||||
|
gTransparencyRelated.unk_1++;
|
||||||
|
if (gTransparencyRelated.unk_1 > 3)
|
||||||
|
gTransparencyRelated.unk_1 = 0;
|
||||||
|
|
||||||
|
coef = gTransparencyRelated.unk_1;
|
||||||
|
if (gTransparencyRelated.unk_1 > 2)
|
||||||
|
coef = 4 - coef;
|
||||||
|
|
||||||
|
coef = -coef;
|
||||||
|
|
||||||
|
eva = gIoRegistersBackup.BLDALPHA_NonGameplay_EVA;
|
||||||
|
evb = gIoRegistersBackup.BLDALPHA_NonGameplay_EVB;
|
||||||
|
|
||||||
|
evb += coef;
|
||||||
|
if (evb < 0)
|
||||||
|
evb = 0;
|
||||||
|
else if (evb > 16)
|
||||||
|
evb = 16;
|
||||||
|
|
||||||
|
eva -= coef;
|
||||||
|
if (eva < 0)
|
||||||
|
eva = 0;
|
||||||
|
else if (eva > 16)
|
||||||
|
eva = 16;
|
||||||
|
|
||||||
|
gWrittenToBLDALPHA = evb << 8 | eva;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -616,6 +709,6 @@ void unk_55e60(void)
|
|||||||
void unk_55f68(void)
|
void unk_55f68(void)
|
||||||
{
|
{
|
||||||
UpdateAnimatedPaletteAfterTransitionOrReload();
|
UpdateAnimatedPaletteAfterTransitionOrReload();
|
||||||
ColorFadingTransferPaletteOnTransition(); // Undefined
|
ColorFadingTransferPaletteOnTransition();
|
||||||
CheckPlayLoadingJingle();
|
CheckPlayLoadingJingle();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user