From c4f4dcebc783d5ab8588227691e35fee485e508a Mon Sep 17 00:00:00 2001 From: fullgrowngaming <42490167+fullgrowngaming@users.noreply.github.com> Date: Mon, 12 Oct 2020 20:33:42 -0700 Subject: [PATCH] en_ending_hero4 OK (#39) Co-authored-by: Rozelette --- linker_scripts/code_script.txt | 5 +- linker_scripts/object_script.txt | 4 ++ .../ovl_En_Ending_Hero4/z_en_ending_hero4.c | 50 ++++++++++++++++--- .../ovl_En_Ending_Hero4/z_en_ending_hero4.h | 8 ++- 4 files changed, 56 insertions(+), 11 deletions(-) diff --git a/linker_scripts/code_script.txt b/linker_scripts/code_script.txt index 53e05acd9..ac10e0620 100644 --- a/linker_scripts/code_script.txt +++ b/linker_scripts/code_script.txt @@ -8670,8 +8670,9 @@ SECTIONS ovl_En_Ending_Hero4 : AT(RomLocation) { build/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.o(.text) - build/asm/ovl_En_Ending_Hero4_data.o(.data) - build/asm/ovl_En_Ending_Hero4_rodata.o(.rodata) + build/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.o(.data) + build/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.o(.rodata) + build/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4_overlay.o(.ovl) } SegmentEnd = .; SegmentSize = SegmentEnd - SegmentStart; diff --git a/linker_scripts/object_script.txt b/linker_scripts/object_script.txt index da9905b70..e79920d10 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_hero4 */ +D_0600D640 = 0x0600D640; +D_06002A84 = 0x06002A84; + /* en_ending_hero3 */ D_06007150 = 0x06007150; D_06000E50 = 0x06000E50; diff --git a/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.c b/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.c index 12ce28ed2..fc3e1b3b4 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.c +++ b/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.c @@ -9,7 +9,9 @@ void EnEndingHero4_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnEndingHero4_Update(Actor* thisx, GlobalContext* globalCtx); void EnEndingHero4_Draw(Actor* thisx, GlobalContext* globalCtx); -/* +void func_80C23748(EnEndingHero4* this); +void func_80C23764(EnEndingHero4* this, GlobalContext* globalCtx); + const ActorInit En_Ending_Hero4_InitVars = { ACTOR_EN_ENDING_HERO4, ACTORTYPE_NPC, @@ -21,16 +23,48 @@ const ActorInit En_Ending_Hero4_InitVars = { (ActorFunc)EnEndingHero4_Update, (ActorFunc)EnEndingHero4_Draw }; -*/ -GLOBAL_ASM("asm/non_matchings/ovl_En_Ending_Hero4_0x80C23690/EnEndingHero4_Init.asm") +extern SkeletonHeader D_0600D640; +extern AnimationHeader D_06002A84; -GLOBAL_ASM("asm/non_matchings/ovl_En_Ending_Hero4_0x80C23690/EnEndingHero4_Destroy.asm") +void EnEndingHero4_Init(Actor* thisx, GlobalContext* globalCtx) { + EnEndingHero4* this = THIS; -GLOBAL_ASM("asm/non_matchings/ovl_En_Ending_Hero4_0x80C23690/func_80C23748.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_0600D640, &D_06002A84, this->limbDrawTable, + this->transitionDrawTable, 17); + Actor_SetDrawParams(&this->actor.shape, 0.0f, func_800B3FC0, 25.0f); + func_80C23748(this); +} -GLOBAL_ASM("asm/non_matchings/ovl_En_Ending_Hero4_0x80C23690/func_80C23764.asm") +void EnEndingHero4_Destroy(Actor* thisx, GlobalContext* globalCtx) { +} -GLOBAL_ASM("asm/non_matchings/ovl_En_Ending_Hero4_0x80C23690/EnEndingHero4_Update.asm") +void func_80C23748(EnEndingHero4* this) { + this->unk258 = 1; + this->actionFunc = func_80C23764; +} -GLOBAL_ASM("asm/non_matchings/ovl_En_Ending_Hero4_0x80C23690/EnEndingHero4_Draw.asm") +void func_80C23764(EnEndingHero4* this, GlobalContext* globalCtx) { + SkelAnime_FrameUpdateMatrix(&this->skelAnime); +} + +void EnEndingHero4_Update(Actor* thisx, GlobalContext* globalCtx) { + EnEndingHero4* this = THIS; + + this->actionFunc(this, globalCtx); + Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + func_800B78B8(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D); +} + +void EnEndingHero4_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnEndingHero4* 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_Hero4/z_en_ending_hero4.h b/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.h index accf7134e..60def244c 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.h +++ b/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.h @@ -5,9 +5,15 @@ struct EnEndingHero4; +typedef void (*EnEndingHero4ActionFunc)(struct BgHakaCurtain*, GlobalContext*); + typedef struct EnEndingHero4 { /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x118]; + /* 0x144 */ SkelAnime skelAnime; + /* 0x188 */ Vec3s limbDrawTable[17]; + /* 0x1EE */ Vec3s transitionDrawTable[17]; + /* 0x254 */ EnEndingHero4ActionFunc actionFunc; + /* 0x258 */ u16 unk258; } EnEndingHero4; // size = 0x25C extern const ActorInit En_Ending_Hero4_InitVars;