From 6e8b8201840d905e38bb15fbc9301504748abf4f Mon Sep 17 00:00:00 2001 From: cadmic Date: Wed, 28 Aug 2024 18:00:06 -0700 Subject: [PATCH] [ntsc-1.2] Match z_game_over.c, PAL 1.1 fixes (#2099) * Match z_game_over.c (PAL 1.1 change) * Fix previous matches that are actually PAL 1.1 changes * Add versions.h to global.h * Add versions.h to z_game_over.c too * And the others too * Fix awkward wording --- include/global.h | 1 + src/code/z_game_over.c | 6 ++++++ src/overlays/actors/ovl_En_Ge3/z_en_ge3.c | 6 ++++-- src/overlays/actors/ovl_En_Go2/z_en_go2.c | 3 ++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/include/global.h b/include/global.h index 9ab8e14b38..d2a081a5fb 100644 --- a/include/global.h +++ b/include/global.h @@ -4,5 +4,6 @@ #include "functions.h" #include "variables.h" #include "macros.h" +#include "versions.h" #endif diff --git a/src/code/z_game_over.c b/src/code/z_game_over.c index ff2f2a57db..e6335307da 100644 --- a/src/code/z_game_over.c +++ b/src/code/z_game_over.c @@ -1,6 +1,7 @@ #include "z64game_over.h" #include "global.h" +#include "versions.h" void GameOver_Init(PlayState* play) { play->gameOverCtx.state = GAMEOVER_INACTIVE; @@ -61,7 +62,12 @@ void GameOver_Update(PlayState* play) { } } +#if OOT_VERSION < PAL_1_1 + gSaveContext.nayrusLoveTimer = 0; +#else gSaveContext.nayrusLoveTimer = 2000; +#endif + gSaveContext.save.info.playerData.naviTimer = 0; gSaveContext.seqId = (u8)NA_BGM_DISABLED; gSaveContext.natureAmbienceId = NATURE_ID_DISABLED; diff --git a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c index 5fbcb179dd..096c7bdf79 100644 --- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c +++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c @@ -6,6 +6,7 @@ #include "z_en_ge3.h" #include "assets/objects/object_geldb/object_geldb.h" +#include "versions.h" #define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) @@ -237,10 +238,11 @@ s32 EnGe3_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p // Turn head case GELDB_LIMB_HEAD: rot->x += this->headRot.y; -#if PLATFORM_GC +#if OOT_VERSION >= PAL_1_1 FALLTHROUGH; - // This is a hack to fix the color-changing clothes this Gerudo has on N64 versions default: + // This is a hack to fix a bug present before PAL 1.1, where the actor's clothes can change color + // depending on what was drawn earlier in the frame. OPEN_DISPS(play->state.gfxCtx, "../z_en_ge3.c", 547); switch (limbIndex) { case GELDB_LIMB_NECK: diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index ebbb8e2b78..3b9b1939fb 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -3,6 +3,7 @@ #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_oF1d_map/object_oF1d_map.h" #include "quake.h" +#include "versions.h" #define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4 | ACTOR_FLAG_5) @@ -1577,7 +1578,7 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { this->actionFunc = EnGo2_CurledUp; } } else { -#if PLATFORM_GC +#if OOT_VERSION >= PAL_1_1 CLEAR_INFTABLE(INFTABLE_10C); #endif this->collider.dim.height = (D_80A4816C[PARAMS_GET_S(this->actor.params, 0, 5)].height * 0.6f);