From 8b326a11cc4b35df495d7bb471d3b63ee2f53c2e Mon Sep 17 00:00:00 2001 From: Owlenuff Date: Wed, 2 Oct 2024 20:48:19 +0200 Subject: [PATCH] Document cubeList --- include/enums.h | 13 +++++++-- include/functions.h | 4 +-- manual_syms.pal.txt | 6 ++-- src/FP/ch/boggy2.c | 6 ++-- src/GV/code_7060.c | 4 +-- src/TTC/ch/blubber.c | 10 +++---- src/core2/ba/marker.c | 4 +-- src/core2/ch/snacker.c | 2 +- src/core2/code_34790.c | 4 +-- src/core2/code_4A6F0.c | 2 +- src/core2/code_7060.c | 8 +++--- src/core2/code_7AF80.c | 56 ++++++++++++++++++------------------- src/core2/code_956B0.c | 4 +-- src/core2/code_9B180.c | 2 +- src/core2/nc/dynamicCam12.c | 2 +- 15 files changed, 67 insertions(+), 60 deletions(-) diff --git a/include/enums.h b/include/enums.h index 8fc7aabc..b6f5d409 100644 --- a/include/enums.h +++ b/include/enums.h @@ -1964,8 +1964,11 @@ enum actor_e ACTOR_151_LOCKUP_SLOW = 0x151, ACTOR_152_LOCKUP_MEDIUM, ACTOR_153_LOCKUP_FAST, - - ACTOR_158_UNKNOWN = 0x158, + ACTOR_154_UNKNOWN, + ACTOR_155_UNKNOWN, + ACTOR_156_UNKNOWN, + ACTOR_157_UNKNOWN, + ACTOR_158_UNKNOWN, ACTOR_15A_UNKNOWN = 0x15A, @@ -2133,6 +2136,9 @@ enum actor_e ACTOR_32B_UNKNOWN = 0x32B, //something with Tanktup + ACTOR_32F_UNKNOWN = 0x32F, + ACTOR_330_UNKNOWN, + ACTOR_332_TWINKLY_BLUE = 0x332, ACTOR_333_TWINKLY_GREEN, ACTOR_334_TWINKLY_ORANGE, @@ -2222,7 +2228,8 @@ enum actor_e ACTOR_3C7_FF_PRIZE_GRUNTY_DOLL = 0x3C7, ACTOR_3C8_FF_PRIZE_TOOTY = 0x3C8, - ACTOR_3CA_ROCK_TRAPPING_GRUNTY = 0x3CA + ACTOR_3CA_ROCK_TRAPPING_GRUNTY = 0x3CA, + ACTOR_3CB_UNKNOWN }; enum bundle_e { diff --git a/include/functions.h b/include/functions.h index 28f82e50..6724aebf 100644 --- a/include/functions.h +++ b/include/functions.h @@ -450,8 +450,8 @@ void func_80352CF4(f32 *, f32 *, f32, f32); AnimCtrl *baanim_getAnimCtrlPtr(void); void player_setYPosition(f32); -NodeProp *nodeprop_findByActorIdAndActorPosition(enum actor_e arg0, Actor *arg1); -NodeProp *func_80304CAC(s32 arg0, f32 position[3]); +NodeProp *nodeprop_findByActorIdAndActorPosition(enum actor_e actor_id, Actor *actor_ptr); +NodeProp *nodeprop_findByActorIdAndPosition_f32(enum actor_e actor_id, f32 position[3]); Actor *actorArray_findClosestActorFromActorId(f32 position[3], enum actor_e actor_id, s32 arg2, f32 *min_distance_ptr); Actor *subaddie_getLinkedActor(Actor *); diff --git a/manual_syms.pal.txt b/manual_syms.pal.txt index a6e388e4..c69a033b 100644 --- a/manual_syms.pal.txt +++ b/manual_syms.pal.txt @@ -259,9 +259,9 @@ func_802F9F80 = 0x802fa160; func_802F9FD0 = 0x802fa1b0; func_802FA060 = 0x802fa240; func_802FADD4 = 0x802fafb4; -cubeList_findNodePropByActorId = 0x80304b6c; -nodeprop_findByActorIdAndActorPosition = 0x80304dd8; -func_80304CAC = 0x80304e4c; +cubeList_findNodePropByActorIdAndPosition_s32 = 0x80304b6c; +nodeprop_findByActorIdAndActorPosition = 0x80304dd8; +nodeprop_findByActorIdAndPosition_f32 = 0x80304e4c; nodeprop_getPosition_s32 = 0x80304eec; nodeprop_getPosition = 0x80304f08; _nodeProp_findPositionFromActorId = 0x80304f70; diff --git a/src/FP/ch/boggy2.c b/src/FP/ch/boggy2.c index 765fb59d..d95dcc85 100644 --- a/src/FP/ch/boggy2.c +++ b/src/FP/ch/boggy2.c @@ -4,7 +4,7 @@ extern void func_8028E668(f32[3], f32, f32, f32); extern Actor *func_80328230(enum actor_e id, f32 pos[3], f32 rot[3]); -extern NodeProp *cubeList_findNodePropByActorId(enum actor_e, s32[3]); +extern NodeProp *cubeList_findNodePropByActorIdAndPosition_s32(enum actor_e, s32[3]); extern f32 func_8038BE20(f32 arg0[3]); typedef struct { @@ -383,8 +383,8 @@ void func_803895E0(void){ for (i = 0; i< 7; i++){ s0 = (i < 3) - ? cubeList_findNodePropByActorId(D_80391DB8[i].unk0, D_80391DA0) - : cubeList_findNodePropByActorId(D_80391DB8[i].unk0, D_80391DAC); + ? cubeList_findNodePropByActorIdAndPosition_s32(D_80391DB8[i].unk0, D_80391DA0) + : cubeList_findNodePropByActorIdAndPosition_s32(D_80391DB8[i].unk0, D_80391DAC); nodeprop_getPosition(s0, sp64); f20 = (f32)func_80304DA8(s0); diff --git a/src/GV/code_7060.c b/src/GV/code_7060.c index d65b7513..fb852637 100644 --- a/src/GV/code_7060.c +++ b/src/GV/code_7060.c @@ -38,7 +38,7 @@ void func_8038D47C(Actor *this){ this->spawn_position_y = 2997.0f; this->spawn_position_z = 5884.0f; }//L8038D4FC - tmp_v0 = func_80304CAC(0x32f, this->spawn_position); + tmp_v0 = nodeprop_findByActorIdAndPosition_f32(ACTOR_32F_UNKNOWN, this->spawn_position); if(!tmp_v0){ this->unk1C_x = -1394.0f; this->unk1C_y = 2811.0f; @@ -48,7 +48,7 @@ void func_8038D47C(Actor *this){ nodeprop_getPosition(tmp_v0, this->unk1C); } - tmp_v0 = func_80304CAC(0x330, this->spawn_position); + tmp_v0 = nodeprop_findByActorIdAndPosition_f32(ACTOR_330_UNKNOWN, this->spawn_position); if(!tmp_v0){ this->velocity_x = -1424.0f; this->velocity_y = 2811.0f; diff --git a/src/TTC/ch/blubber.c b/src/TTC/ch/blubber.c index d73a1b50..07504110 100644 --- a/src/TTC/ch/blubber.c +++ b/src/TTC/ch/blubber.c @@ -37,10 +37,10 @@ ActorAnimationInfo gChBlubberAnimations[6] = { {ASSET_B8_ANIM_BLUBBER_RUN, 0.8f} }; -ActorInfo gChBlubber = { +ActorInfo gChBlubber = { MARKER_A3_BLUBBER, ACTOR_115_BLUBBER, ASSET_370_MODEL_BLUBBER, - 0x1, gChBlubberAnimations, - __chBlubber_updateFunc, __chBlubber_update2Func, __chBlubber_drawFunc, + 0x1, gChBlubberAnimations, + __chBlubber_updateFunc, __chBlubber_update2Func, __chBlubber_drawFunc, 0, 0x399, 1.8f, 0 }; @@ -162,7 +162,7 @@ static void __chBlubber_updateFunc(Actor *this){ subaddie_set_state_forward(this, CH_BLUBBER_STATE_3_UNKNOWN); } - if( mapSpecificFlags_get(TTC_SPECIFIC_FLAG_0_BLUBBER_UNKNOWN) + if( mapSpecificFlags_get(TTC_SPECIFIC_FLAG_0_BLUBBER_UNKNOWN) && !this->unk138_23 ){ if (item_getCount(ITEM_18_GOLD_BULLIONS) == 0) { @@ -214,7 +214,7 @@ static void __chBlubber_updateFunc(Actor *this){ __chBlubber_checkJiggySpawnedTextAndAdvanceState(this); break; - case CH_BLUBBER_STATE_3_UNKNOWN: + case CH_BLUBBER_STATE_3_UNKNOWN: break; case CH_BLUBBER_STATE_4_UNKNOWN: diff --git a/src/core2/ba/marker.c b/src/core2/ba/marker.c index f5e3b51c..1a8932ae 100644 --- a/src/core2/ba/marker.c +++ b/src/core2/ba/marker.c @@ -24,7 +24,7 @@ extern Actor *baModel_80291AAC(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx ** extern void baMarker_8028D7B8(s32 arg0, ActorMarker *arg1, struct5Cs *collision_flags); extern void func_802EE6CC(f32[3], s32, s32[4], s32, f32, f32, s32,s32,s32); extern void func_80320ED8(ActorMarker *, f32, s32); -extern NodeProp *cubeList_findNodePropByActorId(enum actor_e actor_id, s32 position[3]); +extern NodeProp *cubeList_findNodePropByActorIdAndPosition_s32(enum actor_e actor_id, s32 position[3]); typedef struct { @@ -157,7 +157,7 @@ void __baMarker_8028B9A8(s32 arg0){ NodeProp *tmp_v0; s32 ideal_yaw[3]; - tmp_v0 = cubeList_findNodePropByActorId(0x1F6, 0); + tmp_v0 = cubeList_findNodePropByActorIdAndPosition_s32(0x1F6, NULL); nodeprop_getPosition_s32(tmp_v0, &ideal_yaw); func_802CA1CC(arg0); actor_spawnWithYaw_s32(ACTOR_47_EMPTY_HONEYCOMB, &ideal_yaw, 0); diff --git a/src/core2/ch/snacker.c b/src/core2/ch/snacker.c index eef36918..04aa719f 100644 --- a/src/core2/ch/snacker.c +++ b/src/core2/ch/snacker.c @@ -333,7 +333,7 @@ void chSnacker_spawn(void) { _player_getPosition(spawn_position); if (volatileFlag_get(VOLATILE_FLAG_C1_IN_FINAL_CHARACTER_PARADE) != 0) { - nodeprop_getPosition(func_80304CAC(0x3CB, spawn_position), spawn_position); + nodeprop_getPosition(nodeprop_findByActorIdAndPosition_f32(ACTOR_3CB_UNKNOWN, spawn_position), spawn_position); } else{ spawn_angle_rad = randf2(0.0f, 3.28f); diff --git a/src/core2/code_34790.c b/src/core2/code_34790.c index 7821d774..0bc9adb8 100644 --- a/src/core2/code_34790.c +++ b/src/core2/code_34790.c @@ -9,7 +9,7 @@ extern Actor *func_80328230(enum actor_e, f32[3], f32[3]); extern void func_802BEA4C(f32[3], f32[3], f32, f32[3]); extern void func_802BEBE8(f32[3], f32[3], f32, f32[3]); extern void func_802BEAAC(f32[3], f32[3], f32, f32[3], f32[3], f32[3], f32[3]); -extern NodeProp *cubeList_findNodePropByActorId(enum actor_e, s32[3]); +extern NodeProp *cubeList_findNodePropByActorIdAndPosition_s32(enum actor_e, s32[3]); extern BKCollisionTri *func_80320B98(f32[3], f32[3], f32[3], s32); f32 func_802BB938(f32[3], f32[3]); f32 func_802BBD48(void); @@ -60,7 +60,7 @@ bool func_802BB720(s32 arg0, f32 arg1[3], f32 arg2[3], s32 *arg3) { if ((arg0 >= 0x5B) && (arg0 < 0x63)) { arg0 -= 0x40; } - temp_v0 = cubeList_findNodePropByActorId(D_803657E0[arg0], NULL); + temp_v0 = cubeList_findNodePropByActorIdAndPosition_s32(D_803657E0[arg0], NULL); if (temp_v0 != NULL) { nodeprop_getPosition(temp_v0, arg1); *arg3 = func_80304DB8(temp_v0); diff --git a/src/core2/code_4A6F0.c b/src/core2/code_4A6F0.c index cc08a469..bc69a763 100644 --- a/src/core2/code_4A6F0.c +++ b/src/core2/code_4A6F0.c @@ -105,7 +105,7 @@ bool chMumbo_withinHorzDistToPlayer(s32 x, s32 z, s32 dist) { bool chMumbo_func_802D181C(s32 arg0) { s32 search_start_cube[3] = D_80367504; - return BOOL(cubeList_findNodePropByActorId(arg0, search_start_cube)); + return BOOL(cubeList_findNodePropByActorIdAndPosition_s32(arg0, search_start_cube)); } void chMumbo_func_802D186C(Actor *this) { diff --git a/src/core2/code_7060.c b/src/core2/code_7060.c index b63ce46f..e81f72ba 100644 --- a/src/core2/code_7060.c +++ b/src/core2/code_7060.c @@ -98,8 +98,8 @@ void func_8028E0F0(s32 arg0, s32 arg1[3]) { case 1: sp68 = 1; ml_vec3f_copy(sp40, sp7C); - nodeprop_getPosition(func_80304CAC(0x156, sp40), sp58); - nodeprop_getPosition(func_80304CAC(0x157, sp40), sp4C); + nodeprop_getPosition(nodeprop_findByActorIdAndPosition_f32(ACTOR_156_UNKNOWN, sp40), sp58); + nodeprop_getPosition(nodeprop_findByActorIdAndPosition_f32(ACTOR_157_UNKNOWN, sp40), sp4C); sp40[0] = ((sp4C[0] - sp58[0]) * D_8037BFB0[0]) + sp58[0]; sp40[2] = ((sp4C[2] - sp58[2]) * D_8037BFB0[1]) + sp58[2]; ml_vec3f_copy(sp7C, sp40); @@ -107,8 +107,8 @@ void func_8028E0F0(s32 arg0, s32 arg1[3]) { case 2: sp64 = 1; ml_vec3f_copy(sp1C, sp7C); - nodeprop_getPosition(func_80304CAC(0x154, sp1C), sp34); - nodeprop_getPosition(func_80304CAC(0x155, sp1C), sp28); + nodeprop_getPosition(nodeprop_findByActorIdAndPosition_f32(ACTOR_154_UNKNOWN, sp1C), sp34); + nodeprop_getPosition(nodeprop_findByActorIdAndPosition_f32(ACTOR_155_UNKNOWN, sp1C), sp28); sp1C[1] = ((sp28[1] - sp34[1]) * D_8037BFB0[0]) + sp34[1]; ml_vec3f_copy(sp7C, sp1C); break; diff --git a/src/core2/code_7AF80.c b/src/core2/code_7AF80.c index 7d2ef178..b203c35d 100644 --- a/src/core2/code_7AF80.c +++ b/src/core2/code_7AF80.c @@ -32,7 +32,7 @@ typedef struct { Struct_core2_7AF80_2 *unk8; } Struct_core2_7AF80_1; -NodeProp *cubeList_findNodePropByActorId(enum actor_e actor_id, s32 arg1[3]); +NodeProp *cubeList_findNodePropByActorIdAndPosition_s32(enum actor_e actor_id, s32 arg1[3]); s32 func_80304FC4(enum actor_e *actor_id_list, NodeProp **node_list, s32 arg2); void cube_positionToIndices(s32 arg0[3], f32 arg1[3]); NodeProp *func_803080C8(s32 arg0); @@ -932,18 +932,18 @@ s32 func_803048E0(s32 arg0[3], s32 arg1[3], s32 arg2, s32 arg3, s32 arg4) { return func_8032F170(arg1, arg2); } -s32 func_80304984(s32 arg0, u32 *arg1) { - NodeProp *temp_v0; +s32 func_80304984(s32 actor_id, u32 *arg1) { + NodeProp *temp_v0 = cubeList_findNodePropByActorIdAndPosition_s32(actor_id, NULL); - temp_v0 = cubeList_findNodePropByActorId(arg0, 0); if (temp_v0 != 0) { *arg1 = temp_v0->unk6.radius; return 1; } + return 0; } -NodeProp *cubeList_findNodePropByActorId(enum actor_e actor_id, s32 position[3]) { +NodeProp *cubeList_findNodePropByActorIdAndPosition_s32(enum actor_e actor_id, s32 position[3]) { s32 cube_indices[3]; s32 i; f32 position_f32[3]; @@ -995,42 +995,42 @@ NodeProp *cubeList_findNodePropByActorId(enum actor_e actor_id, s32 position[3]) return NULL; } -NodeProp *nodeprop_findByActorIdAndActorPosition(enum actor_e actor_id, Actor *actor){ - s32 tmp_position[3]; +NodeProp *nodeprop_findByActorIdAndActorPosition(enum actor_e actor_id, Actor *actor_ptr) { + s32 pos_s32[3]; s32 *position; - if (actor != NULL) { - tmp_position[0] = actor->position_x; - tmp_position[1] = actor->position_y; - tmp_position[2] = actor->position_z; + if (actor_ptr != NULL) { + pos_s32[0] = actor_ptr->position_x; + pos_s32[1] = actor_ptr->position_y; + pos_s32[2] = actor_ptr->position_z; } - if (actor == NULL) { + if (actor_ptr == NULL) { position = NULL; } else { - position = tmp_position; + position = pos_s32; } - return cubeList_findNodePropByActorId(actor_id, position); + return cubeList_findNodePropByActorIdAndPosition_s32(actor_id, position); } -NodeProp *func_80304CAC(s32 arg0, f32 *arg1) { - s32 vec[3]; +NodeProp *nodeprop_findByActorIdAndPosition_f32(enum actor_e actor_id, f32 *position) { + s32 pos_s32[3]; - vec[0] = (s32)arg1[0]; - vec[1] = (s32)arg1[1]; - vec[2] = (s32)arg1[2]; - return cubeList_findNodePropByActorId(arg0, vec); + pos_s32[0] = (s32) position[0]; + pos_s32[1] = (s32) position[1]; + pos_s32[2] = (s32) position[2]; + return cubeList_findNodePropByActorIdAndPosition_s32(actor_id, pos_s32); } -NodeProp *func_80304D04(s32 arg0, s16 *arg1) { - s32 arr[3]; +NodeProp *nodeprop_findByActorIdAndPosition_s16(enum actor_e actor_id, s16 *position) { + s32 pos_s32[3]; - arr[0] = (s32)arg1[0]; - arr[1] = (s32)arg1[1]; - arr[2] = (s32)arg1[2]; - return cubeList_findNodePropByActorId(arg0, arr); + pos_s32[0] = (s32) position[0]; + pos_s32[1] = (s32) position[1]; + pos_s32[2] = (s32) position[2]; + return cubeList_findNodePropByActorIdAndPosition_s32(actor_id, pos_s32); } s32 nodeprop_getRadius(NodeProp *arg0) { @@ -1056,7 +1056,7 @@ s32 func_80304DB8(NodeProp *arg0) { bool _nodeProp_findPositionFromActorId(enum actor_e actor_id, s32 *position) { NodeProp *node_prop; - node_prop = cubeList_findNodePropByActorId(actor_id, NULL); + node_prop = cubeList_findNodePropByActorIdAndPosition_s32(actor_id, NULL); if (node_prop != 0) { position[0] = (s32) node_prop->x; position[1] = (s32) node_prop->y; @@ -1187,7 +1187,7 @@ bool func_80305290(bool (* arg0)(NodeProp *), bool (* arg1)(Prop *)){ bool func_80305344(s32 arg0, u32 *arg1) { NodeProp *temp_v0; - temp_v0 = cubeList_findNodePropByActorId(arg0, NULL); + temp_v0 = cubeList_findNodePropByActorIdAndPosition_s32(arg0, NULL); if (temp_v0 != NULL) { *arg1 = temp_v0->unkC_31; return 1; diff --git a/src/core2/code_956B0.c b/src/core2/code_956B0.c index 161a6d96..e519b18e 100644 --- a/src/core2/code_956B0.c +++ b/src/core2/code_956B0.c @@ -736,8 +736,8 @@ void func_8031E204(NodeProp *node, s32 arg1, s32 arg2){ f32 sp28[3]; f32 sp1C[3]; - nodeprop_getPosition(func_80304D04(0x154, &node->x), sp34); - nodeprop_getPosition(func_80304D04(0x155, &node->x), sp28); + nodeprop_getPosition(nodeprop_findByActorIdAndPosition_s16(ACTOR_154_UNKNOWN, &node->x), sp34); + nodeprop_getPosition(nodeprop_findByActorIdAndPosition_s16(ACTOR_155_UNKNOWN, &node->x), sp28); player_getPosition(sp1C); if(sp28[1] < sp1C[1]){ sp1C[1] = sp28[1]; diff --git a/src/core2/code_9B180.c b/src/core2/code_9B180.c index e67f7b51..09e02f00 100644 --- a/src/core2/code_9B180.c +++ b/src/core2/code_9B180.c @@ -130,7 +130,7 @@ void func_803223AC(void) { func_80244A98(1); for(i_ptr = D_8036DE00; i_ptr != &D_8036DE00[6]; i_ptr++){ - i_ptr->unk4 = cubeList_findNodePropByActorId(i_ptr->unk0, 0); + i_ptr->unk4 = cubeList_findNodePropByActorIdAndPosition_s32(i_ptr->unk0, NULL); if(i_ptr->unk4 != 0 && i_ptr->unk8 != NULL){ i_ptr->unk8(i_ptr); } diff --git a/src/core2/nc/dynamicCam12.c b/src/core2/nc/dynamicCam12.c index 227ca436..47ce69a0 100644 --- a/src/core2/nc/dynamicCam12.c +++ b/src/core2/nc/dynamicCam12.c @@ -231,7 +231,7 @@ void func_802C16CC(s32 arg0) { if(sp38 != D_8037DBE0.unk28 && D_8037DBE0.unk28 != -1){ player_getPosition(sp54); ml_vec3f_to_vec3w(sp48, sp54); - sp30 = cubeList_findNodePropByActorId(sp38, sp48); + sp30 = cubeList_findNodePropByActorIdAndPosition_s32(sp38, sp48); if(sp30 != NULL) { nodeprop_getPosition(sp30, sp54); switch (func_80304DB8(sp30)) { /* irregular */