From 96d05d4e7d97dccf7fef335b708307c204e0725a Mon Sep 17 00:00:00 2001 From: fullgrowngaming <42490167+fullgrowngaming@users.noreply.github.com> Date: Mon, 28 Sep 2020 16:27:21 -0700 Subject: [PATCH] en_tanron6 OK (#27) * en_tanron6 OK * Fixed name of SetupDoNothing * Fixed initvars name * Fixed initvars name * Fixed initvars name --- include/functions_overlay.h | 2 +- linker_scripts/code_script.txt | 5 ++- .../actors/ovl_En_Tanron6/z_en_tanron6.c | 41 +++++++++++++++---- .../actors/ovl_En_Tanron6/z_en_tanron6.h | 5 ++- tables/functions.txt | 2 +- 5 files changed, 42 insertions(+), 13 deletions(-) diff --git a/include/functions_overlay.h b/include/functions_overlay.h index 1887813b71..e0c6911b88 100644 --- a/include/functions_overlay.h +++ b/include/functions_overlay.h @@ -12066,7 +12066,7 @@ void EnTanron5_Draw(void); // func_80BE5B58 void func_80BE5C10(void); // func_80BE5C10 void EnTanron6_Init(void); // func_80BE6040 void EnTanron6_Destroy(void); // func_80BE60AC -void func_80BE60BC(void); // func_80BE60BC +void EnTanron6_DoNothing(void); // EnTanron6_DoNothing void func_80BE60D0(void); // func_80BE60D0 void EnTanron6_Update(void); // func_80BE60E0 void EnTanron6_Draw(void); // func_80BE6140 diff --git a/linker_scripts/code_script.txt b/linker_scripts/code_script.txt index 0ca1557b6d..225cf4d3a5 100644 --- a/linker_scripts/code_script.txt +++ b/linker_scripts/code_script.txt @@ -7810,8 +7810,9 @@ SECTIONS ovl_En_Tanron6 : AT(RomLocation) { build/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.o(.text) - build/asm/ovl_En_Tanron6_data.o(.data) - build/asm/ovl_En_Tanron6_rodata.o(.rodata) + build/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.o(.data) + build/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.o(.rodata) + build/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6_overlay.o(.ovl) } SegmentEnd = .; SegmentSize = SegmentEnd - SegmentStart; diff --git a/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.c b/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.c index 49ba2d1239..8bb151e9ff 100644 --- a/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.c +++ b/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.c @@ -9,7 +9,9 @@ void EnTanron6_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnTanron6_Update(Actor* thisx, GlobalContext* globalCtx); void EnTanron6_Draw(Actor* thisx, GlobalContext* globalCtx); -/* +void EnTanron6_DoNothing(EnTanron6* this); +void func_80BE60D0(EnTanron6* this, GlobalContext* globalCtx); + const ActorInit En_Tanron6_InitVars = { ACTOR_EN_TANRON6, ACTORTYPE_ENEMY, @@ -21,16 +23,39 @@ const ActorInit En_Tanron6_InitVars = { (ActorFunc)EnTanron6_Update, (ActorFunc)EnTanron6_Draw }; -*/ -GLOBAL_ASM("asm/non_matchings/ovl_En_Tanron6_0x80BE6040/EnTanron6_Init.asm") +ActorDamageChart D_80BE6170 = { 0xF0, 0xF0, 0x00, 0xF1, 0xE1, 0xE1, 0x00, 0xE1, 0xF0, 0xF0, 0xF0, + 0xE1, 0xE1, 0x46, 0xF0, 0xF0, 0xE1, 0xF0, 0xF0, 0x00, 0x00, 0xF0, + 0xE1, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0 }; -GLOBAL_ASM("asm/non_matchings/ovl_En_Tanron6_0x80BE6040/EnTanron6_Destroy.asm") +void EnTanron6_Init(Actor* thisx, GlobalContext* globalCtx) { + EnTanron6* this = THIS; -GLOBAL_ASM("asm/non_matchings/ovl_En_Tanron6_0x80BE6040/func_80BE60BC.asm") + this->actor.unkA0.mass = 0xA; + Actor_SetDrawParams(&this->actor.shape, 0, func_800B3FC0, 19.0f); + this->actor.unkA0.health = 1; + this->actor.unkA0.damageChart = &D_80BE6170; + this->actor.unk1F = 6; + EnTanron6_DoNothing(this); +} -GLOBAL_ASM("asm/non_matchings/ovl_En_Tanron6_0x80BE6040/func_80BE60D0.asm") +void EnTanron6_Destroy(Actor* thisx, GlobalContext* globalCtx) { +} -GLOBAL_ASM("asm/non_matchings/ovl_En_Tanron6_0x80BE6040/EnTanron6_Update.asm") +void EnTanron6_DoNothing(EnTanron6* this) { + this->actionFunc = func_80BE60D0; +} -GLOBAL_ASM("asm/non_matchings/ovl_En_Tanron6_0x80BE6040/EnTanron6_Draw.asm") +void func_80BE60D0(EnTanron6* this, GlobalContext* globalCtx) { +} + +void EnTanron6_Update(Actor* thisx, GlobalContext* globalCtx) { + EnTanron6* this = THIS; + + this->actionFunc(this, globalCtx); + Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + func_800B78B8(globalCtx, &this->actor, 10.0f, 40.0f, 40.0f, 0x1D); +} + +void EnTanron6_Draw(Actor* thisx, GlobalContext* globalCtx) { +} diff --git a/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.h b/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.h index 656f744faa..f6e16ef242 100644 --- a/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.h +++ b/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.h @@ -5,9 +5,12 @@ struct EnTanron6; +typedef void (*EnTanron6ActionFunc)(struct EnTanron6*, GlobalContext*); + typedef struct EnTanron6 { /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0xC0]; + /* 0x144 */ char unk_144[0xBC]; + /* 0x200 */ EnTanron6ActionFunc actionFunc; } EnTanron6; // size = 0x204 extern const ActorInit En_Tanron6_InitVars; diff --git a/tables/functions.txt b/tables/functions.txt index 1ad10bf117..3cf302a0fb 100644 --- a/tables/functions.txt +++ b/tables/functions.txt @@ -16059,7 +16059,7 @@ 0x80BE5C10:("func_80BE5C10",), 0x80BE6040:("EnTanron6_Init",), 0x80BE60AC:("EnTanron6_Destroy",), - 0x80BE60BC:("func_80BE60BC",), + 0x80BE60BC:("EnTanron6_DoNothing",), 0x80BE60D0:("func_80BE60D0",), 0x80BE60E0:("EnTanron6_Update",), 0x80BE6140:("EnTanron6_Draw",),