From 0beaddd30b32a810bdbc26f8cbc5c402f713583e Mon Sep 17 00:00:00 2001 From: kyleburnette Date: Tue, 4 May 2021 15:59:45 -0700 Subject: [PATCH] bg_lbfshot OK (#92) * bg_lbfshot OK * formatted source files * Update z_bg_lbfshot.c * Update z_bg_lbfshot.h --- linker_scripts/code_script.txt | 4 +-- linker_scripts/object_script.txt | 3 +++ .../actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c | 26 +++++++++++++++---- .../actors/ovl_Bg_Lbfshot/z_bg_lbfshot.h | 3 +-- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/linker_scripts/code_script.txt b/linker_scripts/code_script.txt index a9769414eb..3a610e246b 100644 --- a/linker_scripts/code_script.txt +++ b/linker_scripts/code_script.txt @@ -8998,9 +8998,9 @@ SECTIONS ovl_Bg_Lbfshot : AT(RomLocation) { build/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.o(.text) - build/asm/overlays/ovl_Bg_Lbfshot_data.o(.data) + build/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.o(.data) build/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.o(.rodata) - build/asm/overlays/ovl_Bg_Lbfshot_rodata.o(.rodata) + build/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot_overlay.o(.ovl) } SegmentEnd = .; SegmentSize = SegmentEnd - SegmentStart; diff --git a/linker_scripts/object_script.txt b/linker_scripts/object_script.txt index eab2d3de3d..41fc12b777 100644 --- a/linker_scripts/object_script.txt +++ b/linker_scripts/object_script.txt @@ -90,6 +90,9 @@ D_06009120 = 0x06009120; D_06005458 = 0x06005458; D_0600788C = 0x0600788C; +/* z_bg_lbfshot */ +D_060014D8 = 0x060014D8; +D_06000228 = 0x06000228; /* en_ending_hero4 */ D_0600D640 = 0x0600D640; diff --git a/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c b/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c index 98e8a3f39a..0533044ec6 100644 --- a/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c +++ b/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c @@ -8,7 +8,6 @@ void BgLbfshot_Init(Actor* thisx, GlobalContext* globalCtx); void BgLbfshot_Destroy(Actor* thisx, GlobalContext* globalCtx); void BgLbfshot_Draw(Actor* thisx, GlobalContext* globalCtx); -/* const ActorInit Bg_Lbfshot_InitVars = { ACTOR_BG_LBFSHOT, ACTORCAT_BG, @@ -20,10 +19,27 @@ const ActorInit Bg_Lbfshot_InitVars = { (ActorFunc)func_800BDFB0, (ActorFunc)BgLbfshot_Draw }; -*/ -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Bg_Lbfshot_0x80C18120/BgLbfshot_Init.asm") +static InitChainEntry D_80C18200[] = { + ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), +}; -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Bg_Lbfshot_0x80C18120/BgLbfshot_Destroy.asm") +extern CollisionHeader D_060014D8; +extern UNK_TYPE D_06000228; -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Bg_Lbfshot_0x80C18120/BgLbfshot_Draw.asm") +void BgLbfshot_Init(Actor* thisx, GlobalContext* globalCtx) { + BgLbfshot* this = THIS; + + Actor_ProcessInitChain(&this->dyna.actor, D_80C18200); + this->dyna.actor.uncullZoneForward = 4000.0f; + BcCheck3_BgActorInit(&this->dyna, 1); + BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_060014D8); +} +void BgLbfshot_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgLbfshot* this = THIS; + + BgCheck_RemoveActorMesh(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); +} +void BgLbfshot_Draw(Actor* thisx, GlobalContext* globalCtx) { + func_800BDFC0(globalCtx, &D_06000228); +} diff --git a/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.h b/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.h index b67c59cf88..788602e05a 100644 --- a/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.h +++ b/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.h @@ -6,8 +6,7 @@ struct BgLbfshot; typedef struct BgLbfshot { - /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x1C]; + /* 0x000 */ DynaPolyActor dyna; } BgLbfshot; // size = 0x160 extern const ActorInit Bg_Lbfshot_InitVars;