From 9e3cd5054475bfb88e9e29387eb3725266cd1dc3 Mon Sep 17 00:00:00 2001 From: petrie911 Date: Fri, 14 Apr 2023 14:14:57 -0500 Subject: [PATCH] now with decomp.me --- src/overlays/actors/ovl_Obj_Mine/z_obj_mine.c | 8 +++++--- tools/disasm/variables.txt | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/overlays/actors/ovl_Obj_Mine/z_obj_mine.c b/src/overlays/actors/ovl_Obj_Mine/z_obj_mine.c index cc3ee9fd7..228f44527 100644 --- a/src/overlays/actors/ovl_Obj_Mine/z_obj_mine.c +++ b/src/overlays/actors/ovl_Obj_Mine/z_obj_mine.c @@ -6,7 +6,7 @@ #include "z_obj_mine.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" -#include "assets/objects/object_ny/object_ny.h" +#include "objects/object_ny/object_ny.h" #define FLAGS 0x00000000 @@ -482,9 +482,11 @@ void ObjMine_Water_WallCheck(ObjMine* this, PlayState* play) { } #ifdef NON_MATCHING +// https://decomp.me/scratch/BW51G // Probably equivalent, but nightmare loop unrolls. The tension section also has weird comparisons. It should be // equivalent to what's written, but it seems the actual code comparisons were implemented differently. ASM suggests // multiple index variables were used at once. + void ObjMine_Water_ApplyForces(ObjMine* this) { static Vec3f sLastLinkAccel[OBJMINE_CHAIN_MAX + 1]; ObjMineWaterChain* waterChain = &this->chain.water; @@ -492,7 +494,7 @@ void ObjMine_Water_ApplyForces(ObjMine* this) { s32 i; s16 swayPhase; s32 linkCount = OBJMINE_GET_LINK_COUNT(&this->actor); - f32 inverseCount = 1.0f / (f32)linkCount; + f32 inverseCount = 1.0f / linkCount; f32 restoreY = (waterChain->links[linkCount - 1].pos.y - waterChain->restY) * waterChain->restoreY; Vec3f tension; f32 scaledKnockback; @@ -570,7 +572,7 @@ void ObjMine_Water_ApplyForces(ObjMine* this) { } } #else -Vec3f D_80A849D0[0x40]; +Vec3f sLastLinkAccel[OBJMINE_CHAIN_MAX + 1]; void ObjMine_Water_ApplyForces(ObjMine* this); #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Mine/ObjMine_Water_ApplyForces.s") #endif diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 0b44baae3..c8d56bead 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -12311,7 +12311,7 @@ 0x80A84698:("D_80A84698","f32","",0x4), 0x80A8469C:("D_80A8469C","f32","",0x4), 0x80A846A0:("D_80A846A0","f32","",0x4), - 0x80A849D0:("D_80A849D0","UNK_TYPE4","",0x4), + 0x80A849D0:("sLastLinkAccel","Vec3f[]","",0x4), 0x80A85460:("Obj_Purify_InitVars","UNK_TYPE1","",0x1), 0x80A85480:("ObjPurifyInfoList","UNK_TYPE1","",0x1), 0x80A854A0:("D_80A854A0","UNK_TYPE1","",0x1),