diff --git a/include/functions.h b/include/functions.h index e4e532c3e1..e2a079f21a 100644 --- a/include/functions.h +++ b/include/functions.h @@ -372,10 +372,10 @@ void Flags_SetTempClear(GlobalContext* globalCtx, s32 flag); void Flags_UnsetTempClear(GlobalContext* globalCtx, s32 flag); s32 Flags_GetCollectible(GlobalContext* globalCtx, s32 flag); void Flags_SetCollectible(GlobalContext* globalCtx, s32 flag); -void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s16 arg3, s16 arg4, - u8 arg5, u8 arg6); -void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s32 arg3, s32 arg4, - s32 arg5, s32 arg6, s32 arg7); +void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s16 x, + s16 y, u8 width, u8 height); +void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s32 x, + s32 y, s32 width, s32 height, s32 delay); s32 func_8002D53C(GlobalContext* globalCtx, TitleCardContext* titleCtx); void Actor_Kill(Actor* actor); void Actor_SetFocus(Actor* actor, f32 offset); @@ -526,7 +526,7 @@ void func_80035650(Actor* actor, ColliderInfo* colBody, s32 freezeFlag); void func_8003573C(Actor* actor, ColliderJntSph* colBody, s32 freezeFlag); void func_80035844(Vec3f* arg0, Vec3f* arg1, Vec3s* arg2, s32 arg3); Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, f32* arg3, s32 timer, s16* unused, - GlobalContext* globalCtx, s16 params, s32 arg8); + GlobalContext* globalCtx, s16 params, s32 arg8); void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2); s32 Flags_GetEventChkInf(s32 flag); void Flags_SetEventChkInf(s32 flag); diff --git a/include/z64.h b/include/z64.h index 3d68fdd0b4..38cc58ebb3 100644 --- a/include/z64.h +++ b/include/z64.h @@ -222,15 +222,15 @@ typedef struct { } TargetContext; // size = 0x98 typedef struct { - /* 0x00 */ void* texture; - /* 0x04 */ s16 unk_4; - /* 0x06 */ s16 unk_6; - /* 0x08 */ u8 unk_8; - /* 0x09 */ u8 unk_9; - /* 0x0A */ u8 delayA; - /* 0x0B */ u8 delayB; - /* 0x0C */ s16 unk_C; - /* 0x0E */ s16 unk_E; + /* 0x00 */ void* texture; + /* 0x04 */ s16 x; + /* 0x06 */ s16 y; + /* 0x08 */ u8 width; + /* 0x09 */ u8 height; + /* 0x0A */ u8 durationTimer; // how long the title card appears for before fading + /* 0x0B */ u8 delayTimer; // how long the title card waits to appear + /* 0x0C */ s16 alpha; + /* 0x0E */ s16 intensity; } TitleCardContext; // size = 0x10 typedef struct { diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 659ca65858..cfb6a788b5 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -664,22 +664,22 @@ void Flags_SetCollectible(GlobalContext* globalCtx, s32 flag) { } void func_8002CDE4(GlobalContext* globalCtx, TitleCardContext* titleCtx) { - titleCtx->delayA = titleCtx->delayB = titleCtx->unk_E = titleCtx->unk_C = 0; + titleCtx->durationTimer = titleCtx->delayTimer = titleCtx->intensity = titleCtx->alpha = 0; } -void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s16 arg3, s16 arg4, - u8 arg5, u8 arg6) { +void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s16 x, + s16 y, u8 width, u8 height) { titleCtx->texture = texture; - titleCtx->unk_4 = arg3; - titleCtx->unk_6 = arg4; - titleCtx->unk_8 = arg5; - titleCtx->unk_9 = arg6; - titleCtx->delayA = 80; - titleCtx->delayB = 0; + titleCtx->x = x; + titleCtx->y = y; + titleCtx->width = width; + titleCtx->height = height; + titleCtx->durationTimer = 80; + titleCtx->delayTimer = 0; } -void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s32 arg3, s32 arg4, - s32 arg5, s32 arg6, s32 arg7) { +void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s32 x, + s32 y, s32 width, s32 height, s32 delay) { Scene* loadedScene = globalCtx->loadedScene; u32 size = loadedScene->titleFile.vromEnd - loadedScene->titleFile.vromStart; @@ -688,22 +688,22 @@ void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCt } titleCtx->texture = texture; - titleCtx->unk_4 = arg3; - titleCtx->unk_6 = arg4; - titleCtx->unk_8 = arg5; - titleCtx->unk_9 = arg6; - titleCtx->delayA = 80; - titleCtx->delayB = arg7; + titleCtx->x = x; + titleCtx->y = y; + titleCtx->width = width; + titleCtx->height = height; + titleCtx->durationTimer = 80; + titleCtx->delayTimer = delay; } void TitleCard_Update(GlobalContext* globalCtx, TitleCardContext* titleCtx) { - if (DECR(titleCtx->delayB) == 0) { - if (DECR(titleCtx->delayA) == 0) { - Math_StepToS(&titleCtx->unk_C, 0, 30); - Math_StepToS(&titleCtx->unk_E, 0, 70); + if (DECR(titleCtx->delayTimer) == 0) { + if (DECR(titleCtx->durationTimer) == 0) { + Math_StepToS(&titleCtx->alpha, 0, 30); + Math_StepToS(&titleCtx->intensity, 0, 70); } else { - Math_StepToS(&titleCtx->unk_C, 255, 10); - Math_StepToS(&titleCtx->unk_E, 255, 20); + Math_StepToS(&titleCtx->alpha, 255, 10); + Math_StepToS(&titleCtx->intensity, 255, 20); } } } @@ -718,11 +718,11 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) { s32 spB4; s32 spB0; - if (titleCtx->unk_C != 0) { - spCC = titleCtx->unk_8; - spC8 = titleCtx->unk_9; - spC0 = (titleCtx->unk_4 * 4) - (spCC * 2); - spB8 = (titleCtx->unk_6 * 4) - (spC8 * 2); + if (titleCtx->alpha != 0) { + spCC = titleCtx->width; + spC8 = titleCtx->height; + spC0 = (titleCtx->x * 4) - (spCC * 2); + spB8 = (titleCtx->y * 4) - (spC8 * 2); sp38 = spCC * 2; OPEN_DISPS(globalCtx->state.gfxCtx, "../z_actor.c", 2824); @@ -735,8 +735,8 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) { OVERLAY_DISP = func_80093808(OVERLAY_DISP); - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, (u8)titleCtx->unk_E, (u8)titleCtx->unk_E, (u8)titleCtx->unk_E, - (u8)titleCtx->unk_C); + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, (u8)titleCtx->intensity, (u8)titleCtx->intensity, (u8)titleCtx->intensity, + (u8)titleCtx->alpha); gDPLoadTextureBlock(OVERLAY_DISP++, (s32)titleCtx->texture + spB0, G_IM_FMT_IA, G_IM_SIZ_8b, spCC, spC8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, @@ -745,7 +745,7 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) { gSPTextureRectangle(OVERLAY_DISP++, spC0, spB8, ((sp38 * 2) + spC0) - 4, spB8 + (spC8 * 4) - 1, G_TX_RENDERTILE, 0, 0, 1024, 1024); - spC8 = titleCtx->unk_9 - spC8; + spC8 = titleCtx->height - spC8; if (spC8 > 0) { gDPLoadTextureBlock(OVERLAY_DISP++, (s32)titleCtx->texture + spB0 + 0x1000, G_IM_FMT_IA, G_IM_SIZ_8b, spCC, @@ -761,9 +761,9 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) { } s32 func_8002D53C(GlobalContext* globalCtx, TitleCardContext* titleCtx) { - if ((globalCtx->actorCtx.titleCtx.delayB != 0) || (globalCtx->actorCtx.titleCtx.unk_C != 0)) { - titleCtx->delayA = 0; - titleCtx->delayB = 0; + if ((globalCtx->actorCtx.titleCtx.delayTimer != 0) || (globalCtx->actorCtx.titleCtx.alpha != 0)) { + titleCtx->durationTimer = 0; + titleCtx->delayTimer = 0; return 0; } diff --git a/src/code/z_demo.c b/src/code/z_demo.c index dbde060673..028846a598 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -259,8 +259,8 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* break; case 15: if (sp3F != 0) { - TitleCard_InitPlaceName(globalCtx, &globalCtx->actorCtx.titleCtx, player->giObjectSegment, 0xA0, 0x78, - 0x90, 0x18, 0x14); + TitleCard_InitPlaceName(globalCtx, &globalCtx->actorCtx.titleCtx, player->giObjectSegment, 160, 120, + 144, 24, 20); } break; case 16: diff --git a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c index 422912aabf..20a3271c0e 100644 --- a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c +++ b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c @@ -336,7 +336,7 @@ void EnfHG_Intro(EnfHG* this, GlobalContext* globalCtx) { Math_ApproachF(&this->cameraSpeedMod, 1.0f, 1.0f, 0.05f); if (this->timers[0] == 75) { TitleCard_InitBossName(globalCtx, &globalCtx->actorCtx.titleCtx, - SEGMENTED_TO_VIRTUAL(&gPhantomGanonTitleCardTex), 0xA0, 0xB4, 0x80, 0x28); + SEGMENTED_TO_VIRTUAL(&gPhantomGanonTitleCardTex), 160, 180, 128, 40); } if (this->timers[0] == 0) { this->cutsceneState = INTRO_RETREAT; diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 2610910934..1b2f6efceb 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -4674,7 +4674,7 @@ s32 func_8083B040(Player* this, GlobalContext* globalCtx) { (((this->itemActionParam == PLAYER_AP_BOTTLE_POE) && (this->exchangeItemId == EXCH_ITEM_POE)) || (this->exchangeItemId == EXCH_ITEM_BLUE_FIRE))))))) { - if ((globalCtx->actorCtx.titleCtx.delayB == 0) && (globalCtx->actorCtx.titleCtx.unk_C == 0)) { + if ((globalCtx->actorCtx.titleCtx.delayTimer == 0) && (globalCtx->actorCtx.titleCtx.alpha == 0)) { func_80835DE4(globalCtx, this, func_8084F104, 0); if (sp2C >= 0) { @@ -9052,8 +9052,8 @@ void Player_Init(Actor* thisx, GlobalContext* globalCtx2) { 0x4000) && ((globalCtx->sceneNum != SCENE_DDAN) || (gSaveContext.eventChkInf[11] & 1)) && ((globalCtx->sceneNum != SCENE_NIGHT_SHOP) || (gSaveContext.eventChkInf[2] & 0x20))) { - TitleCard_InitPlaceName(globalCtx, &globalCtx->actorCtx.titleCtx, this->giObjectSegment, 0xA0, 0x78, - 0x90, 0x18, 0x14); + TitleCard_InitPlaceName(globalCtx, &globalCtx->actorCtx.titleCtx, this->giObjectSegment, 160, 120, + 144, 24, 20); } } gSaveContext.showTitleCard = true;