diff --git a/assets/xml/objects/object_yb.xml b/assets/xml/objects/object_yb.xml index 8cf61e347c..1a8503a6e9 100644 --- a/assets/xml/objects/object_yb.xml +++ b/assets/xml/objects/object_yb.xml @@ -1,57 +1,61 @@  + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spec b/spec index a5c9e38766..084c06895f 100644 --- a/spec +++ b/spec @@ -5042,8 +5042,7 @@ beginseg name "ovl_En_Yb" compress include "build/src/overlays/actors/ovl_En_Yb/z_en_yb.o" - include "build/data/ovl_En_Yb/ovl_En_Yb.data.o" - include "build/data/ovl_En_Yb/ovl_En_Yb.reloc.o" + include "build/src/overlays/actors/ovl_En_Yb/ovl_En_Yb_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_En_Yb/z_en_yb.c b/src/overlays/actors/ovl_En_Yb/z_en_yb.c index bb3f81576d..73ae77f67f 100644 --- a/src/overlays/actors/ovl_En_Yb/z_en_yb.c +++ b/src/overlays/actors/ovl_En_Yb/z_en_yb.c @@ -5,8 +5,9 @@ */ #include "z_en_yb.h" +#include "objects/gameplay_keep/gameplay_keep.h" -#define FLAGS 0x02000019 +#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_2000000) #define THIS ((EnYb*)thisx) @@ -15,16 +16,22 @@ void EnYb_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnYb_Update(Actor* thisx, GlobalContext* globalCtx); void EnYb_Draw(Actor* thisx, GlobalContext* globalCtx); -void func_80BFA730(EnYb* this, GlobalContext* globalCtx); -void func_80BFA868(EnYb* this, GlobalContext* globalCtx); -void func_80BFA91C(EnYb* this, GlobalContext* globalCtx); -void func_80BFA9D4(EnYb* this, GlobalContext* globalCtx); -void func_80BFAB4C(EnYb* this, GlobalContext* globalCtx); -void func_80BFABF0(EnYb* this, GlobalContext* globalCtx); -void func_80BFAC88(EnYb* this, GlobalContext* globalCtx); -void func_80BFAE80(EnYb* this, GlobalContext* globalCtx); +void EnYb_Idle(EnYb* this, GlobalContext* globalCtx); +void EnYb_TeachingDanceFinish(EnYb* this, GlobalContext* globalCtx); +void EnYb_SetupLeaving(EnYb* this, GlobalContext* globalCtx); + +void EnYb_UpdateAnimation(EnYb* this, GlobalContext* globalCtx); +void EnYb_FinishTeachingCutscene(EnYb* this); +void EnYb_Disappear(EnYb* this, GlobalContext* globalCtx); +void EnYb_ReceiveMask(EnYb* this, GlobalContext* globalCtx); +void EnYb_Talk(EnYb* this, GlobalContext* globalCtx); +void EnYb_TeachingDance(EnYb* this, GlobalContext* globalCtx); +void EnYb_WaitForMidnight(EnYb* this, GlobalContext* globalCtx); + +void EnYb_ActorShadowFunc(Actor* thisx, Lights* mapper, GlobalContext* globalCtx); +void EnYb_SetAnimation(GlobalContext*, EnYb*, s16, u8, f32); +s32 EnYb_CanTalk(EnYb* this, GlobalContext* globalCtx); -#if 0 const ActorInit En_Yb_InitVars = { ACTOR_EN_YB, ACTORCAT_NPC, @@ -37,59 +44,439 @@ const ActorInit En_Yb_InitVars = { (ActorFunc)EnYb_Draw, }; -// static ColliderCylinderInit sCylinderInit = { -static ColliderCylinderInit D_80BFB2B0 = { - { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_ENEMY, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, }, - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, }, +static ColliderCylinderInit sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 20, 40, 0, { 0, 0, 0 } }, }; -#endif +// crashes if I try to mod it in to look at it +// assumption: draw uses two different skeleton functions, might be incompatible +static AnimationHeader* gYbUnusedAnimations[] = { &object_yb_Anim_000200 }; -extern ColliderCylinderInit D_80BFB2B0; +static LinkAnimationHeader* gLinkAnimations[] = { &gameplay_keep_Linkanim_00DF28, &gameplay_keep_Linkanim_00CF98 }; -extern UNK_TYPE D_06000200; +static Vec3f D_80BFB2E8 = { 0.0f, 0.5f, 0.0f }; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/EnYb_Init.s") +static Vec3f D_80BFB2F4 = { 500.0f, -500.0, 0.0f }; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/EnYb_Destroy.s") +static Vec3f D_80BFB300 = { 500.0f, -500.0f, 0.0f }; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA2FC.s") +void EnYb_Init(Actor* thisx, GlobalContext* globalCtx) { + EnYb* this = THIS; + s16 tempCutscene; + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA350.s") + Actor_SetScale(&this->actor, 0.01f); + ActorShape_Init(&this->actor.shape, 0.0f, EnYb_ActorShadowFunc, 20.0f); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA444.s") + // @Bug this alignment is because of player animations, but should be using ALIGN16 + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gYbSkeleton, &object_yb_Anim_000200, + (uintptr_t)this->jointTable & ~0xF, (uintptr_t)this->morphTable & ~0xF, YB_LIMB_MAX); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA5CC.s") + Animation_PlayLoop(&this->skelAnime, &object_yb_Anim_000200); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA634.s") + Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); + this->actor.colChkInfo.mass = MASS_IMMOVABLE; + this->actionFunc = EnYb_Idle; + this->currentAnimIndex = 3; // gets overwritten to 2 in EnYb_SetAnimation later + this->actor.terminalVelocity = -9.0f; + this->actor.gravity = -1.0f; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA67C.s") + EnYb_SetAnimation(globalCtx, this, 2, ANIMMODE_LOOP, 0.0f); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA6E0.s") + tempCutscene = this->actor.cutscene; + for (i = 0; i < ARRAY_COUNT(this->cutscenes); i++) { + this->cutscenes[i] = tempCutscene; + if (tempCutscene != -1) { + this->actor.cutscene = tempCutscene; + tempCutscene = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); + } + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA710.s") + this->cutsceneIndex = -1; + this->actor.cutscene = this->cutscenes[0]; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA730.s") + // between midnight and morning start spawned + if (gSaveContext.time < CLOCK_TIME(6, 0)) { + this->alpha = 255; + } else { // else (night 6pm to midnight): wait to appear + this->alpha = 0; + this->actionFunc = EnYb_WaitForMidnight; + this->actor.flags &= ~ACTOR_FLAG_1; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA868.s") + // check if already healed + if (gSaveContext.weekEventReg[82] & 4) { + Actor_MarkForDeath(&this->actor); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA91C.s") +void EnYb_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnYb* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA9D4.s") + Collider_DestroyCylinder(globalCtx, &this->collider); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFAB4C.s") +void func_80BFA2FC(GlobalContext* globalCtx) { + if (INV_CONTENT(ITEM_MASK_KAMARO) == ITEM_MASK_KAMARO) { + func_80151BB4(globalCtx, 0x34); + } + func_80151BB4(globalCtx, 0xF); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFABF0.s") +/** + * Custom shadow draw function of type ActorShadowFunc. + */ +void EnYb_ActorShadowFunc(Actor* thisx, Lights* mapper, GlobalContext* globalCtx) { + Vec3f oldPos; + EnYb* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFAC88.s") + if (this->alpha > 0) { + if (this->currentAnimIndex == 2) { + f32 tempScale = (((27.0f - this->shadowPos.y) + this->actor.world.pos.y) * ((1 / 2.25f) * 0.001f)) + 0.01f; + this->actor.scale.x = tempScale; + } + Math_Vec3f_Copy(&oldPos, &this->actor.world.pos); + Math_Vec3f_Copy(&this->actor.world.pos, &this->shadowPos); + func_800B4AEC(globalCtx, &this->actor, 50.0f); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFAE80.s") + if (oldPos.y < this->actor.floorHeight) { + this->actor.world.pos.y = this->actor.floorHeight; + } else { + this->actor.world.pos.y = oldPos.y; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/EnYb_Update.s") + ActorShadow_DrawCircle(&this->actor, mapper, globalCtx); + Math_Vec3f_Copy(&this->actor.world.pos, &oldPos); + this->actor.scale.x = 0.01f; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFB074.s") +void EnYb_SetAnimation(GlobalContext* globalCtx, EnYb* this, s16 animIndex, u8 animMode, f32 transitionRate) { + if (animIndex >= 0 && animIndex < 3) { + if (animIndex != this->currentAnimIndex || animMode != ANIMMODE_LOOP) { + if (animIndex > 0) { + if (animMode == ANIMMODE_LOOP) { + LinkAnimation_Change(globalCtx, &this->skelAnime, gLinkAnimations[animIndex - 1], 1.0f, 0.0f, + Animation_GetLastFrame(gLinkAnimations[animIndex - 1]), ANIMMODE_LOOP, + transitionRate); + } else { + // unused case, (only called once with animMode = ANIMMODE_LOOP) + LinkAnimation_Change(globalCtx, &this->skelAnime, gLinkAnimations[animIndex - 1], 1.0f, 0.0f, + Animation_GetLastFrame(gLinkAnimations[animIndex - 1]), ANIMMODE_LOOP, + transitionRate); + } + } else { + // unused case, (only called once with animIndex = 2) + AnimationHeader* animationPtr = gYbUnusedAnimations[animIndex]; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFB0E0.s") + if (1) {} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/EnYb_Draw.s") + Animation_Change(&this->skelAnime, gYbUnusedAnimations[animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(animationPtr), animMode, transitionRate); + } + this->currentAnimIndex = animIndex; + } + } +} + +s32 EnYb_CanTalk(EnYb* this, GlobalContext* globalCtx) { + if (this->actor.xzDistToPlayer < 100.0f && Player_IsFacingActor(&this->actor, 0x3000, globalCtx) && + Actor_IsFacingPlayer(&this->actor, 0x3000)) { + return true; + } else { + return false; + } +} + +void EnYb_UpdateAnimation(EnYb* this, GlobalContext* globalCtx) { + if (this->currentAnimIndex <= 0) { + SkelAnime_Update(&this->skelAnime); + } else { + LinkAnimation_Update(globalCtx, &this->skelAnime); + } +} + +void EnYb_FinishTeachingCutscene(EnYb* this) { + if (this->cutsceneIndex != -1) { + if (ActorCutscene_GetCurrentIndex() == this->cutscenes[this->cutsceneIndex]) { + ActorCutscene_Stop(this->cutscenes[this->cutsceneIndex]); + } + this->cutsceneIndex = -1; + } +} + +void EnYb_ChangeCutscene(EnYb* this, s16 cutsceneId) { + EnYb_FinishTeachingCutscene(this); + this->cutsceneIndex = cutsceneId; +} + +/** + * Sets a flag that enables the Kamaro dancing proximity music at night. + */ +void EnYb_EnableProximityMusic(EnYb* this) { + func_800B9084(&this->actor); +} + +void EnYb_Disappear(EnYb* this, GlobalContext* globalCtx) { + s32 pad; + Vec3f sp60; + s32 i; + + EnYb_UpdateAnimation(this, globalCtx); + for (i = 3; i >= 0; i--) { + sp60.x = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.x; + sp60.z = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.z; + sp60.y = randPlusMinusPoint5Scaled(50.0f) + (this->actor.world.pos.y + 20.0f); + func_800B3030(globalCtx, &sp60, &D_80BFB2E8, &D_80BFB2E8, 100, 0, 2); + } + + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EN_EXTINCT); + if (this->alpha > 10) { + this->alpha -= 10; + } else { + Actor_MarkForDeath(&this->actor); + } +} + +void EnYb_SetupLeaving(EnYb* this, GlobalContext* globalCtx) { + EnYb_UpdateAnimation(this, globalCtx); + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { + this->actor.flags &= ~ACTOR_FLAG_10000; + this->actionFunc = EnYb_Talk; + // I am counting on you + func_801518B0(globalCtx, 0x147D, &this->actor); + func_80BFA2FC(globalCtx); + } else { + func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1); + } + EnYb_EnableProximityMusic(this); +} + +void EnYb_ReceiveMask(EnYb* this, GlobalContext* globalCtx) { + EnYb_UpdateAnimation(this, globalCtx); + // Player is parent: receiving the Kamaro mask + if (Actor_HasParent(&this->actor, globalCtx)) { + this->actor.parent = NULL; + this->actionFunc = EnYb_SetupLeaving; + this->actor.flags |= ACTOR_FLAG_10000; + func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1); + } else { + Actor_PickUp(&this->actor, globalCtx, GI_MASK_KAMARO, 10000.0f, 100.0f); + } + EnYb_EnableProximityMusic(this); +} + +void EnYb_Talk(EnYb* this, GlobalContext* globalCtx) { + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0x1000, 0x200); + this->actor.world.rot.y = this->actor.shape.rot.y; + EnYb_UpdateAnimation(this, globalCtx); + + if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx) != 0) { + switch (globalCtx->msgCtx.unk11F04) { + case 0x147D: // I am counting on you + func_801477B4(globalCtx); + this->actionFunc = EnYb_Disappear; + gSaveContext.weekEventReg[82] |= 0x4; + break; + case 0x147C: // Spread my dance across the world + if (Player_GetMask(globalCtx) == PLAYER_MASK_KAMARO) { + func_801477B4(globalCtx); + this->actionFunc = EnYb_Idle; + + } else if (INV_CONTENT(ITEM_MASK_KAMARO) == ITEM_MASK_KAMARO) { + func_80151938(globalCtx, 0x147D); // I am counting on you + func_80BFA2FC(globalCtx); + + } else { + func_801477B4(globalCtx); + this->actionFunc = EnYb_ReceiveMask; + EnYb_ReceiveMask(this, globalCtx); + } + break; + default: + func_801477B4(globalCtx); + this->actionFunc = EnYb_Idle; + break; + } + } + EnYb_EnableProximityMusic(this); +} + +void EnYb_TeachingDanceFinish(EnYb* this, GlobalContext* globalCtx) { + EnYb_UpdateAnimation(this, globalCtx); + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { + this->actionFunc = EnYb_Talk; + // Spread my dance across the world + func_801518B0(globalCtx, 0x147C, &this->actor); + this->actor.flags &= ~ACTOR_FLAG_10000; + } else { + func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1); + } + EnYb_EnableProximityMusic(this); +} + +// dancing countdown +void EnYb_TeachingDance(EnYb* this, GlobalContext* globalCtx) { + EnYb_UpdateAnimation(this, globalCtx); + + if (this->teachingCutsceneTimer > 0) { + this->teachingCutsceneTimer--; + } else { + EnYb_FinishTeachingCutscene(this); + this->actionFunc = EnYb_TeachingDanceFinish; + this->actor.flags |= ACTOR_FLAG_10000; + func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1); + } + EnYb_EnableProximityMusic(this); +} + +void EnYb_Idle(EnYb* this, GlobalContext* globalCtx) { + s32 pad; + Player* player = GET_PLAYER(globalCtx); + + EnYb_UpdateAnimation(this, globalCtx); + if (this->actor.xzDistToPlayer < 180.0f && fabsf(this->actor.playerHeightRel) < 50.0f && + globalCtx->msgCtx.ocarinaMode == 3 && globalCtx->msgCtx.unk1202E == 7 && + gSaveContext.playerForm == PLAYER_FORM_HUMAN) { + this->actionFunc = EnYb_TeachingDance; + this->teachingCutsceneTimer = 200; + EnYb_ChangeCutscene(this, 0); + } else if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { + func_80BFA2FC(globalCtx); + this->actionFunc = EnYb_Talk; + if (Player_GetMask(globalCtx) == PLAYER_MASK_KAMARO) { + // I have taught you, go use it + func_801518B0(globalCtx, 0x147C, &this->actor); + } else { + // regular talk to him first dialogue + func_801518B0(globalCtx, 0x147B, &this->actor); + } + } else if (EnYb_CanTalk(this, globalCtx)) { + func_800B8614(&this->actor, globalCtx, 120.0f); + } + + if (this->playerOcarinaOut & 1) { + if (!(player->stateFlags2 & 0x8000000)) { + this->playerOcarinaOut &= ~1; + } + } else if ((player->stateFlags2 & 0x8000000) && this->actor.xzDistToPlayer < 180.0f && + fabsf(this->actor.playerHeightRel) < 50.0f) { + this->playerOcarinaOut |= 1; + Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); + } + + EnYb_EnableProximityMusic(this); +} + +void EnYb_WaitForMidnight(EnYb* this, GlobalContext* globalCtx) { + if (gSaveContext.time < CLOCK_TIME(6, 0)) { + EnYb_UpdateAnimation(this, globalCtx); + this->alpha += 5; + if (this->alpha > 250) { + this->alpha = 255; + this->actor.flags |= ACTOR_FLAG_1; + this->actionFunc = EnYb_Idle; + } + EnYb_EnableProximityMusic(this); + } +} + +void EnYb_Update(Actor* thisx, GlobalContext* globalCtx) { + s32 pad; + EnYb* this = THIS; + + if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_1)) { + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + } + if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_1)) { + Actor_MoveWithGravity(&this->actor); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 40.0f, 25.0f, 40.0f, 5); + } + + this->actionFunc(this, globalCtx); + + if (this->cutsceneIndex != -1 && ActorCutscene_GetCurrentIndex() != this->cutscenes[this->cutsceneIndex]) { + if (ActorCutscene_GetCurrentIndex() == 0x7C) { + ActorCutscene_Stop(0x7C); + ActorCutscene_SetIntentToPlay(this->cutscenes[this->cutsceneIndex]); + } else if (ActorCutscene_GetCanPlayNext(this->cutscenes[this->cutsceneIndex])) { + if (this->cutsceneIndex == 0) { + ActorCutscene_StartAndSetUnkLinkFields(this->cutscenes[this->cutsceneIndex], &this->actor); + } + } else { + ActorCutscene_SetIntentToPlay(this->cutscenes[this->cutsceneIndex]); + } + } +} + +void EnYb_PostLimbDrawOpa(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { + EnYb* this = THIS; + + if (limbIndex == YB_LIMB_HEAD) { + Matrix_MultiplyVector3fByState(&D_80BFB2F4, &this->actor.focus.pos); + } + if (limbIndex == YB_LIMB_LEGS_ROOT) { + Matrix_MultiplyVector3fByState(&gZeroVec3f, &this->shadowPos); + } +} + +void EnYb_PostLimbDrawXlu(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) { + EnYb* this = THIS; + + if (limbIndex == YB_LIMB_HEAD) { + Matrix_MultiplyVector3fByState(&D_80BFB300, &this->actor.focus.pos); + } + if (limbIndex == YB_LIMB_LEGS_ROOT) { + Matrix_MultiplyVector3fByState(&gZeroVec3f, &this->shadowPos); + } +} + +void EnYb_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnYb* this = THIS; + + OPEN_DISPS(globalCtx->state.gfxCtx); + + if (this->alpha != 0) { + if (this->alpha < 255) { + if (this->alpha > 128) { + func_8012C2B4(POLY_XLU_DISP++); + Scene_SetRenderModeXlu(globalCtx, 2, 2); + } else { + func_8012C304(POLY_XLU_DISP++); + Scene_SetRenderModeXlu(globalCtx, 1, 2); + } + gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->alpha); + + if (1) {} + + POLY_XLU_DISP = + SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, + this->skelAnime.dListCount, NULL, EnYb_PostLimbDrawXlu, &this->actor, POLY_XLU_DISP); + + } else { + func_8012C28C(globalCtx->state.gfxCtx); + Scene_SetRenderModeXlu(globalCtx, 0, 1); + SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, + this->skelAnime.dListCount, NULL, EnYb_PostLimbDrawOpa, &this->actor); + } + } + + CLOSE_DISPS(globalCtx->state.gfxCtx); +} diff --git a/src/overlays/actors/ovl_En_Yb/z_en_yb.h b/src/overlays/actors/ovl_En_Yb/z_en_yb.h index ca8a59d932..1b4c898a2e 100644 --- a/src/overlays/actors/ovl_En_Yb/z_en_yb.h +++ b/src/overlays/actors/ovl_En_Yb/z_en_yb.h @@ -2,17 +2,28 @@ #define Z_EN_YB_H #include "global.h" +#include "objects/object_yb/object_yb.h" struct EnYb; typedef void (*EnYbActionFunc)(struct EnYb*, GlobalContext*); typedef struct EnYb { - /* 0x0000 */ Actor actor; - /* 0x0144 */ char unk_144[0x2DC]; - /* 0x0420 */ EnYbActionFunc actionFunc; + /* 0x000 */ Actor actor; + /* 0x144 */ SkelAnime skelAnime; + /* 0x188 */ Vec3s jointTable[YB_LIMB_MAX]; + /* 0x20C */ UNK_TYPE1 unkPadding20C[0x94]; + /* 0x2A0 */ Vec3s morphTable[YB_LIMB_MAX]; + /* 0x324 */ UNK_TYPE1 unkPadding324[0x94]; + /* 0x3B8 */ ColliderCylinder collider; + /* 0x404 */ Vec3f shadowPos; + /* 0x410 */ u16 playerOcarinaOut; + /* 0x412 */ s16 currentAnimIndex; + /* 0x414 */ s16 alpha; + /* 0x416 */ s16 cutscenes[2]; + /* 0x41A */ s16 cutsceneIndex; + /* 0x41C */ s16 teachingCutsceneTimer; + /* 0x420 */ EnYbActionFunc actionFunc; } EnYb; // size = 0x424 -extern const ActorInit En_Yb_InitVars; - #endif // Z_EN_YB_H diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 3f1a4541c8..8e58c7435d 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -16379,24 +16379,24 @@ 0x80BFA100:("EnYb_Init",), 0x80BFA2D0:("EnYb_Destroy",), 0x80BFA2FC:("func_80BFA2FC",), - 0x80BFA350:("func_80BFA350",), - 0x80BFA444:("func_80BFA444",), - 0x80BFA5CC:("func_80BFA5CC",), - 0x80BFA634:("func_80BFA634",), - 0x80BFA67C:("func_80BFA67C",), - 0x80BFA6E0:("func_80BFA6E0",), - 0x80BFA710:("func_80BFA710",), - 0x80BFA730:("func_80BFA730",), - 0x80BFA868:("func_80BFA868",), - 0x80BFA91C:("func_80BFA91C",), - 0x80BFA9D4:("func_80BFA9D4",), - 0x80BFAB4C:("func_80BFAB4C",), - 0x80BFABF0:("func_80BFABF0",), - 0x80BFAC88:("func_80BFAC88",), - 0x80BFAE80:("func_80BFAE80",), + 0x80BFA350:("EnYb_ActorShadowFunc",), + 0x80BFA444:("EnYb_SetAnimation",), + 0x80BFA5CC:("EnYb_CanTalk",), + 0x80BFA634:("EnYb_UpdateAnimation",), + 0x80BFA67C:("EnYb_FinishTeachingCutscene",), + 0x80BFA6E0:("EnYb_ChangeCutscene",), + 0x80BFA710:("EnYb_EnableProximityMusic",), + 0x80BFA730:("EnYb_Disappear",), + 0x80BFA868:("EnYb_SetupLeaving",), + 0x80BFA91C:("EnYb_ReceiveMask",), + 0x80BFA9D4:("EnYb_Talk",), + 0x80BFAB4C:("EnYb_TeachingDanceFinish",), + 0x80BFABF0:("EnYb_TeachingDance",), + 0x80BFAC88:("EnYb_Idle",), + 0x80BFAE80:("EnYb_WaitForMidnight",), 0x80BFAEFC:("EnYb_Update",), - 0x80BFB074:("func_80BFB074",), - 0x80BFB0E0:("func_80BFB0E0",), + 0x80BFB074:("EnYb_PostLimbDrawOpa",), + 0x80BFB0E0:("EnYb_PostLimbDrawXlu",), 0x80BFB14C:("EnYb_Draw",), 0x80BFB480:("EnRz_Init",), 0x80BFB780:("func_80BFB780",), diff --git a/undefined_syms.txt b/undefined_syms.txt index 38b0953cc6..3aa77e775e 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -2049,11 +2049,6 @@ D_06005C64 = 0x06005C64; D_06000700 = 0x06000700; -// ovl_En_Yb - -D_06000200 = 0x06000200; -D_06005F48 = 0x06005F48; - // ovl_En_Zl4 D_06013328 = 0x06013328;