From a5c039f2eec37c52976945fd80483abe1a443845 Mon Sep 17 00:00:00 2001 From: kyleburnette Date: Sat, 27 Mar 2021 11:55:09 -0700 Subject: [PATCH] en_tag_obj OK (#84) * en_tag_obj OK * Changed collider formatting at m4's request * Removed use of macro and changed name of collider to reflect that it is unused --- linker_scripts/code_script.txt | 4 +-- .../actors/ovl_En_Tag_Obj/z_en_tag_obj.c | 27 +++++++++++++++---- .../actors/ovl_En_Tag_Obj/z_en_tag_obj.h | 3 ++- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/linker_scripts/code_script.txt b/linker_scripts/code_script.txt index 7ce9752788..394de0dd17 100644 --- a/linker_scripts/code_script.txt +++ b/linker_scripts/code_script.txt @@ -6422,9 +6422,9 @@ SECTIONS ovl_En_Tag_Obj : AT(RomLocation) { build/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.o(.text) - build/asm/overlays/ovl_En_Tag_Obj_data.o(.data) + build/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.o(.data) build/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.o(.rodata) - build/asm/overlays/ovl_En_Tag_Obj_rodata.o(.rodata) + build/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj_overlay.o(.ovl) } SegmentEnd = .; SegmentSize = SegmentEnd - SegmentStart; diff --git a/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.c b/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.c index d22486a852..3ae4250996 100644 --- a/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.c +++ b/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.c @@ -8,7 +8,12 @@ void EnTagObj_Init(Actor* thisx, GlobalContext* globalCtx); void EnTagObj_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnTagObj_Update(Actor* thisx, GlobalContext* globalCtx); -/* +static ColliderCylinderInit unusedColliderInit = { + { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, OC2_TYPE_2, COLSHAPE_CYLINDER, }, + { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_NONE, }, + { 20, 30, 0, { 0, 0, 0 } }, +}; + const ActorInit En_Tag_Obj_InitVars = { ACTOR_EN_TAG_OBJ, ACTORCAT_PROP, @@ -20,10 +25,22 @@ const ActorInit En_Tag_Obj_InitVars = { (ActorFunc)EnTagObj_Update, (ActorFunc)NULL }; -*/ -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Tag_Obj_0x80B12870/EnTagObj_Init.asm") +void EnTagObj_Init(Actor* thisx, GlobalContext* globalCtx) { + EnTagObj* this = (EnTagObj*)thisx; -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Tag_Obj_0x80B12870/EnTagObj_Destroy.asm") + this->hasSpawnedSeahorse = 0; +} -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Tag_Obj_0x80B12870/EnTagObj_Update.asm") +void EnTagObj_Destroy(Actor* thisx, GlobalContext* globalCtx) { +} + +void EnTagObj_Update(Actor* thisx, GlobalContext* globalCtx) { + EnTagObj* this = (EnTagObj*)thisx; + + if (!this->hasSpawnedSeahorse) { + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_OT, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, 0, 0, 0); + this->hasSpawnedSeahorse = 1; + } +} diff --git a/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.h b/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.h index 3c1fbcda53..9da2f4c9ce 100644 --- a/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.h +++ b/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.h @@ -7,7 +7,8 @@ struct EnTagObj; typedef struct EnTagObj { /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x54]; + /* 0x144 */ char unk_144[0x50]; + /* 0x194 */ s32 hasSpawnedSeahorse; } EnTagObj; // size = 0x198 extern const ActorInit En_Tag_Obj_InitVars;