diff --git a/linker_scripts/code_script.txt b/linker_scripts/code_script.txt index 3a610e246b..7a1f315a01 100644 --- a/linker_scripts/code_script.txt +++ b/linker_scripts/code_script.txt @@ -8772,9 +8772,9 @@ SECTIONS ovl_Obj_Kepn_Koya : AT(RomLocation) { build/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.o(.text) - build/asm/overlays/ovl_Obj_Kepn_Koya_data.o(.data) + build/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.o(.data) build/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.o(.rodata) - build/asm/overlays/ovl_Obj_Kepn_Koya_rodata.o(.rodata) + build/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya_overlay.o(.ovl) } SegmentEnd = .; SegmentSize = SegmentEnd - SegmentStart; diff --git a/linker_scripts/object_script.txt b/linker_scripts/object_script.txt index 41fc12b777..458cafefd4 100644 --- a/linker_scripts/object_script.txt +++ b/linker_scripts/object_script.txt @@ -129,6 +129,10 @@ D_06007750 = 0x06007750; D_0600A390 = 0x0600A390; D_0600A490 = 0x0600A490; +/* z_obj_kepn_koya */ +D_0600805C = 0x0600805C; +D_06003478 = 0x06003478; + /* en_po_fusen */ D_06000040 = 0x06000040; D_060024F0 = 0x060024F0; diff --git a/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c b/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c index 3e85ba2fe8..402c4a61ba 100644 --- a/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c +++ b/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c @@ -9,7 +9,6 @@ void ObjKepnKoya_Destroy(Actor* thisx, GlobalContext* globalCtx); void ObjKepnKoya_Update(Actor* thisx, GlobalContext* globalCtx); void ObjKepnKoya_Draw(Actor* thisx, GlobalContext* globalCtx); -/* const ActorInit Obj_Kepn_Koya_InitVars = { ACTOR_OBJ_KEPN_KOYA, ACTORCAT_PROP, @@ -21,12 +20,36 @@ const ActorInit Obj_Kepn_Koya_InitVars = { (ActorFunc)ObjKepnKoya_Update, (ActorFunc)ObjKepnKoya_Draw }; -*/ -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Kepn_Koya_0x80C07B20/ObjKepnKoya_Init.asm") +static InitChainEntry D_80C07C40[] = { + ICHAIN_F32(uncullZoneScale, 1200, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneDownward, 900, ICHAIN_STOP), +}; -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Kepn_Koya_0x80C07B20/ObjKepnKoya_Destroy.asm") +extern CollisionHeader D_0600805C; +extern UNK_TYPE D_06003478; -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Kepn_Koya_0x80C07B20/ObjKepnKoya_Update.asm") +void ObjKepnKoya_Init(Actor* thisx, GlobalContext* globalCtx) { + ObjKepnKoya* this = THIS; -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Kepn_Koya_0x80C07B20/ObjKepnKoya_Draw.asm") + Actor_ProcessInitChain(&this->dyna.actor, &D_80C07C40); + Actor_SetScale(&this->dyna.actor, 0.1f); + BcCheck3_BgActorInit(&this->dyna, 0); + BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_0600805C); + if (this->dyna.bgId == 0x32) { + Actor_MarkForDeath(&this->dyna.actor); + } +} + +void ObjKepnKoya_Destroy(Actor* thisx, GlobalContext* globalCtx) { + ObjKepnKoya* this = THIS; + + BgCheck_RemoveActorMesh(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); +} + +void ObjKepnKoya_Update(Actor* thisx, GlobalContext* globalCtx) { +} + +void ObjKepnKoya_Draw(Actor* thisx, GlobalContext* globalCtx) { + func_800BDFC0(globalCtx, &D_06003478); +} diff --git a/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.h b/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.h index 6c34339b53..14a7c0e793 100644 --- a/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.h +++ b/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.h @@ -6,8 +6,7 @@ struct ObjKepnKoya; typedef struct ObjKepnKoya { - /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x1C]; + /* 0x000 */ DynaPolyActor dyna; } ObjKepnKoya; // size = 0x160 extern const ActorInit Obj_Kepn_Koya_InitVars;