From ee0ab1cbc949cd3b311f085295cd6709cb56ad67 Mon Sep 17 00:00:00 2001 From: kyleburnette Date: Thu, 11 Feb 2021 19:12:54 -0800 Subject: [PATCH] en_hs2 OK (#46) * en_hs2 OK * Formatted files * Renamed the DoNothing func. Co-authored-by: fullgrowngaming --- include/functions_overlay.h | 2 +- linker_scripts/code_script.txt | 5 +++-- src/overlays/actors/ovl_En_Hs2/z_en_hs2.c | 26 +++++++++++++++++------ src/overlays/actors/ovl_En_Hs2/z_en_hs2.h | 5 ++++- tables/functions.txt | 2 +- 5 files changed, 28 insertions(+), 12 deletions(-) diff --git a/include/functions_overlay.h b/include/functions_overlay.h index e52b3382c2..367869f3d8 100644 --- a/include/functions_overlay.h +++ b/include/functions_overlay.h @@ -4323,7 +4323,7 @@ void ObjKibako2_Update(void); // func_8098ED4C void ObjKibako2_Draw(void); // func_8098EE0C void EnHs2_Init(void); // func_8098EF60 void EnHs2_Destroy(void); // func_8098EF9C -void func_8098EFAC(void); // func_8098EFAC +void EnHs2_DoNothing(void); // func_8098EFAC void EnHs2_Update(void); // func_8098EFBC void EnHs2_Draw(void); // func_8098EFE0 void func_8098F040(void); // func_8098F040 diff --git a/linker_scripts/code_script.txt b/linker_scripts/code_script.txt index 82fa57559d..ed053af4ea 100644 --- a/linker_scripts/code_script.txt +++ b/linker_scripts/code_script.txt @@ -3084,8 +3084,9 @@ SECTIONS ovl_En_Hs2 : AT(RomLocation) { build/src/overlays/actors/ovl_En_Hs2/z_en_hs2.o(.text) - build/asm/ovl_En_Hs2_data.o(.data) - build/asm/ovl_En_Hs2_rodata.o(.rodata) + build/src/overlays/actors/ovl_En_Hs2/z_en_hs2.o(.data) + build/src/overlays/actors/ovl_En_Hs2/z_en_hs2.o(.rodata) + build/src/overlays/actors/ovl_En_Hs2/z_en_hs2_overlay.o(.ovl) } SegmentEnd = .; SegmentSize = SegmentEnd - SegmentStart; diff --git a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c index c0adf57897..118d9d0cc1 100644 --- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c +++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c @@ -9,7 +9,8 @@ void EnHs2_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnHs2_Update(Actor* thisx, GlobalContext* globalCtx); void EnHs2_Draw(Actor* thisx, GlobalContext* globalCtx); -/* +void EnHs2_DoNothing(EnHs2* this, GlobalContext* globalCtx); + const ActorInit En_Hs2_InitVars = { ACTOR_EN_HS2, ACTORTYPE_NPC, @@ -21,14 +22,25 @@ const ActorInit En_Hs2_InitVars = { (ActorFunc)EnHs2_Update, (ActorFunc)EnHs2_Draw }; -*/ -GLOBAL_ASM("asm/non_matchings/ovl_En_Hs2_0x8098EF60/EnHs2_Init.asm") +void EnHs2_Init(Actor* thisx, GlobalContext* globalCtx) { + EnHs2* this = THIS; -GLOBAL_ASM("asm/non_matchings/ovl_En_Hs2_0x8098EF60/EnHs2_Destroy.asm") + Actor_SetScale(&this->actor, 1.0f); + this->actionFunc = EnHs2_DoNothing; +} -GLOBAL_ASM("asm/non_matchings/ovl_En_Hs2_0x8098EF60/func_8098EFAC.asm") +void EnHs2_Destroy(Actor* thisx, GlobalContext* globalCtx) { +} -GLOBAL_ASM("asm/non_matchings/ovl_En_Hs2_0x8098EF60/EnHs2_Update.asm") +void EnHs2_DoNothing(EnHs2* this, GlobalContext* globalCtx) { +} -GLOBAL_ASM("asm/non_matchings/ovl_En_Hs2_0x8098EF60/EnHs2_Draw.asm") +void EnHs2_Update(Actor* thisx, GlobalContext* globalCtx) { + EnHs2* this = THIS; + + this->actionFunc(this, globalCtx); +} + +void EnHs2_Draw(Actor* thisx, GlobalContext* globalCtx) { +} diff --git a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h index fc456acc42..08119cfc00 100644 --- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h +++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h @@ -5,9 +5,12 @@ struct EnHs2; +typedef void (*EnHs2ActionFunc)(struct EnHs2*, GlobalContext*); + typedef struct EnHs2 { /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x254]; + /* 0x144 */ char unk_144[0x250]; + /* 0x394 */ EnHs2ActionFunc actionFunc; } EnHs2; // size = 0x398 extern const ActorInit En_Hs2_InitVars; diff --git a/tables/functions.txt b/tables/functions.txt index 0732415aa7..b31bd721ad 100644 --- a/tables/functions.txt +++ b/tables/functions.txt @@ -8344,7 +8344,7 @@ 0x8098EE0C:("ObjKibako2_Draw",), 0x8098EF60:("EnHs2_Init",), 0x8098EF9C:("EnHs2_Destroy",), - 0x8098EFAC:("func_8098EFAC",), + 0x8098EFAC:("EnHs2_DoNothing",), 0x8098EFBC:("EnHs2_Update",), 0x8098EFE0:("EnHs2_Draw",), 0x8098F040:("func_8098F040",),