From 1042a72fd2439e6c0f02bb37bb221572caa4d157 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Mon, 23 Mar 2020 15:23:50 -0400 Subject: [PATCH] Done --- data/overlays/actors/z_bg_haka_megane.data.s | 22 ------- data/overlays/actors/z_bg_haka_megane.reloc.s | 11 ---- spec | 2 +- .../ovl_Bg_Haka_Megane/z_bg_haka_megane.c | 64 ++++++++++--------- 4 files changed, 36 insertions(+), 63 deletions(-) delete mode 100644 data/overlays/actors/z_bg_haka_megane.data.s delete mode 100644 data/overlays/actors/z_bg_haka_megane.reloc.s diff --git a/data/overlays/actors/z_bg_haka_megane.data.s b/data/overlays/actors/z_bg_haka_megane.data.s deleted file mode 100644 index 549be94316..0000000000 --- a/data/overlays/actors/z_bg_haka_megane.data.s +++ /dev/null @@ -1,22 +0,0 @@ -.include "macro.inc" - - # assembler directives - .set noat # allow manual use of $at - .set noreorder # don't insert nops after branches - .set gp=64 # allow use of 64-bit general purposee registers - -.section .data - -glabel Bg_Haka_Megane_InitVars - .word 0x00AE0600, 0x000000B0, 0x00010000, 0x0000016C -.word BgHakaMegane_Init -.word BgHakaMegane_Destroy -.word BgHakaMegane_Update -.word 0x00000000 -glabel D_8087DD50 - .word 0x48500064 -glabel D_8087DD54 - .word 0x06001830, 0x06001AB8, 0x00000000, 0x06004330, 0x060044D0, 0x00000000, 0x06004780, 0x06004940, 0x00000000, 0x06004B00, 0x00000000, 0x06004CC0, 0x00000000 -glabel D_8087DD88 - .word 0x06001060, 0x06001920, 0x060003F0, 0x060040F0, 0x060043B0, 0x06001120, 0x060045A0, 0x060047F0, 0x060018F0, 0x060049B0, 0x06003CF0, 0x06004B70, 0x06002ED0, 0x00000000 - diff --git a/data/overlays/actors/z_bg_haka_megane.reloc.s b/data/overlays/actors/z_bg_haka_megane.reloc.s deleted file mode 100644 index 93d77a13c6..0000000000 --- a/data/overlays/actors/z_bg_haka_megane.reloc.s +++ /dev/null @@ -1,11 +0,0 @@ -.include "macro.inc" - - # assembler directives - .set noat # allow manual use of $at - .set noreorder # don't insert nops after branches - .set gp=64 # allow use of 64-bit general purposee registers - -.section .rodata -glabel D_8087DDC0 - -.incbin "baserom/ovl_Bg_Haka_Megane", 0x380, 0x00000070 diff --git a/spec b/spec index 7b5f072fc7..f640e16ab9 100644 --- a/spec +++ b/spec @@ -866,7 +866,7 @@ endseg beginseg name "ovl_Bg_Haka_Megane" include "build/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.o" - include "build/data/overlays/actors/z_bg_haka_megane.reloc.o" + include "build/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c index 980d584f1e..a3d30e0823 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c +++ b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c @@ -1,16 +1,22 @@ +/* + * File: z_bg_haka_megane.c + * Overlay: ovl_Bg_Haka_Megane + * Description: + */ + #include "z_bg_haka_megane.h" #define ROOM 0x00 #define FLAGS 0x000000B0 -void BgHakaMegane_Init(BgHakaMegane* this, GlobalContext* globalCtx); -void BgHakaMegane_Destroy(BgHakaMegane* this, GlobalContext* globalCtx); -void BgHakaMegane_Update(BgHakaMegane* this, GlobalContext* globalCtx); +static void BgHakaMegane_Init(BgHakaMegane* this, GlobalContext* globalCtx); +static void BgHakaMegane_Destroy(BgHakaMegane* this, GlobalContext* globalCtx); +static void BgHakaMegane_Update(BgHakaMegane* this, GlobalContext* globalCtx); -void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx); -void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx); -void func_8087DC64(BgHakaMegane* this, GlobalContext* globalCtx); -void func_8087DC94(BgHakaMegane* this, GlobalContext* globalCtx); +static void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx); +static void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx); +static void func_8087DC64(BgHakaMegane* this, GlobalContext* globalCtx); +static void func_8087DC94(BgHakaMegane* this, GlobalContext* globalCtx); const ActorInit Bg_Haka_Megane_InitVars = { @@ -26,23 +32,23 @@ const ActorInit Bg_Haka_Megane_InitVars = NULL, }; -InitChainEntry initChain[] = { +static InitChainEntry initChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -UNK_TYPE D_8087DD54[] = { +static UNK_TYPE collisions[] = { 0x06001830, 0x06001AB8, 0x00000000, 0x06004330, 0x060044D0, 0x00000000, 0x06004780, 0x06004940, 0x00000000, 0x06004B00, 0x00000000, 0x06004CC0, 0x00000000, }; -UNK_TYPE D_8087DD88[] = { +static UNK_TYPE dlists[] = { 0x06001060, 0x06001920, 0x060003F0, 0x060040F0, 0x060043B0, 0x06001120, 0x060045A0, - 0x060047F0, 0x060018F0, 0x060049B0, 0x06003CF0, 0x06004B70, 0x06002ED0, 0x00000000, + 0x060047F0, 0x060018F0, 0x060049B0, 0x06003CF0, 0x06004B70, 0x06002ED0, }; extern UNK_TYPE D_06001250; -void BgHakaMegane_Init(BgHakaMegane* this, GlobalContext* globalCtx) { +static void BgHakaMegane_Init(BgHakaMegane* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; Actor_ProcessInitChain(thisx, initChain); @@ -61,25 +67,25 @@ void BgHakaMegane_Init(BgHakaMegane* this, GlobalContext* globalCtx) { } } -void BgHakaMegane_Destroy(BgHakaMegane* this, GlobalContext* globalCtx) { +static void BgHakaMegane_Destroy(BgHakaMegane* this, GlobalContext* globalCtx) { DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } -void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx) { - Actor* thisx = &this->dyna.actor; - s32 local_c; - u32 collision; +static void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx) { + s32 localC; + UNK_TYPE collision; if (Object_IsLoaded(&globalCtx->objectCtx, this->objBankIndex)) { - thisx->draw = (ActorFunc)func_8087DC94; - thisx->objBankIndex = this->objBankIndex; - Actor_SetObjectDependency(globalCtx, thisx); + this->dyna.actor.objBankIndex = this->objBankIndex; + this->dyna.actor.draw = (ActorFunc)func_8087DC94; + Actor_SetObjectDependency(globalCtx, &this->dyna.actor); if (globalCtx->roomCtx.curRoom.showInvisActors) { this->actionFunc = (ActorFunc)func_8087DBF0; - collision = D_8087DD54[thisx->params]; + collision = collisions[this->dyna.actor.params]; if (collision != 0) { - DynaPolyInfo_Alloc(&collision, &local_c); - this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); + DynaPolyInfo_Alloc(collision, &localC); + this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, + &this->dyna.actor, localC); } } else { this->actionFunc = (ActorFunc)func_8087DC64; @@ -87,7 +93,7 @@ void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx) { } } -void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx) { +static void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; if (globalCtx->actorCtx.unk_03 != 0) { thisx->flags |= 0x80; @@ -98,21 +104,21 @@ void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx) { } } -void func_8087DC64(BgHakaMegane* this, GlobalContext* globalCtx) { +static void func_8087DC64(BgHakaMegane* this, GlobalContext* globalCtx) { } -void BgHakaMegane_Update(BgHakaMegane* this, GlobalContext* globalCtx) { +static void BgHakaMegane_Update(BgHakaMegane* this, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); } -void func_8087DC94(BgHakaMegane* this, GlobalContext* globalCtx) { +static void func_8087DC94(BgHakaMegane* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; if ((thisx->flags & 0x80) == 0x80) { - Draw_DListXlu(globalCtx, D_8087DD88[thisx->params]); + Draw_DListXlu(globalCtx, dlists[thisx->params]); } else { - Draw_DListOpa(globalCtx, D_8087DD88[thisx->params]); + Draw_DListOpa(globalCtx, dlists[thisx->params]); } if (thisx->params == 0) {