From 53fc438d819281e2f6011dd2ca5497804e9fcea8 Mon Sep 17 00:00:00 2001 From: TrulyNaN <52424023+TrulyNaN@users.noreply.github.com> Date: Mon, 20 Jun 2022 15:57:09 -0400 Subject: [PATCH] Merge z_bg_kin2 bombwall (#840) * test commit * undoing test commit * making sure this is the right repo * removing test file * init for OSH bombable wall started. put back Actor* in function declarations. * BgKin2Bombwall_Init is matching. * started z_bg_kin2_bombwall destroy function. One mismatch right now. * BgKin2Bombwall_Destroy matches. * BgKin2Bombwall_Draw matches. * Fixed BgKin2Bombwall_Init * BgKin2Bombwall_Init and BgKin2Bombwall_Destroy both match. Fixed s32 array in struct. * BgKin2Bombwall_Draw and BgKin2Bombwall_Update match. * Only func_80B6E020 and func_80B6E090 left to match in ovl_Bg_Kin2_Bombwall. * func_80B6E020 from ovl_Bg_Kin2_Bombwall matches. * Went from 8925 to about 5-6k diff score for func_80B6E090 in ovl_Bg_Kin2_Bombwall * Took func_80B6E090 from about 5300 diff score to about 4300 diff score in ovl_Bg_Kin2_Bombwall. * Diff score for ovl_Bg_Kin2_Bombwall func_80B6E090 went from 4k ish to 3277 * Diff score for ovl_Bg_Kin2_Bombwall func_80B6E090 went from 3277 to 2262. * Diff score for ovl_Bg_Kin2_Bombwall func_80B6E090 went from 2262 to 1589. * only slight progress on ovl_Bg_Kinw_Bombwall's func_80B6E090 * Got to 1473 diff score on ovl_Bg_Kinw_Bombwall's func_80B6E090 * Put in the changes made by EllipticEllipsis and hensldm for ovl_Bg_Kin2_Bombwall's func_8066E090. * renamed some symbols. Fake symbol removal makes nonzero diff, but rom OK's after make. * moving declarations around, ordering. * One.word.away. from importing data in ovl_Bg_Kin2_Bombwall. * ovl_Bg_Kin2_Bombwall data imported. Matching. * Edited spec for reloc of ovl_Bg_Kin2_Bombwall. * Removed extra comments for ovl_Bg_Kin2_Bombwall. * unpushed stuff. dunno. * forgot to save z_bg_kin2_bombwall.c * need to commit before make-ing in master. * Ported z_bg_kin2_bombwall's code. Data next. * Imported data for merging z_bg_kin2_bombwall. Yes, I yelled when it OK'd. * Added comments to remember what does what in z_bg_kin2_bombwall. * Some comments in z_bg_kin2_bombwall.c and function names ideas. * Added comments for function name ideas. Cleaned up temps in z_bg_kin2_bombwall except in func_80B6E090. * Renamed most functions and some variables in z_bg_kin2_bombwall. * Made a name suggestion for func_80B6E020 after testing in game. * Ran format.sh. * Update src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c 1 and 0 replaced by true and false in func_80B6E020. Co-authored-by: Isghj <42048411+isghj5@users.noreply.github.com> * Update src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c Bending to the x-- supremacy. Co-authored-by: Isghj <42048411+isghj5@users.noreply.github.com> * PR fixes (not done yet) including more consistent use of THIS, removing arg0 and arg1 variable names, standardizing params for z_bg_kin2_bombwall, turning some if-return to if-else, removing unnecessary casts. * Applied isghj5's and EllipticEllipsis' suggestions except for the object file in z_bg_kin2_bombwall. Object file next. * Screwd up formatting. * Thinking of playing with object_kin2_obj. * Documented most of object_kin2_obj based on bombwall, fence and shelf actors. * Had forgotten an arg1 in z_bg_kin2_bombwall.c * Replaced a float by its fractional representation. I need to learn float magic. * Update src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c Co-authored-by: EllipticEllipsis * Update src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.h Co-authored-by: EllipticEllipsis * Applied more formatting and naming remarks from PR about the C file. Assets and object stuff next. * Display lists and collision header in z_bg_kin2_bombwall.c renamed after their descriptive names in the object's XML file. Name for Ocean Spider House drawers chests left to change. * Update src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c Co-authored-by: Derek Hensley * One extra line in an if, collision naming convention applied and renamed Ocean Spider House nightstands to drawers chests. * Update src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c Co-authored-by: Derek Hensley * Changed drawers chest to chest of drawers in object_kin2_obj and z_bg_kin2_shelf. * Removed some unnecessary comment. * Update src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c Co-authored-by: EllipticEllipsis * Fixed BgKin2Bombwall_SpawnEffects after the Rand_Next() type update. * Update src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c Rand_Next() update. Co-authored-by: EllipticEllipsis * Update src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c Rand_Next() update. Co-authored-by: EllipticEllipsis * Adding Co-authors Co-authored-by EllipticEllipsis 73679967+EllipticEllipsis@users.noreply.github.com Co-authored-by Derek-Hensley hensley.derek58@gmail.com Co-authored-by Maide eeeedddccc@hotmail.co.uk Co-authored-by Tom-Overton tom.overton@outlook.com Co-authored-by Fig02 fig02srl@gmail.com Co-authored-by Parker-Burnett burnettparker@gmail.com Co-authored-by isghj5 isghj5@gmail.com * Adding Co-authors Co-authored-by EllipticEllipsis 73679967+EllipticEllipsis@users.noreply.github.com Co-authored-by Derek-Hensley hensley.derek58@gmail.com Co-authored-by Maide eeeedddccc@hotmail.co.uk Co-authored-by Tom-Overton tom.overton@outlook.com Co-authored-by Fig02 fig02srl@gmail.com Co-authored-by Parker-Burnett burnettparker@gmail.com Co-authored-by isghj5 isghj5@gmail.com * Adding Co-authors Co-authored-by EllipticEllipsis 73679967+EllipticEllipsis@users.noreply.github.com Co-authored-by Derek-Hensley hensley.derek58@gmail.com Co-authored-by Maide eeeedddccc@hotmail.co.uk Co-authored-by Tom-Overton tom.overton@outlook.com Co-authored-by Fig02 fig02srl@gmail.com Co-authored-by Parker-Burnett burnettparker@gmail.com Co-authored-by isghj5 isghj5@gmail.com * Adding Co-authors Co-authored-by EllipticEllipsis 73679967+EllipticEllipsis@users.noreply.github.com Co-authored-by Derek-Hensley hensley.derek58@gmail.com Co-authored-by Maide eeeedddccc@hotmail.co.uk Co-authored-by Tom-Overton tom.overton@outlook.com Co-authored-by Fig02 fig02srl@gmail.com Co-authored-by Parker-Burnett burnettparker@gmail.com Co-authored-by isghj5 isghj5@gmail.com * Adding Co-authors Co-authored-by EllipticEllipsis 73679967+EllipticEllipsis@users.noreply.github.com Co-authored-by Derek-Hensley hensley.derek58@gmail.com Co-authored-by Maide eeeedddccc@hotmail.co.uk Co-authored-by Tom-Overton tom.overton@outlook.com Co-authored-by Fig02 fig02srl@gmail.com Co-authored-by Parker-Burnett burnettparker@gmail.com Co-authored-by isghj5 isghj5@gmail.com * Adding Co-authors Co-authored-by: EllipticEllipsis 73679967+EllipticEllipsis@users.noreply.github.com Co-authored-by: Derek-Hensley hensley.derek58@gmail.com Co-authored-by: Maide eeeedddccc@hotmail.co.uk Co-authored-by: Tom-Overton tom.overton@outlook.com Co-authored-by: Fig02 fig02srl@gmail.com Co-authored-by: Parker-Burnett burnettparker@gmail.com Co-authored-by: isghj5 isghj5@gmail.com * Adding Co-authors Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> Co-authored-by: Derek-Hensley Co-authored-by: Maide Co-authored-by: Tom-Overton Co-authored-by: Fig02 Co-authored-by: Parker-Burnett Co-authored-by: isghj5 * Update src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c Co-authored-by: EllipticEllipsis Co-authored-by: Isghj <42048411+isghj5@users.noreply.github.com> Co-authored-by: EllipticEllipsis Co-authored-by: Derek Hensley Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> Co-authored-by: Maide Co-authored-by: Tom-Overton Co-authored-by: Fig02 Co-authored-by: Parker-Burnett Co-authored-by: isghj5 --- assets/xml/objects/object_kin2_obj.xml | 40 ++-- spec | 3 +- .../ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c | 201 +++++++++++++++--- .../ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.h | 12 +- .../ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c | 2 +- .../ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c | 4 +- tools/disasm/functions.txt | 16 +- 7 files changed, 212 insertions(+), 66 deletions(-) diff --git a/assets/xml/objects/object_kin2_obj.xml b/assets/xml/objects/object_kin2_obj.xml index 93e55786cc..e0ae09106c 100644 --- a/assets/xml/objects/object_kin2_obj.xml +++ b/assets/xml/objects/object_kin2_obj.xml @@ -1,34 +1,34 @@  - - - - + + + + - + - - + + - - + + - + - - - - - - - - - - + + + + + + + + + + diff --git a/spec b/spec index a7e9ba36c7..102e2f9239 100644 --- a/spec +++ b/spec @@ -4059,8 +4059,7 @@ beginseg name "ovl_Bg_Kin2_Bombwall" compress include "build/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.o" - include "build/data/ovl_Bg_Kin2_Bombwall/ovl_Bg_Kin2_Bombwall.data.o" - include "build/data/ovl_Bg_Kin2_Bombwall/ovl_Bg_Kin2_Bombwall.reloc.o" + include "build/src/overlays/actors/ovl_Bg_Kin2_Bombwall/ovl_Bg_Kin2_Bombwall_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c b/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c index 5630bdd8f1..510b76fe8a 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c @@ -3,8 +3,8 @@ * Overlay: ovl_Bg_Kin2_Bombwall * Description: Ocean Spider House - Bombable Wall */ - #include "z_bg_kin2_bombwall.h" +#include "objects/object_kin2_obj/object_kin2_obj.h" #define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_10000000) @@ -15,8 +15,14 @@ void BgKin2Bombwall_Destroy(Actor* thisx, GlobalContext* globalCtx); void BgKin2Bombwall_Update(Actor* thisx, GlobalContext* globalCtx); void BgKin2Bombwall_Draw(Actor* thisx, GlobalContext* globalCtx); -#if 0 -const ActorInit Bg_Kin2_Bombwall_InitVars = { +void BgKin2Bombwall_SetupWait(BgKin2Bombwall* this); +void BgKin2Bombwall_Wait(BgKin2Bombwall* this, GlobalContext* globalCtx); +void BgKin2Bombwall_SetupPlayCutscene(BgKin2Bombwall* this); +void BgKin2Bombwall_PlayCutscene(BgKin2Bombwall* this, GlobalContext* globalCtx); +void BgKin2Bombwall_SetupEndCutscene(BgKin2Bombwall* this); +void BgKin2Bombwall_EndCutscene(BgKin2Bombwall* this, GlobalContext* globalCtx); + +ActorInit Bg_Kin2_Bombwall_InitVars = { ACTOR_BG_KIN2_BOMBWALL, ACTORCAT_BG, FLAGS, @@ -28,50 +34,191 @@ const ActorInit Bg_Kin2_Bombwall_InitVars = { (ActorFunc)BgKin2Bombwall_Draw, }; -// static ColliderCylinderInit sCylinderInit = { -static ColliderCylinderInit D_80B6E6F0 = { - { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, OC2_NONE, COLSHAPE_CYLINDER, }, - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_NONE, }, +static ColliderCylinderInit sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, { 60, 60, 0, { 0, 0, 0 } }, }; -// static InitChainEntry sInitChain[] = { -static InitChainEntry D_80B6E748[] = { +s32 BgKin2Bombwall_IsHitFromNearby(BgKin2Bombwall* this, GlobalContext* globalCtx) { + Actor* bombwallCollider; + + if (this->collider.base.acFlags & AC_HIT) { + bombwallCollider = this->collider.base.ac; + // Distance check required to only react to sufficiently close explosions. + if ((bombwallCollider != NULL) && + (Math3D_Vec3fDistSq(&this->dyna.actor.world.pos, &bombwallCollider->world.pos) < 6400.0f)) { + return true; + } + } + return false; +} + +static Color_RGBA8 sPrimColor = { 210, 210, 210, 255 }; +static Color_RGBA8 sEnvColor = { 140, 140, 140, 255 }; +static Vec3f sDustAccel = { 0.0f, 0.33f, 0.0f }; +static s8 sRandomYOffsets[] = { -60, -34, -8, 18, 44 }; +static s16 sScales[] = { 25, 23, 21, 19, 17, 15, 13, 10 }; // Scales for random explosion debris. + +void BgKin2Bombwall_SpawnEffects(BgKin2Bombwall* this, GlobalContext* globalCtx) { + s32 i; + Vec3f pos; + Vec3f velocity; + Vec3f spD8; + Vec3f spCC; + s32 j; + s32 k; + f32 temp_a0; + s32 pad; + s16 phi_s0; + s16 phi_s1; + + Matrix_RotateYS(this->dyna.actor.shape.rot.y, 0); + + for (i = 0, k = 0; i < 6; i++) { + temp_a0 = (i + 1) * 15.f; + for (j = 0; j < ARRAY_COUNT(sRandomYOffsets); j++) { + k++; + k &= 7; + + spD8.x = sRandomYOffsets[j] + (s32)(Rand_Next() >> 0x1C); + spD8.y = ((Rand_ZeroOne() - 0.5f) * 15.0f) + temp_a0; + spD8.z = (Rand_ZeroOne() * 20.0f) - 10.0f; + + spCC.x = (2.0f * (Rand_ZeroOne() - 0.5f)) + (spD8.x * (6.0f / 325.0f)); + spCC.y = (Rand_ZeroOne() * 7.0f) + 4.0f; + spCC.z = spD8.z * 0.3f; + + Matrix_MultVec3f(&spD8, &pos); + Matrix_MultVec3f(&spCC, &velocity); + + pos.x += this->dyna.actor.world.pos.x; + pos.y += this->dyna.actor.world.pos.y; + pos.z += this->dyna.actor.world.pos.z; + + if (Rand_Next() % 4 == 0) { + phi_s0 = 0x20; + } else { + phi_s0 = 0x40; + } + + if (k < 2 || (s32)Rand_Next() > 0) { + phi_s0 |= 1; + phi_s1 = 1; + func_800B0E48(globalCtx, &pos, &gZeroVec3f, &sDustAccel, &sPrimColor, &sEnvColor, + (Rand_Next() >> 0x1B) + 70, + (Rand_Next() >> 0x1A) + 60); // for dust spawn + } else { + phi_s1 = 0; + } + EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &pos, -550, phi_s0, 30, 0, 0, sScales[k], phi_s1, 0, 50, + -1, OBJECT_KIN2_OBJ, gOceanSpiderHouseBombableWallDebrisDL); + } + } +} + +static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 200, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 300, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), }; -#endif +void BgKin2Bombwall_Init(Actor* thisx, GlobalContext* globalCtx) { + BgKin2Bombwall* this = THIS; + ColliderCylinder* bombwallCollider; -extern ColliderCylinderInit D_80B6E6F0; -extern InitChainEntry D_80B6E748[]; + Actor_ProcessInitChain(&this->dyna.actor, sInitChain); + DynaPolyActor_Init(&this->dyna, 0); + bombwallCollider = &this->collider; + Collider_InitCylinder(globalCtx, bombwallCollider); + if (Flags_GetSwitch(globalCtx, BG_KIN2_BOMBWALL_SWITCH_FLAG(this))) { + Actor_MarkForDeath(&this->dyna.actor); + } else { + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &gOceanSpiderHouseBombableWallCol); + Collider_SetCylinder(globalCtx, bombwallCollider, &this->dyna.actor, &sCylinderInit); + Collider_UpdateCylinder(&this->dyna.actor, bombwallCollider); + Actor_SetFocus(&this->dyna.actor, 60.0f); + BgKin2Bombwall_SetupWait(this); + } +} -extern UNK_TYPE D_06000128; -extern UNK_TYPE D_06000360; -extern UNK_TYPE D_06000490; +void BgKin2Bombwall_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgKin2Bombwall* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/func_80B6E020.s") + DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); + Collider_DestroyCylinder(globalCtx, &this->collider); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/func_80B6E090.s") +void BgKin2Bombwall_SetupWait(BgKin2Bombwall* this) { + this->actionFunc = BgKin2Bombwall_Wait; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/BgKin2Bombwall_Init.s") +void BgKin2Bombwall_Wait(BgKin2Bombwall* this, GlobalContext* globalCtx) { + if (BgKin2Bombwall_IsHitFromNearby(this, globalCtx)) { + this->collider.base.acFlags &= ~AC_HIT; + ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + BgKin2Bombwall_SetupPlayCutscene(this); + } else { + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/BgKin2Bombwall_Destroy.s") +void BgKin2Bombwall_SetupPlayCutscene(BgKin2Bombwall* this) { + this->actionFunc = BgKin2Bombwall_PlayCutscene; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/func_80B6E4B8.s") +void BgKin2Bombwall_PlayCutscene(BgKin2Bombwall* this, GlobalContext* globalCtx) { + if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { + ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + Flags_SetSwitch(globalCtx, BG_KIN2_BOMBWALL_SWITCH_FLAG(this)); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 60, NA_SE_EV_WALL_BROKEN); + func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); + this->dyna.actor.draw = NULL; + BgKin2Bombwall_SpawnEffects(this, globalCtx); + BgKin2Bombwall_SetupEndCutscene(this); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/func_80B6E4CC.s") + } else { + ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/func_80B6E544.s") +void BgKin2Bombwall_SetupEndCutscene(BgKin2Bombwall* this) { + this->timer = 40; + this->actionFunc = BgKin2Bombwall_EndCutscene; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/func_80B6E558.s") +void BgKin2Bombwall_EndCutscene(BgKin2Bombwall* this, GlobalContext* globalCtx) { + this->timer--; + if (this->timer <= 0) { + ActorCutscene_Stop(this->dyna.actor.cutscene); + Actor_MarkForDeath(&this->dyna.actor); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/func_80B6E5F8.s") +void BgKin2Bombwall_Update(Actor* thisx, GlobalContext* globalCtx) { + BgKin2Bombwall* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/func_80B6E614.s") + this->actionFunc(this, globalCtx); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/BgKin2Bombwall_Update.s") +void BgKin2Bombwall_Draw(Actor* thisx, GlobalContext* globalCtx) { + BgKin2Bombwall* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Kin2_Bombwall/BgKin2Bombwall_Draw.s") + Gfx_DrawDListOpa(globalCtx, gOceanSpiderHouseBombableWallDL); + Gfx_DrawDListXlu(globalCtx, gOceanSpiderHouseBombableWallCrackDL); +} diff --git a/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.h b/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.h index 25ebd0362e..c4d76c860a 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.h +++ b/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.h @@ -1,6 +1,8 @@ #ifndef Z_BG_KIN2_BOMBWALL_H #define Z_BG_KIN2_BOMBWALL_H +#define BG_KIN2_BOMBWALL_SWITCH_FLAG(thisx) (thisx->dyna.actor.params & 0x7F) + #include "global.h" struct BgKin2Bombwall; @@ -8,12 +10,10 @@ struct BgKin2Bombwall; typedef void (*BgKin2BombwallActionFunc)(struct BgKin2Bombwall*, GlobalContext*); typedef struct BgKin2Bombwall { - /* 0x0000 */ Actor actor; - /* 0x0144 */ char unk_144[0x64]; - /* 0x01A8 */ BgKin2BombwallActionFunc actionFunc; - /* 0x01AC */ char unk_1AC[0x4]; + /* 0x000 */ DynaPolyActor dyna; + /* 0x15C */ ColliderCylinder collider; + /* 0x1A8 */ BgKin2BombwallActionFunc actionFunc; + /* 0x1AC */ s8 timer; } BgKin2Bombwall; // size = 0x1B0 -extern const ActorInit Bg_Kin2_Bombwall_InitVars; - #endif // Z_BG_KIN2_BOMBWALL_H diff --git a/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c b/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c index 37d176f5ac..ae1563122a 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c +++ b/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c @@ -270,5 +270,5 @@ void BgKin2Fence_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgKin2Fence_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, object_kin2_obj_DL_000828); + Gfx_DrawDListOpa(globalCtx, gOceanSpiderHouseFireplaceGrateDL); } diff --git a/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c b/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c index 499fb034a4..72828611b8 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c +++ b/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c @@ -51,9 +51,9 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_STOP), }; -CollisionHeader* D_80B70780[] = { &object_kin2_obj_Colheader_001328, &object_kin2_obj_Colheader_000F80 }; +CollisionHeader* D_80B70780[] = { &gOceanSpiderHouseChestOfDrawersCol, &gOceanSpiderHouseBookshelfCol }; -Gfx* D_80B70788[] = { object_kin2_obj_DL_0010F8, object_kin2_obj_DL_000CA8 }; +Gfx* D_80B70788[] = { gOceanSpiderHouseChestOfDrawersDL, gOceanSpiderHouseBookshelfDL }; s32 func_80B6FB30(BgKin2Shelf* this, GlobalContext* globalCtx) { s32 temp_v1 = BGKIN2SHELF_GET_1(&this->dyna.actor); diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index ce9fdca47f..7b3b9a12d3 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -14294,16 +14294,16 @@ 0x80B6DEA8:("func_80B6DEA8",), 0x80B6DEB8:("BgHakaCurtain_Update",), 0x80B6DF44:("BgHakaCurtain_Draw",), - 0x80B6E020:("func_80B6E020",), - 0x80B6E090:("func_80B6E090",), + 0x80B6E020:("BgKin2Bombwall_IsHitFromNearby",), + 0x80B6E090:("BgKin2Bombwall_SpawnEffects",), 0x80B6E3AC:("BgKin2Bombwall_Init",), 0x80B6E470:("BgKin2Bombwall_Destroy",), - 0x80B6E4B8:("func_80B6E4B8",), - 0x80B6E4CC:("func_80B6E4CC",), - 0x80B6E544:("func_80B6E544",), - 0x80B6E558:("func_80B6E558",), - 0x80B6E5F8:("func_80B6E5F8",), - 0x80B6E614:("func_80B6E614",), + 0x80B6E4B8:("BgKin2Bombwall_SetupWait",), + 0x80B6E4CC:("BgKin2Bombwall_Wait",), + 0x80B6E544:("BgKin2Bombwall_SetupPlayCutscene",), + 0x80B6E558:("BgKin2Bombwall_PlayCutscene",), + 0x80B6E5F8:("BgKin2Bombwall_SetupEndCutscene",), + 0x80B6E614:("BgKin2Bombwall_EndCutscene",), 0x80B6E664:("BgKin2Bombwall_Update",), 0x80B6E688:("BgKin2Bombwall_Draw",), 0x80B6E820:("BgKin2Fence_CheckHitMask",),