summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDragorn421 <Dragorn421@users.noreply.github.com>2024-08-23 22:26:53 +0200
committerGitHub <noreply@github.com>2024-08-23 16:26:53 -0400
commit614c41105896733bb18da5871a95c8df4e55fad5 (patch)
treee178fccb3e9e83ce63b7516322ddbab539e5ed52 /src
parent37f0774778ac0cf04c21a0071d6d173bfe4068db (diff)
match z_title.c (#2075)
Diffstat (limited to 'src')
-rw-r--r--src/overlays/gamestates/ovl_title/z_title.c58
1 files changed, 56 insertions, 2 deletions
diff --git a/src/overlays/gamestates/ovl_title/z_title.c b/src/overlays/gamestates/ovl_title/z_title.c
index 3d1ea7a35..5e4a3c8bc 100644
--- a/src/overlays/gamestates/ovl_title/z_title.c
+++ b/src/overlays/gamestates/ovl_title/z_title.c
@@ -7,8 +7,19 @@
#include "global.h"
#include "alloca.h"
#include "versions.h"
+
+#if PLATFORM_N64
+#include "n64dd.h"
+#endif
+
#include "assets/textures/nintendo_rogo_static/nintendo_rogo_static.h"
+// TODO
+void func_800014E8_unknown(void);
+s32 func_801C8090_unknown(void);
+void func_801C7BC4_unknown(void);
+s32 func_801C7ED0_unknown(void);
+
#if OOT_DEBUG
void ConsoleLogo_PrintBuildInfo(Gfx** gfxP) {
Gfx* gfx;
@@ -33,10 +44,29 @@ void ConsoleLogo_PrintBuildInfo(Gfx** gfxP) {
}
#endif
-// Note: In other rom versions this function also updates unk_1D4, coverAlpha, addAlpha, visibleDuration to calculate
-// the fade-in/fade-out + the duration of the n64 logo animation
void ConsoleLogo_Calc(ConsoleLogoState* this) {
+#if PLATFORM_N64
+ if ((this->coverAlpha == 0) && (this->visibleDuration != 0)) {
+ this->unk_1D4--;
+ this->visibleDuration--;
+ if (this->unk_1D4 == 0) {
+ this->unk_1D4 = 400;
+ }
+ } else {
+ this->coverAlpha += this->addAlpha;
+ if (this->coverAlpha <= 0) {
+ this->coverAlpha = 0;
+ this->addAlpha = 3;
+ } else if (this->coverAlpha >= 255) {
+ this->coverAlpha = 255;
+ this->exit = true;
+ }
+ }
+ this->uls = this->ult & 0x7F;
+ this->ult++;
+#else
this->exit = true;
+#endif
}
void ConsoleLogo_SetupView(ConsoleLogoState* this, f32 x, f32 y, f32 z) {
@@ -154,13 +184,37 @@ void ConsoleLogo_Main(GameState* thisx) {
void ConsoleLogo_Destroy(GameState* thisx) {
ConsoleLogoState* this = (ConsoleLogoState*)thisx;
+#if PLATFORM_N64
+ if (this->unk_1E0) {
+ if (func_801C8090_unknown() != 0) {
+ func_800D31A0();
+ }
+ func_801C7BC4_unknown();
+ }
+#endif
+
Sram_InitSram(&this->state, &this->sramCtx);
+
+#if PLATFORM_N64
+ func_800014E8_unknown();
+#endif
}
void ConsoleLogo_Init(GameState* thisx) {
u32 size = (uintptr_t)_nintendo_rogo_staticSegmentRomEnd - (uintptr_t)_nintendo_rogo_staticSegmentRomStart;
ConsoleLogoState* this = (ConsoleLogoState*)thisx;
+#if PLATFORM_N64
+ if ((B_80121AE0 != 0) && ((u8)B_80121AE1 != 0) && (B_80121AE2 == 0)) {
+ if (func_801C7ED0_unknown() != 0) {
+ func_800D31A0();
+ }
+ this->unk_1E0 = true;
+ } else {
+ this->unk_1E0 = false;
+ }
+#endif
+
this->staticSegment = GAME_STATE_ALLOC(&this->state, size, "../z_title.c", 611);
PRINTF("z_title.c\n");
ASSERT(this->staticSegment != NULL, "this->staticSegment != NULL", "../z_title.c", 614);