From 8d0076b0107f9eecb25d4a8a1cc30d1e31045efc Mon Sep 17 00:00:00 2001 From: fig02 Date: Thu, 1 Feb 2024 19:52:52 -0500 Subject: [PATCH] Match retail Title and Sample gamestates (#1692) * match title and sample * change to directive * no bad return --- include/functions.h | 2 +- src/code/z_view.c | 6 +++--- src/overlays/gamestates/ovl_title/z_title.c | 7 +++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/functions.h b/include/functions.h index ea003b2a5f..a7547e0a1b 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1182,7 +1182,7 @@ void View_InitDistortion(View* view); void View_ClearDistortion(View* view); void View_SetDistortion(View* view, Vec3f orientation, Vec3f scale, f32 speed); s32 View_StepDistortion(View* view, Mtx* projectionMtx); -void View_Apply(View* view, s32 mask); +s32 View_Apply(View* view, s32 mask); s32 View_ApplyOrthoToOverlay(View* view); s32 View_ApplyPerspectiveToOverlay(View* view); s32 View_UpdateViewingMatrix(View* view); diff --git a/src/code/z_view.c b/src/code/z_view.c index 1d07362452..7ed1247424 100644 --- a/src/code/z_view.c +++ b/src/code/z_view.c @@ -275,13 +275,13 @@ s32 View_StepDistortion(View* view, Mtx* projectionMtx) { /** * Apply view to POLY_OPA_DISP, POLY_XLU_DISP (and OVERLAY_DISP if ortho) */ -void View_Apply(View* view, s32 mask) { +s32 View_Apply(View* view, s32 mask) { mask = (view->flags & mask) | (mask >> 4); if (mask & VIEW_PROJECTION_ORTHO) { - View_ApplyOrtho(view); + return View_ApplyOrtho(view); } else { - View_ApplyPerspective(view); + return View_ApplyPerspective(view); } } diff --git a/src/overlays/gamestates/ovl_title/z_title.c b/src/overlays/gamestates/ovl_title/z_title.c index 807516b850..78d4058ee3 100644 --- a/src/overlays/gamestates/ovl_title/z_title.c +++ b/src/overlays/gamestates/ovl_title/z_title.c @@ -8,6 +8,7 @@ #include "alloca.h" #include "assets/textures/nintendo_rogo_static/nintendo_rogo_static.h" +#if OOT_DEBUG void ConsoleLogo_PrintBuildInfo(Gfx** gfxP) { Gfx* gfx; GfxPrint* printer; @@ -29,6 +30,7 @@ void ConsoleLogo_PrintBuildInfo(Gfx** gfxP) { GfxPrint_Destroy(printer); *gfxP = gfx; } +#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 @@ -128,13 +130,14 @@ void ConsoleLogo_Main(GameState* thisx) { ConsoleLogo_Calc(this); ConsoleLogo_Draw(this); - if (OOT_DEBUG && gIsCtrlr2Valid) { +#if OOT_DEBUG + if (gIsCtrlr2Valid) { Gfx* gfx = POLY_OPA_DISP; - s32 pad; ConsoleLogo_PrintBuildInfo(&gfx); POLY_OPA_DISP = gfx; } +#endif if (this->exit) { gSaveContext.seqId = (u8)NA_BGM_DISABLED;