diff --git a/decompressed.us.v10.yaml b/decompressed.us.v10.yaml index 8d88d9aa..bf191f93 100644 --- a/decompressed.us.v10.yaml +++ b/decompressed.us.v10.yaml @@ -630,7 +630,7 @@ segments: - [0xF90770, c, code_3AE10] #DONE - [0xF90C20, c, done/code_3B2C0] #DONE - [0xF90F20, c, code_3B5C0] #DONE - - [0xF914E0, c, code_3BB80] #DONE + - [0xF914E0, c, spawnqueue] #DONE - [0xF92D30, c, ch/gameSelect] #DONE - [0xF94430, c, code_3EAD0] #DONE - [0xF94590, c, code_3EC30] #DONE @@ -927,7 +927,7 @@ segments: - [0x1034730, .data, code_37E50] - [0x1034760, .data, code_382E0] - [0x1034770, .data, code_3AE10] - - [0x1034790, .data, code_3BB80] + - [0x1034790, .data, spawnqueue] - [0x10347A0, .data, ch/gameSelect] - [0x1034900, .data, code_3EAD0] - [0x1034980, .data, code_3EC30] @@ -1198,7 +1198,7 @@ segments: - [0x1044930, .rodata, code_39A10] - [0x1044950, .rodata, code_39EF0] - [0x1044990, .rodata, code_3AE10] - - [0x10449A0, .rodata, code_3BB80] + - [0x10449A0, .rodata, spawnqueue] - [0x10449F0, .rodata, ch/gameSelect] - [0x1044B70, .rodata, code_3ECE0] - [0x1044B80, .rodata, ch/bigbutt] diff --git a/include/core2/modelRender.h b/include/core2/modelRender.h index ce43ed30..d9ef8cb4 100644 --- a/include/core2/modelRender.h +++ b/include/core2/modelRender.h @@ -25,7 +25,7 @@ void modelRender_setPrimAndEnvColors(s32 env[4], s32 prim[4]); void modelRender_setEnvColor(s32 r, s32 g, s32 b, s32 a); void modelRender_setAlpha(s32 a); void func_8033A444(struct58s *arg0); -void func_8033A450(s32 arg0); +void func_8033A450(struct5Bs *arg0); void func_8033A45C(s32 arg0, s32 arg1); void func_8033A470(s32 arg0, s32 arg1); void modelRender_setTextureList(BKTextureList *textureList); diff --git a/include/core2/timedfunc.h b/include/core2/timedfunc.h index c475bff6..ec2874d8 100644 --- a/include/core2/timedfunc.h +++ b/include/core2/timedfunc.h @@ -2,24 +2,18 @@ #define __TIMED_FUNC_H__ #include -typedef void (* TFQM0)(void); -typedef void (* TFQM1)(s32); -typedef void (* TFQM2)(s32, s32); -typedef void (* TFQM3)(s32, s32, s32); -typedef void (* TFQM4)(s32, s32, s32, s32); -typedef void (* TFQM5)(s32, s32, s32, s32, s32); -typedef void (* TFQM6)(void *); +#include "generic.h" #define reinterpret_cast(type, var) (*((type *)&var)) -void timedFunc_set_0(f32 time, TFQM0 funcPtr); -void timedFunc_set_1(f32 time, TFQM1 funcPtr, s32 arg0); -void timedFunc_set_2(f32 time, TFQM2 funcPtr, s32 arg0, s32 arg1); -void timedFunc_set_3(f32 time, TFQM3 funcPtr, s32 arg0, s32 arg1, s32 arg2); -void timedFunc_set_4(f32 time, TFQM4 funcPtr, s32 arg0, s32 arg1, s32 arg2, s32 arg3); -void timedFunc_set_5(f32 time, TFQM5 funcPtr, s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4); -void timedFunc_set_6(f32 time, TFQM6 funcPtr, void* argPtr ); +void timedFunc_set_0(f32 time, GenMethod_0 funcPtr); +void timedFunc_set_1(f32 time, GenMethod_1 funcPtr, s32 arg0); +void timedFunc_set_2(f32 time, GenMethod_2 funcPtr, s32 arg0, s32 arg1); +void timedFunc_set_3(f32 time, GenMethod_3 funcPtr, s32 arg0, s32 arg1, s32 arg2); +void timedFunc_set_4(f32 time, GenMethod_4 funcPtr, s32 arg0, s32 arg1, s32 arg2, s32 arg3); +void timedFunc_set_5(f32 time, GenMethod_5 funcPtr, s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4); +void timedFunc_set_6(f32 time, GenMethod_6 funcPtr, void* argPtr ); void timedJiggySpawn(f32 time, s32 jiggyId, f32 *position); #endif diff --git a/include/functions.h b/include/functions.h index 7d8f1f4f..608020cb 100644 --- a/include/functions.h +++ b/include/functions.h @@ -226,7 +226,7 @@ void particleEmitter_setSprite(ParticleEmitter *, enum asset_e); void particleEmitter_setPosition(ParticleEmitter *, f32[3]); ParticleEmitter *partEmitList_pushNew(u32); void func_802BB3DC(s32, f32, f32); -void func_802C3F04(GenMethod_4, s32, s32, s32, s32); +void __spawnQueue_add_4(GenMethod_4, s32, s32, s32, s32); Actor *func_802C4140(enum actor_e actor_id, s32 x, s32 y, s32 z); void func_8030DA44(u8); @@ -451,7 +451,7 @@ void func_8030EC20(enum sfx_e uid, f32 arg1, f32 arg2, u32 arg3, u32 arg4); u8 func_8030ED2C(enum sfx_e uid, s32 arg1); void func_80320044(s32, s32, s32); -Actor *func_80325300(ActorMarker *marker, f32 rotation[3]); +Actor *marker_getActorAndRotation(ActorMarker *marker, f32 rotation[3]); Actor *func_80325934(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); Actor *func_80325E78(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); @@ -520,7 +520,7 @@ void player_setYPosition(f32); NodeProp *func_80304C38(enum actor_e arg0, Actor *arg1); NodeProp *func_80304CAC(s32 arg0, f32 position[3]); -Actor *func_80326D68(f32 position[3], enum actor_e actor_id, s32 arg2, f32 *min_distance_ptr); +Actor *actorArray_findClosestActorFromActorId(f32 position[3], enum actor_e actor_id, s32 arg2, f32 *min_distance_ptr); Actor *subaddie_getLinkedActor(Actor *); /* used in RBB */ @@ -544,7 +544,7 @@ void func_802C8F70(f32); void func_802F9DB8(s32, f32, f32, f32); void func_802F9F80(s32, f32, f32, f32); void func_802FA060(s32, s32, s32, f32); -Actor *func_80326EEC(enum actor_e); +Actor *actorArray_findActorFromActorId(enum actor_e); f32 func_8038A6B8(ActorMarker *); void *defrag_asset(void *); void func_80255FE4(f32 [3], f32 [3], f32 [3], f32); @@ -579,8 +579,8 @@ void func_802596AC(f32 a0[3], f32 a1[3], f32 a2[3], f32 a3[3]); void func_8024E55C(s32, s32 [6]); -void __spawnqueue_add_1(GenMethod_1, s32); -#define SPAWNQUEUE_ADD_1(method, arg0) __spawnqueue_add_1((GenMethod_1) (method), reinterpret_cast(s32, (arg0))) +void __spawnQueue_add_1(GenMethod_1, s32); +#define SPAWNQUEUE_ADD_1(method, arg0) __spawnQueue_add_1((GenMethod_1) (method), reinterpret_cast(s32, (arg0))) void func_802FAD64(enum item_e); void nodeprop_getPosition(NodeProp *, f32[3]); diff --git a/include/generic.h b/include/generic.h index 2127fa89..626cd636 100644 --- a/include/generic.h +++ b/include/generic.h @@ -7,5 +7,6 @@ typedef void (* GenMethod_2)(s32, s32); typedef void (* GenMethod_3)(s32, s32, s32); typedef void (* GenMethod_4)(s32, s32, s32, s32); typedef void (* GenMethod_5)(s32, s32, s32, s32, s32); +typedef void (* GenMethod_6)(void *); #endif diff --git a/include/model.h b/include/model.h index a6d839cf..4138ddaa 100644 --- a/include/model.h +++ b/include/model.h @@ -195,5 +195,5 @@ typedef struct{ BKVertexList *func_8033A148(BKModelBin *arg0); Vtx *vtxList_getVertices(BKVertexList *vtxList); -void func_80333D48(BKVertexList *arg0, f32 position[3], f32 rotation[3], f32 scale, s32 arg4, BKVertexList *arg5); +void func_80333D48(BKVertexList *arg0, f32 position[3], f32 rotation[3], f32 scale, f32 arg4[3], BKVertexList *arg5); #endif diff --git a/include/structs.h b/include/structs.h index a8193df3..d2074924 100644 --- a/include/structs.h +++ b/include/structs.h @@ -635,7 +635,7 @@ typedef struct { typedef struct struct_63_s{ s16 unk0; // u8 pad2[2]; - void (*unk4)(s32, struct actor_marker_s *); + void (*unk4)(vector(struct2s) **, struct actorMarker_s *); } Struct63s; typedef struct struct_64_s{ @@ -645,8 +645,8 @@ typedef struct struct_64_s{ typedef struct struct_65_s{ f32 unk0[3]; - struct actor_marker_s *unkC; - s32 (*unk10)(f32[3], f32, struct actor_marker_s *); + struct actorMarker_s *unkC; + s32 (*unk10)(f32[3], f32, struct actorMarker_s *); s16 unk14[3]; s16 unk1A[3]; u8 unk20; @@ -665,7 +665,7 @@ typedef void (*Struct68DrawMethod)(void *, struct struct_68_s *, f32[3], f32[3] typedef struct struct_68_s{ u8 unk0; // u8 pad1[0x3]; - struct actor_marker_s *unk4; + struct actorMarker_s *unk4; Struct68DrawMethod unk8; BKModelBin *unkC; u8 pad10[0x4]; @@ -688,10 +688,10 @@ typedef struct { } Struct6Bs; typedef struct{ - s32 (* unk0)(struct actor_marker_s *, f32[3], f32[3], f32[3], s32); - s32 (* unk4)(struct actor_marker_s *, f32[3], f32[3], f32, f32[3], s32, u32); - s32 (* unk8)(struct actor_marker_s *, f32[3], f32, f32[3], s32); - s32 (* unkC)(struct actor_marker_s *, f32[3], f32, f32[3], s32); + s32 (* unk0)(struct actorMarker_s *, f32[3], f32[3], f32[3], s32); + s32 (* unk4)(struct actorMarker_s *, f32[3], f32[3], f32, f32[3], s32, u32); + s32 (* unk8)(struct actorMarker_s *, f32[3], f32, f32[3], s32); + s32 (* unkC)(struct actorMarker_s *, f32[3], f32, f32[3], s32); } Struct6Cs; typedef struct struct_6D_s{ @@ -830,7 +830,7 @@ typedef struct { f32 unk0; u8 unk4; u8 pad5[0x3]; - void (* unk8)(struct actor_marker_s *); + void (* unk8)(struct actorMarker_s *); s32 unkC; }Struct7Fs; @@ -856,18 +856,18 @@ typedef struct { typedef struct { enum actor_e actor_id; - struct actor_marker_s *marker; + struct actorMarker_s *marker; f32 position[3]; - void (*unk14)(struct actor_s *, struct actor_marker_s *); - struct actor_marker_s *unk18; + void (*unk14)(struct actor_s *, struct actorMarker_s *); + struct actorMarker_s *unk18; }Struct81s; typedef struct { enum actor_e actor_id; - struct actor_marker_s *marker; + struct actorMarker_s *marker; f32 position[3]; - void (*unk14)(struct actor_s *, struct actor_marker_s *); - struct actor_marker_s *unk18; + void (*unk14)(struct actor_s *, struct actorMarker_s *); + struct actorMarker_s *unk18; }Struct82s; typedef struct { diff --git a/src/BGS/ch/croctus.c b/src/BGS/ch/croctus.c index 28a338c8..ed4cc378 100644 --- a/src/BGS/ch/croctus.c +++ b/src/BGS/ch/croctus.c @@ -2,13 +2,13 @@ #include "functions.h" #include "variables.h" -extern void func_80328748(ActorAnimCtrl *, f32, f32); +extern void func_80328748(AnimCtrl *, f32, f32); extern void func_8028F94C(s32, f32[3]); extern void func_80324CFC(f32, enum comusic_e, s32); extern void func_803289EC(Actor *, f32, s32); extern void func_80326310(Actor *); extern void actor_setOpacity(Actor *, s32); -extern void func_802C3D3C(void (*)(s32, s32), s32, s32); +extern void __spawnQueue_add_2(void (*)(s32, s32), s32, s32); extern void func_802BAFE4(s32 arg0); @@ -74,7 +74,7 @@ void func_80387E00(s32 arg0){ Actor * this = marker_getActor(marker); func_803262E4(this); - func_802C3D3C(func_80387D18, reinterpret_cast(s32, marker), 0x1E); + __spawnQueue_add_2((GenMethod_2)func_80387D18, reinterpret_cast(s32, marker), 0x1E); } void func_80387E40(ActorMarker * arg0){ @@ -95,10 +95,10 @@ void func_80387E68(ActorMarker *caller, enum asset_e text_id, s32 arg2){ func_80328B8C(this, 5, 0.79f, 1); func_80326310(this); bgs_D_803907B8[this->unkF4_8]->propPtr->unk8_4 = TRUE; - timedFunc_set_1(1.1f, func_80387E00, bgs_D_803907B8[this->unkF4_8]); + timedFunc_set_1(1.1f, (GenMethod_1)func_80387E00, reinterpret_cast(s32, bgs_D_803907B8[this->unkF4_8])); timed_setCameraToNode(0.8f, 9); func_80324DBC(3.4f, 0xC87, 0xE, NULL, NULL, func_80387E68, NULL); - func_802C3D3C(&func_80387D18, this->marker, 0x46); + __spawnQueue_add_2((GenMethod_2) func_80387D18, reinterpret_cast(s32, this->marker), 0x46); } else{ func_80324E88(0.0f); @@ -158,12 +158,12 @@ void func_80387FD4(Actor *this){ } if (this->unkF4_8 < 5) { bgs_D_803907B8[this->unkF4_8]->propPtr->unk8_4 = TRUE; - timedFunc_set_1(1.1f, (GenMethod_1)func_80387E00, bgs_D_803907B8[this->unkF4_8]); + timedFunc_set_1(1.1f, (GenMethod_1)func_80387E00, reinterpret_cast(s32, bgs_D_803907B8[this->unkF4_8])); func_802BAFE4(D_803907B0[this->unkF4_8-1]); } else { timedFunc_set_1(0.8f, (GenMethod_1)func_80387D90, (s32) this->marker); } - func_802C3D3C(&func_80387D18, this->marker, 0x46); + __spawnQueue_add_2((GenMethod_2)func_80387D18, reinterpret_cast(s32, this->marker), 0x46); } } }//L80388348 diff --git a/src/BGS/ch/leafboat.c b/src/BGS/ch/leafboat.c index f11e3469..e6bac0f9 100644 --- a/src/BGS/ch/leafboat.c +++ b/src/BGS/ch/leafboat.c @@ -16,7 +16,7 @@ typedef struct chleafboat_s{ } ActorLocal_Leafboat; void func_8038FD9C(Actor *this); -Actor *func_8038FD10(ActorMarker *this, Gfx** gdl, Mtx** mtx, u32 arg3); +Actor *func_8038FD10(ActorMarker *this, Gfx** gdl, Mtx** mtx, Vtx **Vtx); /* .data section */ @@ -30,23 +30,23 @@ ActorInfo D_80390DA8 = {MARKER_DA_LEAFBOAT, ACTOR_F1_LEAFBOAT, ASSET_30D_MODEL_L /* .code section */ -Actor *func_8038FD10(ActorMarker *this, Gfx** gdl, Mtx** mtx, u32 arg3){ +Actor *func_8038FD10(ActorMarker *this, Gfx** gdl, Mtx** mtx, Vtx **vtx){ Actor * thisActor; thisActor = marker_getActor(this); if((thisActor->unk1C_x != 0.0f) && (0x80 < thisActor->alpha_124_19)){ - thisActor = func_80325888(this, gdl, mtx, arg3); + thisActor = func_80325888(this, gdl, mtx, vtx); } return thisActor; } -void func_8038FD88(ActorMarker *this, u32 arg1){ +void func_8038FD88(ActorMarker *this, ActorMarker *other){ this->unk3E_1 = 1; } void func_8038FD9C(Actor *this){ f32 sp64[3]; - f32 sp58[3]; + f32 player_position[3]; ActorLocal_Leafboat *local; u8 tmp[6] = D_80390DA0; f32 pad0; @@ -152,13 +152,13 @@ void func_8038FD9C(Actor *this){ local->unk60[1] = this->yaw; local->unk60[2] = this->roll; this->unk60 += time_getDelta(); - _player_getPosition(&sp58); + _player_getPosition(player_position); if( func_80294660() == 0x100 && func_8028F20C() && this->marker->unk3E_1 ){ - sp44 = local->unk54[0] - sp58[0]; - sp40 = local->unk54[2] - sp58[2]; + sp44 = local->unk54[0] - player_position[0]; + sp40 = local->unk54[2] - player_position[2]; sp3C = cosf((local->unk60[1] * M_PI) / 180.0); sp38 = sinf((local->unk60[1] * M_PI) / 180.0); local->unkC[0] = -((sp44 * sp38) + (sp40 * sp3C)) / 8; diff --git a/src/BGS/ch/mrvile.c b/src/BGS/ch/mrvile.c index 7502db56..f586aa9a 100644 --- a/src/BGS/ch/mrvile.c +++ b/src/BGS/ch/mrvile.c @@ -108,13 +108,13 @@ void BGS_func_8038BBA0(Actor *this, s32 arg1){ if(arg1 == 103){ func_80335A24(this->unk148, 0x124, 0.1f, 0.5f); //0x124 = croc_munch if(this->state == 4){ - timed_playSfx(0.31f, SFX_4C_LIP_SMACK, 0.90f, 0x61A8); - timedFunc_set_1(0.31f, func_8038BB40, this->marker); + timed_playSfx(0.31f, SFX_4C_LIP_SMACK, 0.90f, 25000); + timedFunc_set_1(0.31f, (GenMethod_1)func_8038BB40, reinterpret_cast(s32, this->marker)); } else{ - timed_playSfx(0.31f, SFX_4C_LIP_SMACK, 0.90f, 0x61A8); - timed_playSfx(0.81f, SFX_4C_LIP_SMACK, 0.93f, 0x61A8); - timed_playSfx(1.31f, SFX_4C_LIP_SMACK, 0.91f, 0x61A8); + timed_playSfx(0.31f, SFX_4C_LIP_SMACK, 0.90f, 25000); + timed_playSfx(0.81f, SFX_4C_LIP_SMACK, 0.93f, 25000); + timed_playSfx(1.31f, SFX_4C_LIP_SMACK, 0.91f, 25000); } } if(arg1 == 104){ @@ -143,7 +143,7 @@ void func_8038BD84(Actor *this){ void func_8038BDD4(Actor *this) { ActorLocal_MrVile *local; - f32 sp60[3]; + f32 start_position[3]; f32 sp5C; f32 sp58; f32 sp54; @@ -153,9 +153,9 @@ void func_8038BDD4(Actor *this) { local = (ActorLocal_MrVile *)&this->local; sp5C = time_getDelta(); - sp60[0] = this->position[0]; - sp60[1] = this->position[1]; - sp60[2] = this->position[2]; + start_position[0] = this->position[0]; + start_position[1] = this->position[1]; + start_position[2] = this->position[2]; func_8025773C(&local->unk14, sp5C); if ((local->unkC == 102) || (local->unkC == 103) || (local->unkC == 104)) { sp44[0] = 0.0f; @@ -191,7 +191,7 @@ void func_8038BDD4(Actor *this) { } } if (this->position[1] > 100.0f) { - func_8038B9F0(&sp60, this->position, 90.0f, 70.0f, 0); + func_8038B9F0(start_position, this->position, 90.0f, 70.0f, 0); } } @@ -228,7 +228,7 @@ void func_8038C0C8(Actor * this, s32 next_state){ Actor *chvile_draw(ActorMarker *marker, Gfx **gfx, Mtx** mtx, Vtx **vtx){ Actor *this; ActorLocal_MrVile *local; - f32 sp34[3]; + f32 position[3]; this = func_80325888(marker, gfx, mtx, vtx); @@ -238,10 +238,10 @@ Actor *chvile_draw(ActorMarker *marker, Gfx **gfx, Mtx** mtx, Vtx **vtx){ (local->unk14 > 0.0f) && (this->marker->unk14_21) ) { - func_8034A174(func_80329934(), 5, &sp34); - sp34[1] -= 30.0f; + func_8034A174(func_80329934(), 5, position); + position[1] -= 30.0f; modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL); - modelRender_draw(gfx, mtx, &sp34, 0, local->unk14, 0, local->unk4); + modelRender_draw(gfx, mtx, position, 0, local->unk14, 0, local->unk4); } return this; } @@ -323,12 +323,10 @@ void BGS_func_8038C460(ActorMarker *arg0){ } void chvile_update(Actor *this) { - ActorLocal_MrVile *local; - bool var_v1; - f32 sp94; + f32 player_position[3]; f32 sp90; f32 temp_a0; - f32 temp_f0; + bool var_v1; f32 sp84; f32 sp80; f32 sp7C; @@ -337,8 +335,8 @@ void chvile_update(Actor *this) { f32 sp70; f32 sp6C; f32 sp68; - f32 sp50; - f32 sp58[3]; + ActorLocal_MrVile *local; + f32 random_position[3]; local = (ActorLocal_MrVile *)&this->local; if (!this->unk16C_4) { @@ -352,17 +350,17 @@ void chvile_update(Actor *this) { return; } if (local->game_marker == NULL) { - local->game_marker = func_80326D68(this->position, 0x138, -1, &sp90)->marker; + local->game_marker = actorArray_findClosestActorFromActorId(this->position, 0x138, -1, &sp90)->marker; } - player_getPosition(&sp94); - sp90 = ml_vec3f_distance(this->position, &sp94); + player_getPosition(player_position); + sp90 = ml_vec3f_distance(this->position, player_position); if (sp90 <= 300.0f) { local->unk0 = (local->unk0 == 0) ? 1 : 2; } else if (sp90 > 300.0f) { local->unk0 = 0U; } if (this->state == 2) { - func_80258A4C(this->position, this->yaw - 90.0f, &sp94, &sp84, &sp80, &sp7C); + func_80258A4C(this->position, this->yaw - 90.0f, player_position, &sp84, &sp80, &sp7C); if (((sp84 > 50.0f) && (0.05 < sp7C)) || (sp7C < -0.05)) { this->yaw += sp7C * 20.0f; } else { @@ -432,15 +430,15 @@ void chvile_update(Actor *this) { } if ((this->state == 6)){ local->unk10 = 400.0f; - if((ml_vec3f_distance(this->position, local->target_position) < 100.0f) || (ml_vec3f_distance(&sp94, local->target_position) < 300.0f)) { + if((ml_vec3f_distance(this->position, local->target_position) < 100.0f) || (ml_vec3f_distance(player_position, local->target_position) < 300.0f)) { for(i = 0; i < 10; i++){ - sp58[0] = randf2(-500.0f, 500.0f); - sp58[1] = 0.0f; - sp58[2] = randf2(-500.0f, 500.0f); - if ((i == 0) || (ml_vec3f_distance(&sp94, &sp58) > ml_vec3f_distance(&sp94, local->target_position))) { - local->target_position[0] = sp58[0]; - local->target_position[1] = sp58[1]; - local->target_position[2] = sp58[2]; + random_position[0] = randf2(-500.0f, 500.0f); + random_position[1] = 0.0f; + random_position[2] = randf2(-500.0f, 500.0f); + if ((i == 0) || (ml_vec3f_distance(player_position, random_position) > ml_vec3f_distance(player_position, local->target_position))) { + local->target_position[0] = random_position[0]; + local->target_position[1] = random_position[1]; + local->target_position[2] = random_position[2]; } }; } diff --git a/src/BGS/ch/tanktup.c b/src/BGS/ch/tanktup.c index 78a67d11..74e79742 100644 --- a/src/BGS/ch/tanktup.c +++ b/src/BGS/ch/tanktup.c @@ -9,7 +9,7 @@ void func_80324E88(f32); void timedFunc_set_2(f32, void(*)(s32, s32), s32, s32); void func_8028E668(f32[3], f32, f32, f32); -extern void func_802C3E10(void(*arg0)(void), ActorMarker *, s32, s32); +extern void __spawnQueue_add_3(GenMethod_3, s32, s32, s32); void func_8038F6A4(Actor *); @@ -18,7 +18,7 @@ enum chtanktup_leg_e { TANKTUP_LEG_FRONT_LEFT, TANKTUP_LEG_BACK_LEFT, TANKTUP_LEG_FRONT_RIGHT, - TANKTUP_LEG_BACK_RIGHT, + TANKTUP_LEG_BACK_RIGHT }; ActorAnimationInfo BGS_D_80390C20[] = { @@ -53,7 +53,7 @@ void func_8038F470(ActorMarker *this, s32 arg1, enum chtanktup_leg_e leg_id){ void func_8038F51C(Actor *this){ Actor * spawnPtr; - spawnPtr = func_80326D68(this->position, ACTOR_E8_TANKTUP, -1, 0); + spawnPtr = actorArray_findClosestActorFromActorId(this->position, ACTOR_E8_TANKTUP, -1, 0); spawnPtr->tanktup.unk0[this->unk10_12] = 1; spawnPtr->tanktup.unk10 = 1; } @@ -65,26 +65,26 @@ s32 func_8038F570(s16 *arg0){ pos[0] = (f32)arg0[0]; pos[1] = (f32)arg0[1]; pos[2] = (f32)arg0[2]; - spawnPtr = func_80326D68(pos, ACTOR_E8_TANKTUP, -1, 0); + spawnPtr = actorArray_findClosestActorFromActorId(pos, ACTOR_E8_TANKTUP, -1, 0); return spawnPtr->state == 3; } -void func_8038F5E4(s32 arg0, s32 arg1, s32 arg2){ +void func_8038F5E4(ActorMarker *marker, enum asset_e text_id, s32 arg2){ func_80324E88(0.0f); } void func_8038F610(Actor *this) { f32 sp24[3]; - func_8034A174(this->marker->unk44, 8, &sp24); - if (func_80258368(&sp24) != 0) { - func_8028E668(&sp24, 200.0f, -600.0f, 300.0f); + func_8034A174(this->marker->unk44, 8, sp24); + if (func_80258368(sp24) != 0) { + func_8028E668(sp24, 200.0f, -600.0f, 300.0f); } - func_8034A174(this->marker->unk44, 7, &sp24); - if (func_80258368(&sp24) != 0) { - func_8028E668(&sp24, 200.0f, -600.0f, 200.0f); + func_8034A174(this->marker->unk44, 7, sp24); + if (func_80258368(sp24) != 0) { + func_8028E668(sp24, 200.0f, -600.0f, 200.0f); } } @@ -97,7 +97,7 @@ void func_8038F6A4(Actor *this) ActorLocal_TanktupBody *local = (ActorLocal_TanktupBody *) (&this->local); f32 sp48[3]; s32 sp44; - Prop *temp_v0; + NodeProp *temp_v0; if (!this->initialized) { temp_v0 = func_80304C38(ACTOR_32B_UNKNOWN, this); @@ -124,7 +124,7 @@ void func_8038F6A4(Actor *this) { if (local->unk0[sp44] == 0) { - func_802C3E10(func_8038F470, *((s32 *) (&this->marker)), local->unk0[sp44], sp44); + __spawnQueue_add_3((GenMethod_3)func_8038F470, *((s32 *) (&this->marker)), local->unk0[sp44], sp44); } } diff --git a/src/BGS/ch/yumblie.c b/src/BGS/ch/yumblie.c index 746cb5af..3b917c02 100644 --- a/src/BGS/ch/yumblie.c +++ b/src/BGS/ch/yumblie.c @@ -6,13 +6,14 @@ extern void func_803253A0(Actor *); extern void func_80325794(ActorMarker *); extern f32 randf (void); +extern BKModelBin *chvilegame_get_grumblie_model(ActorMarker *marker); enum chyumblie_state_e{ YUMBLIE_STATE_1_UNDER_GROUND = 1, YUMBLIE_STATE_2_APPEAR, YUMBLIE_STATE_3_ABOVE_GROUND, YUMBLIE_STATE_4_DISAPPEAR, - YUMBLIE_STATE_5_BEING_EATEN, + YUMBLIE_STATE_5_BEING_EATEN }; typedef struct chyumblie_s{ @@ -157,7 +158,7 @@ void chyumblie_update(Actor *this){ } if(s0->game_marker == NULL){ - s0->game_marker = func_80326D68(this->position, ACTOR_138_VILE_GAME_CTRL, -1, &sp48)->marker; + s0->game_marker = actorArray_findClosestActorFromActorId(this->position, ACTOR_138_VILE_GAME_CTRL, -1, &sp48)->marker; } sp50 = func_80335684(this->unk148); if(this->state == YUMBLIE_STATE_1_UNDER_GROUND){ diff --git a/src/BGS/code_3030.c b/src/BGS/code_3030.c index 50b6cf5f..9129a562 100644 --- a/src/BGS/code_3030.c +++ b/src/BGS/code_3030.c @@ -43,7 +43,7 @@ void func_80389488(Actor *this, s32 next_state) { if (next_state == 3) { func_8030E6A4(SFX_86_TIPTUP_CHORUS_AH, local->unk8, 0x7FFF); func_80335924(this->unk148, ASSET_12F_ANIM_CHOIR_TURTLE_HURT, 0.1f, 1.75f); - func_80335800(this->unk148, 0.9f, func_80389420, (s32)this->marker); + func_80335800(this->unk148, 0.9f, func_80389420, this->marker); if (local->tiptup_marker != NULL) { func_80388E94(local->tiptup_marker, local->unk0); } @@ -88,7 +88,7 @@ void func_80389668(Actor *this) { local->unkC++; if (local->unkC == 2) { - tiptup = func_80326D68(this->position, ACTOR_27A_TIPTUP, -1, &sp30); + tiptup = actorArray_findClosestActorFromActorId(this->position, ACTOR_27A_TIPTUP, -1, &sp30); local->tiptup_marker = (tiptup != NULL) ? tiptup->marker : NULL; if (local->tiptup_marker != NULL) { func_80388FFC(local->tiptup_marker, &local->unk0, &local->unk8); diff --git a/src/BGS/code_3420.c b/src/BGS/code_3420.c index dda50381..74308522 100644 --- a/src/BGS/code_3420.c +++ b/src/BGS/code_3420.c @@ -228,7 +228,7 @@ void func_80389F08(ActorMarker *marker) { this = marker_getActor(marker); local = (ActorLocal_BGS_3420 *)&this->local; BGS_func_80389850(this, 0); - var_s2 = func_80326F58(0x49); + var_s2 = actorArray_actorCount(ACTOR_49_EXTRA_LIFE); vile = marker_getActor(local->vile_marker); if (var_s2 > 0) { func_8025A6EC(COMUSIC_15_EXTRA_LIFE_COLLECTED, 0x7FF8); @@ -305,7 +305,7 @@ void func_8038A068(Actor *this, s32 next_state) { mapSpecificFlags_set(6, TRUE); func_8038C3DC(local->vile_marker); func_8025A58C(0, 4000); - timedFunc_set_2(1.0f, func_8025A6EC, COMUSIC_55_BGS_MR_VILE, 28000); + timedFunc_set_2(1.0f, (GenMethod_2)func_8025A6EC, COMUSIC_55_BGS_MR_VILE, 28000); } } if (this->state == 5) { @@ -321,29 +321,29 @@ void func_8038A068(Actor *this, s32 next_state) { if (next_state == 6) { func_8038C3B0(local->vile_marker); func_80324E38(0.0f, 3); - timedFunc_set_2(1.0f, func_8025A6EC, COMUSIC_3C_MINIGAME_LOSS, 28000); - timedFunc_set_0(4.0f, func_8038A044); - timedFunc_set_1(4.0f, func_80389C58, (s32) this->marker); + timedFunc_set_2(1.0f, (GenMethod_2)func_8025A6EC, COMUSIC_3C_MINIGAME_LOSS, 28000); + timedFunc_set_0(4.0f, (GenMethod_0)func_8038A044); + timedFunc_set_1(4.0f, (GenMethod_1)func_80389C58, (s32) this->marker); } if (next_state == 8) { func_8038C3B0(local->vile_marker); func_80324E38(0.0f, 3); - timedFunc_set_2(1.0f, func_8025A6EC, COMUSIC_3B_MINIGAME_VICTORY, 28000); - timedFunc_set_0(3.0f, func_8038A044); - timedFunc_set_1(3.0f, func_80389D20, (s32) this->marker); + timedFunc_set_2(1.0f, (GenMethod_2)func_8025A6EC, COMUSIC_3B_MINIGAME_VICTORY, 28000); + timedFunc_set_0(3.0f, (GenMethod_0)func_8038A044); + timedFunc_set_1(3.0f, (GenMethod_1)func_80389D20, (s32) this->marker); } if (next_state == 9) { func_8038C3B0(local->vile_marker); func_80324E38(0.0f, 3); - timedFunc_set_2(1.0f, func_8025A6EC, COMUSIC_3B_MINIGAME_VICTORY, 28000); - timedFunc_set_0(3.0f, func_8038A044); - timedFunc_set_1(3.0f, func_80389E40, (s32) this->marker); + timedFunc_set_2(1.0f, (GenMethod_2)func_8025A6EC, COMUSIC_3B_MINIGAME_VICTORY, 28000); + timedFunc_set_0(3.0f, (GenMethod_0)func_8038A044); + timedFunc_set_1(3.0f, (GenMethod_1)func_80389E40, (s32) this->marker); } if (next_state == 0xA) { func_8038C3B0(local->vile_marker); func_80324E38(0.5f, 3); - timedFunc_set_2(1.0f, func_8025A6EC, COMUSIC_3B_MINIGAME_VICTORY, 28000); - timedFunc_set_1(3.0f, func_80389F08, (s32) this->marker); + timedFunc_set_2(1.0f, (GenMethod_2) func_8025A6EC, COMUSIC_3B_MINIGAME_VICTORY, 28000); + timedFunc_set_1(3.0f, (GenMethod_1) func_80389F08, (s32) this->marker); } if (next_state == 7) { func_8038C384(local->vile_marker); @@ -581,7 +581,7 @@ void chvilegame_update(Actor *this) { return; } if (local->vile_marker == NULL) { - local->vile_marker = func_80326D68(this->position, 0x13A, -1, &sp4C)->marker; + local->vile_marker = actorArray_findClosestActorFromActorId(this->position, 0x13A, -1, &sp4C)->marker; } if (this->state == 1) { if (func_803203FC(2)) { diff --git a/src/BGS/code_9750.c b/src/BGS/code_9750.c index 15a0701d..9d92a6cd 100644 --- a/src/BGS/code_9750.c +++ b/src/BGS/code_9750.c @@ -72,7 +72,7 @@ void BGS_func_8038FB84(ActorMarker *this, ActorMarker *other_marker){ thisActor = marker_getActor(this); FUNC_8030E8B4( SFX_87_TANKTUP_OOOHW, 1.0f, 32750, thisActor->position, 1000, 3000); - timedFunc_set_2(0.65f, (TFQM2) func_8038FB40, (s32) this, (s32) other_marker); + timedFunc_set_2(0.65f, (GenMethod_2) func_8038FB40, (s32) this, (s32) other_marker); func_8038F51C(thisActor); this->collidable = 0; } diff --git a/src/BGS/crc.c b/src/BGS/crc.c index a5660f3d..64e8d6bb 100644 --- a/src/BGS/crc.c +++ b/src/BGS/crc.c @@ -3,4 +3,4 @@ //TODO Implement CRC calculation in Makefile(?) u32 D_80390B20 = 0x00282B61; //BGS.code CRC1 u32 D_80390B24 = 0xccdaeea0; //BGS.code CRC2 -u32 D_80390B28 = 0x0002DE6B; //BGS.data CRC1 (with this value = 0) \ No newline at end of file +u32 D_80390B28 = 0x0002DE6B; //BGS.data CRC1 (with this value = 0) diff --git a/src/BGS/done/ch/code_2270.c b/src/BGS/done/ch/code_2270.c index 6de14272..2caf485b 100644 --- a/src/BGS/done/ch/code_2270.c +++ b/src/BGS/done/ch/code_2270.c @@ -72,11 +72,11 @@ void BGS_func_80388760(void){ func_8025A6EC(COMUSIC_2C_BUZZER, 28000); } -void func_80388784(ActorMarker *this, s32 arg1, s32 arg2){ +void func_80388784(ActorMarker *this, enum asset_e text_id, s32 arg2){ Actor *thisActor; thisActor = marker_getActor(this); - switch(arg1){ + switch(text_id){ case 0xc72: case 0xc74: BGS_func_803888E4(thisActor, 3); @@ -167,8 +167,8 @@ void BGS_func_803888E4(Actor *this, s32 arg1){ for(; i < D_80390864[unqPtr->unkA]; i++){ tmpf += randf2(1.0f, 1.5f); while((rand2 = randi2(1,7)) == prev_member); - timedFunc_set_2(tmpf, func_803886B4, this->marker, rand2); - timedFunc_set_2(tmpf + 0.1, func_803886B4, this->marker, 0); + timedFunc_set_2(tmpf, (GenMethod_2) func_803886B4, reinterpret_cast(s32, this->marker), rand2); + timedFunc_set_2(tmpf + 0.1, (GenMethod_2)func_803886B4, reinterpret_cast(s32, this->marker), 0); prev_member = rand2; }//L80388B7C @@ -179,7 +179,7 @@ void BGS_func_803888E4(Actor *this, s32 arg1){ } func_80324E38(sp54 = tmpf + 0.6, 0); if(func_803203FC(2)){ - timedFunc_set_1(sp54, func_803886F4, this->marker); + timedFunc_set_1(sp54, (GenMethod_1)func_803886F4, reinterpret_cast(s32, this->marker)); }else{ this->state = 0x05; } @@ -194,8 +194,8 @@ void BGS_func_803888E4(Actor *this, s32 arg1){ for(j = 0; j < vector_size(unqPtr->unk4); j++){ s1 = (Struct_BGS_2270_0s *)vector_at(unqPtr->unk4,j); tmpf += randf2(1.0f, 1.5f); - timedFunc_set_2(tmpf, func_803886B4, this->marker, s1->unk0); - timedFunc_set_2(tmpf + 0.1, func_803886B4, this->marker, 0); + timedFunc_set_2(tmpf, (GenMethod_2)func_803886B4, reinterpret_cast(s32, this->marker), s1->unk0); + timedFunc_set_2(tmpf + 0.1, (GenMethod_2)func_803886B4, reinterpret_cast(s32, this->marker), 0); } func_80324E88(tmpf += 2.5); func_80324E38(tmpf + 0.6,0); @@ -238,7 +238,7 @@ void func_80388E94(ActorMarker *this, s32 arg1){ }else{ tmp = (Struct_BGS_2270_0s *)vector_at(unqPtr->unk4, unqPtr->unk0); if(arg1 == tmp->unk0){ - timedFunc_set_1(0.5f, func_80388848, thisActor->marker); + timedFunc_set_1(0.5f, (GenMethod_1)func_80388848, reinterpret_cast(s32, thisActor->marker)); } else{ func_8028F55C(1, thisActor->marker); @@ -271,7 +271,7 @@ void func_80388FFC(ActorMarker *this, s32 *arg1, f32* arg2){ } void func_80389080(Actor *this){ - f32 sp44[3]; + f32 player_position[3]; ActorLocal_BGS_2270 *unqPtr; f32 sp3C; f32 sp38; @@ -301,7 +301,7 @@ void func_80389080(Actor *this){ marker_despawn(this->marker); } else{ - player_getPosition(&sp44); + player_getPosition(player_position); if(func_8033567C(this->unk148) == ASSET_12C_ANIM_TIPTUP_TAPPING && func_80335794(this->unk148) > 0){ func_80335924(this->unk148, ASSET_12B_ANIM_TIPTUP_IDLE, 1.0f, 9.0f); unqPtr->unkC = randf2(5.0f, 15.0f); @@ -309,7 +309,7 @@ void func_80389080(Actor *this){ if(func_8025773C(&unqPtr->unkC, sp3C)){ func_80335924(this->unk148, ASSET_12C_ANIM_TIPTUP_TAPPING, 1.0f, 4.0f); } - func_80258A4C(this->position, this->yaw - 90.0f, &sp44, &sp38, &sp34, &sp30); + func_80258A4C(this->position, this->yaw - 90.0f, player_position, &sp38, &sp34, &sp30); this->yaw = this->yaw + 5.0f*sp30; if(this->state == 1){ if(func_803203FC(2)){ @@ -319,7 +319,7 @@ void func_80389080(Actor *this){ } } else{ - if(ml_vec3f_distance(this->position, &sp44) < 300.0f && player_getTransformation() == TRANSFORM_1_BANJO && !jiggyscore_isSpawned(JIGGY_27_BGS_TIPTUP)){ + if(ml_vec3f_distance(this->position, player_position) < 300.0f && player_getTransformation() == TRANSFORM_1_BANJO && !jiggyscore_isSpawned(JIGGY_27_BGS_TIPTUP)){ BGS_func_803888E4(this, 2); } } @@ -333,12 +333,12 @@ void func_80389080(Actor *this){ } } //L80389370 else{ - if(ml_vec3f_distance(this->position, &sp44) >= 300.0f) + if(ml_vec3f_distance(this->position, player_position) >= 300.0f) BGS_func_803888E4(this, 1); } }//L803893A0 if(this->state == 6){ - if(ml_vec3f_distance(this->position, &sp44) < 300.0f && !unqPtr->unk8){ + if(ml_vec3f_distance(this->position, player_position) < 300.0f && !unqPtr->unk8){ unqPtr->unk8 = 1; func_80311480(0xc7d, 4, 0, 0, 0, 0); } diff --git a/src/BGS/done/ch/code_6730.c b/src/BGS/done/ch/code_6730.c index d8fb7b74..ac5cb41b 100644 --- a/src/BGS/done/ch/code_6730.c +++ b/src/BGS/done/ch/code_6730.c @@ -3,35 +3,35 @@ #include "variables.h" -void func_8038CEE8(Actor *); -void func_8038CC08(Actor * arg0, u32 arg1); +void chfrogminigame_update(Actor *); +void chFrogMinigame_setState(Actor * arg0, u32 arg1); void func_8025A58C(u32, u32); void func_80324E88(f32); ActorInfo BGS_D_80390AB0 = {MARKER_C4_YELLOW_FLIBBIT_CTRL, ACTOR_136_YELLOW_FLIBBIT_CONTROLLER, 0x00, 0x00, NULL, - func_8038CEE8, NULL, func_80325340, + chfrogminigame_update, NULL, func_80325340, 0, 0, 0.0f, 0 }; -f32 D_80390AD4[3] = {1985.0f, 200.0f, -1386.0f}; /* .bss */ u8 D_80391240[4]; /* .code */ -void BGS_func_8038CB20(void){ +static void __chFrogMinigame_spawnJiggy(void){ + static f32 D_80390AD4[3] = {1985.0f, 200.0f, -1386.0f}; jiggySpawn(JIGGY_24_BGS_FLIBBITS, D_80390AD4); } -void func_8038CB48(ActorMarker *arg0, u32 arg1, u32 arg2){ - Actor *actPtr = marker_getActor(arg0); +static void __chFrogMinigame_textCallback(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + Actor *actPtr = marker_getActor(marker); mapSpecificFlags_set(0x10, 0); if(actPtr->state == 4){ - func_8038CC08(actPtr,5); + chFrogMinigame_setState(actPtr,5); } else{ - func_8038CC08(actPtr,3); + chFrogMinigame_setState(actPtr,3); } } @@ -45,7 +45,7 @@ void func_8038CBB4(Actor * arg0){ arg0->bgs_6730.unk4 = 0; } -void func_8038CC08(Actor * arg0, u32 arg1){ +void chFrogMinigame_setState(Actor * arg0, u32 arg1){ ActorLocal_BGS_6730 *s0; s0 = &arg0->bgs_6730; @@ -55,13 +55,13 @@ void func_8038CC08(Actor * arg0, u32 arg1){ mapSpecificFlags_set(0x10, 1); if(!func_8031FF1C(0x1B)){ func_80320004(0x1B, 1); - func_80311480(text_flibbits_meet, 0xf, arg0->position, arg0->marker, func_8038CB48, 0); + func_80311480(text_flibbits_meet, 0xf, arg0->position, arg0->marker, __chFrogMinigame_textCallback, 0); }else{ if(!arg0->bgs_6730.unk8){ - func_80311480(text_flibbits_return, 0x4, arg0->position, arg0->marker, func_8038CB48, 0); + func_80311480(text_flibbits_return, 0x4, arg0->position, arg0->marker, __chFrogMinigame_textCallback, 0); } else{ - func_8038CB48(arg0->marker, text_flibbits_return, 0); + __chFrogMinigame_textCallback(arg0->marker, text_flibbits_return, 0); return; } } @@ -92,12 +92,12 @@ void func_8038CC08(Actor * arg0, u32 arg1){ } if(arg1 == 4){ - func_80311480(text_flibbits_defeat, 0xf, arg0->position, arg0->marker, func_8038CB48, 0); + func_80311480(text_flibbits_defeat, 0xf, arg0->position, arg0->marker, __chFrogMinigame_textCallback, 0); } if(arg1 == 5){ func_80324E38(0.0f, 3); timed_setCameraToNode(0.0f, 0x27); - timedFunc_set_0(0.2f, BGS_func_8038CB20); + timedFunc_set_0(0.2f, __chFrogMinigame_spawnJiggy); func_80324E88(3.0f); func_80324E38(3.0f, 0); arg1 = 6; @@ -125,18 +125,18 @@ void BGS_func_8038CED0(void){ D_80391240[3]++; } -void func_8038CEE8(Actor *this){ - f32 sp34[3]; +void chfrogminigame_update(Actor *this){ + f32 player_position[3]; u32 sp28; - ActorLocal_BGS_6730 *bgs6730; + ActorLocal_BGS_6730 *local; - bgs6730 = &this->bgs_6730; + local = &this->bgs_6730; if(!this->unk16C_4){ this->unk16C_4 = 1; - bgs6730->unk0 = 0; - bgs6730->unk4 = 0; - bgs6730->unk8 = 0; - bgs6730->unkC = 0; + local->unk0 = 0; + local->unk4 = 0; + local->unk8 = 0; + local->unkC = 0; D_80391240[0] = 0; D_80391240[1] = 0; D_80391240[2] = 0; @@ -144,60 +144,60 @@ void func_8038CEE8(Actor *this){ mapSpecificFlags_set(0x12, 0); mapSpecificFlags_set(0x10, 0); if(jiggyscore_isSpawned(JIGGY_24_BGS_FLIBBITS)){ - func_8038CC08(this,6); + chFrogMinigame_setState(this,6); return; }else{ - func_8038CC08(this,1); + chFrogMinigame_setState(this,1); return; } } if(D_80391240[0]>0){ - bgs6730->unk8 += D_80391240[0]; - bgs6730->unkC -= D_80391240[0]; + local->unk8 += D_80391240[0]; + local->unkC -= D_80391240[0]; D_80391240[0] = 0; } if(D_80391240[1]>0){ - bgs6730->unk8 -= D_80391240[1]; + local->unk8 -= D_80391240[1]; D_80391240[1] = 0; } if(D_80391240[2]>0){ - bgs6730->unk8 -= D_80391240[2]; - bgs6730->unkC += D_80391240[2]; + local->unk8 -= D_80391240[2]; + local->unkC += D_80391240[2]; D_80391240[2] = 0; } if(D_80391240[3]>0){ - bgs6730->unkC += D_80391240[3]; + local->unkC += D_80391240[3]; D_80391240[3] = 0; } - player_getPosition(&sp34); - sp28 = (sp34[1] < 500.0f) && (func_80329210(this,sp34) != 0); + player_getPosition(player_position); + sp28 = (player_position[1] < 500.0f) && (func_80329210(this, player_position) != 0); if(this->state == 1){ - if(sp28 && ((bgs6730->unk8 > 0) || (bgs6730->unkC > 0)) && !func_8028FB48(0xe000)){ - func_8038CC08(this,2); + if(sp28 && ((local->unk8 > 0) || (local->unkC > 0)) && !func_8028FB48(0xe000)){ + chFrogMinigame_setState(this,2); } else{ //L8038D0E0 - if(bgs6730->unk4 && !bgs6730->unk8){ + if(local->unk4 && !local->unk8){ func_8038CBB4(this); } } } if(this->state == 3){ if(!sp28){ - func_8038CC08(this, 1); + chFrogMinigame_setState(this, 1); }else{ - if(bgs6730->unk8 < 2 && bgs6730->unkC > 0){ + if(local->unk8 < 2 && local->unkC > 0){ mapSpecificFlags_set(0x12, 1); } } } if(this->state == 1 || this->state == 3){ - if( (bgs6730->unk0) + if( (local->unk0) && !jiggyscore_isSpawned(JIGGY_24_BGS_FLIBBITS) - && !bgs6730->unk8 - && !bgs6730->unkC + && !local->unk8 + && !local->unkC ){ - func_8038CC08(this, 4); + chFrogMinigame_setState(this, 4); } } } diff --git a/src/BGS/done/ch/code_8A60.c b/src/BGS/done/ch/code_8A60.c index 638d440f..1e71b38f 100644 --- a/src/BGS/done/ch/code_8A60.c +++ b/src/BGS/done/ch/code_8A60.c @@ -26,7 +26,11 @@ void func_8038EE50(void){ if(func_80304E24(0x14d, sp24)){ jiggySpawn(JIGGY_20_BGS_ELEVATED_WALKWAY, sp24); - func_802C3F04(func_802C4140, ACTOR_4C_STEAM, *((u32 *) &sp24[0]), *((u32 *) &sp24[1]), *((u32 *) &sp24[2])); + __spawnQueue_add_4((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, + reinterpret_cast(s32, sp24[0]), + reinterpret_cast(s32, sp24[1]), + reinterpret_cast(s32, sp24[2]) + ); } } @@ -65,7 +69,11 @@ void func_8038F018(void){ if(func_80304E24(0x1fc, sp24)){ jiggySpawn(JIGGY_25_BGS_MAZE, sp24); - func_802C3F04(func_802C4140, ACTOR_4C_STEAM, *((u32 *) &sp24[0]), *((u32 *) &sp24[1]), *((u32 *) &sp24[2])); + __spawnQueue_add_4((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, + reinterpret_cast(s32, sp24[0]), + reinterpret_cast(s32, sp24[1]), + reinterpret_cast(s32, sp24[2]) + ); } } diff --git a/src/BGS/done/ch/mudhut.c b/src/BGS/done/ch/mudhut.c index b595a193..77cadc23 100644 --- a/src/BGS/done/ch/mudhut.c +++ b/src/BGS/done/ch/mudhut.c @@ -9,9 +9,9 @@ void func_802C4218(u32,f32,f32,f32); void func_80328A84(Actor *, u32); /* local declarations */ -Actor *func_8038EAD0(ActorMarker *this, Gfx** gdl, Mtx** mtx, u32 arg3); +Actor *chmudhut_draw(ActorMarker *this, Gfx** gdl, Mtx** mtx, Vtx **vtx); void func_8038EB4C(ActorMarker *); -void func_8038EB8C(Actor *this); +void chmudhut_update(Actor *this); /* .data section */ ActorAnimationInfo D_80390B30[4] = { @@ -24,7 +24,7 @@ ActorAnimationInfo D_80390B30[4] = { u32 D_80390B50[6] = {0xA, 0xA, 0xB, 0xA, 0xA, 0xC}; ActorInfo D_80390B68 = {MARKER_D5_BGS_MUD_HUT, ACTOR_C_MUD_HUT, ASSET_7D8_MODEL_MM_HUT_TOP, 0x01, D_80390B30, - func_8038EB8C, func_80326224, func_8038EAD0, + chmudhut_update, func_80326224, chmudhut_draw, 0, 0, 0.0f, 0 }; @@ -43,7 +43,7 @@ void func_8038EA90(void){ } } -Actor *func_8038EAD0(ActorMarker *this, Gfx** gdl, Mtx** mtx, u32 arg3){ +Actor *chmudhut_draw(ActorMarker *this, Gfx** gdl, Mtx** mtx, Vtx **vtx){ Actor *thisActor; thisActor = marker_getActor(this); @@ -51,7 +51,7 @@ Actor *func_8038EAD0(ActorMarker *this, Gfx** gdl, Mtx** mtx, u32 arg3){ if(thisActor->state == 3) return thisActor; - return func_80325888(this, gdl, mtx, arg3); + return func_80325888(this, gdl, mtx, vtx); } void func_8038EB4C(ActorMarker *this){ @@ -63,7 +63,7 @@ void func_8038EB4C(ActorMarker *this){ if(this); } -void func_8038EB8C(Actor *this){ +void chmudhut_update(Actor *this){ f32 diffPos[3]; f32 plyrPos[3]; @@ -78,7 +78,7 @@ void func_8038EB8C(Actor *this){ switch(this->state){ case 1: this->marker->propPtr->unk8_3 = 1; - player_getPosition(&plyrPos); + player_getPosition(plyrPos); diffPos[0] = plyrPos[0] - this->position_x; diffPos[1] = plyrPos[1] - this->position_y; diffPos[2] = plyrPos[2] - this->position_z; @@ -100,9 +100,13 @@ void func_8038EB8C(Actor *this){ if(tmp == 5){ func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); } - __spawnqueue_add_1(func_8038EB4C, this->marker); + __spawnQueue_add_1((GenMethod_1)func_8038EB4C, reinterpret_cast(s32, this->marker)); if(tmp < 5){ - func_802C3F04(func_802C4218,D_80390B50[tmp], ((u32 *)diffPos)[0], ((u32 *)diffPos)[1], ((u32 *)diffPos)[2]); + __spawnQueue_add_4((GenMethod_4)func_802C4218, D_80390B50[tmp], + reinterpret_cast(s32, diffPos[0]), + reinterpret_cast(s32, diffPos[1]), + reinterpret_cast(s32, diffPos[2]) + ); } else { jiggySpawn(JIGGY_23_BGS_HUTS, diffPos); } diff --git a/src/BGS/done/ch/pinkegg.c b/src/BGS/done/ch/pinkegg.c index 9155fdf2..b767162b 100644 --- a/src/BGS/done/ch/pinkegg.c +++ b/src/BGS/done/ch/pinkegg.c @@ -7,7 +7,7 @@ typedef struct chpinkegg_s{ u32 unk4; } ActorLocal_PinkEgg; -void chpinkegg_draw(ActorMarker *this, Gfx ** gdl, Mtx** mptr, u32 arg3); +Actor *chpinkegg_draw(ActorMarker *this, Gfx ** gdl, Mtx** mptr, Vtx **vtx); void chpinkegg_collision(ActorMarker *this, ActorMarker *other_marker); void chpinkegg_update(Actor *this); @@ -67,14 +67,14 @@ void chpinkegg_spawn_next(ActorMarker * arg0, u32 arg1){ } -void chpinkegg_draw(ActorMarker *this, Gfx ** gdl, Mtx** mptr, u32 arg3){ +Actor *chpinkegg_draw(ActorMarker *this, Gfx ** gdl, Mtx** mptr, Vtx **arg3){ u32 sp18; u32 t7; t7 = marker_getActor(this)->state == 3; - func_8033A45C(1, (sp18 = t7) ^ 1); + func_8033A45C(1, NOT(sp18 = t7)); func_8033A45C(2, sp18); - func_80325888(this, gdl, mptr, arg3); + return func_80325888(this, gdl, mptr, arg3); } @@ -90,7 +90,7 @@ void chpinkegg_collision(ActorMarker *this, ActorMarker *other_marker){ this->collidable = 0; thisActor->unk124_6 = 0; if(D_803906C4[(tmp = (ActorLocal_PinkEgg *) &thisActor->local)->unk0] != 0){ - func_802C3D3C(chpinkegg_spawn_next, thisActor->marker, tmp->unk0); + __spawnQueue_add_2(chpinkegg_spawn_next, thisActor->marker, tmp->unk0); } else { jiggySpawn(JIGGY_21_BGS_PINKEGG, thisActor->position); func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); diff --git a/src/CC/code_1F70.c b/src/CC/code_1F70.c index 541564c2..ee7bac49 100644 --- a/src/CC/code_1F70.c +++ b/src/CC/code_1F70.c @@ -22,7 +22,6 @@ extern void func_8024C5CC(f32[3]); extern void ml_vec3f_normalize(f32[3]); extern void func_8033A45C(s32, s32); extern void func_8033A238(s32); -extern void func_8033A450(s32); extern void func_8028FAB0(f32[3]); extern void playerModel_802921D4(f32[3]); @@ -46,7 +45,7 @@ struct { //u8 pad22[0x2]; BKModelBin * unk24; f32 unk28[3]; - s32 unk34; + struct5Bs *unk34; f32 unk38; f32 unk3C; BKVertexList *unk40; diff --git a/src/CCW/code_160.c b/src/CCW/code_160.c index 39876ffa..be86dce8 100644 --- a/src/CCW/code_160.c +++ b/src/CCW/code_160.c @@ -140,7 +140,7 @@ void func_8038687C(Actor *this) { return; } if ((s32)local->unk0 == 1) { - other = func_80326EEC(0x46); + other = actorArray_findActorFromActorId(0x46); if(func_803203FC(2)) { local->unk0 = NULL; if (other != NULL) { @@ -192,7 +192,7 @@ void func_8038687C(Actor *this) { break; } - func_802C3F04(func_802C4140, 0x29B, reinterpret_cast(s32, sp4C[0]), reinterpret_cast(s32, sp4C[1]), reinterpret_cast(s32, sp4C[2])); + __spawnQueue_add_4((GenMethod_4)func_802C4140, 0x29B, reinterpret_cast(s32, sp4C[0]), reinterpret_cast(s32, sp4C[1]), reinterpret_cast(s32, sp4C[2])); local->unk4++; } local->unkC = randf2(0.5 - ((local->unk8 / 10) * 0.4), 1.0 - ((local->unk8 / 10) * 0.8)); diff --git a/src/CCW/code_1B20.c b/src/CCW/code_1B20.c index 6983baa4..cc75eb60 100644 --- a/src/CCW/code_1B20.c +++ b/src/CCW/code_1B20.c @@ -123,14 +123,14 @@ Actor *CCW_func_803882F4(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { } void func_803883F4() { - Actor* actor = func_80326EEC(0x29D); + Actor* actor = actorArray_findActorFromActorId(0x29D); if (actor && actor->state == 1) { func_80387F64(actor, 2); } } bool func_80388438() { - Actor* actor = func_80326EEC(0x29D); + Actor* actor = actorArray_findActorFromActorId(0x29D); if (actor && actor->state == 2) { return TRUE; } diff --git a/src/CCW/code_2270.c b/src/CCW/code_2270.c index 751e1a10..332846a1 100644 --- a/src/CCW/code_2270.c +++ b/src/CCW/code_2270.c @@ -60,7 +60,7 @@ void CCW_func_8038868C(Actor *this, s32 next_state) { timed_playSfx(0.8f, SFX_4B_GULPING, 0.8f, 28000); timed_playSfx(1.4f, SFX_4B_GULPING, 0.8f, 28000); timed_playSfx(2.0f, SFX_4B_GULPING, 0.8f, 28000); - timedFunc_set_2(3.2f, (TFQM2) CCW_func_80388660, (s32) this->marker, 3); + timedFunc_set_2(3.2f, (GenMethod_2) CCW_func_80388660, (s32) this->marker, 3); } if (next_state == 3) { func_803883F4(); @@ -95,7 +95,7 @@ void func_8038894C(ActorMarker* marker, ActorMarker *other_marker) { Actor* actor = marker_getActor(marker); if (actor->state == 1) { actor_collisionOff(actor); - timedFunc_set_2(0.5f, (TFQM2)CCW_func_80388660, (s32)actor->marker, 2); + timedFunc_set_2(0.5f, (GenMethod_2)CCW_func_80388660, (s32)actor->marker, 2); } } diff --git a/src/CCW/code_3310.c b/src/CCW/code_3310.c index 3cbe807f..a4a3e4ba 100644 --- a/src/CCW/code_3310.c +++ b/src/CCW/code_3310.c @@ -111,7 +111,7 @@ void func_80389700(ActorMarker *marker, enum asset_e text_id, s32 arg2) { void func_80389740(ActorMarker *marker) { Actor *this = marker_getActor(marker); if (this->marker->unk14_21) { - func_802C3F04(func_802C4140, 0x30C, reinterpret_cast(s32, D_8038FDE0[0]), reinterpret_cast(s32, D_8038FDE0[1]), reinterpret_cast(s32, D_8038FDE0[2])); + __spawnQueue_add_4((GenMethod_4)func_802C4140, 0x30C, reinterpret_cast(s32, D_8038FDE0[0]), reinterpret_cast(s32, D_8038FDE0[1]), reinterpret_cast(s32, D_8038FDE0[2])); } } diff --git a/src/CCW/code_5540.c b/src/CCW/code_5540.c index 69edb3a9..0782589c 100644 --- a/src/CCW/code_5540.c +++ b/src/CCW/code_5540.c @@ -40,7 +40,7 @@ void chnabnut_setState(Actor *this, s32 next_state) { } if (next_state == NABNUT_STATE_2_WAIT) { - timedFunc_set_2(1.0f, (TFQM2)__chnabnut_setState_method, (s32)this->marker, NABNUT_STATE_3_BACKFLIP); + timedFunc_set_2(1.0f, (GenMethod_2)__chnabnut_setState_method, (s32)this->marker, NABNUT_STATE_3_BACKFLIP); } if (next_state == NABNUT_STATE_3_BACKFLIP) { diff --git a/src/CCW/code_5BF0.c b/src/CCW/code_5BF0.c index c2562f45..5972aea8 100644 --- a/src/CCW/code_5BF0.c +++ b/src/CCW/code_5BF0.c @@ -61,7 +61,7 @@ void CCW_func_8038C16C(Actor *this, s32 next_state) { func_80335924(this->unk148, 0x231, 0.2f, 4.0f); } if ((this->marker->unk14_20 == 0x1C7) || (this->marker->unk14_20 == 0x1CB) || (this->marker->unk14_20 == 0x1C8)) { - other = func_80326EEC(0x313); + other = actorArray_findActorFromActorId(0x313); if (other != 0) { this->position[0] = other->position[0]; this->position[1] = other->position[1]; diff --git a/src/CCW/code_8050.c b/src/CCW/code_8050.c index 319fc827..5a17387a 100644 --- a/src/CCW/code_8050.c +++ b/src/CCW/code_8050.c @@ -87,7 +87,7 @@ void func_8038E4C0(ActorMarker* marker, s32 arg1) { FUNC_8030E8B4(SFX_C2_GRUBLIN_EGH, 1.0f, 32000, actor->position, 1250, 2500); pCtrl = partEmitList_pushNew(1); func_8038E440(pCtrl, actor, ASSET_52D_MODEL_GRUBLIN_HOOD_HAT); - func_802C3F04((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32,actor->position_x), reinterpret_cast(s32,actor->position_y), reinterpret_cast(s32,actor->position_z)); + __spawnQueue_add_4((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32,actor->position_x), reinterpret_cast(s32,actor->position_y), reinterpret_cast(s32,actor->position_z)); actor_collisionOff(actor); actor->unk138_24 = 1; } diff --git a/src/CCW/code_950.c b/src/CCW/code_950.c index cc629a87..e39bcc5f 100644 --- a/src/CCW/code_950.c +++ b/src/CCW/code_950.c @@ -125,7 +125,7 @@ void chwasp_update(Actor *this) { return; } if(local->unk4 == NULL) { - other = func_80326EEC(0x299); + other = actorArray_findActorFromActorId(0x299); if (other == NULL) { marker_despawn(this->marker); return; diff --git a/src/FP/code_11F0.c b/src/FP/code_11F0.c index d87fc8b4..9ce72f1c 100644 --- a/src/FP/code_11F0.c +++ b/src/FP/code_11F0.c @@ -7,6 +7,7 @@ extern void func_80324CD8(f32); Actor *func_803875E0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); void func_8038774C(Actor *this); void func_8038794C(Actor *this); +Actor *func_80328230(enum actor_e id, f32 pos[3], f32 rot[3]); /* .data */ ActorAnimationInfo D_80391B80[] = { @@ -124,7 +125,7 @@ void func_8038794C(Actor *this){ if(jiggyscore_isCollected(JIGGY_2A_FP_BOGGY_1)){ if(!jiggyscore_isCollected(JIGGY_2C_FP_BOGGY_3) && !jiggyscore_isSpawned(JIGGY_2C_FP_BOGGY_3)){ - __spawnqueue_add_1(func_80387760, this->marker); + __spawnQueue_add_1((GenMethod_1)func_80387760, reinterpret_cast(s32, this->marker)); } this->unk38_31 = 0; actor_collisionOff(this); @@ -194,7 +195,7 @@ void func_8038794C(Actor *this){ case 5://L80387D90 if(jiggyscore_isCollected(JIGGY_2A_FP_BOGGY_1)){ this->unk38_31 = 0; - __spawnqueue_add_1(func_80387760, this->marker); + __spawnQueue_add_1((GenMethod_1)func_80387760, reinterpret_cast(s32, this->marker)); } break; } diff --git a/src/FP/code_2350.c b/src/FP/code_2350.c index 20ea323b..f29bfd0d 100644 --- a/src/FP/code_2350.c +++ b/src/FP/code_2350.c @@ -376,7 +376,7 @@ void func_803893E4(Actor *this, f32 arg1, u8 arg2){ void func_803895E0(void){ int i; - s16 *s0; + NodeProp *s0; f32 sp64[3]; Actor *actor; f32 f20; @@ -426,7 +426,7 @@ void func_803896FC(Actor *this){ func_8038B9B0(this->marker); this->unk38_31 = 0; func_80388C88(this); - func_802C3BF8(func_803895E0); + __spawnQueue_add_0(func_803895E0); if(jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2)){ local->unk19 = 2; this->unk4C = 900.0f; @@ -584,7 +584,7 @@ void func_803896FC(Actor *this){ case 1: //L80389F78 if(this->unk38_31 == 2){ if(jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2)){ - __spawnqueue_add_1(func_80388F54, this->marker); + __spawnQueue_add_1((GenMethod_1)func_80388F54, reinterpret_cast(s32, this->marker)); func_8038B9BC(); marker_despawn(this->marker); } diff --git a/src/FP/code_4400.c b/src/FP/code_4400.c index f123e751..4ef60418 100644 --- a/src/FP/code_4400.c +++ b/src/FP/code_4400.c @@ -54,7 +54,7 @@ void func_8038A890(void){ if(D_80392F30.unk1C){ func_802BAFE4(0x12); jiggySpawn(JIGGY_31_FP_SIR_SLUSH, D_80392F30.spawn_pos); - func_802C3F04(func_802C4140, ACTOR_4C_STEAM, + __spawnQueue_add_4((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, D_80392F30.spawn_pos[0]), reinterpret_cast(s32, D_80392F30.spawn_pos[1]), reinterpret_cast(s32, D_80392F30.spawn_pos[2]) diff --git a/src/FP/code_45D0.c b/src/FP/code_45D0.c index b4a8b9ac..5884e6fb 100644 --- a/src/FP/code_45D0.c +++ b/src/FP/code_45D0.c @@ -51,7 +51,7 @@ void func_8038AA60(void){ if(D_80392F50.unk18){ func_802BAFE4(0x11); jiggySpawn(JIGGY_2D_FP_SNOWMAN_BUTTONS, D_80392F50.spawn_pos); - func_802C3F04(func_802C4140, ACTOR_4C_STEAM, + __spawnQueue_add_4((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, D_80392F50.spawn_pos[0]), reinterpret_cast(s32, D_80392F50.spawn_pos[1]), reinterpret_cast(s32, D_80392F50.spawn_pos[2]) diff --git a/src/FP/code_4770.c b/src/FP/code_4770.c index b5709537..34d33ff9 100644 --- a/src/FP/code_4770.c +++ b/src/FP/code_4770.c @@ -115,7 +115,7 @@ void func_8038AC90(s32 indx, s32 arg1){ } void func_8038ADE4(s32 indx, s32 arg1){ - func_802C3D3C(func_8038AC90, indx, arg1); + __spawnQueue_add_2((GenMethod_2)func_8038AC90, indx, arg1); } void func_8038AE14(s32 indx){ @@ -164,7 +164,7 @@ void func_8038AEE0(s32 indx){ } void func_8038B00C(s32 indx){ - __spawnqueue_add_1(func_8038AEE0, indx); + __spawnQueue_add_1((GenMethod_1)func_8038AEE0, indx); } void func_8038B034(void){ @@ -438,7 +438,7 @@ void func_8038B9C8(void){ func_8038ADE4(0x26, 2); func_8038B034(); if(jiggyscore_isSpawned(JIGGY_30_FP_BOGGY_2) || jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2)){ - func_802C3BF8(func_8038B0F8); + __spawnQueue_add_0(func_8038B0F8); } D_803935A8.unk8 = -1; diff --git a/src/FP/code_5CC0.c b/src/FP/code_5CC0.c index b003b204..10161540 100644 --- a/src/FP/code_5CC0.c +++ b/src/FP/code_5CC0.c @@ -252,7 +252,7 @@ void func_8038C94C(ActorMarker *caller, enum asset_e text_id, s32 arg2){ Actor *this = marker_getActor(caller); if(!func_803203FC(UNKFLAGS1_C1_IN_FINAL_CHARACTER_PARADE)){ func_80328A84(this, 6); - __spawnqueue_add_1(func_8038C8F0, this->marker); + __spawnQueue_add_1((GenMethod_1)func_8038C8F0, reinterpret_cast(s32, this->marker)); } } @@ -280,7 +280,7 @@ void func_8038C9A0(Actor *this){ this->velocity_z = 0.0f; this->unk1C[0] = 0.0f; animctrl_setAnimTimer(this->animctrl, 0.0f); - func_8038C428(this, &D_8039207C, 0); + func_8038C428(this, D_8039207C, 0); return; } }//L8038CA9C diff --git a/src/FP/code_6AE0.c b/src/FP/code_6AE0.c index e9237432..a7e6fc03 100644 --- a/src/FP/code_6AE0.c +++ b/src/FP/code_6AE0.c @@ -368,7 +368,7 @@ void func_8038D6C8(Actor *this){ func_8038D324(this); if(actor_animationIsAt(this, 0.999f)) - __spawnqueue_add_1((GenMethod_1)func_8038D474, (s32)this->marker); + __spawnQueue_add_1((GenMethod_1)func_8038D474, (s32)this->marker); if(this->velocity[0] != 0.0f) break; @@ -381,7 +381,7 @@ void func_8038D6C8(Actor *this){ item_set(ITEM_6_HOURGLASS, TRUE); this->unk38_31 = 0xA; item_set(ITEM_24_TWINKLY_SCORE, this->unk38_31); - __spawnqueue_add_1((GenMethod_1)func_8038D41C, (s32)this->marker); + __spawnQueue_add_1((GenMethod_1)func_8038D41C, (s32)this->marker); this->unk60 = 0.0f; func_80347A14(0); func_802FAD64(ITEM_14_HEALTH); @@ -421,7 +421,7 @@ void func_8038D6C8(Actor *this){ if(0.96 < animctrl_getAnimTimer(this->animctrl)){ if(this->unk60 <= 0.0){ - __spawnqueue_add_1((GenMethod_1)func_8038D474, (s32)this->marker); + __spawnQueue_add_1((GenMethod_1)func_8038D474, (s32)this->marker); this->unk60 = 2.9f; } else{ diff --git a/src/FP/code_8E20.c b/src/FP/code_8E20.c index abfc56f2..73a61f7f 100644 --- a/src/FP/code_8E20.c +++ b/src/FP/code_8E20.c @@ -204,7 +204,7 @@ void FP_func_8038F7AC(Actor *this){ this->position[0] = local->unkC[0];\ this->position[1] = local->unkC[1];\ this->position[2] = local->unkC[2]; - __spawnqueue_add_1(FP_func_8038F758, this->marker); + __spawnQueue_add_1((GenMethod_1)FP_func_8038F758, reinterpret_cast(s32, this->marker)); local->unk30 = FALSE; } }//L8038F910 diff --git a/src/FP/code_A40.c b/src/FP/code_A40.c index a0f6a071..4215ec50 100644 --- a/src/FP/code_A40.c +++ b/src/FP/code_A40.c @@ -98,8 +98,8 @@ void chXmasTree_update(Actor *this){ func_8030DD14(this->unk44_31, 3); sfxsource_setSampleRate(this->unk44_31, 28000); } - func_802C3BF8(func_80386FB4); - __spawnqueue_add_1(FP_func_80386FE0, this->marker); + __spawnQueue_add_0(func_80386FB4); + __spawnQueue_add_1((GenMethod_1)FP_func_80386FE0, reinterpret_cast(s32, this->marker)); if(func_8031FF1C(0x13)){ func_80386F84(this); mapSpecificFlags_set(2, FALSE); diff --git a/src/FP/code_A500.c b/src/FP/code_A500.c index 50478ceb..b2a264ad 100644 --- a/src/FP/code_A500.c +++ b/src/FP/code_A500.c @@ -79,8 +79,8 @@ void func_80390B2C(ActorMarker *marker){ void func_80390B70(Actor *this){ func_80324E38(0.0f, 3); timed_setCameraToNode(0.0f, 0); - timedFunc_set_1(0.6f, (GenMethod_1)func_80390ABC, this->marker); - timedFunc_set_1(2.5f, func_80390B2C, this->marker); + timedFunc_set_1(0.6f, (GenMethod_1)func_80390ABC, reinterpret_cast(s32, this->marker)); + timedFunc_set_1(2.5f, (GenMethod_1)func_80390B2C, reinterpret_cast(s32, this->marker)); } void func_80390BDC(Actor *this){ diff --git a/src/FP/code_ABD0.c b/src/FP/code_ABD0.c index 454cdd64..0867ae83 100644 --- a/src/FP/code_ABD0.c +++ b/src/FP/code_ABD0.c @@ -228,7 +228,7 @@ void func_8039180C(Actor *this){ ActorMarker *sp24; if(!this->initialized){ - sp24 = func_80326EEC(0x254); + sp24 = actorArray_findActorFromActorId(0x254); if(sns_get_item_state(SNS_ITEM_ICE_KEY, 1) == 1){ marker_despawn(this->marker); } diff --git a/src/FP/code_B4D0.c b/src/FP/code_B4D0.c index e02f592a..3b43be73 100644 --- a/src/FP/code_B4D0.c +++ b/src/FP/code_B4D0.c @@ -13,7 +13,7 @@ void func_803918C0(void){ if(map_get() == MAP_7F_FP_WOZZAS_CAVE){ D_803935E0.unk0 = func_8030ED2C(SFX_128_FIRE_CRACKING, 2); func_8030DBB4(D_803935E0.unk0, 1.0f); - actor = func_80326EEC(0x353); + actor = actorArray_findActorFromActorId(0x353); if(actor){ D_803935E0.unk4[0] = actor->position_x; D_803935E0.unk4[1] = actor->position_y; diff --git a/src/GV/code_1570.c b/src/GV/code_1570.c index 60e647c4..6b130e35 100644 --- a/src/GV/code_1570.c +++ b/src/GV/code_1570.c @@ -130,7 +130,7 @@ Actor *chgobi2_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ sp3C[1] = this->yaw; sp3C[2] = this->roll; func_8033A238(func_803356A0(this->unk148)); - modelRender_preDraw(func_803253A0, this); + modelRender_preDraw((GenMethod_1)func_803253A0, (s32)this); modelRender_draw(gfx, mtx, this->position, sp3C, 1.0f, NULL, func_80330B1C(this_marker)); if(this->state == 4){ diff --git a/src/GV/code_230.c b/src/GV/code_230.c index 2a90d7a6..dc0c9bde 100644 --- a/src/GV/code_230.c +++ b/src/GV/code_230.c @@ -89,7 +89,7 @@ void func_803867F4(void){ func_802BAFE4(4); if(func_80304E24(0x148, sp24)){ jiggySpawn(JIGGY_46_GV_ANCIENT_ONES, sp24); - func_802C3F04((GenMethod_4)func_802C4140, 0x4C, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2])); + __spawnQueue_add_4((GenMethod_4)func_802C4140, 0x4C, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2])); } } @@ -183,10 +183,10 @@ void chancientone_update(Actor *this){ this->position_z += (sp38 & 2) ? 0xC : -0xC; if(this->unkF4_8 != 1){ if(sp38 == 6){ - func_802C3F04((GenMethod_4)func_802C4140, 0x4C, reinterpret_cast(s32, this->position_x), reinterpret_cast(s32, sp34), reinterpret_cast(s32, this->position_z)); + __spawnQueue_add_4((GenMethod_4)func_802C4140, 0x4C, reinterpret_cast(s32, this->position_x), reinterpret_cast(s32, sp34), reinterpret_cast(s32, this->position_z)); } if(sp38 == 4 && this->position_y < LOCAL_GV_230(this)->unk1C - 600.0f){ - func_802C3F04((GenMethod_4)func_802C4140, 0x11f, reinterpret_cast(s32, this->position_x), reinterpret_cast(s32, sp34), reinterpret_cast(s32, this->position_z)); + __spawnQueue_add_4((GenMethod_4)func_802C4140, 0x11f, reinterpret_cast(s32, this->position_x), reinterpret_cast(s32, sp34), reinterpret_cast(s32, this->position_z)); }//L80386D80 } if(LOCAL_GV_230(this)->unk1C <= this->position_y){ diff --git a/src/GV/code_24D0.c b/src/GV/code_24D0.c index aa3bbcee..dff90f3e 100644 --- a/src/GV/code_24D0.c +++ b/src/GV/code_24D0.c @@ -41,7 +41,7 @@ void chgobirope_update(Actor *this){ this->unk16C_4 = TRUE; this->marker->propPtr->unk8_3 = TRUE; actor_collisionOff(this); - sp2C = func_80326D68(this->position, ACTOR_12E_GOBI_1, -1, &sp28); + sp2C = actorArray_findClosestActorFromActorId(this->position, ACTOR_12E_GOBI_1, -1, &sp28); if(sp2C){ this->position_x = sp2C->position_x; this->position_y = sp2C->position_y; diff --git a/src/GV/code_2730.c b/src/GV/code_2730.c index dbf62d3a..7c92c9ac 100644 --- a/src/GV/code_2730.c +++ b/src/GV/code_2730.c @@ -71,7 +71,7 @@ Actor *func_80388C64(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ sp3C[0] = this->pitch; sp3C[1] = this->yaw; sp3C[2] = this->roll; - modelRender_preDraw(func_803253A0, this); + modelRender_preDraw((GenMethod_1)func_803253A0, (s32) this); func_8033A450(func_80329934()); modelRender_draw(gfx, mtx, this->position, sp3C, 1.0f, NULL,func_80330B1C(this_marker)); func_8034A174(func_80329934(), 5, local->unk0); @@ -105,7 +105,7 @@ void func_80388DC8(Actor *this){ local->unkC = particleEmitter_new(20); local->unk10 = particleEmitter_new(30); GV_D_80391A60 = FALSE; - sp28 = func_80326D68(this->position, ACTOR_12E_GOBI_1, -1, &sp2C); + sp28 = actorArray_findClosestActorFromActorId(this->position, ACTOR_12E_GOBI_1, -1, &sp2C); if(sp28){ this->position_x = sp28->position_x; this->position_y = sp28->position_y; diff --git a/src/GV/code_2EE0.c b/src/GV/code_2EE0.c index f6a5690e..a5783d98 100644 --- a/src/GV/code_2EE0.c +++ b/src/GV/code_2EE0.c @@ -23,13 +23,13 @@ Actor *func_803892D0(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ f32 position[3]; Actor *this; - this = func_80325300(this_marker, rotation); + this = marker_getActorAndRotation(this_marker, rotation); if(this->unk1C[2] != 0.0f){ position[0] = this->position_x; position[1] = this->position_y; position[2] = this->position_z; position[1] += 8.0f; - modelRender_preDraw(func_803253A0, this); + modelRender_preDraw((GenMethod_1)func_803253A0, (s32)this); modelRender_draw(gfx, mtx, position, rotation, this->unk1C[0], NULL, func_80330B1C(this_marker)); } return this; diff --git a/src/GV/code_3D90.c b/src/GV/code_3D90.c index 931deb3a..02901acb 100644 --- a/src/GV/code_3D90.c +++ b/src/GV/code_3D90.c @@ -70,7 +70,7 @@ void func_8038A31C(Actor *this){ if(!this->unk16C_4){ this->unk16C_4 = TRUE; actor_collisionOff(this); - __spawnqueue_add_1((GenMethod_1)func_8038A2C0, reinterpret_cast(s32, this->marker)); + __spawnQueue_add_1((GenMethod_1)func_8038A2C0, reinterpret_cast(s32, this->marker)); this->velocity[0] = 0.0f; } diff --git a/src/GV/code_43B0.c b/src/GV/code_43B0.c index ce995817..68f96fdc 100644 --- a/src/GV/code_43B0.c +++ b/src/GV/code_43B0.c @@ -68,7 +68,7 @@ void func_8038A948(Actor *this){ this->initialized = TRUE; this->marker->propPtr->unk8_3 = TRUE; actor_collisionOff(this); - __spawnqueue_add_1((GenMethod_1)func_8038A8CC, (s32)this->marker); + __spawnQueue_add_1((GenMethod_1)func_8038A8CC, (s32)this->marker); this->velocity_y = 0.0f; } } @@ -84,7 +84,7 @@ void GV_func_8038A9C0(Actor *this){ this->unk16C_4 = TRUE; this->marker->propPtr->unk8_3 = TRUE; actor_collisionOff(this); - __spawnqueue_add_1((GenMethod_1)func_8038A8CC, (s32)this->marker); + __spawnQueue_add_1((GenMethod_1)func_8038A8CC, (s32)this->marker); sp24 = subaddie_getLinkedActor(this); this->unk1C[1] = this->unk48; this->pitch = 0.0f; diff --git a/src/GV/code_5570.c b/src/GV/code_5570.c index 64d53f82..a1cd589d 100644 --- a/src/GV/code_5570.c +++ b/src/GV/code_5570.c @@ -73,7 +73,7 @@ s32 func_8038BAA4(Actor *jiggy){ sp18[0] = (s32)jiggy->position_x; sp18[1] = (s32)jiggy->position_y; sp18[2] = (s32)jiggy->position_z; - tmp_v0 = func_80307164(sp18, jiggy); + tmp_v0 = func_80307164(sp18); if( tmp_v0 < 0) return 0; else @@ -198,7 +198,7 @@ void GV_func_8038BEA0(Actor *this){ this->unk38_31 = 0; D_80391A80 = this->state; func_802BB3DC(0, 14.0f, 0.92f); - func_802C3F04((GenMethod_4)func_802C4140, 0x11f, + __spawnQueue_add_4((GenMethod_4)func_802C4140, 0x11f, reinterpret_cast(s32, this->position_x), reinterpret_cast(s32, this->position_y), reinterpret_cast(s32, this->position_z) ); } diff --git a/src/GV/code_6370.c b/src/GV/code_6370.c index e7a2de6f..9dec4d80 100644 --- a/src/GV/code_6370.c +++ b/src/GV/code_6370.c @@ -50,13 +50,13 @@ void func_8038C760(Actor *this, s32 arg1){ timed_setCameraToNode(0.0f, 8); if(arg1 < 3){ timed_setCameraToNode(3.5f, arg1 + 0x15); - timedFunc_set_3(3.5f, (TFQM3)func_80320044, BKPROG_F8_KING_SANDYBUTT_PYRAMID_STATE, arg1, 2); + timedFunc_set_3(3.5f, (GenMethod_3)func_80320044, BKPROG_F8_KING_SANDYBUTT_PYRAMID_STATE, arg1, 2); func_80324E88(6.5f); func_80324E38(6.5f, 0); } else{ - timedFunc_set_2(3.5f, (TFQM2)func_8025A6EC, COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7fff); - timedFunc_set_3(3.5f, (TFQM3)func_80320044, BKPROG_F8_KING_SANDYBUTT_PYRAMID_STATE, arg1, 2); + timedFunc_set_2(3.5f, (GenMethod_2)func_8025A6EC, COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7fff); + timedFunc_set_3(3.5f, (GenMethod_3)func_80320044, BKPROG_F8_KING_SANDYBUTT_PYRAMID_STATE, arg1, 2); func_80324E88(6.0f); func_80324E38(6.0f, 0); } @@ -181,7 +181,7 @@ void func_8038CC98(Actor *this){ } if(!local->unk14){ - local->unk14 = func_80326EEC(ACTOR_31D_SANDYBUTT_PYRAMID)->marker; + local->unk14 = actorArray_findActorFromActorId(ACTOR_31D_SANDYBUTT_PYRAMID)->marker; } if(this->state == 1){ diff --git a/src/GV/code_7FF0.c b/src/GV/code_7FF0.c index 0f173cee..506916d5 100644 --- a/src/GV/code_7FF0.c +++ b/src/GV/code_7FF0.c @@ -448,7 +448,7 @@ void func_8038F028(UNK_TYPE(s32) arg0, ActorMarker *arg1, s32 arg2, s32 arg3){ sp24[0] = (f32)arg1->propPtr->x; sp24[1] = (f32)arg1->propPtr->y; sp24[2] = (f32)arg1->propPtr->z; - func_802C3F04((GenMethod_4)func_802C4140, 0x4e, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2])); + __spawnQueue_add_4((GenMethod_4)func_802C4140, 0x4e, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2])); func_8025A6EC(COMUSIC_2B_DING_B, 22000); if(mapSpecificFlags_get(arg3)){ timedFunc_set_0(2.0f, func_8038F004); diff --git a/src/GV/code_9130.c b/src/GV/code_9130.c index 3db2e63f..608c7206 100644 --- a/src/GV/code_9130.c +++ b/src/GV/code_9130.c @@ -96,9 +96,9 @@ void __chmazectrl_setState(Actor *this, s32 next_state){ if(next_state == 3){ func_80324E38(0.0f, 3); - timedFunc_set_2(0.0f, (TFQM2)func_8025A6EC, COMUSIC_3E_SANDYBUTT_FAILURE, 0x7FFF); - timedFunc_set_2(1.0f, (TFQM2)__chmazectrl_markerSetState, reinterpret_cast(s32, this->marker), 6); - timedFunc_set_2(2.0f, (TFQM2)__chmazectrl_markerSetState, reinterpret_cast(s32, this->marker), 4); + timedFunc_set_2(0.0f, (GenMethod_2)func_8025A6EC, COMUSIC_3E_SANDYBUTT_FAILURE, 0x7FFF); + timedFunc_set_2(1.0f, (GenMethod_2)__chmazectrl_markerSetState, reinterpret_cast(s32, this->marker), 6); + timedFunc_set_2(2.0f, (GenMethod_2)__chmazectrl_markerSetState, reinterpret_cast(s32, this->marker), 4); }//L8038F850 if(next_state == 4){ diff --git a/src/GV/code_9DB0.c b/src/GV/code_9DB0.c index d9c0145d..9cae4e9e 100644 --- a/src/GV/code_9DB0.c +++ b/src/GV/code_9DB0.c @@ -128,7 +128,7 @@ void func_8039040C(void){ D_80391AE0.tile2_4 = NULL; D_80391AE0.state_9 = 1; D_80391AE0.unkC = 0.0f; - actor = func_80326EEC(0x34f); + actor = actorArray_findActorFromActorId(0x34f); if(actor){ D_80391AE0.unk10 = actor->marker; } diff --git a/src/MM/ch/conga.c b/src/MM/ch/conga.c index a0a612ea..247c9a43 100644 --- a/src/MM/ch/conga.c +++ b/src/MM/ch/conga.c @@ -223,12 +223,12 @@ void func_803876D0(Actor *this){ func_80304D4C(sp40, &((ActorLocal_Conga *)&this->local)->unk10); } if(0.0f == this->unk28){ - this->unk28 = (func_80326CCC(0x36) != NULL)? 2.0f: 1.0f; + this->unk28 = (actorArray_findActorFromMarkerId(MARKER_36_ORANGE_COLLECTABLE) != NULL)? 2.0f: 1.0f; } if(0.0f != this->velocity_x){ this->velocity_x -= 1.0f; if(0.0f == this->velocity_x){ - __spawnqueue_add_1((GenMethod_1)func_80387100, (s32)this->marker); + __spawnQueue_add_1((GenMethod_1)func_80387100, (s32)this->marker); } } marker_setCollisionScripts(this->marker, NULL, NULL, func_80387168); @@ -369,6 +369,6 @@ void func_803876D0(Actor *this){ || (this->state == 7 && actor_animationIsAt(this, 0.468f)) ){ func_8034A1B4(this->marker->unk44, 5, &this->local); - __spawnqueue_add_1((GenMethod_1)func_803873C8, (s32)this->marker); //spawn orange + __spawnQueue_add_1((GenMethod_1)func_803873C8, (s32)this->marker); //spawn orange } } diff --git a/src/MM/ch/hut.c b/src/MM/ch/hut.c index af386fc8..97449214 100644 --- a/src/MM/ch/hut.c +++ b/src/MM/ch/hut.c @@ -92,10 +92,10 @@ void chhut_update(Actor *this){ func_8030E484(SFX_5B_HEAVY_STUFF_FALLING); func_80328A84(this, 1); actor_playAnimationOnce(this); - __spawnqueue_add_1((GenMethod_1)func_803869EC, (s32)this->marker); + __spawnQueue_add_1((GenMethod_1)func_803869EC, (s32)this->marker); func_802C8F70(this->yaw); if(D_8037DCB0 < 5){ - func_802C3F04(func_802C4218, D_803898D8[D_8037DCB0], *(s32*)(&sp3C[0]),*(s32*)(&sp3C[1]),*(s32*)(&sp3C[2])); + __spawnQueue_add_4((GenMethod_4)func_802C4218, D_803898D8[D_8037DCB0], *(s32*)(&sp3C[0]),*(s32*)(&sp3C[1]),*(s32*)(&sp3C[2])); } else{ jiggySpawn(JIGGY_5_MM_HUTS, sp3C); diff --git a/src/MM/ch/juju.c b/src/MM/ch/juju.c index 8d15963f..930b91a6 100644 --- a/src/MM/ch/juju.c +++ b/src/MM/ch/juju.c @@ -48,7 +48,7 @@ Actor* func_80389014(ActorMarker *this, Gfx **dl, Mtx **mPtr, Vtx **arg2){ Actor * actorPtr; ActorLocal_Juju_2 *jujuPtr; - actorPtr = func_80325300(this, sp34); + actorPtr = marker_getActorAndRotation(this, sp34); jujuPtr = (ActorLocal_Juju_2 *)&actorPtr->local; if(jujuPtr->unk0 != 2){ modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL); @@ -92,7 +92,7 @@ void func_803891E8(s32 x, s32 y, s32 z, s32 yaw){ } void func_80389244(s32 x, s32 y, s32 z, s32 yaw){ - func_802C3F04(func_803891E8, x, y, z, yaw); + __spawnQueue_add_4((GenMethod_4)func_803891E8, x, y, z, yaw); func_802BB3DC(0, 10.0f, 0.8f); gcpausemenu_80314AC8(1); } diff --git a/src/MM/ch/jujuhitbox.c b/src/MM/ch/jujuhitbox.c index e346d750..5c3080ec 100644 --- a/src/MM/ch/jujuhitbox.c +++ b/src/MM/ch/jujuhitbox.c @@ -59,7 +59,7 @@ void func_80388BEC(NodeProp *arg0, ActorMarker *arg1){ sp20[0] = (f32)arg0->x; sp20[1] = (f32)arg0->y; sp20[2] = (f32)arg0->z; - sp30 = func_80326D68(sp20, 0x11, -1, &sp34); + sp30 = actorArray_findClosestActorFromActorId(sp20, 0x11, -1, &sp34); if( sp30 != NULL && !( sp34 > 500.0f ) && (sp30->state ==3) @@ -71,7 +71,7 @@ void func_80388BEC(NodeProp *arg0, ActorMarker *arg1){ ((ActorLocal_JujuHitbox *)&sp30->local)->unk4++; func_803892A8(((ActorLocal_JujuHitbox *)&sp30->local)->unk8); func_80353580(arg1); - func_802C3F04((GenMethod_4)func_802C4140, 0x58, *(s32 *)&sp20[0], *(s32 *)&sp20[1], *(s32 *)&sp20[2]); + __spawnQueue_add_4((GenMethod_4)func_802C4140, 0x58, *(s32 *)&sp20[0], *(s32 *)&sp20[1], *(s32 *)&sp20[2]); } } } @@ -123,7 +123,7 @@ void func_80388E20(Actor *this){ } if(!this->unk16C_4){ this->unk16C_4 = 1; - func_802C3D3C(func_80388DFC,this->marker, jujuCtlPtr->unk4); + __spawnQueue_add_2((GenMethod_2)func_80388DFC,this->marker, jujuCtlPtr->unk4); func_80388D14(this); }else{ if( func_80329530(this, 0xfa) diff --git a/src/MM/ch/orangepad.c b/src/MM/ch/orangepad.c index 1c4d5d5e..3228a654 100644 --- a/src/MM/ch/orangepad.c +++ b/src/MM/ch/orangepad.c @@ -28,8 +28,8 @@ void MM_func_803863F0(s32 x, s32 y, s32 z){ } void func_80386444(ActorMarker *arg0){ - f32 sp54; - Actor *actor; + f32 orange_pad_distance; + Actor *orange_pad; f32 sp44[3]; ParticleEmitter *s0; s32 temp_a0; @@ -37,27 +37,30 @@ void func_80386444(ActorMarker *arg0){ sp44[0] = arg0->propPtr->x; sp44[1] = arg0->propPtr->y; sp44[2] = arg0->propPtr->z; - actor = func_80326D68(sp44, 0x57, 1, &sp54); + orange_pad = actorArray_findClosestActorFromActorId(sp44, ACTOR_57_ORANGE_PAD, 1, &orange_pad_distance); - if(actor && !(500.0f < sp54)){ - actor->state = 1; - if(func_80326D68(sp44, 0x57, 1, &sp54)){ + if(orange_pad && !(500.0f < orange_pad_distance)){ + orange_pad->state = 1; + if(actorArray_findClosestActorFromActorId(sp44, ACTOR_57_ORANGE_PAD, 1, &orange_pad_distance)){ func_8025A6EC(COMUSIC_2B_DING_B, 22000); }else{ - temp_a0 = (actor->unk78_13 == 0x106) ? 0x10 : (actor->unk78_13 == 0x76) ? 0xf : 0xe; + temp_a0 = (orange_pad->unk78_13 == 0x106) ? 0x10 + : (orange_pad->unk78_13 == 0x76) ? 0xf + : 0xe; func_802BAFE4(temp_a0); sp44[1] += 50.0f; - timedFunc_set_3(0.6f, (TFQM3) MM_func_803863F0, (s32)sp44[0], (s32)sp44[1], (s32)sp44[2]); + timedFunc_set_3(0.6f, (GenMethod_3) MM_func_803863F0, (s32)sp44[0], (s32)sp44[1], (s32)sp44[2]); func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7FFF); if(!jiggyscore_isCollected(JIGGY_8_MM_ORANGE_PADS)){ func_80311480(0xB3B, 4, NULL, NULL, NULL, NULL); } }// L803865D8 - s0 = partEmitList_pushNew(0x1e); - particleEmitter_setPosition(s0, actor->position); + //emmit sparkles + s0 = partEmitList_pushNew(30); + particleEmitter_setPosition(s0, orange_pad->position); particleEmitter_setModel(s0, 0x89f); func_802EFB70(s0, 0.09f, 0.19f); func_802EFB84(s0, 0.0f, 0.0f); @@ -81,7 +84,7 @@ void func_80386444(ActorMarker *arg0){ func_802EF9F8(s0, 0.01f); func_802EFA18(s0, 3); func_802EFA20(s0, 1.0f, 1.3f); - particleEmitter_emitN(s0, 0x1e); + particleEmitter_emitN(s0, 30); } } @@ -102,7 +105,7 @@ void func_80386768(Actor * this){ }//L803867B0 if(!this->unk16C_4){ - this->unk100 = func_80326D68(this->position, 8,-1, &sp34)->marker; + this->unk100 = actorArray_findClosestActorFromActorId(this->position, 8,-1, &sp34)->marker; this->unk16C_4 = 1; }//L803867E0 diff --git a/src/MMM/ch/motzhand.c b/src/MMM/ch/motzhand.c index 6819b184..3ab6798b 100644 --- a/src/MMM/ch/motzhand.c +++ b/src/MMM/ch/motzhand.c @@ -152,7 +152,7 @@ void chmotzhand_update(Actor *this){ func_80387410(sp30); } else{ - func_80389BCC(*local->pattern_ptr, sp30); + organMinigame_getKeyPosition(*local->pattern_ptr, sp30); sp30[0] += local->unkC[0]; sp30[1] += local->unkC[1]; sp30[2] += local->unkC[2]; diff --git a/src/MMM/ch/napper.c b/src/MMM/ch/napper.c index 4dc7477b..0791e074 100644 --- a/src/MMM/ch/napper.c +++ b/src/MMM/ch/napper.c @@ -120,7 +120,7 @@ void chnapper_update(Actor *this){ }//L80386CBC if(this->state == 0){ - jiggy = func_80326EEC(ACTOR_46_JIGGY); + jiggy = actorArray_findActorFromActorId(ACTOR_46_JIGGY); if(jiggy){ local->jiggy_marker = jiggy->marker; this->position_x = jiggy->position_x;\ @@ -222,4 +222,4 @@ void chnapper_update(Actor *this){ if(0.99 <= this->unk48) marker_despawn(this->marker); } -} \ No newline at end of file +} diff --git a/src/MMM/code_16B0.c b/src/MMM/code_16B0.c index 1858bca9..f849f118 100644 --- a/src/MMM/code_16B0.c +++ b/src/MMM/code_16B0.c @@ -126,7 +126,7 @@ void func_80387DF8(f32 position[3], s32 count, enum asset_e sprite_id) { ParticleEmitter *pCtrl; pCtrl = partEmitList_pushNew(count); - func_802EFFA8(pCtrl, &D_8038BAF4); + func_802EFFA8(pCtrl, D_8038BAF4); particleEmitter_setSprite(pCtrl, sprite_id); particleEmitter_setPosition(pCtrl, position); particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_8038BB28); @@ -184,7 +184,7 @@ void func_80388028(Actor *this){ this->unk16C_4 = TRUE; this->unk16C_0 = TRUE; marker_setCollisionScripts(this->marker, NULL, MMM_func_80387CF4, func_80387D1C); - __spawnqueue_add_1(func_80387D48, this->marker); + __spawnQueue_add_1((GenMethod_1)func_80387D48, reinterpret_cast(s32, this->marker)); func_80387B14(this, (this->state < 5) ? 1 : 6); }//L803880B4 diff --git a/src/MMM/code_3420.c b/src/MMM/code_3420.c index 1ed338bb..7450c60b 100644 --- a/src/MMM/code_3420.c +++ b/src/MMM/code_3420.c @@ -15,7 +15,7 @@ typedef struct { u8 unk1; } Struct_MMM_3420_1; -void func_80389A0C(s32 arg0); +void organMinigame_setState(s32 arg0); /* .data */ Struct_MMM_3420_0 D_8038BF20[] = { @@ -136,28 +136,28 @@ f32 D_8038C1E0[3] = {0.0f, 3250.0f, -3200.0f}; //jiggy spawn position /* .bss */ extern struct { s32 unk0; - ActorMarker *unk4; //motzhand_marker + ActorMarker *motzhand_marker; Struct_MMM_3420_0 *unk8; - u8 unkC; //state - u8 unkD; //pattern id + u8 state; + u8 pattern; //u8 padE[2]; u8 *unk10; }D_8038C4F0; /* .code */ void MMM_func_80389810(ActorMarker *caller, enum asset_e text_id, s32 arg2) { - switch (D_8038C4F0.unkC) { + switch (D_8038C4F0.state) { case 2: - func_80389A0C(3); + organMinigame_setState(3); return; case 4: - func_80389A0C(1); + organMinigame_setState(1); return; case 5: - func_80389A0C(3); + organMinigame_setState(3); return; case 6: - func_80389A0C(7); + organMinigame_setState(7); return; } } @@ -186,15 +186,15 @@ void func_80389910() { void func_803899BC(void){ func_80324E38(0.0f, 3); - timedFunc_set_2(0.0f, (TFQM2)func_8025A6EC, COMUSIC_38_MOTZAND_BEATEN, 0x7fff); + timedFunc_set_2(0.0f, (GenMethod_2)func_8025A6EC, COMUSIC_38_MOTZAND_BEATEN, 0x7fff); timedFunc_set_0(2.25f, func_80389910); } -void func_80389A0C(s32 next_state){ +void organMinigame_setState(s32 next_state){ func_8028F8F8(1, FALSE); if(next_state == 2){ - if(D_8038C4F0.unkD == 0){ - D_8038C4F0.unkD = 1; + if(D_8038C4F0.pattern == 0){ + D_8038C4F0.pattern = 1; func_80311480(0xad3, 4, NULL, NULL, MMM_func_80389810, NULL); } else{//L80389A84 @@ -204,34 +204,34 @@ void func_80389A0C(s32 next_state){ if(next_state == 3){ D_8038C4F0.unk0 = 0; - if(D_8038C4F0.unkD == 1){ + if(D_8038C4F0.pattern == 1){ D_8038C4F0.unk10 = D_8038C1CC; } else{ D_8038C4F0.unk10 = D_8038C1D4; } func_8028F8F8(1, TRUE); - func_803876C8(D_8038C4F0.unk4, D_8038C4F0.unkD); + func_803876C8(D_8038C4F0.motzhand_marker, D_8038C4F0.pattern); }//L80389AF4 if(next_state == 4){ func_80311480(0xadd, 4, NULL, NULL, MMM_func_80389810, NULL); - func_80387720(D_8038C4F0.unk4); + func_80387720(D_8038C4F0.motzhand_marker); } if(next_state == 5){ - D_8038C4F0.unkD++; + D_8038C4F0.pattern++; func_80311480(0xad4, 4, NULL, NULL, MMM_func_80389810, NULL); - func_80387720(D_8038C4F0.unk4); + func_80387720(D_8038C4F0.motzhand_marker); } if(next_state == 6){ MMM_func_803898C8(); timedFunc_set_0(1.25f, func_803899BC); - func_80387654(D_8038C4F0.unk4); + func_80387654(D_8038C4F0.motzhand_marker); } - D_8038C4F0.unkC = next_state; + D_8038C4F0.state = next_state; } s32 func_80389BBC(void){ @@ -239,7 +239,7 @@ s32 func_80389BBC(void){ } //organCtrl_getKeyPosition -void func_80389BCC(s32 key_indx, f32 position[3]) { +void organMinigame_getKeyPosition(s32 key_indx, f32 position[3]) { Struct_MMM_3420_1 *iPtr; s32 is_black_key; @@ -271,16 +271,16 @@ void MMM_func_80389CD8() {} void func_80389CE0() {} int func_80389CE8(s32 arg0, s32 arg1, s32 arg2){ - if(D_8038C4F0.unkC == 3){ + if(D_8038C4F0.state == 3){ if(*D_8038C4F0.unk10 == arg2){ D_8038C4F0.unk0--; D_8038C4F0.unk10++; if(*D_8038C4F0.unk10 == 0){ - if(D_8038C4F0.unkD == 1){ - func_80389A0C(5); + if(D_8038C4F0.pattern == 1){ + organMinigame_setState(5); } else{ - func_80389A0C(6); + organMinigame_setState(6); } } return 1; @@ -307,10 +307,10 @@ void func_80389DF4(s32 arg0, s32 arg1) { D_8038C4F0.unk8 = &D_8038BF20; func_80250170(0, 0x6A, 0); - D_8038C4F0.unkC = 0; + D_8038C4F0.state = 0; if ((map_get() == MAP_1C_MMM_CHURCH) && (arg1 == 2)) { - D_8038C4F0.unk4 = NULL; - D_8038C4F0.unkD = 0; + D_8038C4F0.motzhand_marker = NULL; + D_8038C4F0.pattern = 0; key_position[0] = -1345.0f; key_position[1] = 1150.0f; key_position[2] = -2300.0f; @@ -329,24 +329,24 @@ void func_80389DF4(s32 arg0, s32 arg1) { } } if (jiggyscore_isSpawned(JIGGY_60_MMM_MOTZHAND)) { - func_80389A0C(7); + organMinigame_setState(7); return; } - func_80389A0C(1); + organMinigame_setState(1); } } -void func_80389FC0(void){ +void organMinigame_update(void){ UNK_TYPE(u32) sp4C; - f32 sp48; + f32 motzhand_dist; Actor *motzhand; f32 sp38[3]; f32 plyr_pos[3]; Actor *motzhand_2; - if(D_8038C4F0.unkC == 0) return; + if(D_8038C4F0.state == 0) return; if(func_802501A0(0, 0x6A, &sp4C)){ func_80250170(0, 0x6A, 0); @@ -356,25 +356,25 @@ void func_80389FC0(void){ } }//L8038A02C - if(D_8038C4F0.unkC == 1 && D_8038C4F0.unk4 == NULL){ + if(D_8038C4F0.state == 1 && D_8038C4F0.motzhand_marker == NULL){ sp38[0] = sp38[1] = sp38[2] = 0.0f; - motzhand = func_80326D68(sp38, ACTOR_3A_MOTZHAND, -1, &sp48); - D_8038C4F0.unk4 = motzhand->marker; + motzhand = actorArray_findClosestActorFromActorId(sp38, ACTOR_3A_MOTZHAND, -1, &motzhand_dist); + D_8038C4F0.motzhand_marker = motzhand->marker; }//L8038A078 - if(D_8038C4F0.unkC == 1 || D_8038C4F0.unkC == 3){ - if(func_8038769C(D_8038C4F0.unk4)){ + if(D_8038C4F0.state == 1 || D_8038C4F0.state == 3){ + if(func_8038769C(D_8038C4F0.motzhand_marker)){ player_getPosition(plyr_pos); - motzhand_2 = marker_getActor(D_8038C4F0.unk4); + motzhand_2 = marker_getActor(D_8038C4F0.motzhand_marker); if( ml_vec3f_distance(motzhand_2->position, plyr_pos) < 400.0f && motzhand_2->position_y - 50.0f <= plyr_pos[1] ){ - func_80389A0C(2); + organMinigame_setState(2); } } }//L8038A104 - if(D_8038C4F0.unkC == 3 && D_8038C4F0.unk0 >= 3){ - func_80389A0C(4); + if(D_8038C4F0.state == 3 && D_8038C4F0.unk0 >= 3){ + organMinigame_setState(4); } } diff --git a/src/MMM/code_47D0.c b/src/MMM/code_47D0.c index 100567e2..4651c0fa 100644 --- a/src/MMM/code_47D0.c +++ b/src/MMM/code_47D0.c @@ -82,7 +82,7 @@ void MMM_func_8038ADF0(Struct_MMM_47D0_0 *arg0, Struct68s *arg1) { func_8030E2C4(sp3F); func_8035179C(arg1, sp28); sp38 = 500.0f; - jiggy = func_80326D68(sp28, ACTOR_46_JIGGY, -1, &sp38); + jiggy = actorArray_findClosestActorFromActorId(sp28, ACTOR_46_JIGGY, -1, &sp38); if (jiggy != NULL) { arg0->unk0 = jiggy->marker; } else { diff --git a/src/MMM/code_DC0.c b/src/MMM/code_DC0.c index acb0213d..c22e31e0 100644 --- a/src/MMM/code_DC0.c +++ b/src/MMM/code_DC0.c @@ -91,4 +91,4 @@ bool MMM_func_80387340(ActorMarker *marker){ } func_803871D4(sp1C); return TRUE; -} \ No newline at end of file +} diff --git a/src/MMM/crc.c b/src/MMM/crc.c index bec39d98..46460c53 100644 --- a/src/MMM/crc.c +++ b/src/MMM/crc.c @@ -3,4 +3,4 @@ u32 D_8038C300 = 0x00146061; u32 D_8038C304 = 0xEC79D7B4; u32 D_8038C308 = 0x0001B98D; -u32 D_8038C30C = 0x0; \ No newline at end of file +u32 D_8038C30C = 0x0; diff --git a/src/RBB/code_0.c b/src/RBB/code_0.c index 60ae4a1d..85095a8a 100644 --- a/src/RBB/code_0.c +++ b/src/RBB/code_0.c @@ -94,7 +94,7 @@ void func_803865D0(ActorMarker *marker){ ActorLocal_RBB_0 * local = (ActorLocal_RBB_0 *) &actor->local; RBB_func_803863F0(actor, 1); timed_setCameraToNode(0.0f, D_80390074[local->unk4].unk0); - timedFunc_set_2(0.75*D_80390074[local->unk4].unk4, (TFQM2) func_803865A4, actor->marker, 4); + timedFunc_set_2(0.75*D_80390074[local->unk4].unk4, (GenMethod_2) func_803865A4, actor->marker, 4); func_80324E88(0.75*D_80390074[local->unk4].unk4); func_80324E38(0.75*D_80390074[local->unk4].unk4, 0); timed_playSfx(D_80390074[local->unk4].unk4, SFX_7F_HEAVYDOOR_SLAM, 0.8f, 0x7fd0); @@ -113,7 +113,7 @@ void func_803866F4(Actor *this, s32 arg1){ local->unk8++; func_8025A6EC(COMUSIC_2B_DING_B, 28000); func_80324E38(0.0f, 3); - timedFunc_set_2(0.5f, (TFQM2) func_8025A6EC, COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); + timedFunc_set_2(0.5f, (GenMethod_2) func_8025A6EC, COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); timedFunc_set_1(1.0f, (GenMethod_1) func_803865D0, this->marker); }//L803867D4 if(arg1 == 4){ @@ -166,4 +166,4 @@ void func_803868F0(Actor *this){ } } -} \ No newline at end of file +} diff --git a/src/RBB/code_1570.c b/src/RBB/code_1570.c index 301ec944..5e91bc94 100644 --- a/src/RBB/code_1570.c +++ b/src/RBB/code_1570.c @@ -187,15 +187,15 @@ void func_80387F88(ActorMarker *marker){ timed_playSfx(3.0f, SFX_1A_BIG_THINGS_FALL_OVER, 0.6f, 22000); func_80324E88(4.0f); func_80324E38(4.0f, 0); - timedFunc_set_2(4.0f, (TFQM2) RBB_func_80387F18, (s32) actor->marker, 3); + timedFunc_set_2(4.0f, (GenMethod_2) RBB_func_80387F18, (s32) actor->marker, 3); } void func_80388154(ActorMarker *marker){ Actor *actor = marker_getActor(marker); func_803879F0(); - timedFunc_set_0(0.0f, (TFQM0) RBB_func_80387F44); + timedFunc_set_0(0.0f, (GenMethod_0) RBB_func_80387F44); timed_playSfx(0.0f, SFX_7F_HEAVYDOOR_SLAM, 1.0f, 0x7fc6); - timedFunc_set_2(1.2f, (TFQM2) func_80387B8C, 0x19f, 0); + timedFunc_set_2(1.2f, (GenMethod_2) func_80387B8C, 0x19f, 0); timed_setCameraToNode(1.2f, 8); timedFunc_set_1(1.5f, (GenMethod_1) func_80387F88, (s32) actor->marker); } @@ -204,8 +204,8 @@ void func_803881E8(Actor *this, s32 arg1){ this->state = arg1; if(this->state == 2){ RBB_func_80387960(0.05f); - timedFunc_set_2(0.05f, (TFQM2)func_80387BEC, 0x19f, 0x1f4); - timedFunc_set_2(0.1f, (TFQM2)func_8025A6EC, COMUSIC_2B_DING_B, 28000); + timedFunc_set_2(0.05f, (GenMethod_2)func_80387BEC, 0x19f, 0x1f4); + timedFunc_set_2(0.1f, (GenMethod_2)func_8025A6EC, COMUSIC_2B_DING_B, 28000); func_80324E38(0.2f, 3); timed_setCameraToNode(1.1f, 7); timedFunc_set_1(1.6f, (GenMethod_1)func_80388154, (s32)this->marker); @@ -233,4 +233,4 @@ void RBB_func_803882F4(Actor *this){ func_803881E8(this, 1); } } -} \ No newline at end of file +} diff --git a/src/RBB/code_36A0.c b/src/RBB/code_36A0.c index 07c8968a..f3399e9b 100644 --- a/src/RBB/code_36A0.c +++ b/src/RBB/code_36A0.c @@ -93,11 +93,11 @@ void func_80389C78(Actor *this){ if(levelSpecificFlags_get(local->unk8 ? 4 : 3)){ set_camera_to_node(9); func_80324E38(0.0f, 3); - timedFunc_set_2(0.1f, (TFQM2)levelSpecificFlags_set, local->unk8 ? 0x28 : 0x27, 1); + timedFunc_set_2(0.1f, (GenMethod_2)levelSpecificFlags_set, local->unk8 ? 0x28 : 0x27, 1); func_80324E88(4.5f); func_80324E38(4.5f, 0); - timedFunc_set_2(4.5f, (TFQM2)levelSpecificFlags_set, local->unk8 ? 0x4 : 0x3, 0); - timedFunc_set_3(4.5f, (TFQM3)func_802E4078, MAP_34_RBB_ENGINE_ROOM, !local->unk8 ? 3 : 2, 0); + timedFunc_set_2(4.5f, (GenMethod_2)levelSpecificFlags_set, local->unk8 ? 0x4 : 0x3, 0); + timedFunc_set_3(4.5f, (GenMethod_3)func_802E4078, MAP_34_RBB_ENGINE_ROOM, !local->unk8 ? 3 : 2, 0); func_803228D8(); } }//L80389EA8 @@ -126,4 +126,4 @@ void func_80389C78(Actor *this){ local->unkC = MAX(local->unk4, local->unkC); } }//L8038A08C -} \ No newline at end of file +} diff --git a/src/RBB/code_3CB0.c b/src/RBB/code_3CB0.c index cc5af769..a608e544 100644 --- a/src/RBB/code_3CB0.c +++ b/src/RBB/code_3CB0.c @@ -49,7 +49,7 @@ void RBB_func_8038A0A0(Actor *this, s32 arg1){ levelSpecificFlags_set(local->unk0->unk8, 1); func_803228D8(); timedFunc_set_1(1.1f, (GenMethod_1)func_8028F9DC, 2); - timedFunc_set_3(1.1f, (TFQM3)func_802E4078, MAP_31_RBB_RUSTY_BUCKET_BAY, 0, 0); + timedFunc_set_3(1.1f, (GenMethod_3)func_802E4078, MAP_31_RBB_RUSTY_BUCKET_BAY, 0, 0); }else{ levelSpecificFlags_set(local->unk0->unkA, 1); } diff --git a/src/RBB/code_47D0.c b/src/RBB/code_47D0.c index 3102d5fe..53b86281 100644 --- a/src/RBB/code_47D0.c +++ b/src/RBB/code_47D0.c @@ -74,7 +74,7 @@ void func_8038AC18(Actor *this, s32 new_state){ mapSpecificFlags_set(local->unk4->unk10, TRUE); this->position_y -= 30.0f; local->unk8 = 1.0f; - other = func_80326EEC(0x1c5); + other = actorArray_findActorFromActorId(0x1c5); if(other){ local->unk0 = func_8038B56C(other, this->modelCacheIndex - 0x1be, this); } diff --git a/src/RBB/code_4C70.c b/src/RBB/code_4C70.c index 0294a792..9b18851b 100644 --- a/src/RBB/code_4C70.c +++ b/src/RBB/code_4C70.c @@ -86,7 +86,7 @@ void RBB_func_8038B0B8(Actor *this, s32 arg1){ -5.0f, -5.0f, 0.0f, 5.0f, 5.0f, 0.0f ); - particleEmitter_setPosition(other, &local->unk4); + particleEmitter_setPosition(other, local->unk4); particleEmitter_setParticleVelocityRange(other, -400.0f, 0.0f, -30.0f, -800.0f, 0.0f, 30.0f diff --git a/src/RBB/code_52F0.c b/src/RBB/code_52F0.c index 8dce12b2..933637f9 100644 --- a/src/RBB/code_52F0.c +++ b/src/RBB/code_52F0.c @@ -23,7 +23,7 @@ void func_8038B6E0(Actor *this, s32 arg1){ levelSpecificFlags_set(0x30, TRUE); func_803204E4(0xe, 1); timedFunc_set_0(1.0f, func_803228D8); - timedFunc_set_3(1.0f, (TFQM3)func_802E4078, MAP_31_RBB_RUSTY_BUCKET_BAY, 0, 0); + timedFunc_set_3(1.0f, (GenMethod_3)func_802E4078, MAP_31_RBB_RUSTY_BUCKET_BAY, 0, 0); } } this->state = arg1; @@ -44,4 +44,4 @@ void func_8038B7E8(Actor *this){ else func_8038B6E0(this, 1); } -} \ No newline at end of file +} diff --git a/src/RBB/code_5C10.c b/src/RBB/code_5C10.c index 886d32ba..84677a5e 100644 --- a/src/RBB/code_5C10.c +++ b/src/RBB/code_5C10.c @@ -41,9 +41,9 @@ void func_8038C0FC(Actor *this, s32 new_state){ set_camera_to_node(0xC); func_80324E38(0.0f, 3); timedFunc_set_0(1.0f, func_8038C000); - timedFunc_set_2(1.0f, (TFQM2)mapSpecificFlags_set, 8, TRUE); + timedFunc_set_2(1.0f, (GenMethod_2)mapSpecificFlags_set, 8, TRUE); timed_playSfx(2.1f, SFX_3F6_UNKNOWN, 0.6f, 0x7fbc); - timedFunc_set_2(2.7f, (TFQM2)mapSpecificFlags_set, 4, TRUE); + timedFunc_set_2(2.7f, (GenMethod_2)mapSpecificFlags_set, 4, TRUE); timedFunc_set_0(3.0f, func_8038C058); func_80324DBC(3.0f, 0xb9C, 7, NULL, this->marker, func_8038C0A8, NULL); }//L8038C1D8 @@ -66,6 +66,6 @@ void func_8038C204(Actor *this){ func_80324E88(0.0f); func_80324E38(0.0f, 0); timedFunc_set_0(0.0f, func_803228D8); - timedFunc_set_3(0.0f, (TFQM3)func_802E4078, MAP_8B_RBB_ANCHOR_ROOM, 2, 0); + timedFunc_set_3(0.0f, (GenMethod_3)func_802E4078, MAP_8B_RBB_ANCHOR_ROOM, 2, 0); }//L8038C2E4 -} \ No newline at end of file +} diff --git a/src/RBB/code_5F10.c b/src/RBB/code_5F10.c index 56841854..500df05d 100644 --- a/src/RBB/code_5F10.c +++ b/src/RBB/code_5F10.c @@ -16,4 +16,4 @@ void func_8038C300(Actor *this){ this->unk16C_4 = 1; func_80335924(this->unk148, 0x140, 0.0f, 1.0f); } -} \ No newline at end of file +} diff --git a/src/RBB/code_5F80.c b/src/RBB/code_5F80.c index 595c135b..9c098bdd 100644 --- a/src/RBB/code_5F80.c +++ b/src/RBB/code_5F80.c @@ -105,7 +105,7 @@ void func_8038C39C(Actor *this){ func_802EFA5C(other, 0.0f, 0.1f); particleEmitter_setStartingFrameRange(other, 0, 7); func_802EFA70(other, 4); - particleEmitter_setPosition(other, &this->position); + particleEmitter_setPosition(other, this->position); func_802EFB70(other, local->unk0->unk4*1, local->unk0->unk4*3.0f); func_802EFB84(other, 3.0f*local->unk0->unk4, local->unk0->unk4*7.0f); particleEmitter_setParticleSpawnPositionRange(other, @@ -127,7 +127,7 @@ void RBB_func_8038C538(Actor *this){ func_802EFA5C(other, 0.1f, 0.3f); func_802EFA70(other, 4); particleEmitter_setStartingFrameRange(other, 0, 7); - particleEmitter_setPosition(other, &this->position); + particleEmitter_setPosition(other, this->position); func_802EFB70(other, local->unk0->unk4*1, local->unk0->unk4*6.0f); func_802EFB84(other, 0.5*local->unk0->unk4, local->unk0->unk4*3.0f); particleEmitter_setParticleSpawnPositionRange(other, @@ -156,7 +156,7 @@ void RBB_func_8038C70C(Actor *this){ local->unk0->unk4 * -300.0f, local->unk0->unk4 * 100.0f, local->unk0->unk4 * -300.0f, local->unk0->unk4 * 300.0f, local->unk0->unk4 * 200.0f, local->unk0->unk4 * 300.0f ); - particleEmitter_setPosition(other, &this->position); + particleEmitter_setPosition(other, this->position); func_802EFB70(other, local->unk0->unk4*0.3, local->unk0->unk4*0.8); func_802EFE24(other, -600.0f, -600.0f, -600.0f, @@ -182,7 +182,7 @@ void func_8038C8A8(Actor * this){ func_802EFA5C(other, 0.0, 0.5f); func_802EFA70(other, 4); particleEmitter_setStartingFrameRange(other, 0, 7); - particleEmitter_setPosition(other, &sp24); + particleEmitter_setPosition(other, sp24); func_802EFB70(other, local->unk0->unk4*1, local->unk0->unk4*3.0f); func_802EFB84(other, local->unk0->unk4*3.0f, local->unk0->unk4*6.0f); particleEmitter_setPositionVelocityAndAccelerationRanges(other, &D_80390CA8); @@ -191,14 +191,14 @@ void func_8038C8A8(Actor * this){ particleEmitter_emitN(other, 5); } -void func_8038C9F0(s32 arg0, s32 arg1, s32 arg2){ - Actor *actor = func_80326EEC(0x46); - if(actor) - marker_despawn(actor->marker); +void chbossboombox_respawnJiggy(s32 position_x, s32 position_y, s32 position_z){ + Actor *jiggy = actorArray_findActorFromActorId(ACTOR_46_JIGGY); + if(jiggy) + marker_despawn(jiggy->marker); - D_80391288[0] = (f32)arg0; - D_80391288[1] = (f32)(arg1 + 0x28); - D_80391288[2] = (f32)arg2; + D_80391288[0] = (f32)position_x; + D_80391288[1] = (f32)(position_y + 0x28); + D_80391288[2] = (f32)position_z; jiggySpawn(JIGGY_56_RBB_BOSS_BOOM_BOX, &D_80391288); } @@ -230,13 +230,13 @@ void func_8038CB68(ActorMarker *marker, s32 arg1, s32 arg2){ Actor *actor = marker_getActor(marker); func_80324E88(0.0f); func_80324E38(0.0f, 0); - timedFunc_set_2(0.0f, (TFQM2)RBB_func_8038C370, actor->marker, 3); + timedFunc_set_2(0.0f, (GenMethod_2)RBB_func_8038C370, actor->marker, 3); } -void func_8038CBC0(void){ - Actor * actor = func_80326EEC(0x46); - if(actor) - func_802C8090(actor); +void chbossboombox_hideJiggy(void){ + Actor * jiggy = actorArray_findActorFromActorId(ACTOR_46_JIGGY); + if(jiggy) + chjiggy_hide(jiggy); } int RBB_func_8038CBF0(Actor *this){ @@ -280,7 +280,7 @@ void RBB_func_8038CC9C(Actor *this, s32 new_state){ sp80[1] = sp8C[1] - this->position_y; sp80[2] = sp8C[2] - this->position_z; if(this->state == 2){ - func_8038CBC0(); + chbossboombox_hideJiggy(); } if(this->state == 7){ @@ -320,10 +320,10 @@ void RBB_func_8038CC9C(Actor *this, s32 new_state){ item_set(ITEM_0_HOURGLASS_TIMER, 0x1067); func_80324E88(2.4f); func_80324E38(2.4f, 0); - timedFunc_set_2(2.4f, (TFQM2)RBB_func_8038C370, (s32)this->marker, 3); + timedFunc_set_2(2.4f, (GenMethod_2)RBB_func_8038C370, (s32)this->marker, 3); } else{//L8038CEFC - timedFunc_set_3(2.4f, (TFQM3)comusic_8025AB44, COMUSIC_62_RBB_BOOMBOX, 0x1f40, 0x12C); + timedFunc_set_3(2.4f, (GenMethod_3)comusic_8025AB44, COMUSIC_62_RBB_BOOMBOX, 0x1f40, 0x12C); func_80324DBC(2.4f, 0xb9e, 4, NULL, this->marker, func_8038CB34, func_8038CB68); } }//L8038CF60 @@ -368,7 +368,7 @@ void RBB_func_8038CC9C(Actor *this, s32 new_state){ func_803204E4(5, 1); } else{//L8038D220 - timedFunc_set_3(0.0f, (TFQM3)func_8038C9F0, (s32)this->position_x, (s32)this->position_y, (s32)this->position_z); + timedFunc_set_3(0.0f, (GenMethod_3)chbossboombox_respawnJiggy, (s32)this->position_x, (s32)this->position_y, (s32)this->position_z); func_80311480(0xb9f, 4, 0, 0, 0, 0); } }//L8038D278 @@ -377,12 +377,12 @@ void RBB_func_8038CC9C(Actor *this, s32 new_state){ sp68[0] = this->position_x + 200.0f*local->unk0->unk4; sp68[1] = this->position_y + 80.0f*local->unk0->unk4; sp68[2] = this->position_z; - func_802C3F04(func_802C4140, local->unk0->unk0 + 1, reinterpret_cast(s32, sp68[0]), reinterpret_cast(s32, sp68[1]), reinterpret_cast(s32, sp68[2])); + __spawnQueue_add_4((GenMethod_4)func_802C4140, local->unk0->unk0 + 1, reinterpret_cast(s32, sp68[0]), reinterpret_cast(s32, sp68[1]), reinterpret_cast(s32, sp68[2])); sp68[0] = this->position_x - 200.0f*local->unk0->unk4; sp68[1] = this->position_y + 80.0f*local->unk0->unk4; sp68[2] = this->position_z; - func_802C3F04(func_802C4140, local->unk0->unk0 + 1, reinterpret_cast(s32, sp68[0]), reinterpret_cast(s32, sp68[1]), reinterpret_cast(s32, sp68[2])); + __spawnQueue_add_4((GenMethod_4)func_802C4140, local->unk0->unk0 + 1, reinterpret_cast(s32, sp68[0]), reinterpret_cast(s32, sp68[1]), reinterpret_cast(s32, sp68[2])); } }//L8038D378 @@ -452,7 +452,7 @@ void func_8038D608(ActorMarker *marker, ActorMarker *other){ Actor *func_8038D638(ActorMarker *marker, Gfx **gdl, Mtx ** mptr, s32 arg3){ f32 sp3C[3]; - Actor *actor = func_80325300(marker, &sp3C); + Actor *actor = marker_getActorAndRotation(marker, &sp3C); ActorLocal_RBB_5F80 *local = (ActorLocal_RBB_5F80 *) &actor->local; func_8033A45C(1, local->unk0->unkD); if(local->unk0->unkD == 1){ @@ -529,10 +529,10 @@ void func_8038D8BC(Actor *this){ marker_despawn(this->marker); if(func_803203FC(2)) - func_8038CBC0(); + chbossboombox_hideJiggy(); if(func_803203FC(UNKFLAGS1_1F_IN_CHARACTER_PARADE)){ - func_8038CBC0(); + chbossboombox_hideJiggy(); func_80335924(this->unk148, ASSET_146_ANIM_BOSS_BOOMBOX_APPEAR, 0.0f, 2.4f); func_80335A8C(this->unk148, 2); this->state = 2; diff --git a/src/RBB/code_7A60.c b/src/RBB/code_7A60.c index 10d9969d..18409cfb 100644 --- a/src/RBB/code_7A60.c +++ b/src/RBB/code_7A60.c @@ -24,8 +24,8 @@ void func_8038DE68(Actor *this){ if(jiggyscore_isSpawned(JIGGY_56_RBB_BOSS_BOOM_BOX) && !func_803203FC(2)){ marker_despawn(this->marker); }else{ - func_802C3F04(func_802C4140, 0x281, reinterpret_cast(s32,this->position_x), reinterpret_cast(s32,this->position_y), reinterpret_cast(s32,this->position_z)); + __spawnQueue_add_4((GenMethod_4)func_802C4140, 0x281, reinterpret_cast(s32,this->position_x), reinterpret_cast(s32,this->position_y), reinterpret_cast(s32,this->position_z)); func_8038DE50(this, 1); } }//L8038DEF4 -} \ No newline at end of file +} diff --git a/src/RBB/code_7B20.c b/src/RBB/code_7B20.c index 5ee2e864..c3fee3ac 100644 --- a/src/RBB/code_7B20.c +++ b/src/RBB/code_7B20.c @@ -62,7 +62,7 @@ void func_8038DF6C(Actor* this){ if(++local->unk20 == 2){ for(i = 0x5e; i < 0x63; i++){ - other = func_80326D68(this->position, i, -1, &sp58); + other = actorArray_findClosestActorFromActorId(this->position, i, -1, &sp58); if(sp58 < 300.0f){ local->unk4 = other->marker; other->position_x = this->position_x; diff --git a/src/RBB/code_8520.c b/src/RBB/code_8520.c index 6e6d8872..7358e862 100644 --- a/src/RBB/code_8520.c +++ b/src/RBB/code_8520.c @@ -75,7 +75,7 @@ void func_8038E998(Actor *this){ particleEmitter_setSprite(other, ASSET_70E_SPRITE_SMOKE_2); func_802EFA5C(other, 0.0f, 0.1f); particleEmitter_setStartingFrameRange(other, 0, 7); - particleEmitter_setPosition(other, &this->position); + particleEmitter_setPosition(other, this->position); func_802EFB70(other, 0.25f, 0.75f); func_802EFB84(other, 0.75f, 1.75f); particleEmitter_setParticleSpawnPositionRange(other, -50.0f, 25.0f, -50.0f, 50.0f, 25.0f, 50.0f); @@ -94,7 +94,7 @@ void func_8038EAB4(Actor *this){ particleEmitter_setStartingFrameRange(other, 0, 0); particleEmitter_setParticleFramerateRange(other, 4.0f, 4.0f); particleEmitter_setParticleSpawnPositionRange(other, 0.0f, 200.0f, 0.0f, 0.0f, 200.0f, 0.0f); - particleEmitter_setPosition(other, &this->position); + particleEmitter_setPosition(other, this->position); func_802EFB70(other, 3.0f, 3.0f); func_802EFB84(other, 8.0f, 8.0f); func_802EFEC0(other, 0.5f, 0.5f); @@ -108,7 +108,7 @@ void func_8038EC14(Actor *this){ particleEmitter_setSprite(other, ASSET_70E_SPRITE_SMOKE_2); func_802EFA5C(other, 0.05f, 0.1f); particleEmitter_setStartingFrameRange(other, 0, 7); - particleEmitter_setPosition(other, &this->position); + particleEmitter_setPosition(other, this->position); func_802EFB70(other, 1.0f, 1.5f); func_802EFB84(other, 2.0f, 3.0f); particleEmitter_setParticleSpawnPositionRange(other, -75.0f, 25.0f, -75.0f, 75.0f, 75.0f, 75.0f); @@ -124,7 +124,7 @@ void func_8038ED3C(Actor * actor, s32 arg1){ func_802EF9F8(other, 0.6f); func_802EFA18(other, 3); particleEmitter_setModel(other, arg1); - particleEmitter_setPosition(other, &actor->position); + particleEmitter_setPosition(other, actor->position); func_802EFB70(other, 0.05f, 0.4f); func_802EFE24(other, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); particleEmitter_setSpawnIntervalRange(other, 0.0f, 0.01f); diff --git a/src/RBB/code_9670.c b/src/RBB/code_9670.c index 58d3902f..55f0ea22 100644 --- a/src/RBB/code_9670.c +++ b/src/RBB/code_9670.c @@ -26,7 +26,7 @@ void RBB_func_8038FA60(ActorMarker *marker){ void func_8038FA9C(Actor *this, s32 arg1){ if(arg1 == 3){ func_80324E38(0.0f, 3); - timedFunc_set_2(1.0f, (TFQM2)func_8025A6EC, COMUSIC_2B_DING_B, 28000); + timedFunc_set_2(1.0f, (GenMethod_2)func_8025A6EC, COMUSIC_2B_DING_B, 28000); timed_setCameraToNode(1.8f, 1); timedFunc_set_1(2.0f, (GenMethod_1) RBB_func_8038FA60, (s32)this->marker); func_80324E88(5.0f); diff --git a/src/RBB/code_9840.c b/src/RBB/code_9840.c index b0944e5c..e1cdbeee 100644 --- a/src/RBB/code_9840.c +++ b/src/RBB/code_9840.c @@ -50,7 +50,7 @@ void func_8038FC48(Actor *this){ } else{//L8038FD34 if(local->unk8 == NULL) - local->unk8 = func_80326EEC(*local->unk4)->marker; + local->unk8 = actorArray_findActorFromActorId(*local->unk4)->marker; sp20 = func_8038A6B8(local->unk8); tmp_f2 = 1.5* sp20 + 0.5; func_802F9DB8(local->unk0, tmp_f2, tmp_f2, 0.0f); diff --git a/src/RBB/code_99F0.c b/src/RBB/code_99F0.c index 692ff98c..37bb0856 100644 --- a/src/RBB/code_99F0.c +++ b/src/RBB/code_99F0.c @@ -65,4 +65,4 @@ void func_8038FF70(void){ if(D_803912C8 == 3) func_8038FDE0(0); -} \ No newline at end of file +} diff --git a/src/RBB/code_CA0.c b/src/RBB/code_CA0.c index f8d00b42..543389b8 100644 --- a/src/RBB/code_CA0.c +++ b/src/RBB/code_CA0.c @@ -64,7 +64,7 @@ void func_8038718C(ActorMarker *marker){ timed_playSfx(4.0f, SFX_7F_HEAVYDOOR_SLAM, 1.0f, 19000);\ func_80324E88(5.0f); func_80324E38(5.0f, 0); - timedFunc_set_2(5.0f, (TFQM2) func_80387090, (s32) marker, 3); + timedFunc_set_2(5.0f, (GenMethod_2) func_80387090, (s32) marker, 3); } void func_80387308(ActorMarker *marker){ @@ -86,9 +86,9 @@ void func_80387308(ActorMarker *marker){ timed_playSfx(0.5f, SFX_7F_HEAVYDOOR_SLAM, 0.8f, 19000); timed_playSfx(0.5f, SFX_7F_HEAVYDOOR_SLAM, 0.9f, 19000); timed_playSfx(0.5f, SFX_7F_HEAVYDOOR_SLAM, 1.0f, 19000); - timedFunc_set_2(0.5f, (TFQM2) func_80387090, (s32) actor->marker, 1); + timedFunc_set_2(0.5f, (GenMethod_2) func_80387090, (s32) actor->marker, 1); - timedFunc_set_2(1.5f, (TFQM2) func_803870BC, 0x19d, 0x1f4); + timedFunc_set_2(1.5f, (GenMethod_2) func_803870BC, 0x19d, 0x1f4); func_80324E88(1.5f); func_80324E38(1.5f, 0); diff --git a/src/SM/ch/attacktutorial.c b/src/SM/ch/attacktutorial.c index f627326a..06811790 100644 --- a/src/SM/ch/attacktutorial.c +++ b/src/SM/ch/attacktutorial.c @@ -43,7 +43,7 @@ s32 SM_func_803871FC(Actor *this, s32 arg1){ s32 tmp_v0; sp1C = (arg1 == 1)? ACTOR_166_TOPPER_A : (tmp_v0 = (arg1 == 2)? ACTOR_165_BAWL_A : ACTOR_164_COLLYWOBBLE_A); - func_802C3D3C(__chAttackTutorial_spawnEnemy, this->marker, sp1C); + __spawnQueue_add_2(__chAttackTutorial_spawnEnemy, this->marker, sp1C); } @@ -113,7 +113,7 @@ void chAttackTutorial_update(Actor *this){ if(!this->initialized){ //find closest tutorial bottles - bottles = func_80326D68(this->position, ACTOR_12B_TUTORIAL_BOTTLES, -1, &sp2C); + bottles = actorArray_findClosestActorFromActorId(this->position, ACTOR_12B_TUTORIAL_BOTTLES, -1, &sp2C); if(bottles != NULL){ this->unk1C_x = bottles->position_x; this->unk1C_y = bottles->position_y; diff --git a/src/SM/ch/vegetables.c b/src/SM/ch/vegetables.c index 571732c5..89cd830b 100644 --- a/src/SM/ch/vegetables.c +++ b/src/SM/ch/vegetables.c @@ -203,7 +203,7 @@ void func_80387C28(Actor * this){ if(this->unk38_31){ this->position_y += 100.0f; func_802CA1CC(HONEYCOMB_17_SM_COLIWOBBLE); - func_802C3F04((GenMethod_4)func_802C4218, 0x1f, reinterpret_cast(s32, this->position_x), reinterpret_cast(s32, this->position_y), reinterpret_cast(s32, this->position_z)); + __spawnQueue_add_4((GenMethod_4)func_802C4218, 0x1f, reinterpret_cast(s32, this->position_x), reinterpret_cast(s32, this->position_y), reinterpret_cast(s32, this->position_z)); }//L80387D64 func_803252D0(1.5f, 7); actor_collisionOff(this); diff --git a/src/SM/code_2990.c b/src/SM/code_2990.c index b112d3b4..0d13c456 100644 --- a/src/SM/code_2990.c +++ b/src/SM/code_2990.c @@ -407,7 +407,7 @@ void func_803899B0(Actor * this){ }//L80389B20 if(!this->unk16C_4){ - __spawnqueue_add_1((GenMethod_1)func_80389948, reinterpret_cast(s32, this->marker)); + __spawnQueue_add_1((GenMethod_1)func_80389948, reinterpret_cast(s32, this->marker)); this->unk16C_4 = 1; }//L80389B4C diff --git a/src/SM/code_4070.c b/src/SM/code_4070.c index 010dbe3c..b862238d 100644 --- a/src/SM/code_4070.c +++ b/src/SM/code_4070.c @@ -63,7 +63,7 @@ void SM_func_8038A5D8(Actor *this){ s32 temp_a0; if(!this->initialized){ - temp_v0 = func_80326D68(this->position, ACTOR_12B_TUTORIAL_BOTTLES, -1, &sp40); + temp_v0 = actorArray_findClosestActorFromActorId(this->position, ACTOR_12B_TUTORIAL_BOTTLES, -1, &sp40); if(temp_v0){ this->unk1C_x = temp_v0->position_x; this->unk1C_y = temp_v0->position_y; diff --git a/src/SM/code_5B0.c b/src/SM/code_5B0.c index 340286db..ab62ac89 100644 --- a/src/SM/code_5B0.c +++ b/src/SM/code_5B0.c @@ -113,7 +113,7 @@ void SM_func_80386D68(Actor *this){ if(this->unk100 && func_803870E8(this->unk100)){ func_802CA1CC(HONEYCOMB_18_SM_QUARRIES); - func_802C3F04((GenMethod_4)func_802C4218, 0x1F, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2])); + __spawnQueue_add_4((GenMethod_4)func_802C4218, 0x1F, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2])); } marker_despawn(this->marker); } @@ -139,7 +139,7 @@ void SM_func_80386EF4(Actor *this) { if ((this->state) == 1) { temp_t3 = this->unk38_31++ ^ 2; if ((temp_t3) == 0) { - other = func_80326EEC(0x16E); + other = actorArray_findActorFromActorId(0x16E); if (other != NULL) { this->unk100 = other->marker; } else { diff --git a/src/SM/code_BF0.c b/src/SM/code_BF0.c index b1866997..078cb8c7 100644 --- a/src/SM/code_BF0.c +++ b/src/SM/code_BF0.c @@ -24,7 +24,7 @@ void SM_func_80386FE0(Actor *this){ switch(this->state){ case 1://L80387064 if(this->unk38_31++ == 2){ - this->unk10_12 = func_80326F58(0x16f); + this->unk10_12 = actorArray_actorCount(ACTOR_16F_QUARRIE); func_80328A84(this, 2); } break; diff --git a/src/TTC/ch/treasure.c b/src/TTC/ch/treasure.c index 63735118..82980b37 100644 --- a/src/TTC/ch/treasure.c +++ b/src/TTC/ch/treasure.c @@ -22,7 +22,7 @@ ActorInfo gChTreasureInfo = { /* .code */ void __chtreasure_die(ActorMarker *marker, ActorMarker *otherMarker){ Actor *this = marker_getActor(marker); - func_802C3F04((GenMethod_4) func_802C4140, 0x4C, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2])); + __spawnQueue_add_4((GenMethod_4) func_802C4140, 0x4C, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2])); func_802EE278(this, 3, 0xf, 0x3C, 0.2f, 1.2f); func_803115C4(0xA19); jiggySpawn(JIGGY_11_TTC_RED_X, this->position); diff --git a/src/TTC/code_0.c b/src/TTC/code_0.c index ecb22585..076bc5b4 100644 --- a/src/TTC/code_0.c +++ b/src/TTC/code_0.c @@ -50,8 +50,8 @@ bool TTC_func_803864B0(Actor *this, f32 arg1) { f32 sp3C[3]; s32 sp38; - sp50 = func_80326D68(this->position, 0x52, -1, &sp5C); - sp4C = func_80326D68(this->position, 0x129, -1, &sp58); + sp50 = actorArray_findClosestActorFromActorId(this->position, 0x52, -1, &sp5C); + sp4C = actorArray_findClosestActorFromActorId(this->position, 0x129, -1, &sp58); sp38 = 0; if( (sp58 < sp5C) && (sp58 < 16000.0f) @@ -241,7 +241,7 @@ void func_80386EDC(s32 this, enum item_e item_id){ player_getPosition(sp24); func_802C8F70(randf2(0.0f, 359.0f)); - func_802C3F04(func_802C4218, this, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2])); + __spawnQueue_add_4((GenMethod_4)func_802C4218, this, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2])); item_dec(item_id); } diff --git a/src/TTC/code_10A0.c b/src/TTC/code_10A0.c index d3cbbfca..71222e88 100644 --- a/src/TTC/code_10A0.c +++ b/src/TTC/code_10A0.c @@ -69,7 +69,7 @@ void func_80387574(ActorMarker *caller, enum asset_e text_id, s32 arg1){ if(func_80304E24(0x14b, sp24)){ jiggySpawn(JIGGY_14_TTC_BLUBBER, sp24); - func_802C3F04((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2])); + __spawnQueue_add_4((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2])); } } diff --git a/src/TTC/code_19D0.c b/src/TTC/code_19D0.c index 195cbd63..12d4dda8 100644 --- a/src/TTC/code_19D0.c +++ b/src/TTC/code_19D0.c @@ -341,6 +341,6 @@ bool func_80388A44(s16 arg0[3]){ sp1C[1] = (f32) arg0[1]; sp1C[2] = (f32) arg0[2]; - nipper = func_80326D68(sp1C, ACTOR_117_NIPPER, -1, NULL); + nipper = actorArray_findClosestActorFromActorId(sp1C, ACTOR_117_NIPPER, -1, NULL); return nipper->state == 7; } diff --git a/src/TTC/code_26D0.c b/src/TTC/code_26D0.c index 4bec2470..52adc5bd 100644 --- a/src/TTC/code_26D0.c +++ b/src/TTC/code_26D0.c @@ -135,7 +135,7 @@ void func_80388D04(s32 arg0){ void func_80388D34(Actor *this){ TTC_func_80388C78(this); if(!this->unk16C_4){ - __spawnqueue_add_1((GenMethod_1)func_80388D04, (s32)this->marker); + __spawnQueue_add_1((GenMethod_1)func_80388D04, (s32)this->marker); this->unk16C_4 = TRUE; } } diff --git a/src/TTC/code_2B80.c b/src/TTC/code_2B80.c index ccf3782a..736cfb5d 100644 --- a/src/TTC/code_2B80.c +++ b/src/TTC/code_2B80.c @@ -94,7 +94,7 @@ void func_80389288(ActorMarker *caller, enum asset_e text_id, s32 arg2){ timedFunc_set_0(1.0f, func_80388F88); func_80324E38(2.5f, 0); timedFunc_set_1(2.5f, func_8028F9DC, 2); - timedFunc_set_3(2.5f, (TFQM3)func_802E4078, MAP_A_TTC_SANDCASTLE, 0, 0); + timedFunc_set_3(2.5f, (GenMethod_3)func_802E4078, MAP_A_TTC_SANDCASTLE, 0, 0); func_803228D8(); } diff --git a/src/TTC/code_35D0.c b/src/TTC/code_35D0.c index cb16f42d..5d75a064 100644 --- a/src/TTC/code_35D0.c +++ b/src/TTC/code_35D0.c @@ -123,8 +123,8 @@ void func_80389B38(s32 arg0){ } D_8037DCB4++; - func_802C3BF8(func_80389A9C); - func_802C3BF8(func_80389A1C); + __spawnQueue_add_0(func_80389A9C); + __spawnQueue_add_0(func_80389A1C); } } @@ -157,7 +157,7 @@ void func_80389CC4(s16 arg0[3], s32 arg1){ D_8038D708[1] = (f32)arg0[1]; D_8038D708[2] = (f32)arg0[2]; D_8038D708[1] = func_80309724(D_8038D708); - func_802C3F04((GenMethod_4)func_802C4140, 0xF4, reinterpret_cast(s32, D_8038D708[0]), reinterpret_cast(s32, D_8038D708[1]), reinterpret_cast(s32, D_8038D708[2])); + __spawnQueue_add_4((GenMethod_4)func_802C4140, 0xF4, reinterpret_cast(s32, D_8038D708[0]), reinterpret_cast(s32, D_8038D708[1]), reinterpret_cast(s32, D_8038D708[2])); D_8038D700 = partEmitList_pushNew(3); func_802EFFA8(D_8038D700, D_8038C91C); particleEmitter_setSprite(D_8038D700, ASSET_700_SPRITE_DUST); @@ -168,7 +168,7 @@ void func_80389CC4(s16 arg0[3], s32 arg1){ particleEmitter_emitN(D_8038D700, 5); D_8038D708[2] += 300.0f; gcpausemenu_80314AC8(0); - timedFunc_set_2(0.1f, (TFQM2) func_8028F45C, 9, (s32)&D_8038D708); + timedFunc_set_2(0.1f, (GenMethod_2) func_8028F45C, 9, (s32)&D_8038D708); timedFunc_set_1(0.1f, (GenMethod_1) gcpausemenu_80314AC8, 1); func_80311480(ASSET_A17_TEXT_BURIED_TREASURE_SPAWNED, 4, NULL, NULL, NULL, NULL); D_8037DCB4++; @@ -219,7 +219,7 @@ Actor *func_8038A0D0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ f32 sp38; Actor *actor; - actor = func_80325300(marker, sp4C); + actor = marker_getActorAndRotation(marker, sp4C); switch(marker->modelId){ case ASSET_3E9_MODEL_RED_ARROW://L8038A12C sp3C = 1.0f; diff --git a/src/TTC/code_3E30.c b/src/TTC/code_3E30.c index 83c9991f..8f754142 100644 --- a/src/TTC/code_3E30.c +++ b/src/TTC/code_3E30.c @@ -408,7 +408,7 @@ void func_8038B094(void){ func_80324E88(2.0f); func_80324E38(2.0f, 0); func_803228D8(); - timedFunc_set_3(2.0f, (TFQM3) func_802E4078, MAP_7_TTC_TREASURE_TROVE_COVE, 1, 0); + timedFunc_set_3(2.0f, (GenMethod_3) func_802E4078, MAP_7_TTC_TREASURE_TROVE_COVE, 1, 0); } else if(levelSpecificFlags_get(2) || func_803203FC(2)){ func_8034E71C(sp2C, -500, 0.0f); diff --git a/src/core1/code_0.c b/src/core1/code_0.c index 9d843bf8..329eb712 100644 --- a/src/core1/code_0.c +++ b/src/core1/code_0.c @@ -156,10 +156,10 @@ void func_8023DD0C(void){ case 3: func_80255524(); func_80255ACC(); - func_802C3A18(); + spawnQueue_func_802C3A18(); if(func_802E4424()) func_802E3F8C(0); - func_802C3A38(); + spawnQueue_flush(); break; }//L8023DE34 diff --git a/src/core1/code_12F10.c b/src/core1/code_12F10.c index 81504788..69069dea 100644 --- a/src/core1/code_12F10.c +++ b/src/core1/code_12F10.c @@ -149,10 +149,10 @@ void func_80250E6C(f32 arg0, f32 arg1){ void func_80250E94(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5){ if(D_802823AC){ - timedFunc_set_3(0.0f, (TFQM3) func_80250BA4, 0, (s32) (arg0 * 524288.0f), (s32) (arg2*524288.0f)); - timedFunc_set_3(arg2, (TFQM3) func_80250BA4, (s32) (arg0 * 524288.0f), (s32) (arg1 * 524288.0f), (s32) (arg3*524288.0f)); - timedFunc_set_3(arg2 + arg3, (TFQM3) func_80250BA4, (s32) (arg1 * 524288.0f), (s32) (arg1 * 524288.0f), (s32) (arg4*524288.0f)); - timedFunc_set_3(arg2 + arg3 + arg4, (TFQM3) func_80250BA4, (s32) (arg1 * 524288.0f), 0, (s32) (arg5*524288.0f)); + timedFunc_set_3(0.0f, (GenMethod_3) func_80250BA4, 0, (s32) (arg0 * 524288.0f), (s32) (arg2*524288.0f)); + timedFunc_set_3(arg2, (GenMethod_3) func_80250BA4, (s32) (arg0 * 524288.0f), (s32) (arg1 * 524288.0f), (s32) (arg3*524288.0f)); + timedFunc_set_3(arg2 + arg3, (GenMethod_3) func_80250BA4, (s32) (arg1 * 524288.0f), (s32) (arg1 * 524288.0f), (s32) (arg4*524288.0f)); + timedFunc_set_3(arg2 + arg3 + arg4, (GenMethod_3) func_80250BA4, (s32) (arg1 * 524288.0f), 0, (s32) (arg5*524288.0f)); } } diff --git a/src/core1/code_18350.c b/src/core1/code_18350.c index 7967c9a4..227b3c0d 100644 --- a/src/core1/code_18350.c +++ b/src/core1/code_18350.c @@ -1508,4 +1508,4 @@ void func_8025982C(f32 dst[3], f32 arg1[3], f32 arg2[3], f32 arg3){ for(i=0; i< 3; i++){ dst[i] = arg1[i] + (arg2[i]-arg1[i])*arg3; } -} \ No newline at end of file +} diff --git a/src/core1/code_1BE90.c b/src/core1/code_1BE90.c index b8a7b82c..ca9f5071 100644 --- a/src/core1/code_1BE90.c +++ b/src/core1/code_1BE90.c @@ -594,12 +594,12 @@ s32 func_8025ADD4(enum comusic_e id){ void func_8025AE0C(s32 arg0, f32 arg1){ func_8025A58C(0, arg0); - timedFunc_set_2(arg1, (TFQM2)func_8025A58C, -1, arg0); + timedFunc_set_2(arg1, (GenMethod_2)func_8025A58C, -1, arg0); } void func_8025AE50(s32 arg0, f32 arg1){ func_8025A430(0, arg0, 6); - timedFunc_set_3(arg1, (TFQM3)func_8025A430, -1, arg0, 6); + timedFunc_set_3(arg1, (GenMethod_3)func_8025A430, -1, arg0, 6); } void func_8025AEA0(enum comusic_e track_id, s32 arg1){ @@ -624,5 +624,5 @@ void func_8025AF38(void){ for(iPtr = &D_80276E30[0]; iPtr < &D_80276E30[6]; iPtr++){ iPtr->unk18 = array_defrag(iPtr->unk18); } - D_80276E30 = defrag(D_80276E30); + D_80276E30 = (CoMusic *)defrag(D_80276E30); } diff --git a/src/core1/code_1D00.c b/src/core1/code_1D00.c index a1fd8ec5..fe5de78e 100644 --- a/src/core1/code_1D00.c +++ b/src/core1/code_1D00.c @@ -557,4 +557,4 @@ OSIoMesg * func_802405D0(void){ OSMesgQueue * amgr_getFrameMesgQueue(void){ return &g_AudioManager.audioFrameMsgQ; -} \ No newline at end of file +} diff --git a/src/core1/code_660.c b/src/core1/code_660.c index 93282f78..8bbb3703 100644 --- a/src/core1/code_660.c +++ b/src/core1/code_660.c @@ -1,109 +1,109 @@ -#include -#include "functions.h" -#include "variables.h" -#include "core1/rarezip.h" - - -static int _rarezip_uncompress(u8 **arg0, u8 **arg1, struct huft * arg2); - -#define COMP_HEADER_SIZE 6 - -//border[]= { /* Order of the bit length code lengths */ -u8 D_80275670[] = { - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 -}; - -// static ush cplens[] = { /* Copy lengths for literal codes 257..285 */ -u16 D_80275684[] = { - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, - 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 -}; -// /* note: see note #13 above about the 258 in this list. */ - -// static uch cplext[] = { /* Extra bits for literal codes 257..285 */ -u8 D_802756C4[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, - 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99 -}; /* 99==invalid */ - -// static ush cpdist[] = { /* Copy offsets for distance codes 0..29 */ -u16 D_802756E4[] = { - 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, - 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, - 8193, 12289, 16385, 24577 -}; - -// static uch cpdext[] = { /* Extra bits for distance codes */ -u8 D_80275720[] = { - 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, - 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, - 12, 12, 13, 13 -}; - -// ush mask_bits[] = { -u16 D_80275740[] = { - 0x0000, - 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, - 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff -}; - -s32 D_80275764 = 9; //lbits -s32 D_80275768 = 6; //dbits - -/* .data */ -extern struct huft D_803FBE00; -struct huft *D_8027BF00; -u8 pad_8027BF00[0xC]; -u8 *D_8027BF10; //inbuf -u8 *D_8027BF14; //slide -u32 D_8027BF18; //inptr -u32 D_8027BF1C; //wp -struct huft *D_8027BF20; //unk -u32 D_8027BF24; //bb -u32 D_8027BF28; //bk -u32 D_8027BF2C; //crc1 -u32 D_8027BF30; //crc2 -u32 D_8027BF34; //hufts - - -/* .code */ -s32 rarezip_get_uncompressed_size(u8 *arg0) { - return *((s32*) (arg0 + 2)); -} - -void rarezip_init(void){ - D_8027BF00 = &D_803FBE00; -} - -void rarezip_inflate(u8 *src, u8 *dst){ - _rarezip_inflate(src, dst, D_8027BF00); -} - -void rarezip_uncompress(u8 **srcPtr, u8 **dstPtr){ - //updates in and out buffer ptrs, - _rarezip_uncompress(srcPtr, dstPtr, D_8027BF00); -} - -void func_8023E0E8(void){ - return; -} - -static int _rarezip_inflate(u8 * src, u8 * dst, struct huft * arg2){ - D_8027BF10 = src; - D_8027BF14 = dst; - D_8027BF20 = arg2; - D_8027BF10 += COMP_HEADER_SIZE; - D_8027BF1C = 0; - D_8027BF18 = 0; - inflate(); - return D_8027BF1C; -} - -static int _rarezip_uncompress(u8 **srcPtr, u8 **dstPtr, struct huft * arg2){ - int result; - result = _rarezip_inflate(*srcPtr, *dstPtr, arg2); - *dstPtr = *dstPtr + D_8027BF1C; - *dstPtr = ((u32)*dstPtr & 0xF) ? ((u32)*dstPtr & -0x10) + 0x10: *dstPtr; - *srcPtr = *srcPtr + D_8027BF18 + COMP_HEADER_SIZE; - return result; -} +#include +#include "functions.h" +#include "variables.h" +#include "core1/rarezip.h" + + +static int _rarezip_uncompress(u8 **arg0, u8 **arg1, struct huft * arg2); + +#define COMP_HEADER_SIZE 6 + +//border[]= { /* Order of the bit length code lengths */ +u8 D_80275670[] = { + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 +}; + +// static ush cplens[] = { /* Copy lengths for literal codes 257..285 */ +u16 D_80275684[] = { + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 +}; +// /* note: see note #13 above about the 258 in this list. */ + +// static uch cplext[] = { /* Extra bits for literal codes 257..285 */ +u8 D_802756C4[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99 +}; /* 99==invalid */ + +// static ush cpdist[] = { /* Copy offsets for distance codes 0..29 */ +u16 D_802756E4[] = { + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577 +}; + +// static uch cpdext[] = { /* Extra bits for distance codes */ +u8 D_80275720[] = { + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, + 12, 12, 13, 13 +}; + +// ush mask_bits[] = { +u16 D_80275740[] = { + 0x0000, + 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, + 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff +}; + +s32 D_80275764 = 9; //lbits +s32 D_80275768 = 6; //dbits + +/* .data */ +extern struct huft D_803FBE00; +struct huft *D_8027BF00; +u8 pad_8027BF00[0xC]; +u8 *D_8027BF10; //inbuf +u8 *D_8027BF14; //slide +u32 D_8027BF18; //inptr +u32 D_8027BF1C; //wp +struct huft *D_8027BF20; //unk +u32 D_8027BF24; //bb +u32 D_8027BF28; //bk +u32 D_8027BF2C; //crc1 +u32 D_8027BF30; //crc2 +u32 D_8027BF34; //hufts + + +/* .code */ +s32 rarezip_get_uncompressed_size(u8 *arg0) { + return *((s32*) (arg0 + 2)); +} + +void rarezip_init(void){ + D_8027BF00 = &D_803FBE00; +} + +void rarezip_inflate(u8 *src, u8 *dst){ + _rarezip_inflate(src, dst, D_8027BF00); +} + +void rarezip_uncompress(u8 **srcPtr, u8 **dstPtr){ + //updates in and out buffer ptrs, + _rarezip_uncompress(srcPtr, dstPtr, D_8027BF00); +} + +void func_8023E0E8(void){ + return; +} + +static int _rarezip_inflate(u8 * src, u8 * dst, struct huft * arg2){ + D_8027BF10 = src; + D_8027BF14 = dst; + D_8027BF20 = arg2; + D_8027BF10 += COMP_HEADER_SIZE; + D_8027BF1C = 0; + D_8027BF18 = 0; + inflate(); + return D_8027BF1C; +} + +static int _rarezip_uncompress(u8 **srcPtr, u8 **dstPtr, struct huft * arg2){ + int result; + result = _rarezip_inflate(*srcPtr, *dstPtr, arg2); + *dstPtr = *dstPtr + D_8027BF1C; + *dstPtr = ((u32)*dstPtr & 0xF) ? ((u32)*dstPtr & -0x10) + 0x10: *dstPtr; + *srcPtr = *srcPtr + D_8027BF18 + COMP_HEADER_SIZE; + return result; +} diff --git a/src/core1/code_8C50.c b/src/core1/code_8C50.c index bbbe37f9..d6e868b7 100644 --- a/src/core1/code_8C50.c +++ b/src/core1/code_8C50.c @@ -350,7 +350,7 @@ void func_80247224(void){ } } -void func_80247304(void){}; +void func_80247304(void){} void func_8024730C(void){ static OSViMode D_802759A8 = { diff --git a/src/core1/done/audio/n_reverb.c b/src/core1/done/audio/n_reverb.c index f6677a10..088e5ba4 100644 --- a/src/core1/done/audio/n_reverb.c +++ b/src/core1/done/audio/n_reverb.c @@ -372,4 +372,4 @@ Acmd *__n_filterBuffer(ALLowPass *lp, s32 buff, Acmd *p) lp->first = 0; return ptr; -} \ No newline at end of file +} diff --git a/src/core1/done/audio/n_synsetvol.c b/src/core1/done/audio/n_synsetvol.c index c3b53970..1516b221 100644 --- a/src/core1/done/audio/n_synsetvol.c +++ b/src/core1/done/audio/n_synsetvol.c @@ -27,4 +27,4 @@ void n_alSynSetVol( N_ALVoice *v, s16 volume, ALMicroTime t) //(*f->setParam)(f, AL_FILTER_ADD_UPDATE, update); n_alEnvmixerParam(v->pvoice, AL_FILTER_ADD_UPDATE, update); } -} \ No newline at end of file +} diff --git a/src/core1/done/gu/cosf.c b/src/core1/done/gu/cosf.c index 73c4f121..096a29a3 100644 --- a/src/core1/done/gu/cosf.c +++ b/src/core1/done/gu/cosf.c @@ -134,4 +134,4 @@ int ix, xpt; /* just give up and return 0.0 */ return ( zero.f ); -} \ No newline at end of file +} diff --git a/src/core2/bs/ant.c b/src/core2/bs/ant.c index 6930f589..5f406ab0 100644 --- a/src/core2/bs/ant.c +++ b/src/core2/bs/ant.c @@ -482,4 +482,4 @@ void bsant_drone_update(void){ void bsant_drone_end(void){ bsdrone_end(); func_8029E4EC(); -} \ No newline at end of file +} diff --git a/src/core2/bs/bBarge.c b/src/core2/bs/bBarge.c index 01e7ccb5..772ad53b 100644 --- a/src/core2/bs/bBarge.c +++ b/src/core2/bs/bBarge.c @@ -51,9 +51,9 @@ void func_8029F4F0(void){ } void func_8029F60C(void){ - f32 plyrPos[3]; - _player_getPosition(&plyrPos); - func_8032728C(plyrPos, 50.0f, 2, func_8029F4E0); + f32 player_position[3]; + _player_getPosition(player_position); + func_8032728C(player_position, 50.0f, 2, func_8029F4E0); } diff --git a/src/core2/bs/bFlap.c b/src/core2/bs/bFlap.c index c5f722a2..e0a986f9 100644 --- a/src/core2/bs/bFlap.c +++ b/src/core2/bs/bFlap.c @@ -196,4 +196,4 @@ void bsbflap_end(void) { func_80297B94(); func_8029E090(0, 0.2f); func_8030DA44(D_8037D30C); -} \ No newline at end of file +} diff --git a/src/core2/bs/bFly.c b/src/core2/bs/bFly.c index 96647ffb..349ba162 100644 --- a/src/core2/bs/bFly.c +++ b/src/core2/bs/bFly.c @@ -405,7 +405,7 @@ void func_802A411C(void) { } else { sp44 = 0; } - ml_vec3f_copy(sp28, &D_8037D338); + ml_vec3f_copy(sp28, D_8037D338); ml_vec3f_normalize(sp28); sp24 = mlAbsF(sp34[0] * sp28[0] + sp34[1] * sp28[1] + sp34[2] * sp28[2]); if (miscflag_isTrue(8) || ((sp44 & 0x80) != 0)) { @@ -705,15 +705,15 @@ void func_802A4D70(void){ void func_802A4D90(void) { f32 sp34; - f32 sp28[3]; + f32 player_position[3]; f32 sp1C[3]; func_802BB3DC(2, 100.0f, 0.85f); func_8028A274(0x10D, 1.0f); func_8030E58C(SFX_56_BANJO_HUI, 1.0f); - _player_getPosition(&sp28); + _player_getPosition(player_position); func_80294980(sp1C); - func_80257F18(sp1C, sp28, &sp34); + func_80257F18(sp1C, player_position, &sp34); yaw_setIdeal(mlNormalizeAngle(sp34 + 180.0f)); yaw_applyIdeal(); func_80297970(1300.0f); diff --git a/src/core2/bs/bbuster.c b/src/core2/bs/bbuster.c index 538efae9..aee43e70 100644 --- a/src/core2/bs/bbuster.c +++ b/src/core2/bs/bbuster.c @@ -85,7 +85,7 @@ void bsbbuster_update(void){ AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); s32 sp3C; f32 sp30[3]; - s32 sp24[3]; + f32 player_position[3]; D_8037D2B8 = 0; if(animctrl_isAt(aCtrl, 0.24f)) @@ -144,8 +144,8 @@ void bsbbuster_update(void){ D_8037D2B8 = 1; D_8037D2B0 = 0.09f; D_8037D2BA = 3; - _player_getPosition(&sp24); - func_8032728C(sp24, 150.0f, 2, func_8029FB20); + _player_getPosition(player_position); + func_8032728C(player_position, 150.0f, 2, func_8029FB20); if(func_802931DC(&sp3C)){ sp44 = BS_SPLAT; } @@ -205,4 +205,4 @@ void bsbbuster_end(void){ void func_802A02B4(s32 arg0){ D_8037D2BB = arg0; -} \ No newline at end of file +} diff --git a/src/core2/bs/beeFly.c b/src/core2/bs/beeFly.c index 11f32360..7cb2e071 100644 --- a/src/core2/bs/beeFly.c +++ b/src/core2/bs/beeFly.c @@ -30,15 +30,15 @@ u8 D_8037D2C0; int bsBeeFly_inSet(s32); void func_802A04F0(void){ - f32 plyrPos[3]; //sp1C + f32 player_position[3]; - _player_getPosition(&plyrPos); - plyrPos[0] += randf2(-30.0f, 30.0f); - plyrPos[1] += 30.0f + randf2(0.0f, 30.0f); - plyrPos[2] += randf2(-30.0f, 30.0f); + _player_getPosition(player_position); + player_position[0] += randf2(-30.0f, 30.0f); + player_position[1] += 30.0f + randf2(0.0f, 30.0f); + player_position[2] += randf2(-30.0f, 30.0f); func_803541C0(3); func_803541CC(0x50); - func_80354030(plyrPos, 0.5f); + func_80354030(player_position, 0.5f); } diff --git a/src/core2/bs/croc.c b/src/core2/bs/croc.c index 47b389a4..cde1138c 100644 --- a/src/core2/bs/croc.c +++ b/src/core2/bs/croc.c @@ -204,12 +204,12 @@ void bscroc_jump_init(void){ void bscroc_jump_update(void){ enum bs_e sp2C = 0; AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); - f32 sp1C[3]; + f32 player_velocity[3]; func_802ABE70(); func_802ABF54(); - _get_velocity(&sp1C); - if(button_released(BUTTON_A) && 0.0f < sp1C[1]) + _get_velocity(player_velocity); + if(button_released(BUTTON_A) && 0.0f < player_velocity[1]) gravity_reset(); switch(D_8037D3EC){ @@ -283,12 +283,12 @@ void bscroc_fall_init(void){ void bscroc_fall_update(void){ enum bs_e next_state = 0; AnimCtrl * aCtrl = _player_getAnimCtrlPtr(); - f32 velocity[3]; + f32 player_velocity[3]; func_802ABE70(); func_80299628(0); func_802ABF54(); - _get_velocity(&velocity); + _get_velocity(player_velocity); switch(D_8037D3EC){ case 0: @@ -328,7 +328,7 @@ void bscroc_fall_end(void){ static void __bscroc_recoil_init(s32 damage){ AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); f32 sp38; - f32 sp2C[3]; + f32 player_position[3]; f32 sp20[3]; animctrl_reset(aCtrl); @@ -342,9 +342,9 @@ static void __bscroc_recoil_init(s32 damage){ else func_8030E58C(SFX_56_BANJO_HUI, 1.8f); - _player_getPosition(&sp2C); - func_80294980(&sp20); - func_80257F18(&sp20, &sp2C, &sp38); + _player_getPosition(player_position); + func_80294980(sp20); + func_80257F18(sp20, player_position, &sp38); yaw_setIdeal(mlNormalizeAngle(sp38 + 180.0f)); yaw_applyIdeal(); func_80297970(200.0f); @@ -415,7 +415,7 @@ void bscroc_bounce_end(void){ void bscroc_die_init(void){ AnimCtrl * aCtrl = _player_getAnimCtrlPtr(); f32 sp38; - f32 sp2C[3]; + f32 player_position[3]; f32 sp20[3]; func_8029B930(); @@ -427,9 +427,9 @@ void bscroc_die_init(void){ animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); func_802875AC(aCtrl, "bscroc.c", 0x32b); func_8029C7F4(1,1,2,3); - _player_getPosition(&sp2C); - func_80294980(&sp20); - func_80257F18(&sp20, &sp2C, &sp38); + _player_getPosition(player_position); + func_80294980(sp20); + func_80257F18(sp20, player_position, &sp38); yaw_setIdeal(mlNormalizeAngle(sp38 + 180.0f)); yaw_applyIdeal(); D_8037D3E0 = 250.0f; @@ -504,9 +504,9 @@ static void func_802ACF58(void){ f32 sp2C; f32 sp20[3]; sp2C = func_8028B2E8() ? 500.0f : 400.0f; - func_802589E4(&sp20, yaw_get(), sp2C); + func_802589E4(sp20, yaw_get(), sp2C); sp20[1] = 200.0f; - func_80297A0C(&sp20); + func_80297A0C(sp20); } void bscroc_bite_init(void){ @@ -595,13 +595,13 @@ void bscroc_eat_bad_end(void){ void func_802AD2A8(Gfx **gdl, Mtx **mPtr, void *arg2){ - f32 sp34[3]; + f32 player_rotation[3]; f32 sp28[3]; - player_getRotation(&sp34); - func_8028E9C4(2, &sp28); + player_getRotation(player_rotation); + func_8028E9C4(2, sp28); modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL); - modelRender_draw(gdl, mPtr, &sp28, &sp34, D_8037D3F0, NULL, D_8037D3E8); + modelRender_draw(gdl, mPtr, sp28, player_rotation, D_8037D3F0, NULL, D_8037D3E8); } @@ -705,4 +705,4 @@ void bscroc_drone_update(void){ void bscroc_drone_end(void){ bsdrone_end(); func_802ABFBC(); -} \ No newline at end of file +} diff --git a/src/core2/bs/dronexform.c b/src/core2/bs/dronexform.c index 265e87af..3e4cf51f 100644 --- a/src/core2/bs/dronexform.c +++ b/src/core2/bs/dronexform.c @@ -42,8 +42,11 @@ void func_802AF7A0(ParticleEmitter *arg0, enum asset_e arg1){ func_802EFF50(arg0, 1.0f); } -void func_802AF88C(Actor * arg0, f32 arg1, f32 arg2){ - particleEmitter_setParticleVelocityRange(arg0, arg1*30.0f, 10.0f, arg2*30.0f, arg1*30.0f, 10.0f, arg2*30.0f); +void func_802AF88C(ParticleEmitter * arg0, f32 arg1, f32 arg2){ + particleEmitter_setParticleVelocityRange(arg0, + arg1*30.0f, 10.0f, arg2*30.0f, + arg1*30.0f, 10.0f, arg2*30.0f + ); func_802EFB70(arg0, D_8037D470.unk14, D_8037D470.unk14); } @@ -55,7 +58,7 @@ void func_802AF900(void){ f32 sp3C; f32 sp30[3]; - player_getPosition(&sp30); + player_getPosition(sp30); sp3C = D_8037D470.unk8; sp48 = func_80257A44(sp3C, 0.38f); sp4C = sp48 * 6.283185308; @@ -65,16 +68,16 @@ void func_802AF900(void){ sp30[1] += func_80257C48(func_80257A44(sp3C, 1.14f), 0.0f, 130.0f); sp30[2] += sp44 * D_8037D470.unk18; func_802AF88C(D_8037D470.unk4, sp40, sp44); - particleEmitter_setPosition(D_8037D470.unk4, &sp30); + particleEmitter_setPosition(D_8037D470.unk4, sp30); particleEmitter_emitN(D_8037D470.unk4, 1); - player_getPosition(&sp30); + player_getPosition(sp30); sp4C = (1.0 - func_802588B0(sp48 + 0.5, 1.0f))* 6.283185308; sp30[0] -= sinf(sp4C) * D_8037D470.unk18; sp30[1] += func_80257C48(func_80257A44(sp3C, 1.14f), 130.0f, 0.0f); sp30[2] -= cosf(sp4C) * D_8037D470.unk18; func_802AF88C(D_8037D470.unk0, sp40, sp44); - particleEmitter_setPosition(D_8037D470.unk0, &sp30); + particleEmitter_setPosition(D_8037D470.unk0, sp30); particleEmitter_emitN(D_8037D470.unk0, 1); } @@ -110,7 +113,7 @@ void func_802AFBAC(f32 arg0){ D_8037D470.unk14 = arg0; } -void func_802AFBB8(f32 (* arg0)[3]){ +void func_802AFBB8(f32 arg0[3]){ static struct41s D_80364BB0 = { {{-150.0f, 10.0f, -150.0f}, { 150.0f, 50.0f, 150.0f}}, {{ 0.0f, -50.0f, 0.0f}, { 0.0f, -50.0f, 0.0f}} @@ -276,10 +279,10 @@ static void __bsdronexform_setState(int arg0){ break; case 5:// 802B02F4 - _player_getPosition(&sp24); + _player_getPosition(sp24); sp24[1] += 30.0f; - func_8024E3A8(&sp24, 80.0f); - func_802AFBB8(&sp24); + func_8024E3A8(sp24, 80.0f); + func_802AFBB8(sp24); func_8029E3C0(0, 0.1f); break; @@ -443,4 +446,4 @@ void bsdronexform_end(void){ miscflag_clear(MISC_FLAG_1B_TRANSFORMING); } -void bsdronexform_interrupt(void){}; \ No newline at end of file +void bsdronexform_interrupt(void){} diff --git a/src/core2/bs/jump.c b/src/core2/bs/jump.c index 0b2d2032..7b934424 100644 --- a/src/core2/bs/jump.c +++ b/src/core2/bs/jump.c @@ -95,7 +95,7 @@ void bsjump_update(void){ func_802B6FA8(); } - _get_velocity(&velocity); + _get_velocity(velocity); if((button_released(BUTTON_A) && 0.0f < velocity[1] && !D_8037D4C2) || !can_control_jump_height()){ gravity_reset(); } @@ -189,14 +189,14 @@ void bsjump_fall_init(void){ void bsjump_fall_update(void){ enum bs_e sp2C = 0; AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); - f32 sp1C[3]; + f32 player_velocity[3]; if(miscflag_isTrue(0xf)) func_802978A4(); else func_802B6FA8(); - _get_velocity(&sp1C); + _get_velocity(player_velocity); switch(D_8037D4C0){ case 0://L802B17B8 @@ -245,7 +245,7 @@ void bsjump_fall_update(void){ bs_setState(sp2C); } -void bsjump_fall_end(void){}; +void bsjump_fall_end(void){} void func_802B1928(void) { AnimCtrl *anim_ctrl; diff --git a/src/core2/bs/throw.c b/src/core2/bs/throw.c index 925b79f2..be390ed7 100644 --- a/src/core2/bs/throw.c +++ b/src/core2/bs/throw.c @@ -2,6 +2,8 @@ #include "functions.h" #include "variables.h" +extern ActorMarker *carriedobj_getMarker(void); + /* .bss */ u8 D_8037D580; @@ -28,16 +30,16 @@ void bsthrow_update(void){ enum bs_e next_state = 0; AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); f32 sp34[3]; - f32 sp28[3]; + f32 player_position[3]; f32 sp24; ActorMarker *sp20 = carriedobj_getMarker(); if(D_8037D580 == 0 && sp20 != NULL) func_802948F8(sp20); - _player_getPosition(&sp28); - func_80294A1C(&sp34); - func_80257F18(&sp28, &sp34, &sp24); + _player_getPosition(player_position); + func_80294A1C(sp34); + func_80257F18(player_position, sp34, &sp24); yaw_setIdeal(sp24); if(animctrl_isAt(aCtrl, 0.35f) && sp20){ @@ -71,4 +73,4 @@ void bsthrow_interrupt(void){ else{ //L802B6748 func_80296608(); } -} \ No newline at end of file +} diff --git a/src/core2/bs/walrus.c b/src/core2/bs/walrus.c index e42341f0..765baf4b 100644 --- a/src/core2/bs/walrus.c +++ b/src/core2/bs/walrus.c @@ -774,4 +774,4 @@ void bswalrus_sled_drone_update(void){ void bswalrus_sled_drone_end(void){ bsdrone_end(); func_802B80D0(); -} \ No newline at end of file +} diff --git a/src/core2/ch/badShad.c b/src/core2/ch/badShad.c index b2cf6dc4..cf6ab983 100644 --- a/src/core2/ch/badShad.c +++ b/src/core2/ch/badShad.c @@ -2,7 +2,7 @@ #include "functions.h" #include "variables.h" -extern void func_802C3D3C(void (*)(s32, s32), s32, s32); +extern void __spawnQueue_add_2(void (*)(s32, s32), s32, s32); Actor *func_802D6F48(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3); void func_802D6EA0(Actor *this); @@ -38,7 +38,7 @@ void func_802D6EA0(Actor *this){ Actor *func_802D6F48(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ f32 sp44[3]; f32 sp40; - Actor *this = func_80325300(marker, sp44); + Actor *this = marker_getActorAndRotation(marker, sp44); Actor *other; if(this->despawn_flag) return this; @@ -136,7 +136,7 @@ void func_802D729C(Actor *actor, f32 arg1){ return; } if(!actor->unk104){ - func_802C3D3C(func_802D71A0, (s32) actor->marker, reinterpret_cast(s32, arg1)); + __spawnQueue_add_2((GenMethod_2)func_802D71A0, (s32) actor->marker, reinterpret_cast(s32, arg1)); return; } diff --git a/src/core2/ch/beehive.c b/src/core2/ch/beehive.c index 70dc708f..c6dc8cde 100644 --- a/src/core2/ch/beehive.c +++ b/src/core2/ch/beehive.c @@ -13,13 +13,13 @@ ActorAnimationInfo D_803672C0[] ={ }; ActorInfo D_803672E0 = {0x50, ACTOR_12_BEEHIVE, ASSET_364_MODEL_BEEHIVE, - 1, &D_803672C0, + 1, D_803672C0, func_802CE8D4, func_80326224, func_80325888, 0, 0x333, 0.0f, 0 }; /* .code */ -void func_802CE7E0(ActorMarker *marker, s32 arg1){ +void func_802CE7E0(ActorMarker *marker, ActorMarker *other){ Actor *actor = marker_getActor(marker); FUNC_8030E8B4(SFX_11_WOOD_BREAKING_1, 1.0f, 28000, actor->position, 300, 3000); FUNC_8030E8B4(SFX_D_EGGSHELL_BREAKING, 1.0f, 28000, actor->position, 300, 3000); @@ -27,8 +27,8 @@ void func_802CE7E0(ActorMarker *marker, s32 arg1){ actor_playAnimationOnce(actor); marker->collidable = FALSE; actor->unk138_27 = 3; - func_802C3F04(func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, actor->position[0]), reinterpret_cast(s32, actor->position[1]), reinterpret_cast(s32, actor->position[2])); - func_802C3F04(func_802C4140, ACTOR_4A_WOOD_EXPLOSION, reinterpret_cast(s32, actor->position[0]), reinterpret_cast(s32, actor->position[1]), reinterpret_cast(s32, actor->position[2])); + __spawnQueue_add_4((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, actor->position[0]), reinterpret_cast(s32, actor->position[1]), reinterpret_cast(s32, actor->position[2])); + __spawnQueue_add_4((GenMethod_4)func_802C4140, ACTOR_4A_WOOD_EXPLOSION, reinterpret_cast(s32, actor->position[0]), reinterpret_cast(s32, actor->position[1]), reinterpret_cast(s32, actor->position[2])); actor->marker->propPtr->unk8_3 = 0; func_803115C4(ASSET_D96_TEXT_BEEHIVE); func_803115C4(ASSET_DA6_TEXT_BEEHIVE_WITH_BEES); diff --git a/src/core2/ch/clucker.c b/src/core2/ch/clucker.c index 373577c6..fd6e6c4b 100644 --- a/src/core2/ch/clucker.c +++ b/src/core2/ch/clucker.c @@ -91,7 +91,7 @@ void func_80357264(Actor *this, s32 next_state){ if(next_state == 5){ if(!levelSpecificFlags_get(0x14) - && !( func_80326D68(this->position, 0x318, -1, &sp38) && ( sp38 < 250.0f)) + && !( actorArray_findClosestActorFromActorId(this->position, 0x318, -1, &sp38) && ( sp38 < 250.0f)) ){ levelSpecificFlags_set(0x14, TRUE); func_80324E38(0.0f, 3); diff --git a/src/core2/ch/code_5AB30.c b/src/core2/ch/code_5AB30.c index 0b7e8b34..48e90046 100644 --- a/src/core2/ch/code_5AB30.c +++ b/src/core2/ch/code_5AB30.c @@ -183,7 +183,7 @@ void func_802E1FD0(ActorMarker *marker, ActorMarker *other_marker){ FUNC_8030E8B4(SFX_3EA_UNKNOWN, 1.0f, 30000, actor->position, 1500, 4500); FUNC_8030E8B4(SFX_2F_ORANGE_SPLAT, 1.0f, 30000, actor->position, 1500, 4500); - __spawnqueue_add_1((GenMethod_1)func_802E1BD0, (s32)actor->marker); + __spawnQueue_add_1((GenMethod_1)func_802E1BD0, (s32)actor->marker); if(map_get() == MAP_27_FP_FREEZEEZY_PEAK) func_8038A978(); func_802E1CB8(actor->position, 0xC); @@ -221,7 +221,7 @@ void func_802E20E8(Actor *this){ animctrl_setAnimTimer(this->animctrl, randf()); func_8032BC18(this); if(map_get() == MAP_27_FP_FREEZEEZY_PEAK){ - local->unk0 = func_80326EEC(0x336)->marker; + local->unk0 = actorArray_findActorFromActorId(0x336)->marker; func_8038A990(); } }//L802E21D8 @@ -309,7 +309,7 @@ void func_802E20E8(Actor *this){ && local->unkB ){ func_8030E878(SFX_8F_SNOWBALL_FLYING, randf2(0.95f, 1.05f), 30000, this->position, 800.0f, 3050.0f); - __spawnqueue_add_1((GenMethod_1)func_802E1B24, (s32)this->marker); + __spawnQueue_add_1((GenMethod_1)func_802E1B24, (s32)this->marker); local->unk9 = FALSE; } diff --git a/src/core2/ch/gameSelect.c b/src/core2/ch/gameSelect.c index ce7c2b48..b7b0d89c 100644 --- a/src/core2/ch/gameSelect.c +++ b/src/core2/ch/gameSelect.c @@ -21,9 +21,11 @@ extern void func_8031FB14(s32, s32); extern void func_8031F678(s32, s32); extern void func_80335110(s32); -extern void func_8024E60C(s32, f32*); +extern void func_8024E60C(s32, s32[3]); extern void func_8024E71C(s32, f32*); +extern char *gcpausemenu_TimeToA(int); +extern struct5Bs *func_803097A0(void); /* .data */ f32 D_80365DD0[3][3] = { @@ -88,7 +90,7 @@ gczoombox_t *D_8037DCF0; gczoombox_t *D_8037DCF4; f32 D_8037DCF8[2][3]; f32 D_8037DD10[2][3]; -void *D_8037DD28; +s32 D_8037DD28; s32 D_8037DD2C; f32 D_8037DD30; f32 D_8037DD34; @@ -286,7 +288,7 @@ void func_802C4C14(Actor *this){ f32 sp54; f32 sp50; int i; //sp4C - s32 sp48; + struct5Bs *sp48; f32 sp44; s32 tmp_a2_2; f32 sp34[3]; @@ -298,7 +300,7 @@ void func_802C4C14(Actor *this){ return; if(!this->initialized){ - __spawnqueue_add_1(func_802C4BB4, this->marker); + __spawnQueue_add_1((GenMethod_1)func_802C4BB4, reinterpret_cast(s32, this->marker)); func_802C7318(this); this->unk130 = func_802C71F0; if(sp84 == 0){ @@ -348,7 +350,7 @@ void func_802C4C14(Actor *this){ case 1://L802C4F10 if(sp84 == 1){ func_8030E510(SFX_136_GAMEBOY_STARTUP, 15000); - timedFunc_set_3(0.25f, comusic_8025AB44, COMUSIC_73_GAMEBOY, -1, 2000); + timedFunc_set_3(0.25f, (GenMethod_3)comusic_8025AB44, COMUSIC_73_GAMEBOY, -1, 2000); func_8025A58C(0, 2000); } else{ @@ -390,19 +392,19 @@ void func_802C4C14(Actor *this){ if(animctrl_isStopped(this->animctrl)){ func_802DEB80(); if(!func_8033D1BC(sp84)){ - timedFunc_set_3(0.0f, func_802E4078, MAP_85_CS_SPIRAL_MOUNTAIN_3, 0, 1); + timedFunc_set_3(0.0f, (GenMethod_3)func_802E4078, MAP_85_CS_SPIRAL_MOUNTAIN_3, 0, 1); } else{//L802C511C sp44 = 0.0f; if(this->state == 4 && (sp84 == 0 || sp84 == 1)) sp44 = 0.25f; if(func_802DA498() && func_8031FF1C(BKPROG_BD_ENTER_LAIR_CUTSCENE)){ - timedFunc_set_2(sp44, func_8031FB14, 0, 0); + timedFunc_set_2(sp44, (GenMethod_2)func_8031FB14, 0, 0); } else{//L802C5188 - timedFunc_set_2(sp44, func_8031F678, 0, 0); + timedFunc_set_2(sp44, (GenMethod_2)func_8031F678, 0, 0); }//L802C51A0 - timedFunc_set_1(sp44, func_80335110, 1); + timedFunc_set_1(sp44, (GenMethod_1)func_80335110, 1); }//L802C51B8 this->state = 6; } @@ -426,17 +428,17 @@ void func_802C4C14(Actor *this){ case 0://L802C52B8 func_8030E510(SFX_31_BANJO_OHHWAAOOO, 28000); func_8030E540(SFX_135_CARTOONY_SPRING); - timedFunc_set_2(0.4f, func_8030E510, SFX_13A_GLASS_BREAKING_7, 0x7fff); - timedFunc_set_2(0.9f, func_8030E510, SFX_150_PORCELAIN_CRASH, 0x7fff); - timedFunc_set_2(1.0f, func_8030E510, SFX_151_CAT_MEOW, 0x7fff); + timedFunc_set_2(0.4f, (GenMethod_2)func_8030E510, SFX_13A_GLASS_BREAKING_7, 0x7fff); + timedFunc_set_2(0.9f, (GenMethod_2)func_8030E510, SFX_150_PORCELAIN_CRASH, 0x7fff); + timedFunc_set_2(1.0f, (GenMethod_2)func_8030E510, SFX_151_CAT_MEOW, 0x7fff); break; case 1://L802C5320 - timedFunc_set_2(0.4f, func_8030E510, SFX_31_BANJO_OHHWAAOOO, 28000); - timedFunc_set_2(0.2f, func_8030E510, SFX_E_SHOCKSPRING_BOING, 28000); + timedFunc_set_2(0.4f, (GenMethod_2)func_8030E510, SFX_31_BANJO_OHHWAAOOO, 28000); + timedFunc_set_2(0.2f, (GenMethod_2)func_8030E510, SFX_E_SHOCKSPRING_BOING, 28000); func_8030E540(SFX_2D_KABOING); break; case 2://L802C5364 - timedFunc_set_2(0.15f, func_8030E510, SFX_32_BANJO_EGHEE, 28000); + timedFunc_set_2(0.15f, (GenMethod_2)func_8030E510, SFX_32_BANJO_EGHEE, 28000); func_8030E510(SFX_3F6_UNKNOWN, 28000); func_8030E540(SFX_8F_SNOWBALL_FLYING); break; @@ -603,4 +605,4 @@ void func_802C5A3C(s32 arg0){ void func_802C5A48(void){ D_80365E00 = -1; -} \ No newline at end of file +} diff --git a/src/core2/ch/gloop.c b/src/core2/ch/gloop.c index b2436ba9..76e7f664 100644 --- a/src/core2/ch/gloop.c +++ b/src/core2/ch/gloop.c @@ -83,7 +83,7 @@ void chgloop_update(Actor *this){ sp34[2] = this->position[2]; } if(func_80329530(this, 1900)){ - func_802C3F04(chgloop_spawnBubble, reinterpret_cast(s32, sp34[0]), reinterpret_cast(s32, sp34[1]), reinterpret_cast(s32, sp34[2]), reinterpret_cast(s32, this->yaw)); + __spawnQueue_add_4(chgloop_spawnBubble, reinterpret_cast(s32, sp34[0]), reinterpret_cast(s32, sp34[1]), reinterpret_cast(s32, sp34[2]), reinterpret_cast(s32, this->yaw)); } func_8030E9C4(SFX_3ED, randf()/2 + 0.6, 32000, this->position, 100.0f, 3000.0f); diff --git a/src/core2/ch/icecube.c b/src/core2/ch/icecube.c index fc4de1bf..32383c9d 100644 --- a/src/core2/ch/icecube.c +++ b/src/core2/ch/icecube.c @@ -5,10 +5,12 @@ #define _HorzDist3v(v1, v2) ((v1[0]-v2[0])*(v1[0]-v2[0]) + (v1[2]-v2[2])*(v1[2]-v2[2])) extern void func_802D729C(Actor *, f32); extern f32 func_80257204(f32, f32, f32, f32); +extern Actor *func_802C937C(enum actor_e, f32[3]); void chicecube_update(Actor *this); Actor *chicecube_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + /* .data */ ActorAnimationInfo D_80372B50[] = { {0x000, 0.0f}, @@ -224,7 +226,7 @@ void __chicecube_die(ActorMarker *marker, ActorMarker *other_marker){ func_8035A04C(actor->position, 12, ASSET_505_MODEL_ICECUBE_CHUNK, actor->scale); func_8035A228(actor->position, 6, ASSET_700_SPRITE_DUST, actor->scale); if(actor->unkF4_8 != 1){ - __spawnqueue_add_1(__chicecube_spawnHalfCubes, actor->marker); + __spawnQueue_add_1((GenMethod_1)__chicecube_spawnHalfCubes, reinterpret_cast(s32, actor->marker)); } marker_despawn(actor->marker); } diff --git a/src/core2/ch/jiggy.c b/src/core2/ch/jiggy.c index b581ecb0..81fd85f7 100644 --- a/src/core2/ch/jiggy.c +++ b/src/core2/ch/jiggy.c @@ -14,10 +14,10 @@ typedef struct chjiggy_s{ Actor *func_802C41D8(f32, f32, f32); void func_802C7AF8(u32 x, u32 y, u32 z, u32 arg3); -Actor *func_802C7D0C(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3); +Actor *chjiggy_draw(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3); void func_802C7D98(Actor * arg0); -void func_802C7DC0(Actor *this); -int func_802C8088(Actor *this); +void chjiggy_update(Actor *this); +enum jiggy_e chjiggy_getJiggyId(Actor *this); @@ -31,7 +31,7 @@ ActorAnimationInfo D_80366290[] = { ActorInfo D_803662A8 = { 0x52, ACTOR_46_JIGGY, ASSET_35F_MODEL_JIGGY, 1, D_80366290, - func_802C7DC0, func_802C7D98, func_802C7D0C, + chjiggy_update, func_802C7D98, chjiggy_draw, 0, 0, 0.9f, 0 }; @@ -62,8 +62,8 @@ void func_802C7AB0(ActorMarker * arg0, u32 arg1){ } void func_802C7AF8(u32 x, u32 y, u32 z, u32 arg3){ - func_802C3F04((GenMethod_4)func_802C41D8, ACTOR_4C_STEAM, x, y, z); - func_802C3F04((GenMethod_4)func_802C41D8, ACTOR_14F_DESTROYED_JIGGY, x, y, z); + __spawnQueue_add_4((GenMethod_4)func_802C41D8, ACTOR_4C_STEAM, x, y, z); + __spawnQueue_add_4((GenMethod_4)func_802C41D8, ACTOR_14F_DESTROYED_JIGGY, x, y, z); mapSpecificFlags_set(arg3, 1); } @@ -80,16 +80,15 @@ void func_802C7B8C(Actor *this, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5 actor_collisionOff(this); func_802BAFE4(arg3); func_80356520(arg6); - timedFunc_set_4(0.6f, (TFQM4)func_802C7AF8, (s32)this->position[0], (s32)this->position[1], (s32)this->position[2], arg4); - timedFunc_set_2(0.6f, (TFQM2)func_802C7AB0, (s32)this->marker, arg5); - timedFunc_set_0(1.0f, (TFQM0)func_802BE720); + timedFunc_set_4(0.6f, (GenMethod_4)func_802C7AF8, (s32)this->position[0], (s32)this->position[1], (s32)this->position[2], arg4); + timedFunc_set_2(0.6f, (GenMethod_2)func_802C7AB0, (s32)this->marker, arg5); + timedFunc_set_0(1.0f, (GenMethod_0)func_802BE720); timedFunc_set_1(3.9f, (GenMethod_1)func_802C7B6C, arg4); mapSpecificFlags_set(arg1, 1); } } -//chjiggy_updateRotate -void func_802C7CA4(Actor *this){ +void chjiggy_updateRotation(Actor *this){ f32 delta = time_getDelta(); this->yaw += delta * 230.0f; if(360.0f <= this->yaw){ @@ -99,13 +98,13 @@ void func_802C7CA4(Actor *this){ } //chjiggy_draw -Actor *func_802C7D0C(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3){ +Actor *chjiggy_draw(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3){ Actor * thisActor = marker_getActor(this); ActorLocal_Jiggy *local = (ActorLocal_Jiggy *)&thisActor->local; u32 jiggyId; if(!local->unk0){ - jiggyId = func_802C8088(thisActor); + jiggyId = chjiggy_getJiggyId(thisActor); if((jiggyId == JIGGY_1C_CC_RINGS) || (jiggyId == JIGGY_1D_CC_SLOW_SAWBLADES)){ func_8033A280(10.0f); func_8033A244(30000.0f); @@ -117,11 +116,11 @@ Actor *func_802C7D0C(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3){ void func_802C7D98(Actor * arg0){ func_80343DEC(arg0); - func_802C7CA4(arg0); + chjiggy_updateRotation(arg0); } //chjiggy_update -void func_802C7DC0(Actor *this){ +void chjiggy_update(Actor *this){ ActorLocal_Jiggy *local = (ActorLocal_Jiggy *)&this->local; int i; @@ -144,7 +143,7 @@ void func_802C7DC0(Actor *this){ } else{ func_80328A84(this, 2); - switch(func_802C8088(this)){ + switch(chjiggy_getJiggyId(this)){ case JIGGY_17_CC_CLANKER_RAISED: //L802C7EF8 case JIGGY_49_CCW_EYRIE:// L802C7EF8 this->marker->unk40_21 = 1; @@ -156,7 +155,7 @@ void func_802C7DC0(Actor *this){ this->marker->unk2C_2 = 1; this->unk54 = 0.0f; func_80343DEC(this); - func_802C7CA4(this); + chjiggy_updateRotation(this); break; case JIGGY_3E_GV_GRABBA:// L802C7F6C case JIGGY_4D_CCW_FLOWER:// L802C7F6C @@ -172,8 +171,8 @@ void func_802C7DC0(Actor *this){ } break; case 2: //L802C7FAC - func_802C7CA4(this); - switch(func_802C8088(this)){ + chjiggy_updateRotation(this); + switch(chjiggy_getJiggyId(this)){ case JIGGY_20_BGS_ELEVATED_WALKWAY: //L802C7FE8 func_802C7B8C(this, 4, 3, 0xD, 5, 2, 0xae); break; @@ -191,21 +190,18 @@ void func_802C7DC0(Actor *this){ }//L802C8074 } -//chjiggy_getId -int func_802C8088(Actor *this){ +enum jiggy_e chjiggy_getJiggyId(Actor *this){ ActorLocal_Jiggy *local = (ActorLocal_Jiggy *)&this->local; return local->index; } - -void func_802C8090(Actor * this){ +void chjiggy_hide(Actor * this){ ActorLocal_Jiggy *local = (ActorLocal_Jiggy *)&this->local; local->unk0 = 1; actor_collisionOff(this); } -//chjiggy_setId -void func_802C80B4(Actor *this, u32 id){ +void chjiggy_setJiggyId(Actor *this, u32 id){ ActorLocal_Jiggy *local = (ActorLocal_Jiggy *)&this->local; local->index = id; } diff --git a/src/core2/ch/jigsawdance.c b/src/core2/ch/jigsawdance.c index 01b97887..415deaee 100644 --- a/src/core2/ch/jigsawdance.c +++ b/src/core2/ch/jigsawdance.c @@ -3,6 +3,7 @@ #include "variables.h" extern f32 func_8028EBA4(); +AnimCtrl *player_getAnimCtrlPtr(void); Actor *func_802C80C0(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3); void func_802C811C(Actor * this); @@ -38,7 +39,7 @@ Actor *func_802C80C0(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3){ } void func_802C811C(Actor * this){ - ActorAnimCtrl *plyrMvmt; + AnimCtrl *plyrMvmt; this->marker->collidable = 0; switch(this->state){ diff --git a/src/core2/ch/mole.c b/src/core2/ch/mole.c index fbd27653..5b289123 100644 --- a/src/core2/ch/mole.c +++ b/src/core2/ch/mole.c @@ -293,8 +293,9 @@ void func_802D9CBC(Actor *this){ void func_802D9D60(Actor *this){ s32 sp50[6]; f32 sp4C; - f32 pad44[2]; + f32 pad44[1]; Actor *other; + NodeProp *node_prop; f32 sp34[3]; if(this->unkF4_8 < 8 || this->unkF4_8 >= 0x13) @@ -304,7 +305,7 @@ void func_802D9D60(Actor *this){ this->unk16C_4 = 1; func_803300D8(this->marker, func_802D9C90); if(this->initialized){ - other = func_80326D68(this->position, ACTOR_12C_MOLEHILL, -1, &sp4C); + other = actorArray_findClosestActorFromActorId(this->position, ACTOR_12C_MOLEHILL, -1, &sp4C); this->unk100 = (other) ? other->marker : NULL; if(this->unk100){ other = subaddie_getLinkedActor(this); @@ -316,29 +317,29 @@ void func_802D9D60(Actor *this){ }//L802D9E34 if(!this->initialized){ - other = func_80304C38(0x372, this); - if(other == NULL){ + node_prop = func_80304C38(0x372, this); + if(node_prop == NULL){ this->unk38_0 = FALSE; } else{ this->unk38_0 = TRUE; - nodeprop_getPosition(other, this->unk1C); + nodeprop_getPosition(node_prop, this->unk1C); } - __spawnqueue_add_1(func_802D9C54, this->marker); + __spawnQueue_add_1((GenMethod_1)func_802D9C54, reinterpret_cast(s32, this->marker)); this->marker->propPtr->unk8_3 = FALSE; this->marker->collidable = FALSE; this->initialized = TRUE; if(this->unkF4_8 == 0x12){ - other = func_80304C38(0x349, this); - if(other == NULL){ + node_prop = func_80304C38(0x349, this); + if(node_prop == NULL){ this->velocity[0] = this->position[0]; this->velocity[1] = this->position[1]; this->velocity[2] = this->position[2]; this->unk28 = 500.0f; } else{ //L802D9F08 - nodeprop_getPosition(other, this->velocity); - this->unk28 = 2*nodeprop_getRadius(other); + nodeprop_getPosition(node_prop, this->velocity); + this->unk28 = 2*nodeprop_getRadius(node_prop); } } }//L802D9F34 diff --git a/src/core2/ch/soundsource.c b/src/core2/ch/soundsource.c index 4eba7205..b6ca9d66 100644 --- a/src/core2/ch/soundsource.c +++ b/src/core2/ch/soundsource.c @@ -115,7 +115,7 @@ void func_802D096C(s32 arg0, s32 arg1, s32 arg2, s32 arg3){ } void func_802D09B8(Actor *this, s32 arg1){ - func_802C3F04(func_802D096C, + __spawnQueue_add_4((GenMethod_4)func_802D096C, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2]), diff --git a/src/core2/code_11660.c b/src/core2/code_11660.c index a753cde6..59e17661 100644 --- a/src/core2/code_11660.c +++ b/src/core2/code_11660.c @@ -84,4 +84,4 @@ void func_80298700(void){ else{ D_8037C5D0 = NULL; } -} \ No newline at end of file +} diff --git a/src/core2/code_14420.c b/src/core2/code_14420.c index 49027c73..b811bfd3 100644 --- a/src/core2/code_14420.c +++ b/src/core2/code_14420.c @@ -886,7 +886,7 @@ void func_8029CBC4(void){ void func_8029CBF4(void){ if(item_getCount(ITEM_E_JIGGY) == 10){ if( jiggyscore_total() == 100 && func_8031FF1C(BKPROG_FC_DEFEAT_GRUNTY)){ - timedFunc_set_3(4.1f, (TFQM3)func_802E4078, MAP_95_CS_END_ALL_100, 0, 1); + timedFunc_set_3(4.1f, (GenMethod_3)func_802E4078, MAP_95_CS_END_ALL_100, 0, 1); }//L8029CC58 timedFunc_set_0(4.0f, func_8029CBC4); diff --git a/src/core2/code_16010.c b/src/core2/code_16010.c index fa1d5f8e..79a6754b 100644 --- a/src/core2/code_16010.c +++ b/src/core2/code_16010.c @@ -55,7 +55,7 @@ void func_8029D154(void){ } void func_8029D194(void) { - func_802C3BF8(&func_8029D154); + __spawnQueue_add_0(&func_8029D154); FUNC_8030E624(SFX_A_BANJO_LANDING_05, 1.0f, 28000); func_8030E394(D_8037D210); sfxsource_setSfxId(D_8037D210, SFX_6D_CROC_BITE); diff --git a/src/core2/code_171F0.c b/src/core2/code_171F0.c index 93a05f16..b6f2b89d 100644 --- a/src/core2/code_171F0.c +++ b/src/core2/code_171F0.c @@ -56,4 +56,4 @@ int func_8029E384(s32 arg0){ void func_8029E3C0(s32 arg0, f32 arg1){ D_8037D250.unk20[arg0] = arg1; D_8037D250.unk0[arg0] = arg1; -} \ No newline at end of file +} diff --git a/src/core2/code_2240.c b/src/core2/code_2240.c index 0b7e0022..420ee9be 100644 --- a/src/core2/code_2240.c +++ b/src/core2/code_2240.c @@ -184,4 +184,4 @@ void anim_802897D4(Animation *this, BKAnimationList *arg0, Animation *dst){ void anim_8028980C(Animation *this){ this->unk1C = 2; -} \ No newline at end of file +} diff --git a/src/core2/code_33F90.c b/src/core2/code_33F90.c index d359dbe9..27ea329e 100644 --- a/src/core2/code_33F90.c +++ b/src/core2/code_33F90.c @@ -426,7 +426,7 @@ void func_802BAFE4(s32 arg0) { temp_f0 = func_802BAFA0(arg0, phi_s1); switch(D_803654B8[arg0][phi_s1 + 1]){ case -5: - timedFunc_set_6(temp_f0, (TFQM6) func_802BAF80, NULL); + timedFunc_set_6(temp_f0, (GenMethod_6) func_802BAF80, NULL); phi_s0++; break; diff --git a/src/core2/code_34790.c b/src/core2/code_34790.c index 28ffd1a6..8b8b7c78 100644 --- a/src/core2/code_34790.c +++ b/src/core2/code_34790.c @@ -116,7 +116,7 @@ void func_802BBA84(void) { f32 sp30[3]; f32 sp24[3]; - func_80309998(sp30, sp24); + mapModel_getBounds(sp30, sp24); func_8024C5CC(sp54); func_8024C764(sp3C); func_8024C5A8(sp48); @@ -356,7 +356,7 @@ void func_802BC2CC(s32 arg0) { func_8024CD88(D_8037D908); func_8024CE18(D_8037D918); func_8024CFD4(); - func_802C3D3C(func_802BC2A0, D_8037D908, D_8037D918); + __spawnQueue_add_2((GenMethod_2)func_802BC2A0, D_8037D908, D_8037D918); if (D_8037D8C0 == 2) { func_802BE720(); if (sp1C != 0x63) { diff --git a/src/core2/code_3480.c b/src/core2/code_3480.c index 02319cdf..6d6d0e10 100644 --- a/src/core2/code_3480.c +++ b/src/core2/code_3480.c @@ -24,20 +24,20 @@ void snacker_reset(void){ //__playerWithinHorizontalDistance s32 func_8028A41C(f32 x, f32 z, f32 dist){ - f32 plyrPos[3]; + f32 player_position[3]; - _player_getPosition(&plyrPos); - return func_80259254(plyrPos, x, z, dist); + _player_getPosition(player_position); + return func_80259254(player_position, x, z, dist); } //_snacker_ttc_update s32 func_8028A45C(void){ s32 nextState = 0; - f32 plyrPos[3]; + f32 player_position[3]; - _player_getPosition(&plyrPos); + _player_getPosition(player_position); if(func_8028B470() || func_803203FC(UNKFLAGS1_C1_IN_FINAL_CHARACTER_PARADE)){ //(swimming || ???) - if(plyrPos[1] < 600.0f + if(player_position[1] < 600.0f && !func_8028A41C(2478.0f, 4586.0f, 1750.0f) //within 1750 of sandcastle center && !func_8028A41C(-400.0, 2315.0f, 2000.0f) //within 2000 of blubber's ship center ){ @@ -141,4 +141,4 @@ void func_8028A8D0(void){ //snacker_getState s32 func_8028A94C(void){ return D_8037BF50; -} \ No newline at end of file +} diff --git a/src/core2/code_37CD0.c b/src/core2/code_37CD0.c index c38aa98b..5d3a66df 100644 --- a/src/core2/code_37CD0.c +++ b/src/core2/code_37CD0.c @@ -17,7 +17,7 @@ void func_802BEC60(void) { func_8024C5CC(D_8037DA50.unk0); func_8024C764(D_8037DA50.unkC); - func_80309998(sp24, sp18); + mapModel_getBounds(sp24, sp18); D_8037DA50.unk18[0] = (f32) sp24[0]; D_8037DA50.unk18[1] = (f32) sp24[1]; diff --git a/src/core2/code_3B5C0.c b/src/core2/code_3B5C0.c index e006ecd9..148b645c 100644 --- a/src/core2/code_3B5C0.c +++ b/src/core2/code_3B5C0.c @@ -21,7 +21,7 @@ struct{ /* .code */ bool func_802C2550(void) { - return (ml_vec3f_distance(D_8037DC60.unk0, &D_8037DC60.unk18) < 40.0f); + return (ml_vec3f_distance(D_8037DC60.unk0, D_8037DC60.unk18) < 40.0f); } void func_802C2598(f32 arg0[3], f32 arg1[3]) { @@ -57,8 +57,8 @@ void func_802C26D8(f32 arg0[3], f32 arg1[3]) { if (!func_802C2550() && !func_8028F150()) { func_8028FCC8(1); } - ml_vec3f_copy(arg0, &D_8037DC60.unk0); - ml_vec3f_copy(arg1, &D_8037DC60.unkC); + ml_vec3f_copy(arg0, D_8037DC60.unk0); + ml_vec3f_copy(arg1, D_8037DC60.unkC); } diff --git a/src/core2/code_400F0.c b/src/core2/code_400F0.c index dc6b7409..aa48a16a 100644 --- a/src/core2/code_400F0.c +++ b/src/core2/code_400F0.c @@ -186,7 +186,7 @@ void func_802C74F4(Actor *actor, s32 arg1, f32 arg2){ } void func_802C7568(enum actor_e actor_id, s32 arg1, f32 arg2){ - Actor *actor = func_80326EEC(actor_id); + Actor *actor = actorArray_findActorFromActorId(actor_id); if(actor) func_802C74F4(actor, arg1, arg2); } @@ -198,7 +198,7 @@ void func_802C75A0(Actor *actor, s32 arg1){ } void func_802C75C8(enum actor_e actor_id, s32 arg1){ - Actor *actor = func_80326EEC(actor_id); + Actor *actor = actorArray_findActorFromActorId(actor_id); if(actor) func_802C75A0(actor, arg1); } @@ -208,7 +208,7 @@ void func_802C75F8(Actor *actor, s32 arg1){ } void func_802C7600(enum actor_e actor_id, s32 arg1){ - Actor *actor = func_80326EEC(actor_id); + Actor *actor = actorArray_findActorFromActorId(actor_id); if(actor) func_802C75F8(actor, arg1); } @@ -345,4 +345,4 @@ void func_802C79C4(void){ mapSpecificFlags_set(i, FALSE); } } -} \ No newline at end of file +} diff --git a/src/core2/code_41460.c b/src/core2/code_41460.c index 19963621..2f086cec 100644 --- a/src/core2/code_41460.c +++ b/src/core2/code_41460.c @@ -74,7 +74,7 @@ Actor *func_802C8484(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { u32 phi_v1; s32 phi_s4; - sp58 = func_80325300(marker, &sp5C); + sp58 = marker_getActorAndRotation(marker, &sp5C); temp_s1 = sp58->unk40; phi_s4 = FALSE; for(phi_s0 = temp_s1->begin; phi_s0 < temp_s1->current; phi_s0++){ diff --git a/src/core2/code_440B0.c b/src/core2/code_440B0.c index 5dc3d1e3..124738f2 100644 --- a/src/core2/code_440B0.c +++ b/src/core2/code_440B0.c @@ -181,7 +181,7 @@ void func_802CB7C0(ActorMarker *marker, ActorMarker *other){ sp3C = this->modelCacheIndex == 0xF2; FUNC_8030E8B4(SFX_79_TICKER_DEATH, 1.0f, 32750, this->position, 950, 1900); FUNC_8030E8B4(SFX_79_TICKER_DEATH, 1.0f, 28000, this->position, 950, 1900); - func_802C3F04(func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2])); + __spawnQueue_add_4((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2])); this->unk60 = 5.0f; marker->collidable = FALSE; this->unk138_27 = 1; @@ -191,7 +191,7 @@ void func_802CB7C0(ActorMarker *marker, ActorMarker *other){ ) { this->depth_mode = MODEL_RENDER_DEPTH_COMPARE; if( !jiggyscore_isCollected(JIGGY_16_CC_SNIPPETS) - && ((func_80326D68(this->position, 0xF5, -1, &sp44) == NULL) || (3000.0f < sp44))) { + && ((actorArray_findClosestActorFromActorId(this->position, 0xF5, -1, &sp44) == NULL) || (3000.0f < sp44))) { sp48[0] = 13814.0f; sp48[1] = 3812.0f; sp48[2] = 0.0f; diff --git a/src/core2/code_47BD0.c b/src/core2/code_47BD0.c index 3a39bf0c..74d6866c 100644 --- a/src/core2/code_47BD0.c +++ b/src/core2/code_47BD0.c @@ -322,7 +322,7 @@ void chBeeSwarm_update(Actor *this) { sp78 = 0; if (!this->initialized) { this->initialized = TRUE; - beehive = func_80326D68(this->position, ACTOR_12_BEEHIVE, -1, &spB0); + beehive = actorArray_findClosestActorFromActorId(this->position, ACTOR_12_BEEHIVE, -1, &spB0); this->unk100 = (beehive != NULL) ? beehive->marker : NULL; if(500.0f < spB0){ this->unk100 = NULL; @@ -360,7 +360,7 @@ void chBeeSwarm_update(Actor *this) { actor_collisionOff(this); local->unk20 = assetcache_get(ASSET_3BF_MODEL_PLAYER_SHADOW); if (sp78 == 0) { - beehive = func_80326D68(this->position, ACTOR_12_BEEHIVE, -1, &spB0); + beehive = actorArray_findClosestActorFromActorId(this->position, ACTOR_12_BEEHIVE, -1, &spB0); if (beehive != NULL) { this->unk100 = beehive->marker; } else { diff --git a/src/core2/code_47C0.c b/src/core2/code_47C0.c index 8fd158e3..2f4ad5c3 100644 --- a/src/core2/code_47C0.c +++ b/src/core2/code_47C0.c @@ -166,7 +166,7 @@ void func_8028B9A8(s32 arg0){ } void func_8028BA00(s32 arg0){ - __spawnqueue_add_1(func_8028B9A8, arg0); + __spawnQueue_add_1((GenMethod_1)func_8028B9A8, arg0); if(arg0); } @@ -239,7 +239,7 @@ void func_8028BCA0(Prop *prop){ Actor *actor; //0xb8 f32 spAC[3]; f32 spA0[3]; - s32 sp9C; + s32 jiggy_id; s32 sp98; volatile s32 sp94; s32 sp88[3]; //0 @@ -527,13 +527,13 @@ void func_8028BCA0(Prop *prop){ return; player_getPosition(spA0); - sp9C = func_802C8088(actor); - if( sp9C != JIGGY_2F_FP_XMAS_TREE + jiggy_id = chjiggy_getJiggyId(actor); + if( jiggy_id != JIGGY_2F_FP_XMAS_TREE || (func_8028B2E8() && !(3600.0f < ml_vec3f_distance_squared(actor->position, spA0))) ){ - jiggyscore_setCollected(sp9C, 1); + jiggyscore_setCollected(jiggy_id, TRUE); func_803463F4(ITEM_26_JIGGY_TOTAL, 1); - if(sp9C == JIGGY_20_BGS_ELEVATED_WALKWAY || sp9C == JIGGY_25_BGS_MAZE){ + if(jiggy_id == JIGGY_20_BGS_ELEVATED_WALKWAY || jiggy_id == JIGGY_25_BGS_MAZE){ func_802D6924(); } if(jiggyscore_total() < 3){ @@ -544,7 +544,7 @@ void func_8028BCA0(Prop *prop){ func_8028B8DC(); } - func_802C3F04(func_8028B904, reinterpret_cast(u32, prop->actorProp.x), reinterpret_cast(u32, prop->actorProp.y), reinterpret_cast(u32, prop->actorProp.z), sp9C); + __spawnQueue_add_4((GenMethod_4)func_8028B904, reinterpret_cast(u32, prop->actorProp.x), reinterpret_cast(u32, prop->actorProp.y), reinterpret_cast(u32, prop->actorProp.z), jiggy_id); marker_despawn(marker); } } @@ -574,7 +574,7 @@ void func_8028BCA0(Prop *prop){ case 0x54: //L8028C820 func_8025A6EC(COMUSIC_19_LOW_PITCH_FLUTES, 28000); func_803012F8(); - func_802C3F04(func_802C418C, 0x4E, reinterpret_cast(u32, prop->actorProp.x), reinterpret_cast(u32, prop->actorProp.y), reinterpret_cast(u32, prop->actorProp.z)); + __spawnQueue_add_4((GenMethod_4)func_802C418C, 0x4E, reinterpret_cast(u32, prop->actorProp.x), reinterpret_cast(u32, prop->actorProp.y), reinterpret_cast(u32, prop->actorProp.z)); marker_despawn(marker); break; @@ -747,7 +747,7 @@ void func_8028BCA0(Prop *prop){ miscflag_set(MISC_FLAG_E_TOUCHING_WADING_BOOTS); func_802A6388(chwadingboots_802D6E4C(actor)); bs_checkInterrupt(BS_INTR_1B); - func_802C3F04(func_802C418C, 0x4E, reinterpret_cast(u32, prop->actorProp.x), reinterpret_cast(u32, prop->actorProp.y), reinterpret_cast(u32, prop->actorProp.z)); + __spawnQueue_add_4((GenMethod_4)func_802C418C, 0x4E, reinterpret_cast(u32, prop->actorProp.x), reinterpret_cast(u32, prop->actorProp.y), reinterpret_cast(u32, prop->actorProp.z)); chwadingboots_802D6E54(actor); break; @@ -771,7 +771,7 @@ void func_8028BCA0(Prop *prop){ miscflag_set(MISC_FLAG_10_TOUCHING_TURBO_TRAINERS); func_80294AE8(chtrainers_802CA748(actor)); bs_checkInterrupt(BS_INTR_1A); - func_802C3F04(func_802C418C, 0x4E, reinterpret_cast(u32, prop->actorProp.x), reinterpret_cast(u32, prop->actorProp.y), reinterpret_cast(u32, prop->actorProp.z)); + __spawnQueue_add_4((GenMethod_4)func_802C418C, 0x4E, reinterpret_cast(u32, prop->actorProp.x), reinterpret_cast(u32, prop->actorProp.y), reinterpret_cast(u32, prop->actorProp.z)); chtrainers_802CA750(actor); break; diff --git a/src/core2/code_49A70.c b/src/core2/code_49A70.c index 57681655..666324c3 100644 --- a/src/core2/code_49A70.c +++ b/src/core2/code_49A70.c @@ -121,7 +121,7 @@ void func_802D0F30(ActorMarker *marker, ActorMarker *other_marker) { this = marker_getActor(marker); FUNC_8030E8B4(SFX_1B_EXPLOSION_1, 1.0f, 32736, this->position, 1250, 2500); - __spawnqueue_add_1((GenMethod_1)func_802D0B24, reinterpret_cast(s32, this)); + __spawnQueue_add_1((GenMethod_1)func_802D0B24, reinterpret_cast(s32, this)); func_802D0B54(this); func_802D0CB4(this); func_802D0DDC(this, ASSET_53A_MODEL_SHRAPNAL_PIECE_EYE, 2); diff --git a/src/core2/code_4C020.c b/src/core2/code_4C020.c index 0bfd8491..01cd2d97 100644 --- a/src/core2/code_4C020.c +++ b/src/core2/code_4C020.c @@ -554,7 +554,7 @@ void func_802D4614(enum map_e map_id){ D_803676AC = TRUE; func_8028F918(2); func_8025A788(COMUSIC_69_FF_WARP, 0.0f, 1.7f); - timedFunc_set_2(1.0f, (TFQM2) func_8031CC40, map_id, 2); + timedFunc_set_2(1.0f, (GenMethod_2) func_8031CC40, map_id, 2); } void func_802D4680(Actor *this){ @@ -707,44 +707,44 @@ void func_802D4CD4(Actor *this){ func_802D4AC0(this, 0x4000bb, 0x47); } -void func_802D4D3C(s32 arg0, s32 arg1) { - s32 sp5C[3]; +void func_802D4D3C(enum actor_e arg0, enum actor_e arg1) { + f32 sp5C[3]; s32 sp4C[4]; f32 sp40[3]; - if (func_80304E24(arg1, &sp5C)) { - func_803331D8(arg0, &sp5C); + if (func_80304E24(arg1, sp5C)) { + func_803331D8(arg0, sp5C); func_8025A6EC(COMUSIC_3D_JIGGY_SPAWN, 0x7FFF); if (arg0 == 0x36) { sp4C[3] = 200; sp4C[0] = sp4C[1] = sp4C[2] = 180;\ - ml_vec3f_assign(&sp40, 0.0f, 0.0f, 0.0f); - func_802EE6CC(&sp5C, &sp40, &sp4C, 0, 6.0f, 200.0f, 200, 100, 0); + ml_vec3f_assign(sp40, 0.0f, 0.0f, 0.0f); + func_802EE6CC(sp5C, sp40, sp4C, 0, 6.0f, 200.0f, 200, 100, 0); sp4C[3] = 230; sp4C[0] = sp4C[1] = sp4C[2] = 150; - ml_vec3f_assign(&sp40, 0.0f, 2.0f, 0.0f); - func_802EE6CC(&sp5C, &sp40, &sp4C, 0, 2.0f, 90.0f, 50, 33, 0); + ml_vec3f_assign(sp40, 0.0f, 2.0f, 0.0f); + func_802EE6CC(sp5C, sp40, sp4C, 0, 2.0f, 90.0f, 50, 33, 0); sp4C[3] = 150; sp4C[0] = sp4C[1] = sp4C[2] = 230; - ml_vec3f_assign(&sp40, -3.0f, 1.0f, 1.0f); - func_802EE6CC(&sp5C, &sp40, &sp4C, 0, 3.5f, 130.0f, 100, 80, 0); + ml_vec3f_assign(sp40, -3.0f, 1.0f, 1.0f); + func_802EE6CC(sp5C, sp40, sp4C, 0, 3.5f, 130.0f, 100, 80, 0); sp4C[3] = 200; sp4C[0] = sp4C[1] = sp4C[2] = 250; - ml_vec3f_assign(&sp40, -1.0f, 3.0f, -3.0f); - func_802EE6CC(&sp5C, &sp40, &sp4C, 0, 2.4f, 40.0f, 10, 120, 0); + ml_vec3f_assign(sp40, -1.0f, 3.0f, -3.0f); + func_802EE6CC(sp5C, sp40, sp4C, 0, 2.4f, 40.0f, 10, 120, 0); sp4C[3] = 130; sp4C[0] = sp4C[1] = sp4C[2] = 130; - ml_vec3f_assign(&sp40, 2.0f, -2.0f, 2.0f); - func_802EE6CC(&sp5C, &sp40, &sp4C, 0, 4.7f, 180.0f, 20, 160, 0); + ml_vec3f_assign(sp40, 2.0f, -2.0f, 2.0f); + func_802EE6CC(sp5C, sp40, sp4C, 0, 4.7f, 180.0f, 20, 160, 0); func_8030E6D4(SFX_1B_EXPLOSION_1); } else{ - func_802C3F04(func_802C4140, 0x4C, + __spawnQueue_add_4((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, sp5C[0]), reinterpret_cast(s32, sp5C[1]), reinterpret_cast(s32, sp5C[2]) @@ -775,7 +775,7 @@ void func_802D5058(enum map_e map_id, s32 arg1, bool arg2) { D_8036769C = 0; D_803676A0 = 0; if (map_id != D_80367694) { - timedFunc_set_1(0.25f, func_802D5000, map_id); + timedFunc_set_1(0.25f, (GenMethod_1)func_802D5000, map_id); } else { timedFunc_set_0(0.25f, func_802D63D4); } @@ -913,21 +913,21 @@ void func_802D5628(void){ switch(D_8036768C){ case 0x1: // L802D57C8 if(!D_80367690){ - timedFunc_set_2(0.4f, (TFQM2) func_802D4D3C, 0x34, 0x205); + timedFunc_set_2(0.4f, (GenMethod_2) func_802D4D3C, 0x34, 0x205); D_80367690++; } break; case 0x2: // L802D5808 if(!D_80367690){ - timedFunc_set_2(0.4f, (TFQM2) func_802D4D3C, 0x39, 0x207); + timedFunc_set_2(0.4f, (GenMethod_2) func_802D4D3C, 0x39, 0x207); D_80367690++; } break; case 0x3: // L802D5848 if(!D_80367690){ - timedFunc_set_2(0.4f, (TFQM2) func_802D4D3C, 0x36, 0x20a); + timedFunc_set_2(0.4f, (GenMethod_2) func_802D4D3C, 0x36, 0x20a); D_80367690++; } break; @@ -935,14 +935,14 @@ void func_802D5628(void){ case 0x4: // L802D5888 func_802D5260(); if(!D_80367690){ - timedFunc_set_2(0.4f, (TFQM2) func_802D4D3C, 0x3b, 0x20c); + timedFunc_set_2(0.4f, (GenMethod_2) func_802D4D3C, 0x3b, 0x20c); D_80367690++; } break; case 0x12: // L802D58D0 if(!D_80367690){ - timedFunc_set_2(0.4f, (TFQM2) func_802D4D3C, 0x3c, 0x238); + timedFunc_set_2(0.4f, (GenMethod_2) func_802D4D3C, 0x3c, 0x238); D_80367690++; } break; @@ -1217,13 +1217,13 @@ void func_802D6494(void){ break; case ACTOR_212_IRON_BARS:// L802D6550 if(map_get() == MAP_70_GL_CC_LOBBY && !func_803203FC(UNKFLAGS1_7F_SANDCASTLE_OPEN_CC)){ - func_802D4830(func_80326EEC(ACTOR_212_IRON_BARS), SFX_9A_MECHANICAL_CLOSING, 0.5f); + func_802D4830(actorArray_findActorFromActorId(ACTOR_212_IRON_BARS), SFX_9A_MECHANICAL_CLOSING, 0.5f); func_8025A6CC(COMUSIC_64_WORLD_OPENING_A, 32000); } break; case ACTOR_234_CCW_ENTRANCE_DOOR:// L802D65A0 if(map_get() == MAP_79_GL_CCW_LOBBY && !func_803203FC(UNKFLAGS1_93_SANDCASTLE_OPEN_CCW)){ - func_802D485C(func_80326EEC(ACTOR_234_CCW_ENTRANCE_DOOR), SFX_3EC_CCW_DOOR_OPENING, 0.8f, 15000); + func_802D485C(actorArray_findActorFromActorId(ACTOR_234_CCW_ENTRANCE_DOOR), SFX_3EC_CCW_DOOR_OPENING, 0.8f, 15000); func_8025A6CC(COMUSIC_64_WORLD_OPENING_A, 32000); } break; @@ -1235,13 +1235,13 @@ void func_802D6494(void){ break; case ACTOR_235_FP_ENTANCE_DOOR:// L802D6624 if(map_get() == MAP_6F_GL_FP_LOBBY && !func_803203FC(UNKFLAGS1_8B_SANDCASTLE_OPEN_FP)){ - func_802D4830(func_80326EEC(ACTOR_235_FP_ENTANCE_DOOR), SFX_18_BIGBUTT_SLIDE, 0.5f); + func_802D4830(actorArray_findActorFromActorId(ACTOR_235_FP_ENTANCE_DOOR), SFX_18_BIGBUTT_SLIDE, 0.5f); func_8025A6CC(COMUSIC_64_WORLD_OPENING_A, 32000); } break; case ACTOR_226_GV_ENTRANCE:// L802D6674 if(map_get() == MAP_6E_GL_GV_LOBBY && !func_803203FC(UNKFLAGS1_87_SANDCASTLE_OPEN_GV)){ - func_802D485C(func_80326EEC(ACTOR_226_GV_ENTRANCE), SFX_3EC_CCW_DOOR_OPENING, 0.8f, 15000); + func_802D485C(actorArray_findActorFromActorId(ACTOR_226_GV_ENTRANCE), SFX_3EC_CCW_DOOR_OPENING, 0.8f, 15000); func_8025A6CC(COMUSIC_64_WORLD_OPENING_A, 32000); } break; @@ -1253,7 +1253,7 @@ void func_802D6494(void){ break; case ACTOR_20F_RBB_ENTRANCE_DOOR:// L802D66F8 if(map_get() == MAP_77_GL_RBB_LOBBY && !func_803203FC(UNKFLAGS1_90_SANDCASTLE_OPEN_RBB)){ - func_802D4830(func_80326EEC(ACTOR_20F_RBB_ENTRANCE_DOOR), SFX_9A_MECHANICAL_CLOSING, 0.5f); + func_802D4830(actorArray_findActorFromActorId(ACTOR_20F_RBB_ENTRANCE_DOOR), SFX_9A_MECHANICAL_CLOSING, 0.5f); func_8025A6CC(COMUSIC_64_WORLD_OPENING_A, 32000); } break; diff --git a/src/core2/code_51950.c b/src/core2/code_51950.c index 45ef4a89..9ff8b214 100644 --- a/src/core2/code_51950.c +++ b/src/core2/code_51950.c @@ -52,7 +52,7 @@ void func_802D88E0(Actor *this) { for(i = 0; i < 3; i++){ sp5C[i] = this->position[i] + (randf()*2)*25 - ((i == 1) ? 0 : 25); } - particleEmitter_setPosition(pCtrl, &sp5C); + particleEmitter_setPosition(pCtrl, sp5C); particleEmitter_setSprite(pCtrl, (this->modelCacheIndex == 0x1FF) ? ASSET_715_SPRITE_SPARKLE_RED : ASSET_713_SPRITE_SPARKLE_YELLOW); particleEmitter_setStartingFrameRange(pCtrl, 0, 0); func_802EFB98(pCtrl, &D_80367CD8); @@ -89,5 +89,5 @@ void func_802D8B20(enum actor_e actor_id){ } void func_802D8BE4(bool gold_feather){ - __spawnqueue_add_1(func_802D8B20, (!gold_feather) ? 0x1FF : 0x200); -} \ No newline at end of file + __spawnQueue_add_1((GenMethod_1)func_802D8B20, (!gold_feather) ? 0x1FF : 0x200); +} diff --git a/src/core2/code_55390.c b/src/core2/code_55390.c index da3aa5ed..71863dd6 100644 --- a/src/core2/code_55390.c +++ b/src/core2/code_55390.c @@ -84,7 +84,7 @@ void func_802DC4C4(void) { void func_802DC528(NodeProp *arg0, ActorMarker *arg1){ if(D_8037DE40 == NULL){ - func_802C3BF8(func_802DC4C4); + __spawnQueue_add_0(func_802DC4C4); } } diff --git a/src/core2/code_556C0.c b/src/core2/code_556C0.c index c9cb150b..e2c7c0be 100644 --- a/src/core2/code_556C0.c +++ b/src/core2/code_556C0.c @@ -47,7 +47,7 @@ void func_802DC6E4(void) { void func_802DC748(s32 arg0, s32 arg1){ if(D_8037DE50 == NULL){ - func_802C3BF8(func_802DC6E4); + __spawnQueue_add_0(func_802DC6E4); } } diff --git a/src/core2/code_55850.c b/src/core2/code_55850.c index 74ed8b03..231b6897 100644 --- a/src/core2/code_55850.c +++ b/src/core2/code_55850.c @@ -76,7 +76,7 @@ void func_802DC960(void) { void func_802DC9A4(s32 arg0, s32 arg1){ if(D_8037DE60 == NULL){ - func_802C3BF8(func_802DC960); + __spawnQueue_add_0(func_802DC960); } } diff --git a/src/core2/code_55A90.c b/src/core2/code_55A90.c index a30bb2c4..5e727325 100644 --- a/src/core2/code_55A90.c +++ b/src/core2/code_55A90.c @@ -41,7 +41,7 @@ void func_802DCA90(void) { void func_802DCAD4(s32 arg0, s32 arg1){ if(D_8037DE70 == NULL){ - func_802C3BF8(func_802DCA90); + __spawnQueue_add_0(func_802DCA90); } } diff --git a/src/core2/code_55BC0.c b/src/core2/code_55BC0.c index a1b48672..05936c5f 100644 --- a/src/core2/code_55BC0.c +++ b/src/core2/code_55BC0.c @@ -91,7 +91,7 @@ void func_802DCD34(void){ void func_802DCD78(s32 arg0, s32 arg1){ if(D_8037DE80 == NULL){ - func_802C3BF8(func_802DCD34); + __spawnQueue_add_0(func_802DCD34); } } diff --git a/src/core2/code_55E70.c b/src/core2/code_55E70.c index 6e160296..20d51bca 100644 --- a/src/core2/code_55E70.c +++ b/src/core2/code_55E70.c @@ -79,7 +79,7 @@ void func_802DCFC4(void){ void func_802DD008(s32 arg0, s32 arg1){ if(D_8037DE90 == NULL){ - func_802C3BF8(func_802DCFC4); + __spawnQueue_add_0(func_802DCFC4); } } diff --git a/src/core2/code_560F0.c b/src/core2/code_560F0.c index 43f09511..d71ce24b 100644 --- a/src/core2/code_560F0.c +++ b/src/core2/code_560F0.c @@ -555,7 +555,7 @@ void func_802DE9C8(void){ void func_802DEA18(s32 arg0, s32 arg1){ if(D_8037DEA0 == NULL){ - func_802C3BF8(func_802DE9C8); + __spawnQueue_add_0(func_802DE9C8); } } diff --git a/src/core2/code_57C70.c b/src/core2/code_57C70.c index 4e3d7fbf..0e2958ea 100644 --- a/src/core2/code_57C70.c +++ b/src/core2/code_57C70.c @@ -163,7 +163,7 @@ void func_802DF04C(void){ void func_802DF090(s32 arg0, s32 arg1){ if(D_8037DFE0 == NULL){ - func_802C3BF8(func_802DF04C); + __spawnQueue_add_0(func_802DF04C); } } diff --git a/src/core2/code_584D0.c b/src/core2/code_584D0.c index eb53aeba..1faaa142 100644 --- a/src/core2/code_584D0.c +++ b/src/core2/code_584D0.c @@ -145,7 +145,7 @@ void func_802DF71C(Gfx **gfx, Mtx **mtx, Vtx **vtx) { Actor *this; f32 sp3C; - this = func_80325300(D_8037E060, &sp44); + this = marker_getActorAndRotation(D_8037E060, &sp44); modelRender_preDraw((GenMethod_1)func_803253A0, (s32)this); modelRender_postDraw((GenMethod_1)func_80325794, (s32)D_8037E060); modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL); diff --git a/src/core2/code_59780.c b/src/core2/code_59780.c index e6204e7d..3e8d8e6d 100644 --- a/src/core2/code_59780.c +++ b/src/core2/code_59780.c @@ -88,7 +88,7 @@ Actor *func_802E0738(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ f32 sp34[3]; Actor *this; - this = func_80325300(marker, &sp34); + this = marker_getActorAndRotation(marker, &sp34); modelRender_preDraw( (GenMethod_1)func_802E0710, (s32)this); modelRender_postDraw((GenMethod_1)func_80325794, (s32)marker); modelRender_draw(gfx, mtx, this->position, sp34, this->scale, NULL, func_80330B1C(marker)); diff --git a/src/core2/code_59A80.c b/src/core2/code_59A80.c index 89b82372..fc3768fa 100644 --- a/src/core2/code_59A80.c +++ b/src/core2/code_59A80.c @@ -44,7 +44,7 @@ s32 func_802E0A90(Actor *this){ sp18[0] = (s32)this->position[0]; sp18[1] = (s32)this->position[1]; sp18[2] = (s32)this->position[2]; - id = func_80307164(sp18, this); + id = func_80307164(sp18); if(id < 0){ return 0; } diff --git a/src/core2/code_59D40.c b/src/core2/code_59D40.c index e1d43b39..85c80fd2 100644 --- a/src/core2/code_59D40.c +++ b/src/core2/code_59D40.c @@ -14,7 +14,7 @@ typedef struct { }ActorLocal_core2_59D40; -void func_802E1168(Actor *this); +void chsnacker_update(Actor *this); /* .data */ ActorAnimationInfo D_803685D0[] ={ @@ -33,7 +33,7 @@ ActorAnimationInfo D_803685D0[] ={ ActorInfo D_80368620 = { 0x14, 0x68, 0x3B0, 0x1, D_803685D0, - func_802E1168, func_80326224, func_80325888, + chsnacker_update, func_80326224, func_80325888, 0, 0, 0.0f, 0 }; @@ -157,11 +157,11 @@ f32 func_802E10F0(f32 arg0) { return arg0; } -void func_802E1168(Actor *this) { +void chsnacker_update(Actor *this) { f32 sp5C; ActorLocal_core2_59D40 *local; s32 sp54; - f32 sp48[3]; + f32 player_position[3]; f32 sp44; f32 sp40; s32 tmp; @@ -176,7 +176,7 @@ void func_802E1168(Actor *this) { this->unk154 = 0x085E0000; marker_setCollisionScripts(this->marker, func_802E1050, func_802E1010, func_802E0F60); } - _player_getPosition(&sp48); + _player_getPosition(player_position); sp54 = func_8028A94C(); if(func_802E0DC0(this->position) || ((sp54 != 1) && (sp54 != 2))) { @@ -354,10 +354,10 @@ void func_802E17E8(void) { return; } if (func_803203FC(UNKFLAGS1_C1_IN_FINAL_CHARACTER_PARADE) == 0) { - func_8032BB88(snacker, 0x1388, 0x2EE); + func_8032BB88(snacker, 5000, 750); func_8024BD08(0); func_8025A6EC(0x34, 0); - comusic_8025AB44(0x34, 0x7FFF, 0x2EE); + comusic_8025AB44(COMUSIC_34_SNACKER_DANGER, 0x7FFF, 750); func_8024BD08(1); } D_8037E624 = 0.0f; @@ -370,7 +370,7 @@ void func_802E1A04(s32 nextState) { sp1C = time_getDelta(); if( getGameMode() == GAME_MODE_A_SNS_PICTURE - || getGameMode() == 5 + || getGameMode() == GAME_MODE_5_UNKNOWN || getGameMode() == GAME_MODE_6_FILE_PLAYBACK ){ return; @@ -379,7 +379,7 @@ void func_802E1A04(s32 nextState) { if ((D_8037E620 == NULL)) { D_8037E624 += sp1C; if ((D_8037E628 < D_8037E624) && (nextState != 0)) { - func_802C3BF8(func_802E17E8); + __spawnQueue_add_0(func_802E17E8); D_8037E628 = 1.0f; } } diff --git a/src/core2/code_5BEB0.c b/src/core2/code_5BEB0.c index 3bdc8433..9783381a 100644 --- a/src/core2/code_5BEB0.c +++ b/src/core2/code_5BEB0.c @@ -37,7 +37,7 @@ void mapSavestate_defrag_all(void){ int i; for(i = 0; i < 0x9A; i++){ if(D_8037E650[i]){ - D_8037E650[i] = defrag(D_8037E650[i]); + D_8037E650[i] = (MapSavestate *)defrag(D_8037E650[i]); } } } diff --git a/src/core2/code_5C870.c b/src/core2/code_5C870.c index 8109c91e..c2f957b0 100644 --- a/src/core2/code_5C870.c +++ b/src/core2/code_5C870.c @@ -22,8 +22,7 @@ extern void func_8030ED0C(void); extern void func_80259BD0(void); enum transition_e { - TRANSITION_0_NONE, - + TRANSITION_0_NONE }; void func_802E3BD0(s32 frame_buffer_indx); @@ -594,8 +593,8 @@ s32 func_802E48D8(void){ func_802F0E58(); mapModel_defrag(); func_803086B4(); - func_8032AF94(); - func_802C4320(); + actorArray_defrag(); + spawnQueue_defrag(); func_802F3300(); func_802F542C(); gcdialog_defrag(); diff --git a/src/core2/code_654C0.c b/src/core2/code_654C0.c index 169e4792..2a65630c 100644 --- a/src/core2/code_654C0.c +++ b/src/core2/code_654C0.c @@ -19,8 +19,7 @@ Vtx *vtxList_getVertices(BKVertexList *vtxList){ return &vtxList->vtx_18[0]; } -//vtxList_getBoundingBox_i -void func_802EC458(BKVertexList *vtxList, s32 min[3], s32 max[3]){ +void vtxList_getBounds_s32(BKVertexList *vtxList, s32 min[3], s32 max[3]){ min[0] = vtxList->minCoord_0[0]; min[1] = vtxList->minCoord_0[1]; min[2] = vtxList->minCoord_0[2]; @@ -30,8 +29,7 @@ void func_802EC458(BKVertexList *vtxList, s32 min[3], s32 max[3]){ max[2] = vtxList->maxCoord_6[2]; } -//vtxList_getBoundingBox_f -void func_802EC48C(BKVertexList *vtxList, f32 min[3], f32 max[3]){ +void vtxList_getBounds_f32(BKVertexList *vtxList, f32 min[3], f32 max[3]){ min[0] = (f32) vtxList->minCoord_0[0]; min[1] = (f32) vtxList->minCoord_0[1]; min[2] = (f32) vtxList->minCoord_0[2]; diff --git a/src/core2/code_6B030.c b/src/core2/code_6B030.c index 5c006062..51b643e2 100644 --- a/src/core2/code_6B030.c +++ b/src/core2/code_6B030.c @@ -80,7 +80,7 @@ void func_802F1FC0(Struct65s *self, Gfx **gfx, Mtx **mtx, Vtx **vtx) { spBC = (s32) ((f32)self->unk20 * (1.0f + temp_f2)); temp_s5 = (s32) ((f32)self->unk20 * ((1.0f - (self->unk25 / 255.0f)) + ((self->unk25 / 255.0f) - temp_f2))); func_80251BCC(&D_80380A18); - func_8025235C(&spD0, &spD0); + func_8025235C(spD0, spD0); spD0[0] = (-297.0f * spD0[0]) / spD0[2]; spD0[1] = (297.0f * spD0[1]) / spD0[2]; spC4 = (s32) (spD0[0] + (f32) (framebuffer_width / 2)); @@ -377,17 +377,17 @@ void func_802F2FCC(Struct64s *arg0, f32 arg1[3], s16 arg2, f32 arg3, ActorMarker } } -void func_802F32C4(s32 arg0, f32 arg1[3], f32 arg2, ActorMarker *arg3, void(*arg4)(f32[3], f32, ActorMarker *)){ +void func_802F32C4(Struct64s *arg0, f32 arg1[3], f32 arg2, ActorMarker *arg3, void(*arg4)(f32[3], f32, ActorMarker *)){ func_802F2FCC(arg0, arg1, 8, arg2, arg3, arg4); } void func_802F3300(void) { if (!func_802559A0()) { if (D_80380A10 != NULL) { - D_80380A10 = defrag(D_80380A10); + D_80380A10 = (f32 *)defrag(D_80380A10); } if (D_80368AB0 != NULL) { - D_80368AB0 = defrag(D_80368AB0); + D_80368AB0 = (Struct_core2_6B030_0 *)defrag(D_80368AB0); } } } diff --git a/src/core2/code_6B30.c b/src/core2/code_6B30.c index 955c5a92..7b3e6200 100644 --- a/src/core2/code_6B30.c +++ b/src/core2/code_6B30.c @@ -133,7 +133,7 @@ void func_8028DE6C(enum actor_e actor_id){ func_802948F8(marker); } else{ - __spawnqueue_add_1(func_8028DE0C, carriedObject_getActorID()); + __spawnQueue_add_1((GenMethod_1)func_8028DE0C, carriedObject_getActorID()); } } diff --git a/src/core2/code_6C3E0.c b/src/core2/code_6C3E0.c index bc56471a..12608cef 100644 --- a/src/core2/code_6C3E0.c +++ b/src/core2/code_6C3E0.c @@ -6,6 +6,8 @@ extern bool func_8024549C(f32[3], f32); extern void func_802EFAB0(ParticleEmitter *, s32, f32); extern ParticleEmitter *func_802F3670(s16[3], f32, enum asset_e); extern void func_802F0EAC(ParticleEmitter *, f32); +extern ParticleEmitter *func_802F0EF0(u8); +extern ParticleEmitter *func_802F3E98(f32 pos[3], enum asset_e sprite_id); typedef struct { f32 unk0[2]; diff --git a/src/core2/code_6D490.c b/src/core2/code_6D490.c index f76f4ece..a7e6f074 100644 --- a/src/core2/code_6D490.c +++ b/src/core2/code_6D490.c @@ -230,4 +230,4 @@ void func_802F4978(Struct5Ds *this){ Struct5Ds *func_802F499C(Struct5Ds *this){ return (Struct5Ds *)defrag(this); -} \ No newline at end of file +} diff --git a/src/core2/code_7060.c b/src/core2/code_7060.c index bdc14458..7f94127b 100644 --- a/src/core2/code_7060.c +++ b/src/core2/code_7060.c @@ -950,6 +950,7 @@ void func_8028FCBC(void){ D_8037BFB8 = FALSE; } +//player_setModelVisibile void func_8028FCC8(bool arg0){ playerModel_setVisible(arg0); } diff --git a/src/core2/code_72B10.c b/src/core2/code_72B10.c index 43b7d02c..6a37f26d 100644 --- a/src/core2/code_72B10.c +++ b/src/core2/code_72B10.c @@ -266,4 +266,4 @@ void func_802FA508(void){ } } } -} \ No newline at end of file +} diff --git a/src/core2/code_76D90.c b/src/core2/code_76D90.c index 03bf42a7..c211343e 100644 --- a/src/core2/code_76D90.c +++ b/src/core2/code_76D90.c @@ -228,11 +228,11 @@ void func_802FE844(s32 arg0, struct8s *arg1){ D_803815E4 = 0; D_803815E0 = 0.9999f; func_803463D4(ITEM_13_EMPTY_HONEYCOMB, -6); - timedFunc_set_2(0.25f, (TFQM2)func_8025A6EC, COMUSIC_2B_DING_B, 28000); + timedFunc_set_2(0.25f, (GenMethod_2)func_8025A6EC, COMUSIC_2B_DING_B, 28000); func_803463D4(ITEM_14_HEALTH, 0); timedFunc_set_1(1.25f, (GenMethod_1)item_inc, ITEM_15_HEALTH_TOTAL); timedFunc_set_1(1.25f, (GenMethod_1)func_8030E484, SFX_3EA_UNKNOWN); - timedFunc_set_2(1.25f, (TFQM2)item_set, ITEM_14_HEALTH, item_getCount(ITEM_15_HEALTH_TOTAL)+1); + timedFunc_set_2(1.25f, (GenMethod_2)item_set, ITEM_14_HEALTH, item_getCount(ITEM_15_HEALTH_TOTAL)+1); timedFunc_set_1(1.5f, (GenMethod_1)gcpausemenu_80314AC8, 1); } break; diff --git a/src/core2/code_7AF80.c b/src/core2/code_7AF80.c index a77848dc..18f1ae8a 100644 --- a/src/core2/code_7AF80.c +++ b/src/core2/code_7AF80.c @@ -6,7 +6,7 @@ extern f32 ml_vec3f_distance_squared(f32[3], f32[3]); extern f32 func_802586B0(f32[3], f32[3]); - +extern void mapModel_getCubeBounds(s32 min[3], s32 max[3]); extern f32 func_803243D0(struct56s *arg0, f32 arg1[3]); extern void func_802CAF14(u32*, s32, bool); extern void func_8032D510(Cube *, Gfx **, Mtx **, Vtx **); @@ -453,9 +453,9 @@ void func_80302C94(Gfx **gfx, Mtx **mtx, Vtx **vtx) { func_8032D510(D_80381FA0.unk40, gfx, mtx, vtx); } if (((45.0f <= sp54[1]) && (sp54[1] <= 135.0f)) || ((225.0f <= sp54[1]) && (sp54[1] <= 315.0f))) { - func_80301F50(gfx, mtx, vtx, &sp60, &sp44, &sp38); + func_80301F50(gfx, mtx, vtx, sp60, sp44, sp38); } else { - func_80302634(gfx, mtx, vtx, &sp60, &sp44, &sp38); + func_80302634(gfx, mtx, vtx, sp60, sp44, sp38); } func_80308D2C(gfx, mtx, vtx); } @@ -577,7 +577,7 @@ void * func_803036A0(f32 volume_p1[3], f32 volume_p2[3], f32 arg2[3], u32 arg3) void *var_s5; var_s5 = NULL; - cube_volumeToIndices(&min, &max, volume_p1, volume_p2, D_80381FA0.unk4); + cube_volumeToIndices(min, max, volume_p1, volume_p2, D_80381FA0.unk4); for(cube_indx[2] = min[2]; cube_indx[2] <= max[2]; cube_indx[2]++){ for(cube_indx[1] = min[1]; cube_indx[1] <= max[1]; cube_indx[1]++){ for(cube_indx[0] = min[0]; cube_indx[0] <= max[0]; cube_indx[0]++){ @@ -602,7 +602,7 @@ void * func_80303800(f32 volume_p1[3], f32 volume_p2[3], f32 arg2[3], u32 arg3) void *temp_v0; void *var_s5; - cube_volumeToIndices(&min, &max, volume_p1, volume_p2, D_80381FA0.unk4); + cube_volumeToIndices(min, max, volume_p1, volume_p2, D_80381FA0.unk4); for(cube_indx[0] = min[0]; cube_indx[0] <= max[0]; cube_indx[0]++){ for(cube_indx[1] = min[1]; cube_indx[1] <= max[1]; cube_indx[1]++){ for(cube_indx[2] = min[2]; cube_indx[2] <= max[2]; cube_indx[2]++){ @@ -786,7 +786,7 @@ void cubeList_init(void){ func_80303F38(); D_80381FA0.unk44 = 0; - func_803097AC(D_80381FA0.min, D_80381FA0.max); + mapModel_getCubeBounds(D_80381FA0.min, D_80381FA0.max); D_80381FA0.unk2C = 0; D_80381FA0.width[0] = D_80381FA0.max[0] - D_80381FA0.min[0] + 1; D_80381FA0.width[1] = D_80381FA0.max[1] - D_80381FA0.min[1] + 1; @@ -985,7 +985,7 @@ NodeProp *func_803049CC(enum actor_e actor_id, s32 arg1[3]) { if (func_80305C30(sp7C[1] - D_80381FA0.min[1]) != 0) { for(sp7C[0] = D_80381FA0.min[0]; sp7C[0] <= D_80381FA0.max[0] ; sp7C[0]++) { for(sp7C[2] = D_80381FA0.min[2]; sp7C[2] <= D_80381FA0.max[2] ; sp7C[2]++) { - temp_v0 = func_8032E230(cube_atIndices(&sp7C), actor_id); + temp_v0 = func_8032E230(cube_atIndices(sp7C), actor_id); if (temp_v0 != NULL) { return temp_v0; } @@ -2142,7 +2142,7 @@ NodeProp *func_803080C8(s32 arg0) { if(func_80305C30(sp3C[1] - D_80381FA0.min[1])){ for(sp3C[0] = D_80381FA0.min[0]; sp3C[0] <= D_80381FA0.max[0]; sp3C[0]++){ for(sp3C[2] = D_80381FA0.min[2]; sp3C[2] <= D_80381FA0.max[2]; sp3C[2]++){ - temp_v0 = cube_atIndices(&sp3C); + temp_v0 = cube_atIndices(sp3C); if (temp_v0 != NULL) { for(var_v1 = 0; var_v1 < temp_v0->prop1Cnt; var_v1++){ if (arg0 == temp_v0->prop1Ptr[var_v1].unk10_31) { @@ -2292,7 +2292,7 @@ void func_80308658(Struct_core2_7AF80_1 *arg0, s32 arg1) { return; for(i = arg0; i < arg0 + arg1; i++){ - i->unk8 = defrag(i->unk8); + i->unk8 = (Struct_core2_7AF80_2 *)defrag(i->unk8); } } @@ -2308,7 +2308,7 @@ void func_803086B4(void) { if (cube->prop2Cnt != 0) { if (cube->prop2Ptr != NULL) { prop = cube->prop2Ptr; - cube->prop2Ptr = defrag(cube->prop2Ptr); + cube->prop2Ptr = (Prop *)defrag(cube->prop2Ptr); if (prop != cube->prop2Ptr) { func_80330104(cube); phi_s1 -= 5; @@ -2318,7 +2318,7 @@ void func_803086B4(void) { if (cube->prop1Cnt != 0) { if (cube->prop1Ptr != NULL) { node = cube->prop1Ptr; - cube->prop1Ptr = defrag(cube->prop1Ptr); + cube->prop1Ptr = (NodeProp *)defrag(cube->prop1Ptr); if (node != cube->prop1Ptr) { phi_s1 -= 5; } @@ -2341,19 +2341,19 @@ void func_803086B4(void) { } if (D_8036A9BC != NULL) { - D_8036A9BC = defrag(D_8036A9BC); + D_8036A9BC = (Struct_core2_7AF80_1 *) defrag(D_8036A9BC); } if (D_8036A9C8 != NULL) { - D_8036A9C8 = defrag(D_8036A9C8); + D_8036A9C8 = (Struct_core2_7AF80_1 *) defrag(D_8036A9C8); } if (D_8036A9D4 != NULL) { - D_8036A9D4 = defrag(D_8036A9D4); + D_8036A9D4 = (Struct_core2_7AF80_1 *) defrag(D_8036A9D4); } if (sSpawnableActorList != NULL) { - sSpawnableActorList = defrag(sSpawnableActorList); + sSpawnableActorList = (ActorSpawn *)defrag(sSpawnableActorList); } } else { func_80308658(D_8036A9BC, D_8036A9B8); diff --git a/src/core2/code_83340.c b/src/core2/code_83340.c index aed07f7c..d1b99c45 100644 --- a/src/core2/code_83340.c +++ b/src/core2/code_83340.c @@ -202,8 +202,8 @@ void func_8030AA6C(void) { BKModelBin *temp_a0; s32 phi_s2; - D_80382394 = defrag(D_80382394); - D_80382390 = defrag(D_80382390); + D_80382394 = (struct_7AF80_1 *) defrag(D_80382394); + D_80382390 = (struct_7AF80_0 *) defrag(D_80382390); if (!func_802559A0() && !func_80255AE4() && D_80382390 != NULL) { for(phi_s2 = 0x14; (phi_s2 != 0) && !func_80255AE4(); phi_s2--){ D_8036B800++; diff --git a/src/core2/code_91E10.c b/src/core2/code_91E10.c index 53c15a0a..a2938417 100644 --- a/src/core2/code_91E10.c +++ b/src/core2/code_91E10.c @@ -681,7 +681,7 @@ void func_8031A4CC(void) { } if (func_8031A3BC() == 0) { - D_803830E0->unkC = defrag(D_803830E0->unkC); + D_803830E0->unkC = (QuizQuestionBin *)defrag(D_803830E0->unkC); } D_803830E0 = (Struct_Core2_91E10 *)defrag(D_803830E0); } diff --git a/src/core2/code_935F0.c b/src/core2/code_935F0.c index 7f56d878..a0acf83c 100644 --- a/src/core2/code_935F0.c +++ b/src/core2/code_935F0.c @@ -49,7 +49,7 @@ void func_8031A618(Actor *this) { Actor *jiggy; if (this->unk10_12 == MINIGAME_5_SANDCASTLE) { - jiggy = func_80326EEC(ACTOR_46_JIGGY); + jiggy = actorArray_findActorFromActorId(ACTOR_46_JIGGY); if (jiggy != NULL) { actor_collisionOff(jiggy); jiggy->position[1] -= 1000.0f; @@ -133,7 +133,7 @@ void func_8031A7F4(Actor *this, u32 arg1) { func_8025A70C((func_803203FC(5)) ? COMUSIC_3B_MINIGAME_VICTORY : COMUSIC_3C_MINIGAME_LOSS); func_802E4A70(); func_803204E4(0x21, TRUE); - timedFunc_set_3(2.0f, (TFQM3)func_802E4078, MAP_8E_GL_FURNACE_FUN, 1, 1); + timedFunc_set_3(2.0f, (GenMethod_3)func_802E4078, MAP_8E_GL_FURNACE_FUN, 1, 1); break; } func_80328A84(this, arg1); diff --git a/src/core2/code_956B0.c b/src/core2/code_956B0.c index de8b17e2..44a849c0 100644 --- a/src/core2/code_956B0.c +++ b/src/core2/code_956B0.c @@ -63,8 +63,8 @@ bool func_8031C6E4(void) { if (!mapSpecificFlags_get(0xC)) { mapSpecificFlags_set(0xC, TRUE); func_802DC528(0, 0); - timedFunc_set_2(11.0f, (TFQM2)func_802DC560, 0, 0); - timedFunc_set_3(12.0f, (TFQM3)func_802E4078, MAP_1F_CS_START_RAREWARE, 0, 1); + timedFunc_set_2(11.0f, (GenMethod_2)func_802DC560, 0, 0); + timedFunc_set_3(12.0f, (GenMethod_3)func_802E4078, MAP_1F_CS_START_RAREWARE, 0, 1); } else { timedFuncQueue_flush(); } @@ -394,7 +394,7 @@ void func_8031D604(s32 arg0, s32 arg1) { void func_8031D628(s32 arg0, s32 arg1) { Actor *actor; - actor = func_80326EEC(0x13E); + actor = actorArray_findActorFromActorId(0x13E); if (actor) { marker_despawn(actor->marker); } diff --git a/src/core2/code_9B990.c b/src/core2/code_9B990.c index 8e382843..3d57684c 100644 --- a/src/core2/code_9B990.c +++ b/src/core2/code_9B990.c @@ -149,7 +149,7 @@ void func_80322960(void){ void __overlay_mmm_update(void){ func_8038966C(); - func_80389FC0(); + organMinigame_update(); func_8038AA44(); } diff --git a/src/core2/code_9E370.c b/src/core2/code_9E370.c index 4f76b151..84661a59 100644 --- a/src/core2/code_9E370.c +++ b/src/core2/code_9E370.c @@ -23,7 +23,7 @@ extern void func_802C9334(s32, Actor *); extern void func_8032B3A0(Actor *, ActorMarker *); extern void func_8032EE0C(GenMethod_2, s32); extern void func_8032EE20(void); -extern void func_802C4014(GenMethod_5, s32, s32, s32, s32, s32); +extern void __spawnQueue_add_5(GenMethod_5, s32, s32, s32, s32, s32); void func_8032A6A8(Actor *arg0); @@ -47,9 +47,9 @@ typedef struct { }Actorlocal_Core2_9E370; /* .data */ -ActorArray *D_8036E560 = NULL; //actorArrayPtr +ActorArray *suBaddieActorArray = NULL; //actorArrayPtr s32 D_8036E564 = 0; -s32 D_8036E568 = 0; +struct5Bs *D_8036E568 = NULL; s32 D_8036E56C = 0; void *D_8036E570 = NULL; u8 D_8036E574 = 0; @@ -64,12 +64,11 @@ f32 D_8036E598[4] = {1000.f, 20.0f, 10.5f, 1.0f}; /* .bss */ Actor *D_80383390; s32 D_80383394; -Actor *D_80383398[14]; //array of jiggy actor ptrs +Actor *suBaddieJiggyArray[14]; //array of jiggy actor ptrs -//marker_getActorAndRotation -Actor * func_80325300(ActorMarker *marker,f32 rotation[3]) -{ Actor *actor = &D_8036E560->data[marker->actrArrayIdx]; +Actor * marker_getActorAndRotation(ActorMarker *marker,f32 rotation[3]) +{ Actor *actor = &suBaddieActorArray->data[marker->actrArrayIdx]; rotation[0] = actor->pitch; rotation[1] = actor->yaw; rotation[2] = actor->roll; @@ -119,7 +118,7 @@ void func_803253A0(Actor *this){ } modelRender_setDepthMode(this->depth_mode); - if((s32)this->marker->unk44 != 0){ + if(this->marker->unk44 != 0){ if((s32)this->marker->unk44 == 1){ func_8033A450(D_8036E568); } @@ -217,7 +216,7 @@ Actor *func_80325888(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { f32 sp3C[3]; Actor *this; - this = func_80325300(marker, sp3C); + this = marker_getActorAndRotation(marker, sp3C); modelRender_preDraw((GenMethod_1)func_803253A0, (s32)this); modelRender_postDraw((GenMethod_1)func_80325794, (s32)marker); modelRender_draw(gfx, mtx, this->position, sp3C, this->scale, (this->unk104 != NULL) ? D_8036E580 : NULL, func_803257B4(marker)); @@ -338,7 +337,7 @@ Actor *func_80325E78(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { f32 rotation[3]; Actor *this; - this = func_80325300(marker, rotation); + this = marker_getActorAndRotation(marker, rotation); modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL); modelRender_preDraw((GenMethod_1)func_803253A0, (s32)this); modelRender_postDraw((GenMethod_1)func_80325794, (s32)marker); @@ -355,7 +354,7 @@ Actor *func_80325F2C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { void func_80325F84(Actor *this){} void func_80325F8C(void) { - D_8036E560 = NULL; + suBaddieActorArray = NULL; D_8036E568 = func_8034A2C8(); D_8036E56C = func_802EE5E0(0x10); D_8036E570 = func_802F2AEC(); @@ -412,20 +411,19 @@ void func_80325FE8(Actor *this) { func_8032ACA8(this); } -//actorArray_free() -void func_80326124(void) { +void actorArray_free(void) { Actor *var_s0; - if (D_8036E560 != NULL) { - for(var_s0 = D_8036E560->data; var_s0 < &D_8036E560->data[D_8036E560->cnt]; var_s0++){ + if (suBaddieActorArray != NULL) { + for(var_s0 = suBaddieActorArray->data; var_s0 < &suBaddieActorArray->data[suBaddieActorArray->cnt]; var_s0++){ func_80325FE8(var_s0); if (var_s0->marker != NULL) { marker_free(var_s0->marker); } var_s0->marker = NULL; } - free(D_8036E560); - D_8036E560 = NULL; + free(suBaddieActorArray); + suBaddieActorArray = NULL; } func_8034A2A8(D_8036E568); D_8036E568 = NULL; @@ -529,10 +527,10 @@ void func_803268B4(void) { s32 temp_s1; - if (D_8036E560 != NULL) { + if (suBaddieActorArray != NULL) { sp54 = func_803203FC(101); - for(temp_v1 = D_8036E560->cnt - 1; temp_v1 >= 0; temp_v1--){ - actor = &D_8036E560->data[temp_v1]; + for(temp_v1 = suBaddieActorArray->cnt - 1; temp_v1 >= 0; temp_v1--){ + actor = &suBaddieActorArray->data[temp_v1]; actor_info = actor->actor_info; marker = actor->marker; anim_ctrl = actor->animctrl; @@ -590,7 +588,7 @@ void func_803268B4(void) { func_802D7124(actor, actor_info->shadow_scale); } if (actor->unk10_0) { - actor = &D_8036E560->data[temp_v1]; + actor = &suBaddieActorArray->data[temp_v1]; func_802C96E4(actor); } } @@ -613,12 +611,12 @@ void func_80326C24(s32 arg0){ D_80383394 = arg0; } -Actor *func_80326C30(enum asset_e model_id) { +Actor *actorArray_findActorFromModelId(enum asset_e model_id) { Actor *actor_begin; Actor *i_actor; - actor_begin = D_8036E560->data; - for(i_actor = actor_begin; (i_actor - actor_begin) < D_8036E560->cnt; i_actor++){ + actor_begin = suBaddieActorArray->data; + for(i_actor = actor_begin; (i_actor - actor_begin) < suBaddieActorArray->cnt; i_actor++){ if ((model_id == i_actor->marker->modelId) && !i_actor->despawn_flag) { return i_actor; } @@ -626,13 +624,13 @@ Actor *func_80326C30(enum asset_e model_id) { return NULL; } -Actor *func_80326CCC(s32 arg0) { +Actor *actorArray_findActorFromMarkerId(enum marker_e marker_id) { Actor *actor_begin; Actor *i_actor; - actor_begin = D_8036E560->data; - for(i_actor = actor_begin; i_actor - actor_begin < D_8036E560->cnt; i_actor++) { - if ((arg0 == i_actor->marker->unk14_20) && !i_actor->despawn_flag) { + actor_begin = suBaddieActorArray->data; + for(i_actor = actor_begin; i_actor - actor_begin < suBaddieActorArray->cnt; i_actor++) { + if ((marker_id == i_actor->marker->unk14_20) && !i_actor->despawn_flag) { return i_actor; } } @@ -643,20 +641,20 @@ Actor *func_80326CCC(s32 arg0) { * find the closest actor to position with actor_id and not in state * returns Actor* and distance (last arg) */ -Actor *func_80326D68(f32 position[3], enum actor_e actor_id, s32 arg2, f32 *min_distance_ptr) { +Actor *actorArray_findClosestActorFromActorId(f32 position[3], enum actor_e actor_id, s32 exclude_state, f32 *min_distance_ptr) { Actor *begin; Actor *i_actor; f32 i_dist; f32 min_dist; s32 *closest_actor; - if (D_8036E560 != NULL) { - begin = D_8036E560->data; + if (suBaddieActorArray != NULL) { + begin = suBaddieActorArray->data; closest_actor = NULL; min_dist = 1e+10f; - for(i_actor = begin; (i_actor - begin) < D_8036E560->cnt; i_actor++){ + for(i_actor = begin; (i_actor - begin) < suBaddieActorArray->cnt; i_actor++){ if ( ((actor_id == i_actor->modelCacheIndex) || (actor_id < 0)) - && (arg2 != i_actor->state) + && (exclude_state != i_actor->state) && (i_actor->modelCacheIndex != ACTOR_17_PLAYER_SHADOW) && (i_actor->modelCacheIndex != 0x108) && !i_actor->despawn_flag @@ -676,13 +674,13 @@ Actor *func_80326D68(f32 position[3], enum actor_e actor_id, s32 arg2, f32 *min_ return NULL; } -Actor *func_80326EEC(enum actor_e actor_id) { +Actor *actorArray_findActorFromActorId(enum actor_e actor_id) { Actor *begin; Actor *end; Actor *i_actor; - begin = D_8036E560->data; - end = begin + D_8036E560->cnt; + begin = suBaddieActorArray->data; + end = begin + suBaddieActorArray->cnt; for(i_actor = begin; i_actor < end; i_actor++){ if ((actor_id == i_actor->modelCacheIndex) && !i_actor->despawn_flag) { return i_actor; @@ -691,15 +689,15 @@ Actor *func_80326EEC(enum actor_e actor_id) { return NULL; } -s32 func_80326F58(enum actor_e actor_id) { +s32 actorArray_actorCount(enum actor_e actor_id) { Actor *begin; Actor *end; Actor *i_actor; s32 var_v1; var_v1 = 0; - begin = D_8036E560->data; - end = begin + D_8036E560->cnt; + begin = suBaddieActorArray->data; + end = begin + suBaddieActorArray->cnt; for(i_actor = begin; i_actor < end; i_actor++){ if ((actor_id == i_actor->modelCacheIndex) && !i_actor->despawn_flag) { var_v1 += 1; @@ -708,21 +706,21 @@ s32 func_80326F58(enum actor_e actor_id) { return var_v1; } -Actor **func_80326FC0(void) { +Actor **actorArray_findJiggyActors(void) { Actor *begin; Actor *i_actor; s32 var_a1; - begin = D_8036E560->data; - for(i_actor = begin, var_a1 = 0; (D_8036E560 != NULL) && ((i_actor - begin) < D_8036E560->cnt); i_actor++){ + begin = suBaddieActorArray->data; + for(i_actor = begin, var_a1 = 0; (suBaddieActorArray != NULL) && ((i_actor - begin) < suBaddieActorArray->cnt); i_actor++){ if ((i_actor->modelCacheIndex == ACTOR_46_JIGGY) && !i_actor->despawn_flag) { - D_80383398[var_a1] = i_actor; + suBaddieJiggyArray[var_a1] = i_actor; var_a1 += 1; } } - D_80383398[var_a1] = NULL; - return D_80383398; + suBaddieJiggyArray[var_a1] = NULL; + return suBaddieJiggyArray; } bool func_803270B8(f32 arg0[3], f32 arg1, s32 arg2, int (*arg3)(Actor *), ActorMarker * arg4){ @@ -731,8 +729,8 @@ bool func_803270B8(f32 arg0[3], f32 arg1, s32 arg2, int (*arg3)(Actor *), ActorM Actor * i_ptr; var_s4 = FALSE; - start = &D_8036E560->data[0]; - for(i_ptr = start; (D_8036E560 != NULL) && (i_ptr - start < D_8036E560->cnt); i_ptr++){ + start = &suBaddieActorArray->data[0]; + for(i_ptr = start; (suBaddieActorArray != NULL) && (i_ptr - start < suBaddieActorArray->cnt); i_ptr++){ if( !i_ptr->despawn_flag && i_ptr->marker->collidable && ((arg3 == NULL) || arg3(i_ptr)) @@ -764,18 +762,18 @@ Actor *actor_new(s32 (* position)[3], s32 yaw, ActorInfo* actorInfo, u32 flags){ s32 i; f32 sp44[3]; - if(D_8036E560 == NULL){ - D_8036E560 = (ActorArray *)malloc(sizeof(ActorArray) + 20*sizeof(Actor)); - D_8036E560->cnt = 0; - D_8036E560->max_cnt = 20; + if(suBaddieActorArray == NULL){ + suBaddieActorArray = (ActorArray *)malloc(sizeof(ActorArray) + 20*sizeof(Actor)); + suBaddieActorArray->cnt = 0; + suBaddieActorArray->max_cnt = 20; } - //i = D_8036E560->cnt + 1; - if(D_8036E560->cnt + 1 > D_8036E560->max_cnt){ - D_8036E560->max_cnt = D_8036E560->cnt + 5; - D_8036E560 = (ActorArray *)realloc(D_8036E560, sizeof(ActorArray) + D_8036E560->max_cnt*sizeof(Actor)); + //i = suBaddieActorArray->cnt + 1; + if(suBaddieActorArray->cnt + 1 > suBaddieActorArray->max_cnt){ + suBaddieActorArray->max_cnt = suBaddieActorArray->cnt + 5; + suBaddieActorArray = (ActorArray *)realloc(suBaddieActorArray, sizeof(ActorArray) + suBaddieActorArray->max_cnt*sizeof(Actor)); } - ++D_8036E560->cnt; - D_80383390 = &D_8036E560->data[D_8036E560->cnt - 1]; + ++suBaddieActorArray->cnt; + D_80383390 = &suBaddieActorArray->data[suBaddieActorArray->cnt - 1]; D_80383390->actor_info = actorInfo; D_80383390->unk10_25 = 0; D_80383390->unk10_18 = 0; @@ -845,7 +843,7 @@ Actor *actor_new(s32 (* position)[3], s32 yaw, ActorInfo* actorInfo, u32 flags){ D_80383390->unk124_31 = 0; D_80383390->unkF4_20 = 0; D_80383390->sound_timer = 0.0f; - func_8032FFD4(D_80383390->marker, D_8036E560->cnt - 1); + func_8032FFD4(D_80383390->marker, suBaddieActorArray->cnt - 1); marker_setModelId(D_80383390->marker, actorInfo->modelId); func_803300C8(D_80383390->marker, actorInfo->update_func); func_803300D0(D_80383390->marker, actorInfo->unk10); @@ -1036,19 +1034,19 @@ static void __actor_free(ActorMarker *arg0, Actor *arg1){ s32 arrayEnd; //copy last actor over actor to delete - arrayEnd = &D_8036E560->data[D_8036E560->cnt - 1]; + arrayEnd = &suBaddieActorArray->data[suBaddieActorArray->cnt - 1]; func_80325FE8(arg1); if((s32)arg1 != arrayEnd) memcpy(arg1, arrayEnd, 0x180); //memcpy arg1->marker->actrArrayIdx = arg0->actrArrayIdx; //remove last actor from actor array - D_8036E560->cnt--; + suBaddieActorArray->cnt--; //shrink actor array capacity - if(D_8036E560->cnt + 8 <= D_8036E560->max_cnt){ - D_8036E560->max_cnt = D_8036E560->cnt + 4; - D_8036E560 = (ActorArray *)realloc(D_8036E560, D_8036E560->max_cnt*sizeof(Actor) + sizeof(ActorArray)); + if(suBaddieActorArray->cnt + 8 <= suBaddieActorArray->max_cnt){ + suBaddieActorArray->max_cnt = suBaddieActorArray->cnt + 4; + suBaddieActorArray = (ActorArray *)realloc(suBaddieActorArray, suBaddieActorArray->max_cnt*sizeof(Actor) + sizeof(ActorArray)); } marker_free(arg0); @@ -1129,8 +1127,8 @@ void func_803283D4(void){ Actor *iPtr; if(D_8036E574){ if(D_8036E578) - for(i = D_8036E560->cnt-1; i >= 0 ; i--){ - iPtr = &D_8036E560->data[i]; + for(i = suBaddieActorArray->cnt-1; i >= 0 ; i--){ + iPtr = &suBaddieActorArray->data[i]; if(iPtr->despawn_flag) __actor_free(iPtr->marker, iPtr); } @@ -1639,7 +1637,7 @@ Struct64s* func_8032994C(void){ //marker_getActorPtr Actor *marker_getActor(ActorMarker *this){ - return &(D_8036E560->data[this->actrArrayIdx]); + return &(suBaddieActorArray->data[this->actrArrayIdx]); } Actor *subaddie_getLinkedActor(Actor *this){ @@ -1709,9 +1707,9 @@ void *actors_appendToSavestate(void * begin, u32 end){ u32 sp30; //SavedActorDataSize u32 sp2C; //SavedActorDataOffset - if(D_8036E560){ + if(suBaddieActorArray){ sp30 = 0; - for(s1 = D_8036E560->data; s1 < &D_8036E560->data[(u32) D_8036E560->cnt]; s1++){ + for(s1 = suBaddieActorArray->data; s1 < &suBaddieActorArray->data[(u32) suBaddieActorArray->cnt]; s1++){ if( s1->marker && s1->unk10_1 == 1 && s1->despawn_flag == 0 @@ -1726,7 +1724,7 @@ void *actors_appendToSavestate(void * begin, u32 end){ end = (u32)sp3C + sp2C; *(u32 *)end = sp30; s0 = (Actor *)((u8*)end + sizeof(u32)); - for(s1 = D_8036E560->data; s1 < &D_8036E560->data[(u32) D_8036E560->cnt]; s1++){ + for(s1 = suBaddieActorArray->data; s1 < &suBaddieActorArray->data[(u32) suBaddieActorArray->cnt]; s1++){ if( s1->marker && s1->unk10_1 == 1 && s1->despawn_flag == 0 @@ -1795,8 +1793,8 @@ void func_8032A09C(s32 arg0, s32 arg1) { Actor *temp_v0_6; - func_802C3BE8(); - if (D_8036E560 != NULL) { + spawnQueue_lock(); + if (suBaddieActorArray != NULL) { func_803283BC(); var_s3 = 0; var_s0 = var_s1->actor_save_state; @@ -1806,7 +1804,7 @@ void func_8032A09C(s32 arg0, s32 arg1) { } var_s0++; } - for(var_s0 = &D_8036E560->data[0]; var_s0 < &D_8036E560->data[D_8036E560->cnt]; var_s0++){ + for(var_s0 = &suBaddieActorArray->data[0]; var_s0 < &suBaddieActorArray->data[suBaddieActorArray->cnt]; var_s0++){ if ((var_s0->unk78_13 != 0) && (var_s3 < var_s0->unk78_13)) { var_s3 = var_s0->unk78_13; } @@ -1826,7 +1824,7 @@ void func_8032A09C(s32 arg0, s32 arg1) { } var_s0++; } - for(var_s0 = &D_8036E560->data[0]; var_s0 < &D_8036E560->data[D_8036E560->cnt]; var_s0++){ + for(var_s0 = &suBaddieActorArray->data[0]; var_s0 < &suBaddieActorArray->data[suBaddieActorArray->cnt]; var_s0++){ if ((var_s0->unk78_13 != 0)) { sp60[var_s0->unk78_13] = var_s0; } @@ -1865,15 +1863,15 @@ void func_8032A09C(s32 arg0, s32 arg1) { free(sp60); free(sp5C); } - func_802C3BDC(); + spawnQueue_unlock(); } #endif void func_8032A5F8(void) { Actor *var_s0; - if (D_8036E560 != NULL) { - for(var_s0 = &D_8036E560->data[0]; var_s0 < &D_8036E560->data[D_8036E560->cnt]; var_s0++){ + if (suBaddieActorArray != NULL) { + for(var_s0 = &suBaddieActorArray->data[0]; var_s0 < &suBaddieActorArray->data[suBaddieActorArray->cnt]; var_s0++){ if (var_s0->unk124_31 == 0xfff) { var_s0->unk124_31 = 0; func_8032A6A8(var_s0); @@ -1890,7 +1888,7 @@ void func_8032A6A8(Actor *arg0) { if (arg0->unk44_14 != -1) { var_f0 = 1.0f; - for(var_v0 = &D_8036E560->data[0]; var_v0 < &D_8036E560->data[D_8036E560->cnt]; var_v0++){ + for(var_v0 = &suBaddieActorArray->data[0]; var_v0 < &suBaddieActorArray->data[suBaddieActorArray->cnt]; var_v0++){ if ((arg0->unk44_14 == var_v0->unk44_14) && (arg0 != var_v0)) { var_f2 = var_v0->unk48; if ((var_f2 <= var_f0) && (arg0->unk48 <= var_f2)) { @@ -1908,8 +1906,8 @@ Actor *func_8032A7AC(Actor *arg0) { Actor *var_a0; if (arg0->unk124_31 != 0) { - if (D_8036E560 != NULL) { - for(var_a0 = &D_8036E560->data[0]; var_a0 < &D_8036E560->data[D_8036E560->cnt]; var_a0++){ + if (suBaddieActorArray != NULL) { + for(var_a0 = &suBaddieActorArray->data[0]; var_a0 < &suBaddieActorArray->data[suBaddieActorArray->cnt]; var_a0++){ if (arg0->unk124_31 == var_a0->unk78_13) { return var_a0; } @@ -1977,20 +1975,20 @@ void actor_collisionOn(Actor* this){ } void func_8032AA9C(void){ - func_802C3BDC(); + spawnQueue_unlock(); } void func_8032AABC(void){ Actor *i_ptr; - Actor *start = &D_8036E560->data[0]; + Actor *start = &suBaddieActorArray->data[0]; u32 i; u32 cnt; - func_802C3BE8(); + spawnQueue_lock(); - if(D_8036E560 != NULL){ - cnt = D_8036E560->cnt; + if(suBaddieActorArray != NULL){ + cnt = suBaddieActorArray->cnt; for(i_ptr = start, i = 0; i < cnt; i++, i_ptr++){ i_ptr->marker->unk14_21 = 0; } @@ -2058,15 +2056,15 @@ void func_8032AD7C(s32 arg0) { static s32 D_8036E5A8 = 0; - if (D_8036E560 != NULL) { - if (D_8036E5A8 >= D_8036E560->cnt) { + if (suBaddieActorArray != NULL) { + if (D_8036E5A8 >= suBaddieActorArray->cnt) { D_8036E5A8 = 0; } - for(var_s0 = 0; var_s0 < ((arg0 == 1) ? 0xF : D_8036E560->cnt); var_s0++){ - if (func_80330E28(&D_8036E560->data[D_8036E5A8]) == NULL) { - func_8032ACA8(&D_8036E560->data[D_8036E5A8]); + for(var_s0 = 0; var_s0 < ((arg0 == 1) ? 0xF : suBaddieActorArray->cnt); var_s0++){ + if (func_80330E28(&suBaddieActorArray->data[D_8036E5A8]) == NULL) { + func_8032ACA8(&suBaddieActorArray->data[D_8036E5A8]); } - D_8036E5A8 = (D_8036E5A8 + 1) % D_8036E560->cnt; + D_8036E5A8 = (D_8036E5A8 + 1) % suBaddieActorArray->cnt; } } } @@ -2076,13 +2074,13 @@ void func_8032AEB4(void) { Actor *temp_s2; Actor *var_s0; - temp_s2 = &D_8036E560->data[0]; - for(var_s0 = temp_s2; (D_8036E560 != NULL) && ((var_s0 - temp_s2) != D_8036E560->cnt); var_s0++){ + temp_s2 = &suBaddieActorArray->data[0]; + for(var_s0 = temp_s2; (suBaddieActorArray != NULL) && ((var_s0 - temp_s2) != suBaddieActorArray->cnt); var_s0++){ func_8032ACA8(var_s0); } } -void func_8032AF94(void) { +void actorArray_defrag(void) { AnimCtrl *temp_a0_4; ParticleEmitter *temp_a0_2; ParticleEmitter *temp_a0_3; @@ -2095,52 +2093,52 @@ void func_8032AF94(void) { s32 temp_a0_9; s32 temp_t7; s32 var_s1; - Actor *temp_s0; + Actor *i_actor; void *temp_s0_2; static s32 D_8036E5AC = 0; - if (D_8036E560 != NULL) { + if (suBaddieActorArray != NULL) { for(var_s1 = 0; var_s1 < 8; var_s1++){ D_8036E5AC++; - if (D_8036E5AC >= D_8036E560->cnt) { + if (D_8036E5AC >= suBaddieActorArray->cnt) { D_8036E5AC = 0; } - temp_s0 = &D_8036E560->data[D_8036E5AC]; + i_actor = &suBaddieActorArray->data[D_8036E5AC]; - if ((s32)temp_s0->marker->unk44 < 0) { - temp_s0->marker->unk44 = func_8034A348(temp_s0->marker->unk44); + if ((s32)i_actor->marker->unk44 < 0) { + i_actor->marker->unk44 = func_8034A348(i_actor->marker->unk44); } - if (temp_s0->unk158[0] != NULL) { - temp_s0->unk158[0] = func_802F0D74(temp_s0->unk158[0]); + if (i_actor->unk158[0] != NULL) { + i_actor->unk158[0] = func_802F0D74(i_actor->unk158[0]); } - if (temp_s0->unk158[1] != NULL) { - temp_s0->unk158[1] = func_802F0D74(temp_s0->unk158[1]); + if (i_actor->unk158[1] != NULL) { + i_actor->unk158[1] = func_802F0D74(i_actor->unk158[1]); } - if (temp_s0->animctrl != NULL) { - temp_s0->animctrl = animctrl_defrag(temp_s0->animctrl); + if (i_actor->animctrl != NULL) { + i_actor->animctrl = animctrl_defrag(i_actor->animctrl); } - if (temp_s0->marker->unk20 != NULL) { - temp_s0->marker->unk20 = func_802EA374(temp_s0->marker->unk20); + if (i_actor->marker->unk20 != NULL) { + i_actor->marker->unk20 = func_802EA374(i_actor->marker->unk20); } - if (temp_s0->unk148 != NULL) { - temp_s0->unk148 = (Struct80s*)defrag(temp_s0->unk148); + if (i_actor->unk148 != NULL) { + i_actor->unk148 = (Struct80s*)defrag(i_actor->unk148); } - if (temp_s0->marker->unk50 != NULL) { - temp_s0->marker->unk50 = func_803406D4(temp_s0->marker->unk50); + if (i_actor->marker->unk50 != NULL) { + i_actor->marker->unk50 = func_803406D4(i_actor->marker->unk50); } - if (temp_s0->marker->unk14_20 == MARKER_217_BEE_SWARM) { - func_802CEB60(temp_s0); + if (i_actor->marker->unk14_20 == MARKER_217_BEE_SWARM) { + func_802CEB60(i_actor); } } - D_8036E560 = (ActorArray *) defrag(D_8036E560); + suBaddieActorArray = (ActorArray *) defrag(suBaddieActorArray); } if (D_8036E568 != 0) { @@ -2156,10 +2154,10 @@ ActorMarker *func_8032B16C(enum jiggy_e jiggy_id) { Actor *temp_s3; Actor *var_s0; - if (D_8036E560 != NULL) { - temp_s3 = &D_8036E560->data[0]; - for(var_s0 = temp_s3; (var_s0 - temp_s3) < D_8036E560->cnt; var_s0++){ - if ((var_s0->marker->unk14_20 == MARKER_52_JIGGY) && (func_802C8088(&(var_s0->marker)) == jiggy_id)) { + if (suBaddieActorArray != NULL) { + temp_s3 = &suBaddieActorArray->data[0]; + for(var_s0 = temp_s3; (var_s0 - temp_s3) < suBaddieActorArray->cnt; var_s0++){ + if ((var_s0->marker->unk14_20 == MARKER_52_JIGGY) && (chjiggy_getJiggyId(&(var_s0->marker)) == jiggy_id)) { return var_s0->marker; } } @@ -2178,12 +2176,12 @@ void func_8032B258(Actor *this, enum collision_e arg1) { func_8034A174( this->marker->unk44, 0x20, sp38); } if (((s32)this->marker->unk44 < 0) && ((sp38[0] != 0.0f) || (sp38[1] != 0.0f) || (sp38[2] != 0.0f))) { - func_802C4014((GenMethod_5)func_802C4260, this->unk138_27 + 0x15, reinterpret_cast(s32,sp38[0]), reinterpret_cast(s32,sp38[1]), reinterpret_cast(s32,sp38[2]), reinterpret_cast(s32,sp44)); + __spawnQueue_add_5((GenMethod_5)func_802C4260, this->unk138_27 + 0x15, reinterpret_cast(s32,sp38[0]), reinterpret_cast(s32,sp38[1]), reinterpret_cast(s32,sp38[2]), reinterpret_cast(s32,sp44)); return; } else{ sp34 = this->position[1] + 50.0f; - func_802C4014((GenMethod_5)func_802C4260, this->unk138_27 + 0x15, reinterpret_cast(s32,this->position[0]), reinterpret_cast(s32,sp34), reinterpret_cast(s32,this->position[2]), reinterpret_cast(s32,sp44)); + __spawnQueue_add_5((GenMethod_5)func_802C4260, this->unk138_27 + 0x15, reinterpret_cast(s32,this->position[0]), reinterpret_cast(s32,sp34), reinterpret_cast(s32,this->position[2]), reinterpret_cast(s32,sp44)); } } } @@ -2299,15 +2297,15 @@ void func_8032B5C0(ActorMarker *arg0, ActorMarker *arg1, struct5Cs *arg2) { } func_8032EE0C(func_8032B38C, this); if (((s32)arg0->unk44 < 0) && ((sp50[0] != 0.0f) || (sp50[1] != 0.0f) || (sp50[2] != 0.0f))) { - func_802C4014(func_802C4260, sp70 + 0x15, reinterpret_cast(s32, sp50[0]), reinterpret_cast(s32, sp50[1]), reinterpret_cast(s32, sp50[2]), reinterpret_cast(s32, sp5C)); + __spawnQueue_add_5((GenMethod_5)func_802C4260, sp70 + 0x15, reinterpret_cast(s32, sp50[0]), reinterpret_cast(s32, sp50[1]), reinterpret_cast(s32, sp50[2]), reinterpret_cast(s32, sp5C)); } else if (this->unk16C_3 && func_803048E0(sp3C, &sp4C, &sp48, 3, (s32) (func_8033229C(arg0) * 4.0f))) { sp50[0] = (f32) sp48->x; sp50[1] = (f32) sp48->y; sp50[2] = (f32) sp48->z; - func_802C4014(func_802C4260, sp70 + 0x15, reinterpret_cast(s32, sp50[0]), reinterpret_cast(s32, sp50[1]), reinterpret_cast(s32, sp50[2]), reinterpret_cast(s32, sp5C)); + __spawnQueue_add_5((GenMethod_5)func_802C4260, sp70 + 0x15, reinterpret_cast(s32, sp50[0]), reinterpret_cast(s32, sp50[1]), reinterpret_cast(s32, sp50[2]), reinterpret_cast(s32, sp5C)); } else { sp38 = this->position[1] + func_8033229C(arg0); - func_802C4014(func_802C4260, sp70 + 0x15, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, sp38), reinterpret_cast(s32, this->position[2]), reinterpret_cast(s32, sp5C)); + __spawnQueue_add_5((GenMethod_5)func_802C4260, sp70 + 0x15, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, sp38), reinterpret_cast(s32, this->position[2]), reinterpret_cast(s32, sp5C)); } func_8032EE20(); } diff --git a/src/core2/code_A5BC0.c b/src/core2/code_A5BC0.c index 9b406213..b3548dac 100644 --- a/src/core2/code_A5BC0.c +++ b/src/core2/code_A5BC0.c @@ -7,7 +7,7 @@ extern int func_802E74A0(f32[3], f32, s32, s32); extern s32 func_802E9118(BKCollisionList * collision_list, BKVertexList *vtx_list, f32 arg2[3], s32 arg3, f32 arg4, f32 arg5[3], f32 arg6[3], f32 arg7, f32 arg8[3], s32 arg9, s32 argA); extern f32 func_802EC920(BKVertexList *); -extern void func_802C39D4(void); +extern void spawnQueue_func_802C39D4(void); extern bool func_80340020(s32, f32[3], f32[3], f32, s32, BKVertexList *, f32[3], f32[3]); extern void func_80340200(s32, f32[3], f32[3], f32, s32, s32, BKVertexList *, s32); extern s32 func_802E9DD8(BKCollisionList *collisionList, BKVertexList *vtxList, f32 arg2[3], f32 *arg3, f32 arg4, f32 arg5[3], f32 arg6, f32 arg7[3], s32 arg8); @@ -1597,7 +1597,7 @@ void func_80330FF4(void){ func_80340200(D_8038341C->unk50, phi_s0->position, scale, 1.0f, NULL, D_80383420, func_80330DA4(phi_s0), D_80383410); }//L8033108C - func_802C39D4(); + spawnQueue_func_802C39D4(); if(D_8038341C != NULL){ phi_s0 = marker_getActor(D_8038341C); player_getPosition(sp48); @@ -1650,7 +1650,7 @@ s32 func_803311D4(Cube *arg0, f32 *arg1, f32 *arg2, f32 *arg3, u32 arg4) { f32 var_f10; f32 var_f4; f32 var_f6; - s32 (*temp_v1_2)(struct actor_marker_s *, f32 [3], f32, f32 [3], s32); + s32 (*temp_v1_2)(struct actorMarker_s *, f32 [3], f32, f32 [3], s32); s32 temp_s0; s32 temp_s0_2; BKCollisionList *temp_s2; diff --git a/src/core2/code_ABC00.c b/src/core2/code_ABC00.c index fd47820a..85d80749 100644 --- a/src/core2/code_ABC00.c +++ b/src/core2/code_ABC00.c @@ -174,10 +174,10 @@ void func_80332CCC(void) { Actor **temp_v0; s32 i; - temp_v0 = func_80326FC0(); + temp_v0 = actorArray_findJiggyActors(); for(D_8038356C = 0; temp_v0[D_8038356C] != NULL; D_8038356C++){ if(!temp_v0[D_8038356C]->unk44_2){ - D_8036E834[func_802C8088(temp_v0[D_8038356C]) - 1].unk10.marker = temp_v0[D_8038356C]->marker; + D_8036E834[chjiggy_getJiggyId(temp_v0[D_8038356C]) - 1].unk10.marker = temp_v0[D_8038356C]->marker; } } } @@ -274,7 +274,7 @@ void func_80333270(enum jiggy_e jiggy_id, f32 position[3], void (*method)(Actor void func_803332D0(Actor *arg0) { - s32 indx = func_802C8088(arg0) - 1; + s32 indx = chjiggy_getJiggyId(arg0) - 1; Struct81s *sp18 = &D_8036E834[indx].unk10; if (D_8036E834[indx].unkC) { @@ -305,16 +305,16 @@ void func_80333388(enum jiggy_e jiggy_id) { } void func_803333DC(Struct81s *arg0, Actor *arg1) { - s32 sp20; + s32 jiggy_id; arg0->marker = arg1->marker; if (arg0->unk14 != NULL) { arg0->unk14(arg1, arg0->unk18); } func_803300D8(arg1->marker, func_803332D0); - sp20 = ((s32) ((s32)arg0 - (s32)&D_8036E834) / 0x2C) + 1; - func_802C80B4(arg1, sp20); - if ((sp20 == JIGGY_49_CCW_EYRIE) || (sp20 == JIGGY_39_LAIR_MMM_WITCH_SWITCH) || (sp20 == JIGGY_3C_LAIR_CCW_WITCH_SWITCH)) { + jiggy_id = ((s32) ((s32)arg0 - (s32)&D_8036E834) / 0x2C) + 1; + chjiggy_setJiggyId(arg1, jiggy_id); + if ((jiggy_id == JIGGY_49_CCW_EYRIE) || (jiggy_id == JIGGY_39_LAIR_MMM_WITCH_SWITCH) || (jiggy_id == JIGGY_3C_LAIR_CCW_WITCH_SWITCH)) { arg1->marker->unk40_21 = TRUE; arg1->marker->unk40_20 = TRUE; } diff --git a/src/core2/code_AC520.c b/src/core2/code_AC520.c index a46b57a5..bf439cca 100644 --- a/src/core2/code_AC520.c +++ b/src/core2/code_AC520.c @@ -40,7 +40,7 @@ extern void func_803334B0(f32 position[3], f32 rotation[3], f32 scale, f32 arg3[ end_ptr = (Struct_core2_AC520_0 *)vector_getEnd(D_80383570.unk0); mlMtxIdent(); func_80252CC4(position, rotation, scale, arg3); - D_80383570.unk44 = &D_80383570.unk4; + D_80383570.unk44 = D_80383570.unk4; iPtr = start_ptr; for(; iPtr < end_ptr && D_80383570.unk44 < D_80383570.unk48; iPtr++){ if(iPtr->unk34 && ml_vec3f_distance(position, iPtr->unk0) < iPtr->unk1C + arg4){ @@ -148,7 +148,7 @@ void func_80333974(s32 index){ v0->unk34 = 0; } -s32 func_803339A4(s32 arg0){ +s32 func_803339A4(f32 arg0[3]){ Struct_core2_AC520_0 *beginPtr = vector_getBegin(D_80383570.unk0); Struct_core2_AC520_0 *endPtr = vector_getEnd(D_80383570.unk0); Struct_core2_AC520_0 *iPtr; @@ -156,7 +156,7 @@ s32 func_803339A4(s32 arg0){ for(iPtr = beginPtr; iPtr < endPtr; iPtr++){ if(iPtr->unk34){ - if(!tmp_s0 || ml_vec3f_distance(arg0, iPtr) < ml_vec3f_distance(arg0, tmp_s0)){ + if(tmp_s0 == NULL || ml_vec3f_distance(arg0, iPtr->unk0) < ml_vec3f_distance(arg0, tmp_s0->unk0)){ tmp_s0 = iPtr; } } @@ -221,7 +221,7 @@ s32 func_80333C78(s32 arg0){ return func_8034AF98(arg0, 0); } -void func_80333D48(BKVertexList *arg0, f32 position[3], f32 rotation[3], f32 scale, s32 arg4, BKVertexList *arg5) { +void func_80333D48(BKVertexList *arg0, f32 position[3], f32 rotation[3], f32 scale, f32 arg4[3], BKVertexList *arg5) { static s32 D_8036F970[3] = {0, 0, 0}; Vtx *i_ptr; Vtx *end_ptr; diff --git a/src/core2/code_AD5B0.c b/src/core2/code_AD5B0.c index 5b725711..244acc51 100644 --- a/src/core2/code_AD5B0.c +++ b/src/core2/code_AD5B0.c @@ -36,7 +36,7 @@ void func_80334540(Gfx** gdl, Mtx **mptr, Vtx **vptr) { if (func_80320708() == 0) { write_file_blocks(0, 0, 0x80BC7230, EEPROM_MAXBLOCKS); } - func_802C3BDC(); + spawnQueue_unlock(); sky_draw(gdl, mptr, vptr); func_802BBD2C(&sp44, &sp40); func_8024CE60(sp44, sp40); @@ -96,7 +96,7 @@ void func_80334540(Gfx** gdl, Mtx **mptr, Vtx **vptr) { if (func_802E49F0() == 0) { func_802BBD0C(gdl, mptr, vptr); } - func_802C3BE8(); + spawnQueue_lock(); } void func_803348B0(s32 arg0, s32 arg1, s32 arg2){ @@ -135,7 +135,7 @@ void func_80334910(void) { func_8028E644(); func_80322F5C(); func_80341A54(); - func_802C398C(); + spawnQueue_free(); func_802F53D0(); func_802FAC3C(); func_802C8F68(); @@ -210,7 +210,7 @@ void func_80334B20(enum map_e arg0, s32 arg1, s32 arg2) { func_802FAE4C(); } func_8031B644(); - func_802C2B10(); + spawnQueue_malloc(); func_803329AC(); func_80350BFC(); func_80323190(); @@ -244,7 +244,7 @@ void func_80334B20(enum map_e arg0, s32 arg1, s32 arg2) { gcdialog_init(); mapSpecificFlags_clearAll(); func_803411B0(); - func_802C2B5C(); + spawnQueue_reset(); func_80322FBC(); func_8028E4B0(); func_80322F9C(); diff --git a/src/core2/code_B3A80.c b/src/core2/code_B3A80.c index fb03b57f..5a223d5b 100644 --- a/src/core2/code_B3A80.c +++ b/src/core2/code_B3A80.c @@ -47,7 +47,7 @@ f32 func_8033AA10(AnimationFile *this, s32 arg1){ return (f32)(arg1 - this->unk0)/(f32)(this->unk2 - this->unk0); } -void func_8033AA50(AnimationFile *anim_file, f32 arg1, s32 arg2){ +void func_8033AA50(AnimationFile *anim_file, f32 arg1, Struct_B1400 *arg2){ s32 tmp_s1; int i; f32 tmp_f22; @@ -55,7 +55,7 @@ void func_8033AA50(AnimationFile *anim_file, f32 arg1, s32 arg2){ f32 sp54[3][3]; tmp_f22 = func_8033ABA0(anim_file, arg1); - tmp_s0 = (s32)anim_file + sizeof(AnimationFile); + tmp_s0 = (AnimationFileElement *)((s32)anim_file + sizeof(AnimationFile)); tmp_s1 = 0; for(i = 0; i < anim_file->elem_cnt; i++){//L8033AAB8 if(tmp_s0->unk0_15 != tmp_s1){ @@ -199,7 +199,7 @@ void func_8033B180(void){ } void func_8033B1BC(void){ - struct21s *tmp_a0; + vector(struct21s) *tmp_a0; struct21s *iPtr; struct21s *start_ptr; struct21s *endPtr; @@ -220,8 +220,8 @@ void func_8033B1BC(void){ } void func_8033B268(void){ - D_80383CE0[0] = defrag(D_80383CE0[0]); - D_80383CE0[1] = defrag(D_80383CE0[1]); + D_80383CE0[0] = (vector(struct21s) *)defrag(D_80383CE0[0]); + D_80383CE0[1] = (vector(struct21s) *)defrag(D_80383CE0[1]); } void func_8033B2A4(s32 arg0) { @@ -385,7 +385,7 @@ void *assetcache_get(s32 arg0) { if (func_8025498C((u32)comp_size + uncomp_size) && !sp28) { sp33 = 1; uncompressed_file = malloc((u32)comp_size + uncomp_size); - compressed_file = (s32) uncompressed_file + uncomp_size; + compressed_file = (void *)((s32) uncompressed_file + uncomp_size); } else { sp33 = 2; if (sp28 != 0) { @@ -513,7 +513,7 @@ s32 func_8033BDAC(enum asset_e id, void *dst, s32 size) { } else if(size >= var_s0) { sp2B = 2; - comp_ptr = malloc(comp_ptr); + comp_ptr = (s32)malloc(comp_ptr); } else{ return 0; @@ -525,7 +525,7 @@ s32 func_8033BDAC(enum asset_e id, void *dst, s32 size) { var_s0 = (comp_ptr - (comp_ptr & (0x10 -1))) + 0x10; if(size >= comp_ptr){ - comp_ptr = dst; + comp_ptr = (s32)dst; } else{ return 0; @@ -537,7 +537,7 @@ s32 func_8033BDAC(enum asset_e id, void *dst, s32 size) { rarezip_inflate(comp_ptr, dst); osWritebackDCache(dst, D_80370A10); if (sp2B == 2) { - free(comp_ptr); + free((void *)comp_ptr); } } return var_s0; diff --git a/src/core2/code_C0B80.c b/src/core2/code_C0B80.c index 4cf03db1..dffbb128 100644 --- a/src/core2/code_C0B80.c +++ b/src/core2/code_C0B80.c @@ -12,7 +12,7 @@ void func_80347B10(Struct81s *arg0){ } void func_80347B54(Struct81s *arg0){ - __spawnqueue_add_1((GenMethod_1)func_80347B10, reinterpret_cast(s32, arg0)); + __spawnQueue_add_1((GenMethod_1)func_80347B10, reinterpret_cast(s32, arg0)); } void func_80347B80(Struct81s *arg0) { diff --git a/src/core2/code_C0CF0.c b/src/core2/code_C0CF0.c index f787887c..ea97f995 100644 --- a/src/core2/code_C0CF0.c +++ b/src/core2/code_C0CF0.c @@ -14,7 +14,7 @@ void func_80347C80(Struct81s *arg0){ } void func_80347CC8(Struct81s *arg0){ - __spawnqueue_add_1((GenMethod_1)func_80347C80, reinterpret_cast(s32, arg0)); + __spawnQueue_add_1((GenMethod_1)func_80347C80, reinterpret_cast(s32, arg0)); } void func_80347CF4(Struct81s *arg0) { diff --git a/src/core2/code_C0E60.c b/src/core2/code_C0E60.c index 80544ccd..61675943 100644 --- a/src/core2/code_C0E60.c +++ b/src/core2/code_C0E60.c @@ -79,7 +79,7 @@ void func_80347DF0(Struct81s *arg0){ } void func_80347E34(Struct81s *arg0){ - __spawnqueue_add_1((GenMethod_1) func_80347DF0, reinterpret_cast(s32, arg0)); + __spawnQueue_add_1((GenMethod_1) func_80347DF0, reinterpret_cast(s32, arg0)); } void func_80347E60(Struct81s *arg0) { diff --git a/src/core2/code_C5440.c b/src/core2/code_C5440.c index 3a2a9718..8e9ebadb 100644 --- a/src/core2/code_C5440.c +++ b/src/core2/code_C5440.c @@ -196,4 +196,4 @@ void * func_8034C9D4(void){ D_80372030[iPtr->unk6].unk4(&iPtr->unk8, iPtr->unk0, iPtr->unk4); } -} \ No newline at end of file +} diff --git a/src/core2/code_D5D10.c b/src/core2/code_D5D10.c index af2b6752..885e9d6a 100644 --- a/src/core2/code_D5D10.c +++ b/src/core2/code_D5D10.c @@ -73,7 +73,7 @@ void chskeleton_despawn(ActorMarker *marker, s32 arg1) { func_802DAD8C(partEmitList_pushNew(2), this, ASSET_4CD_MODEL_LIMBO_ARM); func_8035CCA0(partEmitList_pushNew(4), this, ASSET_4D0_MODEL_LIMBO_BONE); FUNC_8030E8B4(SFX_119_FISH_DEATH, 1.0f, 32000, this->position, 1250, 2500); - func_802C3F04(func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2])); + __spawnQueue_add_4((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2])); marker_despawn(marker); } diff --git a/src/core2/code_D6180.c b/src/core2/code_D6180.c index f3fb3726..a616f8e8 100644 --- a/src/core2/code_D6180.c +++ b/src/core2/code_D6180.c @@ -71,7 +71,7 @@ void func_8035D1F0(ActorMarker *arg0, s32 arg1) { func_802DAD8C(partEmitList_pushNew(2), this, ASSET_4C8_MODEL_MUMMUM_ARM); func_8035D110(partEmitList_pushNew(1), this, ASSET_4CB_MODEL_MUMMUM_BODY); FUNC_8030E8B4(SFX_119_FISH_DEATH, 0.8f, 32000, this->position, 1250, 2500); - func_802C3F04((GenMethod_4) func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2])); + __spawnQueue_add_4((GenMethod_4) func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2])); marker_despawn(arg0); } @@ -151,4 +151,4 @@ void func_8035D4F0(ActorMarker *marker, s32 arg1){ } } } -} \ No newline at end of file +} diff --git a/src/core2/code_D7D10.c b/src/core2/code_D7D10.c index c2fdf0e6..6da33680 100644 --- a/src/core2/code_D7D10.c +++ b/src/core2/code_D7D10.c @@ -44,7 +44,7 @@ Actor *func_8035ECA0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { Actor *this; ActorLocal_core2_D7D10 *local; - this = func_80325300(marker, rotation); + this = marker_getActorAndRotation(marker, rotation); local = (ActorLocal_core2_D7D10 *)&this->local; func_8033A45C(3, (s32) this->velocity[1]); func_8033A45C(4, local->unk0); diff --git a/src/core2/code_DAAA0.c b/src/core2/code_DAAA0.c index 5e3240bb..d5d77fd7 100644 --- a/src/core2/code_DAAA0.c +++ b/src/core2/code_DAAA0.c @@ -146,19 +146,19 @@ void func_80361BD0(s32 arg0, s32 arg1, s32 arg2){ actor->unk124_11 = arg2; } -void func_80361C24(s32 arg0, f32 arg1, s32 arg2, f32 arg3){ +void func_80361C24(s32 arg0, f32 arg1, ActorMarker * arg2, f32 arg3){ func_80288D84(arg0, arg1, func_80361B68, reinterpret_cast(s32, arg2), reinterpret_cast(s32, arg3)); } -void func_80361C64(s32 arg0, f32 arg1, s32 arg2, s32 arg3, s32 arg4){ +void func_80361C64(s32 arg0, f32 arg1, ActorMarker * arg2, s32 arg3, s32 arg4){ func_80288DCC(arg0, arg1, func_80361B98, reinterpret_cast(s32, arg2), reinterpret_cast(s32, arg3), arg4); } -void func_80361CAC(s32 arg0, f32 arg1, s32 arg2, f32 arg3){ +void func_80361CAC(s32 arg0, f32 arg1, ActorMarker *arg2, f32 arg3){ func_80288DCC(arg0, arg1, func_80361BD0, reinterpret_cast(s32, arg2), reinterpret_cast(s32, arg3), 1); } -void func_80361CF4(s32 arg0, f32 arg1, s32 arg2, f32 arg3){ +void func_80361CF4(s32 arg0, f32 arg1, ActorMarker *arg2, f32 arg3){ func_80288DCC(arg0, arg1, func_80361BD0, reinterpret_cast(s32, arg2), reinterpret_cast(s32, arg3), 2); } @@ -166,7 +166,7 @@ void func_80361D3C(s32 arg0, f32 arg1, s32 arg2, s32 arg3){ func_80288D84(arg0, arg1, func_80361AB0, reinterpret_cast(s32, arg2), reinterpret_cast(s32, arg3)); } -void func_80361D7C(s32 arg0, f32 arg1, s32 arg2, s32 arg3, u32 arg4){ +void func_80361D7C(s32 arg0, f32 arg1, struct ActorMarker *arg2, s32 arg3, u32 arg4){ func_80288DCC(arg0, arg1, func_80361AE0, reinterpret_cast(s32, arg2), arg3, arg4); } diff --git a/src/core2/code_EE40.c b/src/core2/code_EE40.c index 1a36f06b..169c2c61 100644 --- a/src/core2/code_EE40.c +++ b/src/core2/code_EE40.c @@ -15,7 +15,7 @@ void func_80295DD0(void){ s32 sp24[3]; s32 sp18[3]; - func_80309998(sp18, sp24); + mapModel_getBounds(sp18, sp24); ml_vec3w_to_vec3f(D_8037C3C0.unkC, sp18); ml_vec3w_to_vec3f(D_8037C3C0.unk0, sp24); D_8037C3C0.unkC[0] -= 400.0f; diff --git a/src/core2/gc/pauseMenu.c b/src/core2/gc/pauseMenu.c index 8350d5ff..4a323084 100644 --- a/src/core2/gc/pauseMenu.c +++ b/src/core2/gc/pauseMenu.c @@ -62,7 +62,7 @@ extern void func_8033BD20(void *); enum gcpausemenu_state_e { PAUSE_STATE_0_CLOSED = 0, - PAUSE_STATE_1_OPENING = 1, + PAUSE_STATE_1_OPENING = 1 }; @@ -191,7 +191,7 @@ void gcpausemenu_defrag(void){ for(i =0; i< 4; i++){ if(D_80383010.zoombox[i]){ func_80318C0C(D_80383010.zoombox[i]); - D_80383010.zoombox[i] = defrag(D_80383010.zoombox[i]); + D_80383010.zoombox[i] = (gczoombox_t *)defrag(D_80383010.zoombox[i]); } } } @@ -312,7 +312,7 @@ char *gcpausemenu_TimeToA(int time){ void gcpausemenu_printLevelTotals(enum level_e level){ s32 val; s32 max; - const char empty[1] = 0; //empty + char empty[] = {0}; //empty //note ratio 2 string gcpausemenu_getLevelNoteScore(level, &val, &max); @@ -357,7 +357,7 @@ void gcpausemenu_getTotalHoneycombScore(s32 *dst){ void gcpausemenu_printTotals(void){ s32 val; - const char D_8036C61C[] = 0; + char D_8036C61C[] = {0}; //note ratio 2 string gcpausemenu_getTotalNoteScore(&val); @@ -1238,7 +1238,7 @@ void __gcpausemenu_drawSprite(Gfx** gdl, Mtx** mptr, Vtx** vptr, BKSprite* sprit } -void gcpausemenu_drawSprite(Gfx** gdl, Mtx** mptr, s32 vptr, BKSprite *sprite, s32 frame, f32 x, f32 y, s32 mirror, u8 a){ +void gcpausemenu_drawSprite(Gfx** gdl, Mtx** mptr, Vtx **vptr, BKSprite *sprite, s32 frame, f32 x, f32 y, s32 mirror, u8 a){ BKSpriteFrame *_frame; s32 w; s32 h; @@ -1359,7 +1359,7 @@ void gcpausemenu_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) { func_8033A45C(i, 1); modelRender_setDepthMode(MODEL_RENDER_DEPTH_NONE); modelRender_setAlpha(D_80383010.sns_alpha); - modelRender_draw(gfx, mtx, &sp98, &sp8C, 0.8f, &sp80, D_80383010.sns_egg_model); + modelRender_draw(gfx, mtx, sp98, sp8C, 0.8f, sp80, D_80383010.sns_egg_model); func_8024E2FC(); func_8024C904(gfx, mtx); } diff --git a/src/core2/gc/section.c b/src/core2/gc/section.c index ec2e8e4d..3c7171e8 100644 --- a/src/core2/gc/section.c +++ b/src/core2/gc/section.c @@ -182,7 +182,7 @@ MapInfo * func_8030AD00(enum map_e map_id){ enum level_e map_getLevel(enum map_e map){ return func_8030AD00(map)->level_id; -}; +} /* returns string containing the map name and index */ char *gcsection_getName(enum map_e map){ @@ -280,4 +280,4 @@ void func_8030AFD8(s32 arg0){ func_80250FC0(); //stop controller motor gcpausemenu_80314B24(); func_80347A70(); -} \ No newline at end of file +} diff --git a/src/core2/mapModel.c b/src/core2/mapModel.c index 9c9d63c4..308af087 100644 --- a/src/core2/mapModel.c +++ b/src/core2/mapModel.c @@ -7,9 +7,8 @@ extern UNK_TYPE(s32) func_802E8E88(BKCollisionList *, BKVertexList *, f32[3], f32[3], f32, f32[3], s32, s32); extern UNK_TYPE(s32) func_802E92AC(BKCollisionList *, BKVertexList *, f32[3], f32, f32[3], s32); extern s32 func_802EC394(BKModelUnk14List *arg0, s32 arg1, s32 arg2, f32 arg3, s32 arg4, s32 arg5, s32 arg6); -extern void func_802EC458(BKVertexList *, s32[3], s32[3]); +extern void vtxList_getBounds_s32(BKVertexList *, s32[3], s32[3]); extern void func_802F7BC0(Gfx **, Mtx **, Vtx **); -extern void func_8033A450(s32); extern void func_8033A45C(s32, s32); @@ -308,7 +307,7 @@ void mapModel_opa_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) { func_8033A45C(2, 1); break; case MAP_1D_MMM_CELLAR: - func_8033A45C(1, func_80326EEC(0x191) ? 0 : 1); + func_8033A45C(1, actorArray_findActorFromActorId(0x191) ? 0 : 1); break; case MAP_7C_CS_INTRO_BANJOS_HOUSE_1: case MAP_89_CS_INTRO_BANJOS_HOUSE_2: @@ -355,7 +354,7 @@ void mapModel_xlu_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) { if (mapModel.model_bin_xlu != NULL) { if (map_get() == MAP_1D_MMM_CELLAR) { - func_8033A45C(1, (func_80326EEC(0x191) != NULL) ? 0 : 1); + func_8033A45C(1, (actorArray_findActorFromActorId(0x191) != NULL) ? 0 : 1); } modelRender_setDepthMode(MODEL_RENDER_DEPTH_COMPARE); temp_a0 = mapModel.unk4; @@ -399,46 +398,46 @@ struct5Bs *func_803097A0(void){ } -void func_803097AC(s32 arg0[3], s32 arg1[3]) { - func_802EC458(func_8033A148(mapModel.model_bin_opa), arg0, arg1); - func_8033ECD8(arg0, arg1, 1000); - arg0[0] = arg0[0] + mapModel.description->unk6[0]; - arg0[1] = arg0[1] + mapModel.description->unk6[1]; - arg0[2] = arg0[2] + mapModel.description->unk6[2]; - arg1[0] = arg1[0] + mapModel.description->unkC[0]; - arg1[1] = arg1[1] + mapModel.description->unkC[1]; - arg1[2] = arg1[2] + mapModel.description->unkC[2]; +void mapModel_getCubeBounds(s32 min[3], s32 max[3]) { + vtxList_getBounds_s32(func_8033A148(mapModel.model_bin_opa), min, max); + func_8033ECD8(min, max, 1000); + min[0] = min[0] + mapModel.description->unk6[0]; + min[1] = min[1] + mapModel.description->unk6[1]; + min[2] = min[2] + mapModel.description->unk6[2]; + max[0] = max[0] + mapModel.description->unkC[0]; + max[1] = max[1] + mapModel.description->unkC[1]; + max[2] = max[2] + mapModel.description->unkC[2]; } -void func_80309888(s32 arg0[3], s32 arg1[3]) { +void mapModel_getOpaBounds(s32 min[3], s32 max[3]) { s32 i; - func_802EC458(func_8033A148(mapModel.model_bin_opa), arg0, arg1); + vtxList_getBounds_s32(func_8033A148(mapModel.model_bin_opa), min, max); for(i = 0; i < 3; i++){ - arg0[i] *= mapModel.scale; - arg1[i] *= mapModel.scale; + min[i] *= mapModel.scale; + max[i] *= mapModel.scale; } } -void func_80309998(s32 arg0[3], s32 arg1[3]) { +void mapModel_getBounds(s32 min[3], s32 max[3]) { s32 i, j; - s32 sp3C[3]; - s32 sp30[3]; + s32 xlu_min[3]; + s32 xlu_max[3]; - func_802EC458(func_8033A148(mapModel.model_bin_opa), arg0, arg1); + vtxList_getBounds_s32(func_8033A148(mapModel.model_bin_opa), min, max); for(i = 0; i < 3; i++){ - arg0[i] *= mapModel.scale; - arg1[i] *= mapModel.scale; + min[i] *= mapModel.scale; + max[i] *= mapModel.scale; } if (mapModel.model_bin_xlu != NULL) { - func_802EC458(func_8033A148(mapModel.model_bin_xlu), sp3C, sp30); + vtxList_getBounds_s32(func_8033A148(mapModel.model_bin_xlu), xlu_min, xlu_max); for(j = 0; j < 3; j++){ - if(sp3C[j] < arg0[j]){ - arg0[j] = sp3C[j]; + if(xlu_min[j] < min[j]){ + min[j] = xlu_min[j]; } - if(arg1[j] < sp30[j]){ - arg1[j] = sp30[j]; + if(max[j] < xlu_max[j]){ + max[j] = xlu_max[j]; } } diff --git a/src/core2/modelRender.c b/src/core2/modelRender.c index abca6a3e..25501f42 100644 --- a/src/core2/modelRender.c +++ b/src/core2/modelRender.c @@ -600,7 +600,7 @@ enum model_render_color_mode_e{ }; /* .bss */ -s32 D_80383650; +struct5Bs *D_80383650; s32 D_80383658[0x2A]; s32 D_80383700; bool D_80383704; @@ -1479,7 +1479,7 @@ void func_8033A444(struct58s *arg0){ D_8038371C = arg0; } -void func_8033A450(s32 arg0){ +void func_8033A450(struct5Bs *arg0){ D_80383650 = arg0; } diff --git a/src/core2/playerModel.c b/src/core2/playerModel.c index a21f06b2..0a143340 100644 --- a/src/core2/playerModel.c +++ b/src/core2/playerModel.c @@ -144,7 +144,7 @@ void playerModel_reset(void){ if(!func_8028ADB4()) playerModel_updateModel(); player_getPosition(plyr_pos); - func_802C3F04((GenMethod_4)func_802C4140, + __spawnQueue_add_4((GenMethod_4)func_802C4140, ACTOR_17_PLAYER_SHADOW, reinterpret_cast(s32, plyr_pos[0]), reinterpret_cast(s32, plyr_pos[1]), diff --git a/src/core2/sla.c b/src/core2/sla.c index 6af0c9f0..d3cf76f7 100644 --- a/src/core2/sla.c +++ b/src/core2/sla.c @@ -44,17 +44,17 @@ void *func_802EDAA4(SLA **this, s32 *arg1) { first_ptr = (s16*)var_s0->unk4; var_s0->elem_cnt = new_cnt; *this = var_s0; - for(i = new_cnt - 1, i_ptr = &var_s0->unk4[i * var_s0->elem_size]; i >= prev_cnt; i--){ + for(i = new_cnt - 1, i_ptr = (s16*)&var_s0->unk4[i * var_s0->elem_size]; i >= prev_cnt; i--){ *i_ptr = *first_ptr; *first_ptr = i; - i_ptr = (s32)i_ptr - var_s0->elem_size; + i_ptr = (s16*)((s32)i_ptr - var_s0->elem_size); } } i = *first_ptr; - i_ptr = (s32)first_ptr + (i * var_s0->elem_size); + i_ptr = (s16*)((s32)first_ptr + (i * var_s0->elem_size)); *arg1 = i; *first_ptr = *i_ptr; - return (s32) i_ptr; + return (void *) i_ptr; } int func_802EDC18(SLA *this, s32 arg1) @@ -88,11 +88,11 @@ SLA *array_new(s32 size, s32 cnt){ } void func_802EDCDC(SLA *this, s32 indx){ - void* *ptr_n = ((s32)(this + 1) + indx*this->elem_size); + void* *ptr_n = (void *)((s32)(this + 1) + indx*this->elem_size); *(s16 *)ptr_n = *(s16 *)(this +1); *(s16 *)(this +1) = indx; } SLA *array_defrag(SLA *this){ - return defrag(this); + return (SLA *)defrag(this); } diff --git a/src/core2/code_3BB80.c b/src/core2/spawnqueue.c similarity index 85% rename from src/core2/code_3BB80.c rename to src/core2/spawnqueue.c index 87cf0811..9bb7c719 100644 --- a/src/core2/code_3BB80.c +++ b/src/core2/spawnqueue.c @@ -7,8 +7,8 @@ void func_802E1790(void); -void func_802C3BDC(void); -void func_802C3BE8(void); +void spawnQueue_unlock(void); +void spawnQueue_lock(void); Actor *func_802D7558(s32 *, s32, ActorInfo*, u32); Actor *func_802D75B4(s32 *, s32, ActorInfo*, u32); @@ -173,22 +173,22 @@ typedef struct function_queue_s{ }FunctionQueue; /* .data */ -u8 D_80365DC0 = 0; -u8 D_80365DC4 = 0; -FunctionQueue *D_80365DC8 = NULL; +u8 spawnQueueLock = 0; +u8 spawnQueueLength = 0; +FunctionQueue *spawnQueue = NULL; /* .code */ -void func_802C2B10(void){ - u32 tmp = (map_get() == MAP_90_GL_BATTLEMENTS)? 0x32: 0xF; - D_80365DC8 = (FunctionQueue *) malloc(tmp * sizeof(FunctionQueue)); +void spawnQueue_malloc(void){ + u32 tmp = (map_get() == MAP_90_GL_BATTLEMENTS)? 50: 15; + spawnQueue = (FunctionQueue *) malloc(tmp * sizeof(FunctionQueue)); } -void func_802C2B5C(void){ +void spawnQueue_reset(void){ s32 loaded_asm_file; loaded_asm_file = get_loaded_overlay_id(); - func_802C3BE8(); - D_80365DC4 = 0; + spawnQueue_lock(); + spawnQueueLength = 0; func_802D1724(); func_802E1790(); switch(loaded_asm_file){ @@ -402,136 +402,136 @@ void func_802C2B5C(void){ } func_80305990(1); func_8032A5F8(); - func_802C3BDC(); + spawnQueue_unlock(); } -void func_802C398C(void){ +void spawnQueue_free(void){ spawnableActorList_free(); - func_80326124(); + actorArray_free(); func_80305D94(); - free(D_80365DC8); - D_80365DC8 = NULL; - D_80365DC4 = 0; + free(spawnQueue); + spawnQueue = NULL; + spawnQueueLength = 0; } -void func_802C39D4(void){ +void spawnQueue_func_802C39D4(void){ func_803268B4(); if(!levelSpecificFlags_validateCRC2()){ write_file_blocks(0, 0, 0x80749530, EEPROM_MAXBLOCKS); } } -void func_802C3A18(void){ +void spawnQueue_func_802C3A18(void){ func_803283BC(); } -void func_802C3A38(void){ +void spawnQueue_flush(void){ s32 i; - func_802C3BE8(); - for(i = 0; i < D_80365DC4; i++){ - switch(D_80365DC8[i].arg_cnt){ + spawnQueue_lock(); + for(i = 0; i < spawnQueueLength; i++){ + switch(spawnQueue[i].arg_cnt){ case 0: - D_80365DC8[i].func0(); + spawnQueue[i].func0(); break; case 1: - D_80365DC8[i].func1(D_80365DC8[i].arg[0]); + spawnQueue[i].func1(spawnQueue[i].arg[0]); break; case 2: - D_80365DC8[i].func2(D_80365DC8[i].arg[0], D_80365DC8[i].arg[1]); + spawnQueue[i].func2(spawnQueue[i].arg[0], spawnQueue[i].arg[1]); break; case 3: - D_80365DC8[i].func3(D_80365DC8[i].arg[0], D_80365DC8[i].arg[1], D_80365DC8[i].arg[2]); + spawnQueue[i].func3(spawnQueue[i].arg[0], spawnQueue[i].arg[1], spawnQueue[i].arg[2]); break; case 4: - D_80365DC8[i].func4(D_80365DC8[i].arg[0], D_80365DC8[i].arg[1], D_80365DC8[i].arg[2], D_80365DC8[i].arg[3]); + spawnQueue[i].func4(spawnQueue[i].arg[0], spawnQueue[i].arg[1], spawnQueue[i].arg[2], spawnQueue[i].arg[3]); break; case 5: - D_80365DC8[i].func5(D_80365DC8[i].arg[0], D_80365DC8[i].arg[1], D_80365DC8[i].arg[2], D_80365DC8[i].arg[3], D_80365DC8[i].arg[4]); + spawnQueue[i].func5(spawnQueue[i].arg[0], spawnQueue[i].arg[1], spawnQueue[i].arg[2], spawnQueue[i].arg[3], spawnQueue[i].arg[4]); break; default: break; } } - D_80365DC4 = 0; + spawnQueueLength = 0; func_803283D4(); } -void func_802C3BDC(void){ - D_80365DC0 = 0; +void spawnQueue_unlock(void){ + spawnQueueLock = 0; } -void func_802C3BE8(void){ - D_80365DC0 = 1; +void spawnQueue_lock(void){ + spawnQueueLock = 1; } -void func_802C3BF8(void (* arg0)(void)){ +void __spawnQueue_add_0(void (* arg0)(void)){ u32 tmp = (map_get() == MAP_90_GL_BATTLEMENTS)? 0x32: 0xF; - if(tmp != D_80365DC4){ - D_80365DC8[D_80365DC4].func0 = arg0; - D_80365DC8[D_80365DC4].arg_cnt = 0; - D_80365DC4++; + if(tmp != spawnQueueLength){ + spawnQueue[spawnQueueLength].func0 = arg0; + spawnQueue[spawnQueueLength].arg_cnt = 0; + spawnQueueLength++; } } -void __spawnqueue_add_1(GenMethod_1 arg0, s32 arg1){ +void __spawnQueue_add_1(GenMethod_1 arg0, s32 arg1){ u32 tmp = (map_get() == MAP_90_GL_BATTLEMENTS)? 0x32: 0xF; - if(tmp != D_80365DC4){ - D_80365DC8[D_80365DC4].func0 = (void (*)(void))arg0; - D_80365DC8[D_80365DC4].arg[0] = arg1; - D_80365DC8[D_80365DC4].arg_cnt = 1; - D_80365DC4++; + if(tmp != spawnQueueLength){ + spawnQueue[spawnQueueLength].func0 = (void (*)(void))arg0; + spawnQueue[spawnQueueLength].arg[0] = arg1; + spawnQueue[spawnQueueLength].arg_cnt = 1; + spawnQueueLength++; } } -void func_802C3D3C(void (* arg0)(void), s32 arg1, s32 arg2){ +void __spawnQueue_add_2(void (* arg0)(void), s32 arg1, s32 arg2){ u32 tmp = (map_get() == MAP_90_GL_BATTLEMENTS)? 0x32: 0xF; - if(tmp != D_80365DC4){ - D_80365DC8[D_80365DC4].func0 = arg0; - D_80365DC8[D_80365DC4].arg[0] = arg1; - D_80365DC8[D_80365DC4].arg[1] = arg2; - D_80365DC8[D_80365DC4].arg_cnt = 2; - D_80365DC4++; + if(tmp != spawnQueueLength){ + spawnQueue[spawnQueueLength].func0 = arg0; + spawnQueue[spawnQueueLength].arg[0] = arg1; + spawnQueue[spawnQueueLength].arg[1] = arg2; + spawnQueue[spawnQueueLength].arg_cnt = 2; + spawnQueueLength++; } } -void func_802C3E10(void (* arg0)(void), s32 arg1, s32 arg2, s32 arg3){ +void __spawnQueue_add_3(void (* arg0)(void), s32 arg1, s32 arg2, s32 arg3){ u32 tmp = (map_get() == MAP_90_GL_BATTLEMENTS)? 0x32: 0xF; - if(tmp != D_80365DC4){ - D_80365DC8[D_80365DC4].func0 = arg0; - D_80365DC8[D_80365DC4].arg[0] = arg1; - D_80365DC8[D_80365DC4].arg[1] = arg2; - D_80365DC8[D_80365DC4].arg[2] = arg3; - D_80365DC8[D_80365DC4].arg_cnt = 3; - D_80365DC4++; + if(tmp != spawnQueueLength){ + spawnQueue[spawnQueueLength].func0 = arg0; + spawnQueue[spawnQueueLength].arg[0] = arg1; + spawnQueue[spawnQueueLength].arg[1] = arg2; + spawnQueue[spawnQueueLength].arg[2] = arg3; + spawnQueue[spawnQueueLength].arg_cnt = 3; + spawnQueueLength++; } } -void func_802C3F04(GenMethod_4 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4){ +void __spawnQueue_add_4(GenMethod_4 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4){ u32 tmp = (map_get() == MAP_90_GL_BATTLEMENTS)? 0x32: 0xF; - if(tmp != D_80365DC4){ - D_80365DC8[D_80365DC4].func0 = (void (*)(void))arg0; - D_80365DC8[D_80365DC4].arg[0] = arg1; - D_80365DC8[D_80365DC4].arg[1] = arg2; - D_80365DC8[D_80365DC4].arg[2] = arg3; - D_80365DC8[D_80365DC4].arg[3] = arg4; - D_80365DC8[D_80365DC4].arg_cnt = 4; - D_80365DC4++; + if(tmp != spawnQueueLength){ + spawnQueue[spawnQueueLength].func0 = (void (*)(void))arg0; + spawnQueue[spawnQueueLength].arg[0] = arg1; + spawnQueue[spawnQueueLength].arg[1] = arg2; + spawnQueue[spawnQueueLength].arg[2] = arg3; + spawnQueue[spawnQueueLength].arg[3] = arg4; + spawnQueue[spawnQueueLength].arg_cnt = 4; + spawnQueueLength++; } } -void func_802C4014(void (* arg0)(void), s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5){ +void __spawnQueue_add_5(void (* arg0)(void), s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5){ u32 tmp = (map_get() == MAP_90_GL_BATTLEMENTS)? 0x32: 0xF; - if(tmp != D_80365DC4){ - D_80365DC8[D_80365DC4].func0 = arg0; - D_80365DC8[D_80365DC4].arg[0] = arg1; - D_80365DC8[D_80365DC4].arg[1] = arg2; - D_80365DC8[D_80365DC4].arg[2] = arg3; - D_80365DC8[D_80365DC4].arg[3] = arg4; - D_80365DC8[D_80365DC4].arg[4] = arg5; - D_80365DC8[D_80365DC4].arg_cnt = 5; - D_80365DC4++; + if(tmp != spawnQueueLength){ + spawnQueue[spawnQueueLength].func0 = arg0; + spawnQueue[spawnQueueLength].arg[0] = arg1; + spawnQueue[spawnQueueLength].arg[1] = arg2; + spawnQueue[spawnQueueLength].arg[2] = arg3; + spawnQueue[spawnQueueLength].arg[3] = arg4; + spawnQueue[spawnQueueLength].arg[4] = arg5; + spawnQueue[spawnQueueLength].arg_cnt = 5; + spawnQueueLength++; } } @@ -594,7 +594,7 @@ Actor * func_802C42F0(s32 arg0, s32 arg1, s32 arg2, s32 arg3){ return func_802C8F88(arg0, sp1C); } -void func_802C4320(FunctionQueue *arg0){ - if((arg0 = D_80365DC8) != NULL) - D_80365DC8 = (FunctionQueue *)defrag(); +void spawnQueue_defrag(FunctionQueue *arg0){ + if((arg0 = spawnQueue) != NULL) + spawnQueue = (FunctionQueue *)defrag(); } diff --git a/src/core2/timedfuncqueue.c b/src/core2/timedfuncqueue.c index b911f87c..311b5ce0 100644 --- a/src/core2/timedfuncqueue.c +++ b/src/core2/timedfuncqueue.c @@ -12,13 +12,13 @@ typedef struct timed_function_queue_s{ u8 arg_cnt; u8 pad5[3]; union { - TFQM0 func0; + GenMethod_0 func0; GenMethod_1 func1; - TFQM2 func2; - TFQM3 func3; - TFQM4 func4; - TFQM5 func5; - TFQM6 func6; + GenMethod_2 func2; + GenMethod_3 func3; + GenMethod_4 func4; + GenMethod_5 func5; + GenMethod_6 func6; }; s32 arg[25]; @@ -83,7 +83,7 @@ TimedFunction* __timedFuncQueue_insert(f32 time, s32 cnt, void *funcPtr, s32 arg retVal = (TimedFunction * )vector_insertNew((vector(TimedFunction)**)&D_80383380, ((s32)iPtr - (s32)startPtr)/(s32)sizeof(TimedFunction)); retVal->time = time; retVal->arg_cnt = cnt; - retVal->func5 = (TFQM5) funcPtr; + retVal->func5 = (GenMethod_5) funcPtr; retVal->arg[0] = arg0; retVal->arg[1] = arg1; retVal->arg[2] = arg2; @@ -162,7 +162,7 @@ f32 func_80324C7C(void){ } void timed_playSfx(f32 time, enum sfx_e arg0, f32 arg1, s32 arg2){ - timedFunc_set_3(time, (TFQM3)func_80324A68, arg0, (s32)(arg1*1000.0f), arg2); + timedFunc_set_3(time, (GenMethod_3)func_80324A68, arg0, (s32)(arg1*1000.0f), arg2); } void func_80324CD8(f32 time){ @@ -170,7 +170,7 @@ void func_80324CD8(f32 time){ } void func_80324CFC(f32 time, s32 id, s32 volume){ - timedFunc_set_2(time, (TFQM2)func_80324A28, id, volume); + timedFunc_set_2(time, (GenMethod_2)func_80324A28, id, volume); } void func_80324D2C(f32 time, enum comusic_e arg0){ @@ -188,7 +188,7 @@ void func_80324D54(f32 time, enum sfx_e sfx_id, f32 arg2, s32 arg3, f32 position argStruct.unkC[1] = position[1]; argStruct.unkC[2] = position[2]; - timedFunc_set_6(time, (TFQM6) func_80324AA4, (void *) &argStruct); + timedFunc_set_6(time, (GenMethod_6) func_80324AA4, (void *) &argStruct); } void func_80324DBC(f32 time, enum asset_e text_id, s32 arg2, f32 position[3], ActorMarker *caller, void (*callback_method_1)(ActorMarker *, enum asset_e, s32), void (*callback_method_2)(ActorMarker *, enum asset_e, s32)) { @@ -207,7 +207,7 @@ void func_80324DBC(f32 time, enum asset_e text_id, s32 arg2, f32 position[3], Ac } else { sp20.position[0] = sp20.position[1] = sp20.position[2] = 0.0f; } - timedFunc_set_6(time, (TFQM6) func_80324AEC, (void *) &sp20); + timedFunc_set_6(time, (GenMethod_6) func_80324AEC, (void *) &sp20); } @@ -220,10 +220,10 @@ void timed_setCameraToNode(f32 time, s32 arg0){ } void func_80324E88(f32 time){ - timedFunc_set_0(time, (TFQM0) func_802BAE4C); + timedFunc_set_0(time, (GenMethod_0) func_802BAE4C); } -void timedFunc_set_0(f32 time, TFQM0 funcPtr){ +void timedFunc_set_0(f32 time, GenMethod_0 funcPtr){ __timedFuncQueue_insert(time, 0, (void *) funcPtr, 0, 0, 0, 0, 0); } @@ -231,23 +231,23 @@ void timedFunc_set_1(f32 time, GenMethod_1 funcPtr, s32 arg0){ __timedFuncQueue_insert(time, 1, (void *) funcPtr, arg0, 0, 0, 0, 0); } -void timedFunc_set_2(f32 time, TFQM2 funcPtr, s32 arg0, s32 arg1){ +void timedFunc_set_2(f32 time, GenMethod_2 funcPtr, s32 arg0, s32 arg1){ __timedFuncQueue_insert(time, 2, (void *) funcPtr, arg0, arg1, 0, 0, 0); } -void timedFunc_set_3(f32 time, TFQM3 funcPtr, s32 arg0, s32 arg1, s32 arg2){ +void timedFunc_set_3(f32 time, GenMethod_3 funcPtr, s32 arg0, s32 arg1, s32 arg2){ __timedFuncQueue_insert(time, 3, (void *) funcPtr, arg0, arg1, arg2, 0, 0); } -void timedFunc_set_4(f32 time, TFQM4 funcPtr, s32 arg0, s32 arg1, s32 arg2, s32 arg3){ +void timedFunc_set_4(f32 time, GenMethod_4 funcPtr, s32 arg0, s32 arg1, s32 arg2, s32 arg3){ __timedFuncQueue_insert(time, 4, (void *) funcPtr, arg0, arg1, arg2, arg3, 0); } -void timedFunc_set_5(f32 time, TFQM5 funcPtr, s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4){ +void timedFunc_set_5(f32 time, GenMethod_5 funcPtr, s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4){ __timedFuncQueue_insert(time, 5, (void *) funcPtr, arg0, arg1, arg2, arg3, arg4); } -void timedFunc_set_6(f32 time, TFQM6 funcPtr, void* argPtr ){ +void timedFunc_set_6(f32 time, GenMethod_6 funcPtr, void* argPtr ){ TimedFunction *q = __timedFuncQueue_insert(time, 6, funcPtr, 0, 0, 0, 0, 0); memcpy(&q->arg[5], argPtr, 0x50); } @@ -260,7 +260,7 @@ void timedJiggySpawn(f32 time, s32 jiggyId, f32 *position){ jiggyInfo.pos[1] = position[1]; jiggyInfo.pos[2] = position[2]; - timedFunc_set_6(time, (TFQM6) __spawnjiggy, (void*) &jiggyInfo); + timedFunc_set_6(time, (GenMethod_6) __spawnjiggy, (void*) &jiggyInfo); } bool timedFuncQueue_is_empty(void){ diff --git a/src/cutscenes/code_0.c b/src/cutscenes/code_0.c index cacbe5dc..d8cd3ae1 100644 --- a/src/cutscenes/code_0.c +++ b/src/cutscenes/code_0.c @@ -3,26 +3,26 @@ #include "variables.h" -extern void func_80288D08(s32, f32, void(*)(void)); -extern void func_80288D40(s32, f32, void(*)(s32), s32); -extern void func_80288D84(s32, f32, void(*)(s32,s32), s32, s32); -extern void func_80288EB0(s32, f32, s32, f32, f32); -extern void func_80288EF8(s32, f32, s32, f32); -extern void func_80288F38(s32, f32, s32, f32); -extern void func_80288E68(s32, f32, s32, f32, f32); -extern void func_80288F78(s32, f32, u32); -extern void func_80288FA8(s32, f32, s32); -extern void func_80288FD8(s32, f32, u32); -extern void func_80289090(s32, f32, u32, f32); +extern void func_80288D08(vector(struct2s) **, f32, void(*)(void)); +extern void func_80288D40(vector(struct2s) **, f32, void(*)(s32), s32); +extern void func_80288D84(vector(struct2s) **, f32, void(*)(s32,s32), s32, s32); +extern void func_80288EB0(vector(struct2s) **, f32, s32, f32, f32); +extern void func_80288EF8(vector(struct2s) **, f32, s32, f32); +extern void func_80288F38(vector(struct2s) **, f32, s32, f32); +extern void func_80288E68(vector(struct2s) **, f32, s32, f32, f32); +extern void func_80288F78(vector(struct2s) **, f32, u32); +extern void func_80288FA8(vector(struct2s) **, f32, s32); +extern void func_80288FD8(vector(struct2s) **, f32, u32); +extern void func_80289090(vector(struct2s) **, f32, u32, f32); extern void func_802EFF5C(ParticleEmitter*, f32, f32, f32); extern void func_802EFF7C(ParticleEmitter*, f32, f32, f32); extern void func_802EFF9C(ParticleEmitter*, f32); extern void func_802F9E44(s32, f32, f32, f32, f32); -extern void func_80361C24(s32, f32, s32, s32); -extern void func_80361C64(s32, f32, s32, s32, s32); -extern void func_80361CF4(s32, f32, s32, f32); -extern void func_80361D7C(s32, f32, s32, s32, u32); -extern void func_80361CAC(s32, f32, s32, f32); +extern void func_80361C24(vector(struct2s) **, f32, ActorMarker *, s32); +extern void func_80361C64(vector(struct2s) **, f32, ActorMarker *, s32, s32); +extern void func_80361CF4(vector(struct2s) **, f32, ActorMarker *, f32); +extern void func_80361D7C(vector(struct2s) **, f32, ActorMarker *, s32, u32); +extern void func_80361CAC(vector(struct2s) **, f32, ActorMarker *, f32); /* .code */ void cutscenes_func_803863F0(void){ func_8025A2D8(); @@ -312,7 +312,7 @@ void func_803872B4(s32 arg0) { func_8034A174((struct5Bs *)sp44->marker->unk44, 7, sp34); particleEmitter_setPosition(pCtrl, sp34); particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038D470); - func_802EFB98(pCtrl, &D_8038D440); + func_802EFB98(pCtrl, &D_8038D440.unk0); particleEmitter_emitN(pCtrl, 4); } @@ -336,7 +336,7 @@ void func_80387364(s32 arg0) { func_8034A174((struct5Bs *) sp34->marker->unk44, 8, sp24); particleEmitter_setPosition(pCtrl, sp24); particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038D4DC); - func_802EFB98(pCtrl, &D_8038D4AC); + func_802EFB98(pCtrl, &D_8038D4AC.unk0); particleEmitter_emitN(pCtrl, 1); } @@ -419,7 +419,7 @@ void func_803877A0(s32 arg0) { func_8034A174((struct5Bs *) sp34->marker->unk44, 6, sp24); particleEmitter_setPosition(pCtrl, sp24); particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038D5C0); - func_802EFB98(pCtrl, &D_8038D590); + func_802EFB98(pCtrl, &D_8038D590.unk0); particleEmitter_emitN(pCtrl, 1); } @@ -488,7 +488,7 @@ void func_80387B58(s32 arg0) { func_8034A174((struct5Bs *) sp44->marker->unk44, 5, sp34); particleEmitter_setPosition(pCtrl, sp34); particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038D670); - func_802EFB98(pCtrl, &D_8038D640); + func_802EFB98(pCtrl, &D_8038D640.unk0); particleEmitter_emitN(pCtrl, 1); } @@ -517,7 +517,7 @@ void func_80387C64(s32 arg0) { particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -30.0f, 0.0f, 0.0f, -30.0f, 0.0f); particleEmitter_setPosition(pCtrl, sp34); particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038D6DC); - func_802EFB98(pCtrl, &D_8038D6AC); + func_802EFB98(pCtrl, &D_8038D6AC.unk0); particleEmitter_emitN(pCtrl, 1); } } @@ -543,7 +543,7 @@ void func_80387D88(s32 arg0) { particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -30.0f, 0.0f, 0.0f, -30.0f, 0.0f); particleEmitter_setPosition(pCtrl, sp34); particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038D73C); - func_802EFB98(pCtrl, &D_8038D70C); + func_802EFB98(pCtrl, &D_8038D70C.unk0); particleEmitter_emitN(pCtrl, 25); } } @@ -571,7 +571,7 @@ void func_80387E9C(s32 arg0) { particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -30.0f, 0.0f, 0.0f, -30.0f, 0.0f); particleEmitter_setPosition(pCtrl, sp34); particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038D7A8); - func_802EFB98(pCtrl, &D_8038D778); + func_802EFB98(pCtrl, &D_8038D778.unk0); particleEmitter_emitN(pCtrl, 1); } } @@ -598,7 +598,7 @@ void func_80387FC0(s32 arg0) { particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, 200.0f, 0.0f, 0.0f, 200.0f, 0.0f); particleEmitter_setPosition(pCtrl, sp34); particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038D808); - func_802EFB98(pCtrl, &D_8038D7D8); + func_802EFB98(pCtrl, &D_8038D7D8.unk0); particleEmitter_emitN(pCtrl, 1); } } @@ -626,7 +626,7 @@ void func_803880C8(s32 arg0) { func_8034A174((struct5Bs *) sp34->marker->unk44, 5, sp24); particleEmitter_setPosition(pCtrl, sp24); particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038D874); - func_802EFB98(pCtrl, &D_8038D844); + func_802EFB98(pCtrl, &D_8038D844.unk0); particleEmitter_emitN(pCtrl, 1); } @@ -651,41 +651,41 @@ void func_803881CC(s32 arg0) { particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, 100.0f, 0.0f, 0.0f, 300.0f, 0.0f); particleEmitter_setPosition(pCtrl, sp34); particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038D8D4); - func_802EFB98(pCtrl, &D_8038D8A4); + func_802EFB98(pCtrl, &D_8038D8A4.unk0); particleEmitter_emitN(pCtrl, 2); } } -void func_803882D4(s32 arg0, s32 arg1) { - func_80288F78(arg0, 0.0952f, 0xAD8075U); - func_80288F78(arg0, 0.5279f, 0xAD8C94U); +void func_803882D4(vector(struct2s) **arg0, ActorMarker *arg1) { + func_80288F78(arg0, 0.0952f, (SFX_AD_CATERPILLAR_SQUEAK << 0x10) | (0x80 << 8) | 0x75); + func_80288F78(arg0, 0.5279f, (SFX_AD_CATERPILLAR_SQUEAK << 0x10) | (0x8C << 8) | 0x94); func_8028913C(arg0, 1); - func_80288F78(arg0, 0.55f, 0xC580FAU); - func_80288F78(arg0, 0.8658f, 0xCCD9FAU); - func_80288F78(arg0, 0.9485f, 0x2F8CC3U); + func_80288F78(arg0, 0.55f, (SFX_C5_TWINKLY_POP << 0x10) | (0x80 << 8 )| 0xFA); + func_80288F78(arg0, 0.8658f, (SFX_CC_PAUSEMENU_ENTER_SUBMENU << 0x10) | (0xD9 << 8) | 0xFA); + func_80288F78(arg0, 0.9485f, (SFX_2F_ORANGE_SPLAT << 0x10) | (0x8C << 8) | 0xC3); } -void func_8038837C(s32 arg0, s32 arg1) { - func_80288F78(arg0, 0.03f, 0x012A8CFAU); +void func_8038837C(vector(struct2s) **arg0, ActorMarker *arg1) { + func_80288F78(arg0, 0.03f, (SFX_12A_GRUNTY_AH << 0x10) | (0x8C << 8) | 0xFA); } -void cutscenes_func_803883AC(s32 arg0, s32 arg1) { - func_80288F78(arg0, 0.0282f, 0x012A8CFAU); - func_80288F78(arg0, 0.6107f, 0x207375U); - func_80288F78(arg0, 0.6107f, 0xF9534EU); - func_80288F78(arg0, 0.6664f, 0x208075U); - func_80288F78(arg0, 0.6664f, 0xF9594EU); - func_80288F78(arg0, 0.7421f, 0x207975U); - func_80288F78(arg0, 0.7421f, 0xF9554EU); - func_80288F78(arg0, 0.9772f, 0x2794EU); +void cutscenes_func_803883AC(vector(struct2s) **arg0, ActorMarker *arg1) { + func_80288F78(arg0, 0.0282f, (SFX_12A_GRUNTY_AH << 0x10) | (0x8C << 8) | 0xFA); + func_80288F78(arg0, 0.6107f, (SFX_20_METAL_CLANK_1 << 0x10) | (0x73 << 8) | 0x75); + func_80288F78(arg0, 0.6107f, (SFX_F9_GRUNTLING_NOISE_1 << 0x10) | (0x53 << 8) | 0x4E); + func_80288F78(arg0, 0.6664f, (SFX_20_METAL_CLANK_1 << 0x10) | (0x80 << 8) | 0x75); + func_80288F78(arg0, 0.6664f, (SFX_F9_GRUNTLING_NOISE_1 << 0x10) | (0x59 << 8) | 0x4E); + func_80288F78(arg0, 0.7421f, (SFX_20_METAL_CLANK_1 << 0x10) | (0x79 << 8) | 0x75); + func_80288F78(arg0, 0.7421f, (SFX_F9_GRUNTLING_NOISE_1 << 0x10) | (0x55 << 8) | 0x4E); + func_80288F78(arg0, 0.9772f, (SFX_2_CLAW_SWIPE << 0x10) | (0x79 << 8) | 0x4E); } -void func_80388490(s32 arg0, s32 arg1) { - func_80288F78(arg0, 0.025f, 0x69936U); - func_80288F78(arg0, 0.52f, 0x67336U); +void func_80388490(vector(struct2s) **arg0, ActorMarker *arg1) { + func_80288F78(arg0, 0.025f, (SFX_6_BANJO_LANDING_02 << 0x10) | (0x99 << 8) | 0x36); + func_80288F78(arg0, 0.52f, (SFX_6_BANJO_LANDING_02 << 0x10) | (0x73 << 8) | 0x36); } -void func_803884DC(s32 arg0, s32 arg1) { +void func_803884DC(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); func_80361C64(arg0, 0.001f, arg1, 3, 0); func_8028913C(arg0, 1); @@ -695,18 +695,18 @@ void func_803884DC(s32 arg0, s32 arg1) { func_8028913C(arg0, 7); func_80288EB0(arg0, 0.02f, 0, 35.0f, 0.8f); func_8028913C(arg0, 7); - func_80288D40(arg0, 0.02f, func_80386C34, arg1); + func_80288D40(arg0, 0.02f, func_80386C34, reinterpret_cast(s32, arg1)); func_8028913C(arg0, 0xB); - func_80288D40(arg0, 0.5f, func_80386AC8, arg1); + func_80288D40(arg0, 0.5f, func_80386AC8, reinterpret_cast(s32, arg1)); func_8028913C(arg0, 0xB); - func_80288D40(arg0, 0.7f, func_80386DA0, arg1); + func_80288D40(arg0, 0.7f, func_80386DA0, reinterpret_cast(s32, arg1)); func_8028913C(arg0, 5); - func_80288F78(arg0, 0.149f, 0x017C80FA); + func_80288F78(arg0, 0.149f, (SFX_17C_GRUNTY_FALLING_OFF_1 << 0x10) | (0x80 << 8) | 0xFA); func_8028913C(arg0, 0xB); - func_80288F78(arg0, 0.2f, 0x017D80FA); + func_80288F78(arg0, 0.2f, (SFX_17D_GRUNTY_FALLING_OFF_2 << 0x10) | (0x80 << 8) | 0xFA); } -void cutscenes_func_80388660(s32 arg0, s32 arg1) { +void cutscenes_func_80388660(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); func_80361C64(arg0, 0.001f, arg1, 3, 0); func_8028913C(arg0, 1); @@ -718,21 +718,21 @@ void cutscenes_func_80388660(s32 arg0, s32 arg1) { func_80288F78(arg0, 0.79f, 0x280C3U); } -void func_80388734(s32 arg0, s32 arg1) { +void func_80388734(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); func_80361C64(arg0, 0.001f, arg1, 3, 0); func_8028913C(arg0, 1); func_80361C64(arg0, 0.001f, arg1, 4, 0); } -void func_803887A0(s32 arg0, s32 arg1) { +void func_803887A0(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); func_80361C64(arg0, 0.001f, arg1, 3, 1); func_8028913C(arg0, 1); func_80361C64(arg0, 0.001f, arg1, 4, 1); } -void func_80388814(s32 arg0, s32 arg1) { +void func_80388814(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); func_80361C64(arg0, 0.001f, arg1, 4, 1); func_8028913C(arg0, 1); @@ -745,7 +745,7 @@ void func_80388814(s32 arg0, s32 arg1) { func_80288F78(arg0, 0.831f, 0x87955U); } -void func_80388920(s32 arg0, s32 arg1) { +void func_80388920(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); func_80361C64(arg0, 0.021f, arg1, 4, 1); func_8028913C(arg0, 1); @@ -754,7 +754,7 @@ void func_80388920(s32 arg0, s32 arg1) { func_80288F78(arg0, 0.99f, 0x8C03EU); } -void func_803889CC(s32 arg0, s32 arg1) { +void func_803889CC(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); func_80361C64(arg0, 0.05f, arg1, 4, 1); func_8028913C(arg0, 1); @@ -763,7 +763,7 @@ void func_803889CC(s32 arg0, s32 arg1) { func_80288D08(arg0, 0.05f, func_80386504); } -void func_80388A6C(s32 arg0, s32 arg1) { +void func_80388A6C(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); func_80361C64(arg0, 0.02f, arg1, 4, 2); func_8028913C(arg0, 1); @@ -773,48 +773,48 @@ void func_80388A6C(s32 arg0, s32 arg1) { func_80361D7C(arg0, 0.57f, arg1, 5, 0x4CA675U); } -void func_80388B58(s32 arg0, s32 arg1) { +void func_80388B58(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); func_80361C64(arg0, 0.021f, arg1, 4, 1); func_8028913C(arg0, 1); func_80361C64(arg0, 0.021f, arg1, 5, 1); } -void func_80388BCC(s32 arg0, s32 arg1) { +void func_80388BCC(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); func_80361C64(arg0, 0.021f, arg1, 4, 1); func_8028913C(arg0, 1); func_80361C64(arg0, 0.021f, arg1, 5, 1); } -void func_80388C40(s32 arg0, s32 arg1) { +void func_80388C40(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288F78(arg0, 0.151f, 0x5D59C3U); func_80288F78(arg0, 0.5662f, 0x5E59C3U); - func_80288D40(arg0, 0.56f, func_803880C8, arg1); - func_80288D40(arg0, 0.71f, func_803880C8, arg1); - func_80288D40(arg0, 0.86f, func_803880C8, arg1); + func_80288D40(arg0, 0.56f, func_803880C8, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.71f, func_803880C8, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.86f, func_803880C8, reinterpret_cast(s32, arg1)); } -void func_80388CE4(s32 arg0, s32 arg1) { +void func_80388CE4(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288F78(arg0, 0.16f, 0x01054CC3U); func_80288F78(arg0, 0.7496f, 0x01054CC3U); } -void func_80388D30(s32 arg0, s32 arg1) { - func_80288F78(arg0, 0.0257f, 0x6B40FFU); - func_80288F78(arg0, 0.6287f, 0x6C80FAU); - func_80288F78(arg0, 0.7126f, 0x3F9965U); - func_80288F78(arg0, 0.77f, 0x409965U); - func_80288F78(arg0, 0.8079f, 0x3F9965U); - func_80288F78(arg0, 0.9142f, 0x409965U); +void func_80388D30(vector(struct2s) **arg0, ActorMarker *arg1) { + func_80288F78(arg0, 0.0257f, (SFX_6B_LOCKUP_OPENING << 0x10) | (0x40 << 8) | 0xFF); + func_80288F78(arg0, 0.6287f, (SFX_6C_LOCKUP_CLOSING << 0x10) | (0x80 << 8) | 0xFA); + func_80288F78(arg0, 0.7126f, (SFX_3F_CAULDRON_SQEAK_1 << 0x10) | (0x99 << 8) | 0x65); + func_80288F78(arg0, 0.77f, (SFX_40_CAULDRON_SQEAK_2 << 0x10) | (0x99 << 8) | 0x65); + func_80288F78(arg0, 0.8079f, (SFX_3F_CAULDRON_SQEAK_1 << 0x10) | (0x99 << 8) | 0x65); + func_80288F78(arg0, 0.9142f, (SFX_40_CAULDRON_SQEAK_2 << 0x10) | (0x99 << 8) | 0x65); } -void func_80388DE4(s32 arg0, s32 arg1) { +void func_80388DE4(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288F78(arg0, 0.0145f, 0x6B73FFU); func_80288F78(arg0, 0.6245f, 0x6C80FAU); } -void func_80388E30(s32 arg0, s32 arg1) { +void func_80388E30(vector(struct2s) **arg0, ActorMarker *arg1) { f32 sp2C; sp2C = 0.8f; @@ -823,10 +823,10 @@ void func_80388E30(s32 arg0, s32 arg1) { func_8028913C(arg0, 1); func_80361C64(arg0, 0.01f, arg1, 4, 0); func_8028913C(arg0, 1); - func_80288D84(arg0, 0.01f, func_80386A90, arg1, reinterpret_cast(s32, sp2C)); + func_80288D84(arg0, 0.01f, func_80386A90, reinterpret_cast(s32, arg1), reinterpret_cast(s32, sp2C)); } -void func_80388EE0(s32 arg0, s32 arg1) { +void func_80388EE0(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); func_80361C64(arg0, 0.01f, arg1, 3, 0); func_8028913C(arg0, 1); @@ -836,7 +836,7 @@ void func_80388EE0(s32 arg0, s32 arg1) { func_80288F78(arg0, 0.8132f, 0xC580FFU); } -void func_80388F9C(s32 arg0, s32 arg1) { +void func_80388F9C(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); func_80361C64(arg0, 0.01f, arg1, 3, 0); func_8028913C(arg0, 1); @@ -849,33 +849,33 @@ void func_80388F9C(s32 arg0, s32 arg1) { func_80361D7C(arg0, 0.7384f, arg1, 5, 0x6F804EU); } -void func_803890CC(s32 arg0, s32 arg1) { +void func_803890CC(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); - func_80361C64(arg0, 0.01f, reinterpret_cast(s32, arg1), 3, 1); + func_80361C64(arg0, 0.01f, arg1, 3, 1); func_8028913C(arg0, 1); func_80361C64(arg0, 0.01f, arg1, 4, 1); func_80361D7C(arg0, 0.08f, arg1, 5, 0x6DB375U); - func_80288D40(arg0, 0.08f, cutscenes_func_80387560, arg1); + func_80288D40(arg0, 0.08f, cutscenes_func_80387560, reinterpret_cast(s32, arg1)); func_80361D7C(arg0, 0.2f, arg1, 5, 0x6DB375U); - func_80288D40(arg0, 0.2f, cutscenes_func_80387560, arg1); + func_80288D40(arg0, 0.2f, cutscenes_func_80387560, reinterpret_cast(s32, arg1)); func_80361D7C(arg0, 0.3f, arg1, 5, 0x6DB375U); - func_80288D40(arg0, 0.3f, cutscenes_func_80387560, arg1); + func_80288D40(arg0, 0.3f, cutscenes_func_80387560, reinterpret_cast(s32, arg1)); } -void cutscenes_func_80389204(s32 arg0, s32 arg1) { +void cutscenes_func_80389204(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); - func_80361C64(arg0, 0.01f, reinterpret_cast(s32, arg1), 3, 2); + func_80361C64(arg0, 0.01f, arg1, 3, 2); func_8028913C(arg0, 1); func_80361C64(arg0, 0.01f, arg1, 4, 1); func_80361D7C(arg0, 0.08f, arg1, 5, 0x6DB34EU); - func_80288D40(arg0, 0.08f, func_80387680, arg1); + func_80288D40(arg0, 0.08f, func_80387680, reinterpret_cast(s32, arg1)); func_80361D7C(arg0, 0.2f, arg1, 5, 0x6DB34EU); - func_80288D40(arg0, 0.2f, func_80387680, arg1); + func_80288D40(arg0, 0.2f, func_80387680, reinterpret_cast(s32, arg1)); func_80361D7C(arg0, 0.3f, arg1, 5, 0x6DB34EU); - func_80288D40(arg0, 0.3f, func_80387680, arg1); + func_80288D40(arg0, 0.3f, func_80387680, reinterpret_cast(s32, arg1)); } -void func_8038933C(s32 arg0, s32 arg1) { +void func_8038933C(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288FD8(arg0, 0.1f, 0xA60000U); func_8028913C(arg0, 1); func_80361C64(arg0, 0.01f, arg1, 2, 1); @@ -889,12 +889,12 @@ void func_8038933C(s32 arg0, s32 arg1) { func_80288FA8(arg0, 0.99f, 0xA6); } -void func_80389498(s32 arg0, s32 arg1) { +void func_80389498(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288D40(arg0, 0.06f, func_80386EF8, reinterpret_cast(s32, arg1)); func_80288F78(arg0, 0.06f, 0x03F9B3FAU); } -void func_803894E8(s32 arg0, s32 arg1) { +void func_803894E8(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288F78(arg0, 0.1961f, 0x98A6A4U); func_80288F78(arg0, 0.2914f, 0x98A6A4U); func_80288F78(arg0, 0.3741f, 0x98A6A4U); @@ -906,7 +906,7 @@ void func_803894E8(s32 arg0, s32 arg1) { func_80288F78(arg0, 0.9137f, 0x98A6A4U); } -void func_803895CC(s32 arg0, s32 arg1) { +void func_803895CC(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288F78(arg0, 0.204f, 0x98A6A4U); func_80288F78(arg0, 0.304f, 0x98A6A4U); func_80288F78(arg0, 0.3977f, 0x98A6A4U); @@ -916,12 +916,12 @@ void func_803895CC(s32 arg0, s32 arg1) { func_80288F78(arg0, 0.9109f, 0x8B80FAU); } -void func_80389698(s32 arg0, s32 arg1) { +void func_80389698(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288F78(arg0, 0.0221f, 0x4480FAU); } -void func_803896C8(s32 arg0, s32 arg1) { - func_80361C64(arg0, 0.001f, reinterpret_cast(s32, arg1), 1, 1); +void func_803896C8(vector(struct2s) **arg0, ActorMarker *arg1) { + func_80361C64(arg0, 0.001f, arg1, 1, 1); func_80361C64(arg0, 0.023f, arg1, 6, 1); func_80361C64(arg0, 0.023f, arg1, 5, 0); func_80361C64(arg0, 0.023f, arg1, 7, 0); @@ -930,20 +930,20 @@ void func_803896C8(s32 arg0, s32 arg1) { func_80361C24(arg0, 0.31f, arg1, 6); func_80288EB0(arg0, 0.3209f, 0, 30.0f, 0.4f); func_80361C64(arg0, 0.66f, arg1, 5, 1); - func_80288D40(arg0, 0.66f, func_80387E9C, arg1); + func_80288D40(arg0, 0.66f, func_80387E9C, reinterpret_cast(s32, arg1)); func_80288F78(arg0, 0.66f, 0x3080FAU); func_80361C24(arg0, 0.65f, arg1, 7); } -void cutscenes_func_80389850(s32 arg0, s32 arg1) { +void cutscenes_func_80389850(vector(struct2s) **arg0, ActorMarker *arg1) { func_80361C64(arg0, 0.36f, arg1, 7, 0); func_80361C64(arg0, 0.618f, arg1, 7, 1); func_80361C64(arg0, 0.696f, arg1, 5, 1); } -void cutscenes_func_803898C8(s32 arg0, s32 arg1) { +void cutscenes_func_803898C8(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); - func_80361C64(arg0, 0.03f, reinterpret_cast(s32, arg1), 7, 0); + func_80361C64(arg0, 0.03f, arg1, 7, 0); func_8028913C(arg0, 1); func_80361C64(arg0, 0.03f, arg1, 5, 0); func_8028913C(arg0, 1); @@ -956,17 +956,17 @@ void cutscenes_func_803898C8(s32 arg0, s32 arg1) { func_80361C64(arg0, 0.1f, arg1, 9, 1); func_80288F78(arg0, 0.08f, 0x6080C3U); func_80288F78(arg0, 0.35f, 0x280D2U); - func_80288D40(arg0, 0.45f, func_803877A0, arg1); + func_80288D40(arg0, 0.45f, func_803877A0, reinterpret_cast(s32, arg1)); func_80288F78(arg0, 0.45f, 0x03ED8027U); - func_80288D40(arg0, 0.55f, func_803877A0, arg1); + func_80288D40(arg0, 0.55f, func_803877A0, reinterpret_cast(s32, arg1)); func_80288F78(arg0, 0.55f, 0x03ED8027U); - func_80288D40(arg0, 0.65f, func_803877A0, arg1); + func_80288D40(arg0, 0.65f, func_803877A0, reinterpret_cast(s32, arg1)); func_80288F78(arg0, 0.65f, 0x03ED8027U); - func_80288D40(arg0, 0.75f, func_803877A0, arg1); + func_80288D40(arg0, 0.75f, func_803877A0, reinterpret_cast(s32, arg1)); func_80288F78(arg0, 0.75f, 0x03ED8027U); } -void func_80389AD0(s32 arg0, s32 arg1) { +void func_80389AD0(vector(struct2s) **arg0, ActorMarker *arg1) { func_80361C64(arg0, 0.03f, arg1, 7, 0); func_80361C64(arg0, 0.03f, arg1, 5, 0); func_80361C64(arg0, 0.03f, arg1, 4, 0); @@ -974,47 +974,47 @@ void func_80389AD0(s32 arg0, s32 arg1) { func_80361C64(arg0, 0.03f, arg1, 8, 0); } -void func_80389B84(s32 arg0, s32 arg1) { +void func_80389B84(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288F78(arg0, 0.001f, 0x1F73D2U); - func_80288D40(arg0, 0.001f, func_80387D88, arg1); + func_80288D40(arg0, 0.001f, func_80387D88, reinterpret_cast(s32, arg1)); func_80288F78(arg0, 0.001f, 0x8299D2U); func_80288F78(arg0, 0.003f, 0x66CCFAU); func_80288EB0(arg0, 0.001f, 2, 50.0f, 0.5f); } -void func_80389C30(s32 arg0, s32 arg1) { +void func_80389C30(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288D40(arg0, 0.1f, func_80387C64, reinterpret_cast(s32, arg1)); - func_80288D40(arg0, 0.2f, func_80387C64, arg1); - func_80288D40(arg0, 0.3f, func_80387C64, arg1); - func_80288D40(arg0, 0.4f, func_80387C64, arg1); - func_80288D40(arg0, 0.5f, func_80387C64, arg1); - func_80288D40(arg0, 0.6f, func_80387C64, arg1); - func_80288D40(arg0, 0.7f, func_80387C64, arg1); - func_80288D40(arg0, 0.8f, func_80387C64, arg1); - func_80288D40(arg0, 0.9f, func_80387C64, arg1); + func_80288D40(arg0, 0.2f, func_80387C64, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.3f, func_80387C64, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.4f, func_80387C64, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.5f, func_80387C64, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.6f, func_80387C64, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.7f, func_80387C64, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.8f, func_80387C64, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.9f, func_80387C64, reinterpret_cast(s32, arg1)); } -void func_80389D34(s32 arg0, s32 arg1) { +void func_80389D34(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); func_80361C64(arg0, 0.02f, arg1, 1, 0); } -void func_80389D78(s32 arg0, s32 arg1) { +void func_80389D78(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288D08(arg0, 0.01f, func_803864AC); func_80288D08(arg0, 0.0f, func_803865F0); func_80288F78(arg0, 0.9f, 0x7F80EAU); func_80288EB0(arg0, 0.9f, 0, 5.0f, 0.8f); } -void func_80389DFC(s32 arg0, s32 arg1) { +void func_80389DFC(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288D08(arg0, 0.01f, func_803864AC); func_80288D08(arg0, 0.01f, func_803865F0); - func_80288D40(arg0, 0.8f, func_803872B4, arg1); + func_80288D40(arg0, 0.8f, func_803872B4, reinterpret_cast(s32, arg1)); func_80288F78(arg0, 0.9f, 0x7F80EAU); func_80288EB0(arg0, 0.9f, 0, 5.0f, 0.8f); } -void cutscenes_func_80389EA8(s32 arg0, s32 arg1) { +void cutscenes_func_80389EA8(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); func_80361C64(arg0, 0.023f, arg1, 1, 1); func_8028913C(arg0, 2); @@ -1025,23 +1025,23 @@ void cutscenes_func_80389EA8(s32 arg0, s32 arg1) { func_80289090(arg0, 0.2f, 0xFF00U, 0.4f); func_80289090(arg0, 0.2f, 0xFFU, 0.4f); func_80289090(arg0, 0.2f, 0xFFFFFFU, 0.4f); - func_80288D40(arg0, 0.4f, func_8038702C, arg1); - func_80288D40(arg0, 0.4f, func_80387170, arg1); + func_80288D40(arg0, 0.4f, func_8038702C, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.4f, func_80387170, reinterpret_cast(s32, arg1)); func_8028913C(arg0, 5); func_80288F38(arg0, 0.95f, 0, 0.8f); } -void func_8038A018(s32 arg0, s32 arg1) { +void func_8038A018(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); func_80361C64(arg0, 0.023f, arg1, 1, 0); } -void func_8038A05C(s32 arg0, s32 arg1) { +void func_8038A05C(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); func_80361C64(arg0, 0.02f, arg1, 1, 0); } -void cutscenes_func_8038A0A0(s32 arg0, s32 arg1) { +void cutscenes_func_8038A0A0(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288D08(arg0, 0.01f, func_803864AC); func_80288D08(arg0, 0.0f, func_803865F0); func_80288F78(arg0, 0.8f, 0xB1C075U); @@ -1050,31 +1050,31 @@ void cutscenes_func_8038A0A0(s32 arg0, s32 arg1) { func_80288EB0(arg0, 0.97f, 0, 5.0f, 0.8f); } -void func_8038A15C(s32 arg0, s32 arg1) { +void func_8038A15C(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288D08(arg0, 0.01f, func_803864AC); func_80288D08(arg0, 0.01f, func_803865F0); - func_80288D40(arg0, 0.01f, func_80387364, arg1); - func_80288D40(arg0, 0.15f, func_80387364, arg1); - func_80288D40(arg0, 0.3f, func_80387364, arg1); - func_80288D40(arg0, 0.5f, func_80387364, arg1); + func_80288D40(arg0, 0.01f, func_80387364, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.15f, func_80387364, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.3f, func_80387364, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.5f, func_80387364, reinterpret_cast(s32, arg1)); func_80288F78(arg0, 0.97f, 0x7F80EAU); func_80288EB0(arg0, 0.97f, 0, 5.0f, 0.8f); } -void func_8038A254(s32 arg0, s32 arg1) { +void func_8038A254(vector(struct2s) **arg0, ActorMarker *arg1) { func_80361C64(arg0, 0.001f, arg1, 1, 1); - func_80288D40(arg0, 0.4f, func_8038702C, arg1); - func_80288D40(arg0, 0.4f, func_80387170, arg1); + func_80288D40(arg0, 0.4f, func_8038702C, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.4f, func_80387170, reinterpret_cast(s32, arg1)); func_8028913C(arg0, 3); func_80288F78(arg0, 0.5f, 0x041B809CU); } -void cutscenes_func_8038A2F0(s32 arg0, s32 arg1) { +void cutscenes_func_8038A2F0(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); func_80361C64(arg0, 0.023f, arg1, 1, 0); } -void func_8038A334(s32 arg0, s32 arg1) { +void func_8038A334(vector(struct2s) **arg0, ActorMarker *arg1) { func_80361C64(arg0, 0.01f, arg1, 1, 0); func_80288EB0(arg0, 0.1f, 0, 3.0f, 0.8f); func_80288F78(arg0, 0.1f, 0x9880C3U); @@ -1096,14 +1096,14 @@ void func_8038A334(s32 arg0, s32 arg1) { func_80288F78(arg0, 0.93f, 0x9880C3U); } -void cutscenes_func_8038A54C(s32 arg0, s32 arg1) { +void cutscenes_func_8038A54C(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288F78(arg0, 0.23f, 0x013973A4U); func_80288F78(arg0, 0.36f, 0x01398CA4U); func_80288D08(arg0, 0.53f, func_80386668); func_80288F78(arg0, 0.53f, 0x013980A4U); } -void func_8038A5C8(s32 arg0, s32 arg1) { +void func_8038A5C8(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288F78(arg0, 0.0511f, 0x6594EU); func_80288F78(arg0, 0.53f, 0x6804EU); func_8028913C(arg0, 1); @@ -1118,14 +1118,14 @@ void func_8038A5C8(s32 arg0, s32 arg1) { func_80288F78(arg0, 0.6636f, 0xFA4C7DU); } -void func_8038A6D0(s32 arg0, s32 arg1) { +void func_8038A6D0(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 3); func_80288F78(arg0, 0.05f, 0xFA4C7DU); func_8028913C(arg0, 0xA); func_80288F78(arg0, 0.05f, 0xFA467DU); } -void func_8038A734(s32 arg0, s32 arg1) { +void func_8038A734(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288F78(arg0, 0.18f, 0xD3595DU); func_80288F78(arg0, 0.31f, 0xD3605DU); func_80288F78(arg0, 0.49f, 0xD3595DU); @@ -1134,17 +1134,17 @@ void func_8038A734(s32 arg0, s32 arg1) { func_80288F78(arg0, 0.99f, 0xD3605DU); } -void func_8038A7E8(s32 arg0, s32 arg1) { +void func_8038A7E8(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288D08(arg0, 0.01f, func_803866E0); func_80288F78(arg0, 0.23f, 0x013973A4U); func_80288F78(arg0, 0.36f, 0x01398CA4U); func_80288F78(arg0, 0.53f, 0x013980A4U); } -void cutscenes_func_8038A864(s32 arg0, s32 arg1) { +void cutscenes_func_8038A864(vector(struct2s) **arg0, ActorMarker *arg1) { func_80361CF4(arg0, 0.001f, arg1, 0.7f); func_8028913C(arg0, 2); - func_80288D40(arg0, 0.7f, func_80386578, arg1); + func_80288D40(arg0, 0.7f, func_80386578, reinterpret_cast(s32, arg1)); func_8028913C(arg0, 2); func_80288F78(arg0, 0.7f, 0x0416736DU); func_8028913C(arg0, 3); @@ -1154,23 +1154,23 @@ void cutscenes_func_8038A864(s32 arg0, s32 arg1) { func_80361CAC(arg0, 0.6f, arg1, 0.7f); } -void func_8038A954(s32 arg0, s32 arg1) { +void func_8038A954(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288F78(arg0, 0.53f, 0x6995DU); func_80288F78(arg0, 0.99f, 0x6B35DU); } -void func_8038A9A0(s32 arg0, s32 arg1) { +void func_8038A9A0(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288F78(arg0, 0.377f, 0x014280FAU); } -void func_8038A9D0(s32 arg0, s32 arg1) { +void func_8038A9D0(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288EB0(arg0, 0.001f, 0, 6.0f, 0.4f); func_80288F78(arg0, 0.001f, 0x9880B3U); func_80288EB0(arg0, 0.5069f, 0, 6.0f, 0.4f); func_80288F78(arg0, 0.5069f, 0x988CB3U); } -void func_8038AA64(s32 arg0, s32 arg1) { +void func_8038AA64(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288F78(arg0, 0.05f, 0xFB999CU); func_80288F78(arg0, 0.12f, 0x2809CU); func_80288F78(arg0, 0.33f, 0x2869CU); @@ -1178,22 +1178,22 @@ void func_8038AA64(s32 arg0, s32 arg1) { func_80288F78(arg0, 0.75f, 0x2799CU); } -void func_8038AAFC(s32 arg0, s32 arg1) { +void func_8038AAFC(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288F78(arg0, 0.28f, 0x908CFAU); func_80288D08(arg0, 0.4f, func_80386750); func_80288D08(arg0, 0.4f, func_803867D0); } -void cutscenes_func_8038AB60(s32 arg0, s32 arg1) { - func_80361D7C(arg0, 0.21f, reinterpret_cast(s32, arg1), 5, 0x96804EU); +void cutscenes_func_8038AB60(vector(struct2s) **arg0, ActorMarker *arg1) { + func_80361D7C(arg0, 0.21f, arg1, 5, 0x96804EU); func_80361D7C(arg0, 0.43f, arg1, 5, 0x96864EU); func_80361D7C(arg0, 0.65f, arg1, 5, 0x96884EU); func_80361D7C(arg0, 0.8f, arg1, 5, 0x012D889CU); - func_80288D40(arg0, 0.98f, func_80387424, arg1); + func_80288D40(arg0, 0.98f, func_80387424, reinterpret_cast(s32, arg1)); func_80361D7C(arg0, 0.99f, arg1, 5, 0x9680C3U); } -void func_8038AC54(s32 arg0, s32 arg1) { +void func_8038AC54(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); func_80361C64(arg0, 0.01f, arg1, 3, 0); func_8028913C(arg0, 1); @@ -1222,7 +1222,7 @@ void func_8038AC54(s32 arg0, s32 arg1) { func_80361D7C(arg0, 0.65f, arg1, 5, 0x4C809CU); } -void func_8038AF5C(s32 arg0, s32 arg1) { +void func_8038AF5C(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); func_80361C64(arg0, 0.01f, arg1, 8, 0); func_8028913C(arg0, 1); @@ -1239,10 +1239,10 @@ void func_8038AF5C(s32 arg0, s32 arg1) { func_80361C64(arg0, 0.01f, arg1, 9, 0); } -void func_8038B098(s32 arg0, s32 arg1) { +void func_8038B098(vector(struct2s) **arg0, ActorMarker *arg1) { f32 sp34 = 0.8f; func_8028913C(arg0, 1); - func_80361C64(arg0, 0.01f, reinterpret_cast(s32, arg1), 3, 0); + func_80361C64(arg0, 0.01f, arg1, 3, 0); func_8028913C(arg0, 1); func_80361C64(arg0, 0.01f, arg1, 4, 2); func_8028913C(arg0, 1); @@ -1256,10 +1256,10 @@ void func_8038B098(s32 arg0, s32 arg1) { func_8028913C(arg0, 1); func_80361C64(arg0, 0.01f, arg1, 8, 1); func_8028913C(arg0, 1); - func_80288D84(arg0, 0.01f, func_80386A90, arg1, reinterpret_cast(s32, sp34)); + func_80288D84(arg0, 0.01f, func_80386A90, reinterpret_cast(s32,arg1), reinterpret_cast(s32, sp34)); } -void func_8038B214(s32 arg0, s32 arg1) { +void func_8038B214(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288FD8(arg0, 0.03f, 0xA40000U); func_8028913C(arg0, 1); func_80361C64(arg0, 0.01f, arg1, 3, 0); @@ -1282,7 +1282,7 @@ void func_8038B214(s32 arg0, s32 arg1) { func_80288FA8(arg0, 0.99f, 0xA4); } -void func_8038B404(s32 arg0, s32 arg1) { +void func_8038B404(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288FD8(arg0, 0.03f, 0xA70000U); func_8028913C(arg0, 1); func_80361C64(arg0, 0.01f, arg1, 3, 0); @@ -1304,7 +1304,7 @@ void func_8038B404(s32 arg0, s32 arg1) { func_80288FD8(arg0, 0.73f, 0x570000U); } -void func_8038B5FC(s32 arg0, s32 arg1) { +void func_8038B5FC(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); func_80361C64(arg0, 0.0f, arg1, 3, 0); func_8028913C(arg0, 1); @@ -1321,13 +1321,13 @@ void func_8038B5FC(s32 arg0, s32 arg1) { func_80361C64(arg0, 0.0f, arg1, 8, 1); } -void func_8038B744(s32 arg0, s32 arg1) { +void func_8038B744(vector(struct2s) **arg0, ActorMarker *arg1) { func_80361C64(arg0, 0.01f, arg1, 6, 0); func_80361C64(arg0, 0.01f, arg1, 4, 0); func_80361C64(arg0, 0.01f, arg1, 5, 0); } -void func_8038B7B4(s32 arg0, s32 arg1) { +void func_8038B7B4(vector(struct2s) **arg0, ActorMarker *arg1) { func_80361C64(arg0, 0.01f, arg1, 6, 0); func_80361C64(arg0, 0.01f, arg1, 4, 0); func_80361C64(arg0, 0.01f, arg1, 5, 0); @@ -1340,7 +1340,7 @@ void func_8038B7B4(s32 arg0, s32 arg1) { } -void func_8038B8B8(s32 arg0, s32 arg1) { +void func_8038B8B8(vector(struct2s) **arg0, ActorMarker *arg1) { func_80361C64(arg0, 0.01f, arg1, 6, 0); func_80361C64(arg0, 0.01f, arg1, 4, 1); func_80361C64(arg0, 0.01f, arg1, 5, 1); @@ -1348,26 +1348,26 @@ void func_8038B8B8(s32 arg0, s32 arg1) { func_80288F78(arg0, 0.12f, 0x288075U); func_80288F78(arg0, 0.15f, 0x287975U); func_80288F78(arg0, 0.18f, 0x287975U); - func_80288D40(arg0, 0.4f, func_803878A4, arg1); + func_80288D40(arg0, 0.4f, func_803878A4, reinterpret_cast(s32, arg1)); } -void func_8038B9B4(s32 arg0, s32 arg1) { - func_80361C64(arg0, 0.01f, reinterpret_cast(s32, arg1), 6, 0); +void func_8038B9B4(vector(struct2s) **arg0, ActorMarker *arg1) { + func_80361C64(arg0, 0.01f, arg1, 6, 0); func_80361C64(arg0, 0.01f, arg1, 4, 1); func_80361C64(arg0, 0.01f, arg1, 5, 1); func_80288F78(arg0, 0.068f, 0x6180C3U); func_80288F78(arg0, 0.66f, 0x1F8075U); func_80288EB0(arg0, 0.66f, 0, 20.0f, 0.8f); - func_80288D40(arg0, 0.7f, func_803878A4, arg1); + func_80288D40(arg0, 0.7f, func_803878A4, reinterpret_cast(s32, arg1)); func_80288F78(arg0, 0.76f, 0x1F8075U); - func_80288D40(arg0, 0.77f, cutscenes_func_803879E0, arg1); - func_80288D40(arg0, 0.86f, cutscenes_func_803879E0, arg1); + func_80288D40(arg0, 0.77f, cutscenes_func_803879E0, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.86f, cutscenes_func_803879E0, reinterpret_cast(s32, arg1)); func_80288EB0(arg0, 0.86f, 0, 20.0f, 0.9f); - func_80288D40(arg0, 0.96f, cutscenes_func_803879E0, arg1); + func_80288D40(arg0, 0.96f, cutscenes_func_803879E0, reinterpret_cast(s32, arg1)); } -void func_8038BB30(s32 arg0, s32 arg1) { +void func_8038BB30(vector(struct2s) **arg0, ActorMarker *arg1) { func_80361C64(arg0, 0.01f, arg1, 6, 0); func_80361C64(arg0, 0.01f, arg1, 4, 1); func_80361C64(arg0, 0.01f, arg1, 5, 1); @@ -1376,7 +1376,7 @@ void func_8038BB30(s32 arg0, s32 arg1) { func_80288F78(arg0, 0.94f, 0x697975U); } -void func_8038BBF8(s32 arg0, s32 arg1) { +void func_8038BBF8(vector(struct2s) **arg0, ActorMarker *arg1) { func_80361C64(arg0, 0.01f, arg1, 6, 1); func_80288F78(arg0, 0.5f, 0x21809CU); func_80288EB0(arg0, 0.5f, 0, 5.0f, 0.9f); @@ -1389,20 +1389,20 @@ void func_8038BBF8(s32 arg0, s32 arg1) { func_80288F78(arg0, 0.9f, 0xD3669CU); } -void func_8038BD2C(s32 arg0, s32 arg1) { +void func_8038BD2C(vector(struct2s) **arg0, ActorMarker *arg1) { func_80361C64(arg0, 0.01f, arg1, 6, 0); func_80361C64(arg0, 0.01f, arg1, 4, 0); func_80361C64(arg0, 0.01f, arg1, 5, 0); } -void func_8038BD9C(s32 arg0, s32 arg1) { +void func_8038BD9C(vector(struct2s) **arg0, ActorMarker *arg1) { func_80361C64(arg0, 0.01f, arg1, 6, 1); func_80361C64(arg0, 0.01f, arg1, 4, 1); func_80361C64(arg0, 0.01f, arg1, 5, 1); func_80288F78(arg0, 0.85f, 0x666C3U); } -void func_8038BE30(s32 arg0, s32 arg1) { +void func_8038BE30(vector(struct2s) **arg0, ActorMarker *arg1) { func_80361C64(arg0, 0.01f, arg1, 6, 1); func_80288F78(arg0, 0.32f, 0x03F280C3U); func_80288F78(arg0, 0.4f, 0x1F8055U); @@ -1416,25 +1416,25 @@ void func_8038BE30(s32 arg0, s32 arg1) { func_80288F78(arg0, 0.96f, 0x7805DU); } -void func_8038BF5C(s32 arg0, s32 arg1) { - func_80361C64(arg0, 0.01f, reinterpret_cast(s32, arg1), 4, 1); +void func_8038BF5C(vector(struct2s) **arg0, ActorMarker *arg1) { + func_80361C64(arg0, 0.01f, arg1, 4, 1); func_8028913C(arg0, 1); func_80288D08(arg0, 0.05f, func_80386924); - func_80288D40(arg0, 0.05f, func_80387B58, arg1); - func_80288D40(arg0, 0.15f, func_80387B58, arg1); - func_80288D40(arg0, 0.25f, func_80387B58, arg1); - func_80288D40(arg0, 0.35f, func_80387B58, arg1); - func_80288D40(arg0, 0.45f, func_80387B58, arg1); - func_80288D40(arg0, 0.55f, func_80387B58, arg1); - func_80288D40(arg0, 0.65f, func_80387B58, arg1); - func_80288D40(arg0, 0.75f, func_80387B58, arg1); - func_80288D40(arg0, 0.85f, func_80387B58, arg1); - func_80288D40(arg0, 0.95f, func_80387B58, arg1); + func_80288D40(arg0, 0.05f, func_80387B58, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.15f, func_80387B58, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.25f, func_80387B58, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.35f, func_80387B58, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.45f, func_80387B58, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.55f, func_80387B58, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.65f, func_80387B58, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.75f, func_80387B58, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.85f, func_80387B58, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.95f, func_80387B58, reinterpret_cast(s32, arg1)); func_8028913C(arg0, 0x14); func_80288D08(arg0, 0.05f, cutscenes_func_80386A00); } -void cutscenes_func_8038C0DC(s32 arg0, s32 arg1) { +void cutscenes_func_8038C0DC(vector(struct2s) **arg0, ActorMarker *arg1) { func_80361C64(arg0, 0.01f, arg1, 4, 1); func_8028913C(arg0, 1); func_80288D08(arg0, 0.02f, func_80386990); @@ -1443,18 +1443,18 @@ void cutscenes_func_8038C0DC(s32 arg0, s32 arg1) { } -void cutscenes_func_8038C16C(s32 arg0, s32 arg1) { +void cutscenes_func_8038C16C(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288F78(arg0, 0.2f, 0x17808CU); } -void func_8038C19C(s32 arg0, s32 arg1) { +void func_8038C19C(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); func_80288D08(arg0, 0.02f, cutscenes_func_803863F0); func_8028913C(arg0, 1); func_80288D08(arg0, 0.97f, func_80386410); } -void func_8038C200(s32 arg0, s32 arg1) { +void func_8038C200(vector(struct2s) **arg0, ActorMarker *arg1) { func_8028913C(arg0, 1); func_80288D08(arg0, 0.02f, func_8038645C); func_8028913C(arg0, 1); @@ -1462,43 +1462,43 @@ void func_8038C200(s32 arg0, s32 arg1) { } -void func_8038C264(s32 arg0, s32 arg1) { - func_80288F78(arg0, 0.2f, 0x98808CU); - func_80288F78(arg0, 0.27f, 0x98868CU); - func_80288F78(arg0, 0.5f, 0x98798CU); - func_80288F78(arg0, 0.65f, 0x98868CU); - func_80288F78(arg0, 0.9f, 0x98808CU); - func_80288F78(arg0, 0.95f, 0x98798CU); +void func_8038C264(vector(struct2s) **arg0, ActorMarker *arg1) { + func_80288F78(arg0, 0.2f, (SFX_98_DEAF_THUD << 0x10) | (0x80 << 8) | 0x8C); + func_80288F78(arg0, 0.27f, (SFX_98_DEAF_THUD << 0x10) | (0x86 << 8) | 0x8C); + func_80288F78(arg0, 0.5f, (SFX_98_DEAF_THUD << 0x10) | (0x79 << 8) | 0x8C); + func_80288F78(arg0, 0.65f, (SFX_98_DEAF_THUD << 0x10) | (0x86 << 8) | 0x8C); + func_80288F78(arg0, 0.9f, (SFX_98_DEAF_THUD << 0x10) | (0x80 << 8) | 0x8C); + func_80288F78(arg0, 0.95f, (SFX_98_DEAF_THUD << 0x10) | (0x79 << 8) | 0x8C); } -void func_8038C314(s32 arg0, s32 arg1) { +void func_8038C314(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288F78(arg0, 0.14f, 0x3F803EU); func_80288F78(arg0, 0.75f, 0x40803EU); } -void func_8038C35C(s32 arg0, s32 arg1) { +void func_8038C35C(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288F78(arg0, 0.09f, 0xD0668CU); func_80288F78(arg0, 0.25f, 0xD0338CU); func_80288F78(arg0, 0.84f, 0x3F868CU); } -void func_8038C3BC(s32 arg0, s32 arg1) { +void func_8038C3BC(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288FD8(arg0, 0.01f, 0x430000); func_80288D08(arg0, 0.4f, func_80386434); } -void func_8038C404(s32 arg0, s32 arg1) { +void func_8038C404(vector(struct2s) **arg0, ActorMarker *arg1) { func_80288F78(arg0, 0.74f, 0x1580FAU); - func_80288D40(arg0, 0.74f, func_80387FC0, arg1); + func_80288D40(arg0, 0.74f, func_80387FC0, reinterpret_cast(s32, arg1)); } -void cutscenes_func_8038C454(s32 arg0, s32 arg1) { - func_80288D40(arg0, 0.2f, func_803881CC, arg1); +void cutscenes_func_8038C454(vector(struct2s) **arg0, ActorMarker *arg1) { + func_80288D40(arg0, 0.2f, func_803881CC, reinterpret_cast(s32, arg1)); func_80288F78(arg0, 0.2f, 0x1E808CU); - func_80288D40(arg0, 0.3f, func_803881CC, arg1); - func_80288D40(arg0, 0.35f, func_803881CC, arg1); + func_80288D40(arg0, 0.3f, func_803881CC, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.35f, func_803881CC, reinterpret_cast(s32, arg1)); } /* .h */ diff --git a/src/emptyLvl/code_0.c b/src/emptyLvl/code_0.c index adb4e1f5..e337e34f 100644 --- a/src/emptyLvl/code_0.c +++ b/src/emptyLvl/code_0.c @@ -1,3 +1,3 @@ unsigned char emptyLvl = 0; -void emptyLvl_func_803863F0(void){} \ No newline at end of file +void emptyLvl_func_803863F0(void){} diff --git a/src/fight/chbossjinjobase.c b/src/fight/chbossjinjobase.c index 5c091bdb..41381284 100644 --- a/src/fight/chbossjinjobase.c +++ b/src/fight/chbossjinjobase.c @@ -127,7 +127,7 @@ void func_8038D568(Actor *this){ this->velocity_y = 100.0f; func_802BB3DC(0, 8.0f, 0.92f); - func_802C3F04((GenMethod_4)func_802C4140, 0x3ad, *(s32*)&this->unk1C[0], *(s32*)&this->unk1C[1], *(s32*)&this->unk1C[2]); + __spawnQueue_add_4((GenMethod_4)func_802C4140, 0x3ad, *(s32*)&this->unk1C[0], *(s32*)&this->unk1C[1], *(s32*)&this->unk1C[2]); func_8038D2EC(this->unk1C, 0x10); SPAWNQUEUE_ADD_1(chbossjinjobase_spawnStoneJinjo, this->marker); } diff --git a/src/fight/chbossshadow.c b/src/fight/chbossshadow.c index 10e57cc2..2ff645d6 100644 --- a/src/fight/chbossshadow.c +++ b/src/fight/chbossshadow.c @@ -17,7 +17,7 @@ Actor *chbossshadow_draw(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **arg3) f32 sp34[3]; f32 sp30; Actor *this; - this = func_80325300(marker, sp34); + this = marker_getActorAndRotation(marker, sp34); sp30 = this->scale * ml_map_f(this->unk1C[0], 0.0f, 1000.0f, 1.75f, 0.9f); modelRender_setDepthMode(MODEL_RENDER_DEPTH_COMPARE); modelRender_draw(gdl, mptr, this->position, sp34, sp30, NULL, func_80330B1C(marker)); diff --git a/src/fight/chfinalboss.c b/src/fight/chfinalboss.c index fdb4c0ca..a917ac2b 100644 --- a/src/fight/chfinalboss.c +++ b/src/fight/chfinalboss.c @@ -1319,7 +1319,7 @@ void __chfinalboss_spawnStatue(enum bossjinjo_e statue_id) { Actor *sp1C; ActorLocal_fight_180 *local; - local = (ActorLocal_fight_180 *)&func_80326EEC(ACTOR_38B_GRUNTILDA_FINAL_BOSS)->local; + local = (ActorLocal_fight_180 *)&actorArray_findActorFromActorId(ACTOR_38B_GRUNTILDA_FINAL_BOSS)->local; switch (statue_id) { case BOSSJINJO_ORANGE: @@ -2309,7 +2309,7 @@ void chfinalboss_update(Actor *this){ __chFinalBossJinjoStatueMarker[i] = NULL; } - __spawnqueue_add_1((GenMethod_1) chfinalboss_spawnShadow, (s32) this->marker); + __spawnQueue_add_1((GenMethod_1) chfinalboss_spawnShadow, (s32) this->marker); chfinalboss_setPhase(this->marker, 0); local->hits = 0; func_80386600(this->marker, 0); @@ -2415,7 +2415,7 @@ void func_8038C148(void) { s32 camera_node; f32 sp34; - sp4C = func_80326EEC(ACTOR_38B_GRUNTILDA_FINAL_BOSS); + sp4C = actorArray_findActorFromActorId(ACTOR_38B_GRUNTILDA_FINAL_BOSS); sp48 = (ActorLocal_fight_180 *)&sp4C->local; sp34 = func_8038DFA0(); temp_f20 = sp34 + chjinjonator_80391234(); diff --git a/src/fight/chjinjonatorbase.c b/src/fight/chjinjonatorbase.c index 3f71fb3c..21103f55 100644 --- a/src/fight/chjinjonatorbase.c +++ b/src/fight/chjinjonatorbase.c @@ -97,7 +97,7 @@ void func_8038E260(ActorMarker *arg0) { Actor *sp24 = marker_getActor(arg0); func_802BB3DC(0, 18.0f, 0.92f); - func_802C3F04((GenMethod_4) func_802C4140, 0x3AD, *(u32 *)(&sp24->unk1C_x), *(u32 *)(&sp24->unk1C_y), *(u32 *)(&sp24->unk1C_z)); + __spawnQueue_add_4((GenMethod_4) func_802C4140, 0x3AD, *(u32 *)(&sp24->unk1C_x), *(u32 *)(&sp24->unk1C_y), *(u32 *)(&sp24->unk1C_z)); func_8038E03C(sp24->unk1C, 0x10); } diff --git a/src/fight/chstonejinjo.c b/src/fight/chstonejinjo.c index 2403c782..6278a553 100644 --- a/src/fight/chstonejinjo.c +++ b/src/fight/chstonejinjo.c @@ -3,7 +3,7 @@ #include "variables.h" #include "fight.h" -extern Actor *func_80326EEC(); +extern Actor *actorArray_findActorFromActorId(); extern void func_80328B8C(Actor*, s32, f32, s32); extern f32 chbossjinjo_8038D268(void); @@ -135,5 +135,5 @@ void chstonejinjo_breakOpen(ActorMarker *marker){ } f32 func_8038DFA0(void) { - return func_80326EEC(ACTOR_3A1_STONE_JINJO)->unk1C_x; + return actorArray_findActorFromActorId(ACTOR_3A1_STONE_JINJO)->unk1C_x; } diff --git a/src/fight/fight.h b/src/fight/fight.h index 153299c3..365ed708 100644 --- a/src/fight/fight.h +++ b/src/fight/fight.h @@ -9,4 +9,4 @@ enum bossjinjo_e{ BOSSJINJO_JINJONATOR }; -#endif \ No newline at end of file +#endif diff --git a/src/lair/code_0.c b/src/lair/code_0.c index a2913b7d..87908c3a 100644 --- a/src/lair/code_0.c +++ b/src/lair/code_0.c @@ -822,7 +822,7 @@ void func_80387F1C(void) { jiggySpawn(JIGGY_35_LAIR_CC_WITCH_SWITCH, tmp); // FIXME: macro? - func_802C3F04((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, *(s32 *)&tmp[0], *(s32 *)&tmp[1], *(s32 *)&tmp[2]); + __spawnQueue_add_4((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, *(s32 *)&tmp[0], *(s32 *)&tmp[1], *(s32 *)&tmp[2]); } } @@ -871,7 +871,7 @@ void func_803880BC(Actor *this) this->position_y -= 51.f; this->unk1C[0] = 0; - __spawnqueue_add_1((GenMethod_1)func_80387E94, reinterpret_cast(s32, this->marker)); + __spawnQueue_add_1((GenMethod_1)func_80387E94, reinterpret_cast(s32, this->marker)); if (func_803203FC(0xBC) && !func_8031FF1C(0x9A)) FUNC_8030E624(SFX_3F6_UNKNOWN, 0.75f, 30000); @@ -1144,7 +1144,7 @@ void func_80388524(Actor *this) { break; case 0x235://L80388A24 - sp30 = func_80326EEC(0x236); + sp30 = actorArray_findActorFromActorId(0x236); if(func_8031FF1C(0x35)){ marker_despawn(this->marker); marker_despawn(sp30->marker); @@ -1270,7 +1270,7 @@ void func_80388524(Actor *this) { case 0x235://L80388F34 { - sp28 = func_80326EEC(0x236); + sp28 = actorArray_findActorFromActorId(0x236); this->unk1C[0] += 3.6; if (this->unk1C[0] > 250.0f) { lair_func_80388278(this); @@ -1563,7 +1563,7 @@ void func_8038982C(Actor *this) this->initialized = TRUE; if (!func_8031FF1C(BKPROG_9E_CRYPT_COFFIN_LID_OPEN)) - __spawnqueue_add_1((GenMethod_1)func_803897D4, reinterpret_cast(s32, this->marker)); + __spawnQueue_add_1((GenMethod_1)func_803897D4, reinterpret_cast(s32, this->marker)); } } diff --git a/src/lair/code_5ED0.c b/src/lair/code_5ED0.c index 03512fb8..2e4339ac 100644 --- a/src/lair/code_5ED0.c +++ b/src/lair/code_5ED0.c @@ -774,7 +774,7 @@ void func_8038D1E4(void) case 3: { timedFunc_set_2( - 0.5f, (TFQM2)func_8038D16C, + 0.5f, (GenMethod_2)func_8038D16C, D_80394354[D_8037DCB8->unkC].unk2, D_80394354[D_8037DCB8->unkC].unk4 ); @@ -839,7 +839,7 @@ void func_8038D4BC(void) // trigger warp after a delay timedFunc_set_3(0.25f, - (TFQM3)func_802E4078, + (GenMethod_3)func_802E4078, D_803945B8[D_8037DCB8->unkC].map, D_803945B8[D_8037DCB8->unkC].exit, 1 diff --git a/src/lair/code_A4A0.c b/src/lair/code_A4A0.c index dcf9bb40..bb41ec57 100644 --- a/src/lair/code_A4A0.c +++ b/src/lair/code_A4A0.c @@ -54,7 +54,7 @@ void func_80390890(ActorMarker *marker, ActorMarker *other_marker) { func_80328B8C(this, 5, 0.0f, 1); actor_playAnimationOnce(this); func_8030E878(SFX_C2_GRUBLIN_EGH, local->unkC_27*0.1 + 0.8, 32000, this->position, 1250.0f, 2500.0f); - func_802C3F04((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2])); + __spawnQueue_add_4((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2])); actor_collisionOff(this); this->unk138_24 = TRUE; } diff --git a/src/lair/code_A810.c b/src/lair/code_A810.c index 22e9272e..289653f7 100644 --- a/src/lair/code_A810.c +++ b/src/lair/code_A810.c @@ -78,7 +78,7 @@ void func_80390D3C(Actor *this, s32 val) this->unk1C[2] = this->position_z; } - __spawnqueue_add_1((GenMethod_1)func_80390C00, reinterpret_cast(s32, this->marker)); + __spawnQueue_add_1((GenMethod_1)func_80390C00, reinterpret_cast(s32, this->marker)); break; } @@ -88,7 +88,7 @@ void func_80390D3C(Actor *this, s32 val) this->unk1C[1] = this->position_y; this->unk1C[2] = this->position_z; - __spawnqueue_add_1((GenMethod_1)func_80390CB4, reinterpret_cast(s32, this->marker)); + __spawnQueue_add_1((GenMethod_1)func_80390CB4, reinterpret_cast(s32, this->marker)); break; } diff --git a/symbol_addrs.us.v10.txt b/symbol_addrs.us.v10.txt index 08e2677d..f84a3a08 100644 --- a/symbol_addrs.us.v10.txt +++ b/symbol_addrs.us.v10.txt @@ -705,7 +705,11 @@ bsstand_update = 0x802B4D20; bsstand_end = 0x802B5248; bstwirl_hitboxActive = 0x802B6A40; set_camera_to_node = 0x802BAE20; -__spawnqueue_add_1 = 0x802C3C88; +spawnQueue_func_802C3A18 = 0x802C3A18; +spawnQueue_flush = 0x802C3A38; +spawnQueue_unlock = 0x802C3BDC; +spawnQueue_lock = 0x802C3BE8; +__spawnQueue_add_2 = 0x802C3D3C; func_802C4140 = 0x802C4140; func_802C418C = 0x802C418C; func_802C4218 = 0x802C4218; @@ -967,6 +971,7 @@ sSpawnableActorList = 0x8036A9B4; D_8036B810 = 0x8036B810; D_8036D940 = 0x8036D940; D_8036DD9C = 0x8036DD9C; +suBaddieActorArray = 0x8036E560; D_8036E598 = 0x8036E598; D_8036E5B0 = 0x8036E5B0; D_8036E5C0 = 0x8036E5C0;