diff --git a/linker_scripts/code_script.txt b/linker_scripts/code_script.txt index 165a38f41b..69f6903716 100644 --- a/linker_scripts/code_script.txt +++ b/linker_scripts/code_script.txt @@ -8642,8 +8642,9 @@ SECTIONS ovl_En_Ending_Hero2 : AT(RomLocation) { build/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.o(.text) - build/asm/ovl_En_Ending_Hero2_data.o(.data) - build/asm/ovl_En_Ending_Hero2_rodata.o(.rodata) + build/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.o(.data) + build/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.o(.rodata) + build/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2_overlay.o(.ovl) } SegmentEnd = .; SegmentSize = SegmentEnd - SegmentStart; diff --git a/linker_scripts/object_script.txt b/linker_scripts/object_script.txt index 0c6ac23560..08375a8a7c 100644 --- a/linker_scripts/object_script.txt +++ b/linker_scripts/object_script.txt @@ -34,6 +34,10 @@ D_06018DA0 = 0x06018DA0; D_0601EF10 = 0x0601EF10; D_06018C60 = 0x06018C60; +/* en_ending_hero2 */ +D_06007908 = 0x06007908; +D_060011C0 = 0x060011C0; + /* z_en_dy_extra */ D_0600DD40 = 0x0600DD40; D_0600DEF0 = 0x0600DEF0; diff --git a/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.c b/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.c index 0f6054610a..fca9a92f71 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.c +++ b/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.c @@ -9,7 +9,9 @@ void EnEndingHero2_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnEndingHero2_Update(Actor* thisx, GlobalContext* globalCtx); void EnEndingHero2_Draw(Actor* thisx, GlobalContext* globalCtx); -/* +void func_80C232E8(EnEndingHero2* this); +void func_80C23304(EnEndingHero2* this, GlobalContext* globalCtx); + const ActorInit En_Ending_Hero2_InitVars = { ACTOR_EN_ENDING_HERO2, ACTORTYPE_NPC, @@ -21,16 +23,48 @@ const ActorInit En_Ending_Hero2_InitVars = { (ActorFunc)EnEndingHero2_Update, (ActorFunc)EnEndingHero2_Draw }; -*/ -GLOBAL_ASM("asm/non_matchings/ovl_En_Ending_Hero2_0x80C23230/EnEndingHero2_Init.asm") +extern SkeletonHeader D_06007908; +extern AnimationHeader D_060011C0; -GLOBAL_ASM("asm/non_matchings/ovl_En_Ending_Hero2_0x80C23230/EnEndingHero2_Destroy.asm") +void EnEndingHero2_Init(Actor* thisx, GlobalContext* globalCtx) { + EnEndingHero2* this = THIS; -GLOBAL_ASM("asm/non_matchings/ovl_En_Ending_Hero2_0x80C23230/func_80C232E8.asm") + this->actor.unkA0.mass = 0xFF; + Actor_SetScale(&this->actor, 0.01f); + this->actor.unk1F = 6; + this->actor.gravity = -3.0f; + SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06007908, &D_060011C0, this->limbDrawTable, + this->transitionDrawTable, 20); + Actor_SetDrawParams(&this->actor.shape, 0.0f, func_800B3FC0, 25.0f); + func_80C232E8(this); +} -GLOBAL_ASM("asm/non_matchings/ovl_En_Ending_Hero2_0x80C23230/func_80C23304.asm") +void EnEndingHero2_Destroy(Actor* thisx, GlobalContext* globalCtx) { +} -GLOBAL_ASM("asm/non_matchings/ovl_En_Ending_Hero2_0x80C23230/EnEndingHero2_Update.asm") +void func_80C232E8(EnEndingHero2* this) { + this->unk27C = 1; + this->actionFunc = func_80C23304; +} -GLOBAL_ASM("asm/non_matchings/ovl_En_Ending_Hero2_0x80C23230/EnEndingHero2_Draw.asm") +void func_80C23304(EnEndingHero2* this, GlobalContext* globalCtx) { + SkelAnime_FrameUpdateMatrix(&this->skelAnime); +} + +void EnEndingHero2_Update(Actor* thisx, GlobalContext* globalCtx) { + EnEndingHero2* this = THIS; + + this->actionFunc(this, globalCtx); + Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + func_800B78B8(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D); +} + +void EnEndingHero2_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnEndingHero2* this = THIS; + + func_8012C28C(globalCtx->state.gfxCtx); + func_8012C2DC(globalCtx->state.gfxCtx); + SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, 0, 0, + &this->actor); +} diff --git a/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.h b/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.h index e76c32e544..6af523e1e0 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.h +++ b/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.h @@ -5,9 +5,15 @@ struct EnEndingHero2; +typedef void (*EnEndingHero2ActionFunc)(struct BgHakaCurtain*, GlobalContext*); + typedef struct EnEndingHero2 { /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x13C]; + /* 0x144 */ SkelAnime skelAnime; + /* 0x188 */ Vec3s limbDrawTable[20]; + /* 0x200 */ Vec3s transitionDrawTable[20]; + /* 0x278 */ EnEndingHero2ActionFunc actionFunc; + /* 0x27C */ u16 unk27C; } EnEndingHero2; // size = 0x280 extern const ActorInit En_Ending_Hero2_InitVars;