diff --git a/asm/non_matchings/code_actors/func_80296D10.s b/asm/non_matchings/code_actors/func_80296D10.s index 0852838b2..847367ebb 100644 --- a/asm/non_matchings/code_actors/func_80296D10.s +++ b/asm/non_matchings/code_actors/func_80296D10.s @@ -8,7 +8,7 @@ glabel func_80296D10 /* 100338 80296D28 0C0AD4B6 */ jal vec3f_copy /* 10033C 80296D2C 24840018 */ addiu $a0, $a0, 0x18 /* 100340 80296D30 26040010 */ addiu $a0, $s0, 0x10 -/* 100344 80296D34 0C0AD4C1 */ jal func_802B5304 +/* 100344 80296D34 0C0AD4C1 */ jal vec3s_copy /* 100348 80296D38 8FA50038 */ lw $a1, 0x38($sp) /* 10034C 80296D3C 26040024 */ addiu $a0, $s0, 0x24 /* 100350 80296D40 0C0AD4B6 */ jal vec3f_copy diff --git a/include/actor_types.h b/include/actor_types.h index 57d81f427..2a2b48058 100644 --- a/include/actor_types.h +++ b/include/actor_types.h @@ -5,7 +5,121 @@ // Made this because there will likely be a lot of structs in this file that will be compiled into one eventually. // This keeps the other files cleaner. -struct piranha_plant { +#define ACTOR_FALLING_ROCK 0x05 +#define ACTOR_BANANA 0x06 +#define ACTOR_GREEN_SHELL 0x07 +#define ACTOR_RED_SHELL 0x08 +#define ACTOR_YOSHI_VALLEY_EGG 0x09 +#define ACTOR_PIRANHA_PLANT 0x0A +#define ACTOR_ITEM_BOX 0x0C +#define ACTOR_FAKE_ITEM_BOX 0x0D +#define ACTOR_BANANA_BUNCH 0x0E +#define ACTOR_TRAIN_ENGINE 0x0F +#define ACTOR_TRAIN_TENDER 0x10 +#define ACTOR_TRAIN_PASSENGER_CAR 0x11 +#define ACTOR_TRIPLE_GREEN_SHELL 0x15 +#define ACTOR_TRIPLE_RED_SHELL 0x16 +#define ACTOR_MARIO_RACEWAY_SIGN 0x17 +#define ACTOR_WARIO_STADIUM_SIGN 0x23 +#define ACTOR_PADDLE_WHEEL_BOAT 0x26 +#define ACTOR_RAILROAD_CROSSING 0x27 +#define ACTOR_BLUE_SPINY_SHELL 0x2A +#define ACTOR_HOT_AIR_BALLOON_ITEM_BOX 0x2B +#define ACTOR_KIWANO_FRUIT 0x2D + +/* +Used by the locomotive, tender, and passenger car +*/ +struct TrainCar { + /* 0x00 */ s16 type; + /* 0x02 */ s16 flags; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 wheelRot; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ Vec3s rot; + /* 0x10 */ s16 unk_16; + /* 0x18 */ Vec3f pos; + /* 0x24 */ Vec3f velocity; + /* 0x30 */ UnkActorInner unk30; +}; // size = 0x70 + +struct RailroadCrossing { + /* 0x00 */ s16 type; + /* 0x02 */ s16 flags; + /* 0x04 */ s16 someTimer; + /* 0x06 */ s16 crossingId; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ Vec4s unk_10; + /* 0x18 */ Vec3f pos; + /* 0x24 */ Vec3f velocity; + /* 0x30 */ UnkActorInner unk30; +}; // size = 0x70 + +struct FallingRock { + /* 0x00 */ s16 type; + /* 0x02 */ s16 flags; + /* 0x04 */ s16 respawnTimer; + /* 0x06 */ s16 unk_06; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 boundingBoxSize; + /* 0x10 */ Vec3s rot; + /* 0x16 */ s16 unk_16; + /* 0x18 */ Vec3f pos; + /* 0x24 */ Vec3f velocity; + /* 0x30 */ UnkActorInner unk30; +}; // size = 0x70 + +struct YoshiValleyEgg { + /* 0x00 */ s16 type; + /* 0x02 */ s16 flags; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ f32 pathRadius; + /* 0x0C */ f32 boundingBoxSize; + /* 0x10 */ s16 pathRot; + /* 0x12 */ s16 eggRot; + /* 0x14 */ s16 unk_14; + /* 0x16 */ s16 unk_16; + /* 0x18 */ Vec3f pos; + // Note, pathCenter[1] should be understood to be the Y velocity of the egg + // pathCenter[0] and pathCenter[2] are the X,Z coordinates of the center of the path + /* 0x24 */ Vec3f pathCenter; + /* 0x30 */ UnkActorInner unk30; +}; // size = 0x70 + +struct KiwanoFruit { + /* 0x00 */ s16 type; + /* 0x02 */ s16 flags; + /* 0x04 */ s16 targetPlayer; // Id of the player this actor tracks. Each player has their own kiwano actor just for them + /* 0x06 */ s16 state; + /* 0x08 */ f32 bonkTimer; // bonkState? Not sure what this is tracking, but its some form of count down that starts after the fruit hits you + /* 0x0C */ f32 boundingBoxSize; + /* 0x10 */ s16 animState; + /* 0x12 */ s16 animTimer; + /* 0x14 */ s16 unk_14; + /* 0x16 */ s16 unk_16; + /* 0x18 */ Vec3f pos; + /* 0x24 */ Vec3f velocity; + /* 0x30 */ UnkActorInner unk30; +}; // size = 0x70 + +struct PaddleWheelBoat { + /* 0x00 */ s16 type; + /* 0x02 */ s16 flags; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 wheelRot; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ Vec3s boatRot; + /* 0x16 */ s16 unk_16; + /* 0x18 */ Vec3f pos; + /* 0x24 */ Vec3f velocity; + /* 0x30 */ UnkActorInner unk30; +}; // size = 0x70 + +struct PiranhaPlant { /* 0x00 */ s16 type; /* 0x02 */ s16 flags; /* 0x04 */ Vec4s visibilityStates; // A per-camera visibilty state tracker @@ -15,9 +129,9 @@ struct piranha_plant { /* 0x24 */ Vec4s timers; // A per-camera timer. Might be more appropriate to call this state /* 0x2C */ f32 unk_02C; /* 0x30 */ UnkActorInner unk30; -}; +}; // size = 0x70 -struct triple_shell_parent { +struct TripleShellParent { /* 0x00 */ s16 type; /* 0x02 */ s16 flags; /* 0x04 */ s16 shellsAvailable; @@ -33,7 +147,7 @@ struct triple_shell_parent { /* 0x30 */ UnkActorInner unk30; }; // size = 0x70 -struct shell_actor { +struct ShellActor { /* 0x00 */ s16 type; /* 0x02 */ s16 flags; // Index in D_8015F9B8 for the parent actor of this shell @@ -51,7 +165,7 @@ struct shell_actor { /* 0x30 */ UnkActorInner unk30; }; // size = 0x70 -struct item_box { +struct ItemBox { /* 0x00 */ s16 type; /* 0x02 */ s16 flags; /* 0x04 */ s16 someTimer; @@ -69,7 +183,7 @@ struct item_box { /* 0x30 */ UnkActorInner unk30; }; // size = 0x70 -struct fake_item_box { +struct FakeItemBox { /* 0x00 */ s16 type; /* 0x02 */ s16 flags; /* 0x04 */ s16 someTimer; @@ -85,7 +199,7 @@ struct fake_item_box { /* 0x30 */ UnkActorInner unk30; }; // size = 0x70 -struct banana_bunch_parent { +struct BananaBunchParent { /* 0x00 */ s16 type; /* 0x02 */ s16 flags; /* 0x04 */ s16 unk_04; @@ -100,7 +214,7 @@ struct banana_bunch_parent { /* 0x30 */ UnkActorInner unk30; }; // size = 0x70 -struct banana_actor { +struct BananaActor { /* 0x00 */ s16 type; /* 0x02 */ s16 flags; /* 0x04 */ s16 unk_04; @@ -108,28 +222,28 @@ struct banana_actor { /* 0x08 */ s16 parentIndex; /* 0x0A */ s16 bananaId; // ? Appears to indiciate which banana of the bunch this one is /* 0x0C */ f32 boundingBoxSize; - /* 0x10 */ s16 playerId; // Player that owns this particular banana - /* 0x12 */ s16 elderIndex; // Index of the next-oldest banana in the bunch - /* 0x14 */ s16 youngerIndex; // Index of the next-youngest banana in the bunch. -1 if this banana is the youngest - /* 0x16 */ s16 unk_16; // Index of the next-youngest banana in the bunch. -1 if this banana is the youngest + union { + /* 0x10 */ Vec3s rot; + /* 0x10 */ s16 playerId; // Id of the player that owns this banana + /* 0x12 */ s16 elderIndex; // Index in D_8015F9B8 of the next-oldest banana in the bunch + /* 0x14 */ s16 youngerIndex; // Index in D_8015F9B8 of the next-youngest banana in the bunch + }; + /* 0x16 */ s16 unk_16; /* 0x18 */ Vec3f pos; /* 0x24 */ Vec3f velocity; /* 0x30 */ UnkActorInner unk30; }; // size = 0x70 struct Actor { - /* 0x00 */ s16 unk0; // 0xC, 0xD, or 0x2B - #ifdef AVOID_UB - /* 0x02 */ u16 unk2; - #else - s16 unk2; // bitflags - #endif - /* 0x04 */ s16 unk4; // Timer? - /* 0x06 */ s16 unk6; // 1 // train wheel rot? - /* 0x08 */ f32 unk8; - f32 unkC; - /* 0x0C */ Vec3s unk10; // Actor rotation - /* 0x18 */ Vec3f unk18; - /* 0x24 */ Vec3f unk24; + /* 0x00 */ s16 type; + /* 0x02 */ s16 flags; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 state; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 boundingBoxSize; + /* 0x10 */ Vec3s rot; + /* 0x16 */ s16 unk_16; + /* 0x18 */ Vec3f pos; + /* 0x24 */ Vec3f velocity; /* 0x30 */ UnkActorInner unk30; -}; +}; // size = 0x70 diff --git a/src/code_80296A50.c b/src/code_80296A50.c index c73c4a904..75e53e291 100644 --- a/src/code_80296A50.c +++ b/src/code_80296A50.c @@ -198,242 +198,230 @@ GLOBAL_ASM("asm/non_matchings/code_actors/func_80296A50.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 -? func_80296A50(void *); /* extern */ -? func_802AAAAC(void *); /* extern */ -? func_802ADDC8(void *, f32, ?32, ?32, f32); /* extern */ -? func_802B5304(s32, s32); /* extern */ -? vec3f_copy(s32, s32); /* extern */ +//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd +? func_80296A50(struct Actor *); /* extern */ +? func_802AAAAC(UnkActorInner *); /* extern */ +? func_802ADDC8(UnkActorInner *, f32, f32, f32, f32); /* extern */ +? vec3s_copy(s16 *, s16 *); /* extern */ +? vec3f_copy(f32 *, f32 *); /* extern */ extern u16 D_8015F6FE; extern u16 D_802BA260; static f32 D_802B95F0 = 1.925f; static f32 D_802B95F4 = 0.35f; -void func_80296D10(void *arg0, s32 arg2, s32 arg3, s16 arg4) { - void *sp2C; +void func_80296D10(struct Actor *actor, s32 arg1, Vec3s arg2, Vec3f arg3, s16 actorType) { + UnkActorInner *sp2C; + UnkActorInner *temp_a0; f32 temp_f0; u16 temp_v0; - void *temp_a0; - u16 phi_v0; + s16 phi_v0; - vec3f_copy(arg0 + 0x18); - func_802B5304(arg0 + 0x10, arg2); - vec3f_copy(arg0 + 0x24, arg3); - arg0->unk2 = -0x8000; - arg0->unk4 = 0; - arg0->unk6 = 0; - temp_a0 = arg0 + 0x30; - arg0->unk0 = arg4; - arg0->unk8 = 0.0f; - arg0->unkC = 0.0f; + vec3f_copy(actor->pos); + vec3s_copy(actor->rot, arg2); + vec3f_copy(actor->velocity, arg3); + actor->flags = -0x8000; + actor->unk_04 = 0; + actor->state = 0; + temp_a0 = &actor->unk30; + actor->type = actorType; + actor->unk_08 = 0.0f; + actor->boundingBoxSize = 0.0f; sp2C = temp_a0; func_802AAAAC(temp_a0); - switch (arg4) { + switch (actorType) { case 37: temp_v0 = D_802BA260; - phi_v0 = temp_v0; - if (temp_v0 >= 3) { + phi_v0 = (s16) temp_v0; + if ((s32) temp_v0 >= 3) { D_802BA260 = 0; phi_v0 = 0 & 0xFFFF; } - arg0->unk6 = phi_v0; + actor->state = phi_v0; D_802BA260 += 1; return; - case 9: - arg0->unk2 = arg0->unk2 | 0x4000; - arg0->unk2C = arg0->unk20 + 70.0f; - arg0->unk8 = 70.0f; - arg0->unkC = 20.0f; - arg0->unk24 = arg0->unk18; - arg0->unk28 = arg0->unk1C; + case ACTOR_YOSHI_VALLEY_EGG: + actor->flags |= 0x4000; + actor->velocity[2] = actor->pos[2] + 70.0f; + actor->unk_08 = 70.0f; + actor->boundingBoxSize = 20.0f; + actor->velocity[0] = actor->pos[0]; + actor->velocity[1] = actor->pos[1]; return; - case 45: - arg0->unk6 = 0; - arg0->unk10 = 0; - arg0->unk12 = 0; - arg0->unk14 = 0; - arg0->unkC = 2.0f; + case ACTOR_KIWANO_FRUIT: + actor->state = 0; + actor->rot[0] = 0; + actor->rot[1] = 0; + actor->rot[2] = 0; + actor->boundingBoxSize = 2.0f; return; - case 5: - arg0->unk2 = arg0->unk2 | 0x4000; - arg0->unkC = 10.0f; + case ACTOR_FALLING_ROCK: + actor->flags |= 0x4000; + actor->boundingBoxSize = 10.0f; return; - case 15: - arg0->unk8 = 10.0f; + case ACTOR_TRAIN_ENGINE: + actor->unk_08 = 10.0f; return; - case 6: - arg0->unk2 = arg0->unk2 | 0x5000; - arg0->unkC = 2.0f; + case ACTOR_BANANA: + actor->flags |= 0x5000; + actor->boundingBoxSize = 2.0f; return; - case 7: + case ACTOR_GREEN_SHELL: D_8015F6FE += 1; - arg0->unk4 = 0; - arg0->unkC = 4.0f; - arg0->unk2 = arg0->unk2 | 0x7000; - if (D_8015F6FE >= 0x15) { - func_80296A50(arg0); + actor->unk_04 = 0; + actor->boundingBoxSize = 4.0f; + actor->flags |= 0x7000; + if ((s32) D_8015F6FE >= 0x15) { + func_80296A50(actor); return; } default: return; - case 8: + case ACTOR_RED_SHELL: D_8015F6FE += 1; - arg0->unk4 = 0; - arg0->unkC = 4.0f; - arg0->unk2 = arg0->unk2 | 0x7000; - if (D_8015F6FE >= 0x15) { - func_80296A50(arg0); + actor->unk_04 = 0; + actor->boundingBoxSize = 4.0f; + actor->flags |= 0x7000; + if ((s32) D_8015F6FE >= 0x15) { + func_80296A50(actor); return; } - /* Duplicate return node #30. Try simplifying control flow for better match */ - return; + break; case 2: D_8015F6FE += 1; - arg0->unk2 = arg0->unk2 | 0x4000; - arg0->unk6 = 0x43; - arg0->unkC = 3.0f; - arg0->unk8 = 20.0f; + actor->flags |= 0x4000; + actor->state = 0x0043; + actor->boundingBoxSize = 3.0f; + actor->unk_08 = 20.0f; return; case 3: - arg0->unk2 = arg0->unk2 | 0x4000; - arg0->unk6 = 0x43; - arg0->unkC = 3.0f; - arg0->unk8 = 23.0f; + actor->flags |= 0x4000; + actor->state = 0x0043; + actor->boundingBoxSize = 3.0f; + actor->unk_08 = 23.0f; return; case 4: - arg0->unk2 = arg0->unk2 | 0x4000; - arg0->unk6 = 0x43; - arg0->unkC = 3.0f; - arg0->unk8 = 17.0f; + actor->flags |= 0x4000; + actor->state = 0x0043; + actor->boundingBoxSize = 3.0f; + actor->unk_08 = 17.0f; return; case 19: - arg0->unk6 = 0x43; - arg0->unk2 = -0x8000; - arg0->unkC = 3.0f; - arg0->unk8 = 17.0f; + actor->state = 0x0043; + actor->flags = -0x8000; + actor->boundingBoxSize = 3.0f; + actor->unk_08 = 17.0f; return; case 26: - arg0->unk2 = arg0->unk2 | 0x4000; - arg0->unk6 = 0x43; - arg0->unkC = 3.0f; - arg0->unk8 = 17.0f; + actor->flags |= 0x4000; + actor->state = 0x0043; + actor->boundingBoxSize = 3.0f; + actor->unk_08 = 17.0f; return; case 28: - arg0->unk6 = 0x43; - arg0->unk2 = -0x8000; - arg0->unkC = 3.0f; - arg0->unk8 = 17.0f; + actor->state = 0x0043; + actor->flags = -0x8000; + actor->boundingBoxSize = 3.0f; + actor->unk_08 = 17.0f; return; case 33: - arg0->unk2 = arg0->unk2 | 0x4000; - arg0->unk6 = 0x43; - arg0->unkC = 3.0f; - arg0->unk8 = 17.0f; + actor->flags |= 0x4000; + actor->state = 0x0043; + actor->boundingBoxSize = 3.0f; + actor->unk_08 = 17.0f; return; case 29: - arg0->unk2 = arg0->unk2 | 0x4000; - arg0->unk6 = 0x43; - arg0->unkC = 3.0f; - arg0->unk8 = 17.0f; + actor->flags |= 0x4000; + actor->state = 0x0043; + actor->boundingBoxSize = 3.0f; + actor->unk_08 = 17.0f; return; case 30: - arg0->unk2 = arg0->unk2 | 0x4000; - arg0->unk6 = 0x19; - arg0->unkC = 3.0f; - arg0->unk8 = 7.0f; + actor->flags |= 0x4000; + actor->state = 0x0019; + actor->boundingBoxSize = 3.0f; + actor->unk_08 = 7.0f; return; case 31: - arg0->unk2 = arg0->unk2 | 0x4000; - arg0->unk6 = 0x19; - arg0->unkC = 3.0f; - arg0->unk8 = 7.0f; + actor->flags |= 0x4000; + actor->state = 0x0019; + actor->boundingBoxSize = 3.0f; + actor->unk_08 = 7.0f; return; case 32: - arg0->unk2 = arg0->unk2 | 0x4000; - arg0->unk6 = 0x19; - arg0->unkC = 3.0f; - arg0->unk8 = 7.0f; + actor->flags |= 0x4000; + actor->state = 0x0019; + actor->boundingBoxSize = 3.0f; + actor->unk_08 = 7.0f; return; case 25: - arg0->unk2 = arg0->unk2 | 0x4000; - arg0->unk6 = 0x3C; - arg0->unkC = 3.0f; - arg0->unk8 = 13.0f; + actor->flags |= 0x4000; + actor->state = 0x003C; + actor->boundingBoxSize = 3.0f; + actor->unk_08 = 13.0f; return; - case 13: + case ACTOR_FAKE_ITEM_BOX: temp_f0 = D_802B95F0; - arg0->unk2 = arg0->unk2 | 0x5000; - arg0->unkC = temp_f0; - arg0->unk8 = D_802B95F4; - func_802ADDC8(temp_a0, temp_f0, arg0->unk18, arg0->unk1C, arg0->unk20); + actor->flags |= 0x5000; + actor->boundingBoxSize = temp_f0; + actor->unk_08 = D_802B95F4; + func_802ADDC8(temp_a0, temp_f0, actor->pos[0], actor->pos[1], actor->pos[2]); return; - case 43: - arg0->unk2 = arg0->unk2 | 0x4000; - arg0->unk4 = 0; - arg0->unk6 = 5; - arg0->unkC = 5.5f; + case ACTOR_HOT_AIR_BALLOON_ITEM_BOX: + actor->flags |= 0x4000; + actor->unk_04 = 0; + actor->state = 5; + actor->boundingBoxSize = 5.5f; return; - case 12: - arg0->unk2 = arg0->unk2 | 0x4000; - arg0->unk4 = 0; - arg0->unk6 = 0; - arg0->unkC = 5.5f; - return; - case 10: - arg0->unk2 = arg0->unk2 | 0x4000; - arg0->unk6 = 0x1E; - arg0->unkC = 5.0f; - /* Duplicate return node #30. Try simplifying control flow for better match */ + case ACTOR_ITEM_BOX: + actor->flags |= 0x4000; + actor->unk_04 = 0; + actor->state = 0; + actor->boundingBoxSize = 5.5f; return; + case ACTOR_PIRANHA_PLANT: + actor->flags |= 0x4000; + actor->state = 0x001E; + actor->boundingBoxSize = 5.0f; + break; } } #else GLOBAL_ASM("asm/non_matchings/code_actors/func_80296D10.s") #endif -//#ifdef MIPS_TO_C -// 801646F0 // 80161B68 -// Actor leave screen void func_80297230(Camera *arg0, struct Actor *arg1) { - switch(arg0 - camera1) { // / 0xB8 + switch(arg0 - camera1) { case 0: - arg1->unk2 &= 0xFFFE; + arg1->flags &= 0xFFFE; break; case 1: - arg1->unk2 &= 0xFFFD; + arg1->flags &= 0xFFFD; break; case 2: - arg1->unk2 &= 0xFFFB; + arg1->flags &= 0xFFFB; break; case 3: - arg1->unk2 &= 0xFFF7; + arg1->flags &= 0xFFF7; break; } } -//#else -//GLOBAL_ASM("asm/non_matchings/code_actors/func_80297230.s") -//#endif -//#ifdef MIPS_TO_C void func_802972B8(Camera *arg0, struct Actor *arg1) { switch(arg0 - camera1) { case 0: - arg1->unk2 = (s16) (arg1->unk2 | 1); + arg1->flags |= 1; break; case 1: - arg1->unk2 = (s16) (arg1->unk2 | 2); + arg1->flags |= 2; break; case 2: - arg1->unk2 = (s16) (arg1->unk2 | 4); + arg1->flags |= 4; break; case 3: - arg1->unk2 = (s16) (arg1->unk2 | 8); + arg1->flags |= 8; break; } } -//#else -//GLOBAL_ASM("asm/non_matchings/code_actors/func_802972B8.s") -//#endif #ifdef MIPS_TO_C //generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 @@ -461,21 +449,21 @@ void func_80297340(Camera *arg0) { sp36 = D_8015F8D0.unk8; if ((D_800DC50C != CREDITS_SEQUENCE) && (mtxf_translate(&sp38, &D_8015F8D0), (func_802B4FF8(&sp38, 0) != 0))) { - if (sp36 < arg0->unk8) { + if (sp36 < arg0->unk_08) { if (D_800DC5BC != 0) { temp_v0 = gDisplayListHead; gDisplayListHead = temp_v0 + 8; temp_v0->unk0 = 0xF8000000; - temp_v0->unk4 = (D_801625EC << 0x18) | ((D_801625F4 & 0xFF) << 0x10) | ((D_801625F0 & 0xFF) << 8) | 0xFF; + temp_v0->unk_04 = (D_801625EC << 0x18) | ((D_801625F4 & 0xFF) << 0x10) | ((D_801625F0 & 0xFF) << 8) | 0xFF; temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; temp_v0_2->unk0 = 0x6000000; - temp_v0_2->unk4 = &D_0D001C20; + temp_v0_2->unk_04 = &D_0D001C20; return; } temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = 0xD001B90; + temp_v0_3->unk_04 = 0xD001B90; temp_v0_3->unk0 = 0x6000000; return; } @@ -483,16 +471,16 @@ void func_80297340(Camera *arg0) { temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; temp_v0_4->unk0 = 0xF8000000; - temp_v0_4->unk4 = (D_801625EC << 0x18) | ((D_801625F4 & 0xFF) << 0x10) | ((D_801625F0 & 0xFF) << 8) | 0xFF; + temp_v0_4->unk_04 = (D_801625EC << 0x18) | ((D_801625F4 & 0xFF) << 0x10) | ((D_801625F0 & 0xFF) << 8) | 0xFF; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; temp_v0_5->unk0 = 0x6000000; - temp_v0_5->unk4 = &D_0D001C88; + temp_v0_5->unk_04 = &D_0D001C88; return; } temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0xD001BD8; + temp_v0_6->unk_04 = 0xD001BD8; temp_v0_6->unk0 = 0x6000000; /* Duplicate return node #9. Try simplifying control flow for better match */ } @@ -530,9 +518,9 @@ void func_802976EC(UnkActorInner *arg0, Vec3s arg1) { f32 func_802ABE30(f32, f32, f32, u16); // extern void func_80297760(struct Actor *arg0, Vec3f arg1) { - arg1[0] = arg0->unk18[0]; - arg1[1] = arg0->unk18[1]; - arg1[2] = arg0->unk18[2]; + arg1[0] = arg0->pos[0]; + arg1[1] = arg0->pos[1]; + arg1[2] = arg0->pos[2]; arg1[1] = func_802ABE30(arg1[0], arg1[1], arg1[2], arg0->unk30.unk3A); } @@ -592,7 +580,7 @@ void func_80297818(void) { GLOBAL_ASM("asm/non_matchings/code_actors/func_80297818.s") #endif -extern s8 D_0D007B20[]; +extern Gfx D_0D007B20[]; void func_8029794C(Vec3f arg0, Vec3s arg1, f32 arg2) { Mat4 sp20; @@ -602,7 +590,7 @@ void func_8029794C(Vec3f arg0, Vec3s arg1, f32 arg2) { func_802B5F00(sp20, arg2); if (func_802B4FF8(sp20, 0) != 0) { - gSPDisplayList(gDisplayListHead++, &D_0D007B20); + gSPDisplayList(gDisplayListHead++, D_0D007B20); arg0[1] -= 2.0f; } } @@ -622,17 +610,18 @@ void func_802979F8(struct Actor *arg0, f32 arg1) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 -s32 func_802B4FF8(void *, ?); /* extern */ -f32 func_802B80D0(void *, u16, ?, f32, f32); /* extern */ +//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd +s32 func_802B4FF8(f32 (*)[4], ?); /* extern */ +f32 func_802B80D0(f32 *, u16, ?, f32, f32); /* extern */ extern ? D_06013C00; extern ? D_06013CA0; extern ? D_06013D20; extern ? D_06013DA0; extern ? D_06013E20; extern ? D_80150130; +static f32 D_802B95F8 = 4000000.0f; -void func_80297A50(Camera *camera, void *arg1, void *arg2) { +void func_80297A50(Camera *camera, f32 (*arg1)[4], struct Actor *arg2) { Gfx *temp_v0; Gfx *temp_v0_2; Gfx *temp_v0_3; @@ -640,40 +629,39 @@ void func_80297A50(Camera *camera, void *arg1, void *arg2) { Gfx *temp_v0_5; u16 temp_t0; - if (!(func_802B80D0(arg2 + 0x18, camera->rotX2, 0, *(&D_80150130 + (((camera - camera1) / 184) * 4)), D_802B95F8) < 0.0f) && (arg1->unk30 = arg2->unk18, arg1->unk34 = arg2->unk1C, arg1->unk38 = arg2->unk20, (func_802B4FF8(arg1, 0) != 0))) { - temp_t0 = arg2->unk6; + if (!(func_802B80D0(arg2->pos, (u16) camera->rotX2, 0, *(&D_80150130 + (((s32) (camera - camera1) / 184) * 4)), D_802B95F8) < 0.0f) && (arg1->unk30 = (f32) arg2->pos[0], arg1->unk34 = (f32) arg2->pos[1], arg1->unk38 = (f32) arg2->pos[2], (func_802B4FF8(arg1, 0) != 0))) { + temp_t0 = (u16) arg2->state; switch (temp_t0) { case 0: temp_v0 = gDisplayListHead; gDisplayListHead = temp_v0 + 8; - temp_v0->words.w0 = 0x6000000; - temp_v0->words.w1 = &D_06013C00; + temp_v0->words.w0 = 0x06000000; + temp_v0->words.w1 = (u32) &D_06013C00; return; case 1: temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->words.w0 = 0x6000000; - temp_v0_2->words.w1 = &D_06013CA0; + temp_v0_2->words.w0 = 0x06000000; + temp_v0_2->words.w1 = (u32) &D_06013CA0; return; case 2: temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->words.w0 = 0x6000000; - temp_v0_3->words.w1 = &D_06013D20; + temp_v0_3->words.w0 = 0x06000000; + temp_v0_3->words.w1 = (u32) &D_06013D20; return; case 3: temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->words.w0 = 0x6000000; - temp_v0_4->words.w1 = &D_06013DA0; + temp_v0_4->words.w0 = 0x06000000; + temp_v0_4->words.w1 = (u32) &D_06013DA0; return; case 4: temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->words.w0 = 0x6000000; - temp_v0_5->words.w1 = &D_06013E20; - /* Duplicate return node #9. Try simplifying control flow for better match */ - return; + temp_v0_5->words.w0 = 0x06000000; + temp_v0_5->words.w1 = (u32) &D_06013E20; + break; } } else { default: @@ -683,65 +671,54 @@ void func_80297A50(Camera *camera, void *arg1, void *arg2) { GLOBAL_ASM("asm/non_matchings/code_actors/func_80297A50.s") #endif -//#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -//f32 sins(s32, void *); // extern -//f32 coss(u16, void *); // extern extern f64 D_802B9610; -void update_obj_yoshi_valley_egg(struct Actor *arg0) { - //void *temp_a1; - - //temp_a1 = arg0; - arg0->unk10[0] += 0x5B; - //arg0 = temp_a1; - arg0->unk18[0] = arg0->unk24[0] + (sins(arg0->unk10[0]) * arg0->unk8); - arg0->unk18[2] = arg0->unk24[2] + (coss(arg0->unk10[0]) * arg0->unk8); - if ((arg0->unk2 & 0x400) != 0) { - arg0->unk24[1] -= D_802B9610; - if (arg0->unk24[1] < -3.0f) { - arg0->unk24[1] = -3.0f; +void update_obj_yoshi_valley_egg(struct YoshiValleyEgg *egg) { + egg->pathRot += 0x5B; + egg->pos[0] = egg->pathCenter[0] + (sins(egg->pathRot) * egg->pathRadius); + egg->pos[2] = egg->pathCenter[2] + (coss(egg->pathRot) * egg->pathRadius); + if ((egg->flags & 0x400) != 0) { + egg->pathCenter[1] -= D_802B9610; + if (egg->pathCenter[1] < -3.0f) { + egg->pathCenter[1] = -3.0f; } - arg0->unk18[1] += arg0->unk24[1]; - if (arg0->unk18[1] < 0.0f) { - arg0->unk18[1] = 0.0f; - arg0->unk24[1] = 0.0f; - arg0->unk2 &= 0xFBFF; + egg->pos[1] += egg->pathCenter[1]; + if (egg->pos[1] < 0.0f) { + egg->pos[1] = 0.0f; + egg->pathCenter[1] = 0.0f; + egg->flags &= 0xFBFF; } - arg0->unk10[1] -= 0x4FA; + egg->eggRot -= 0x4FA; } - arg0->unk10[1] -= 0x222; + egg->eggRot -= 0x222; } -//#else -//GLOBAL_ASM("asm/non_matchings/code_actors/update_obj_yoshi_valley_egg.s") -//#endif void update_obj_trees_cacti_shrubs(struct Actor *arg0) { - if (((arg0->unk2 & 0x800) == 0) && ((arg0->unk2 & 0x400) != 0)) { - arg0->unk18[1] = arg0->unk18[1] + 4.0f; - if (arg0->unk18[1] > 800.0f) { - arg0->unk2 |= 0x800; + if (((arg0->flags & 0x800) == 0) && ((arg0->flags & 0x400) != 0)) { + arg0->pos[1] = arg0->pos[1] + 4.0f; + if (arg0->pos[1] > 800.0f) { + arg0->flags |= 0x800; } } } #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_800C9060(f32, f32, s32, ?, void *, Player **); // extern -s32 func_802ABD10(u16, void *); // extern +//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd +? func_800C9060(f32, f32, s32, ?, struct KiwanoFruit *, Player **); /* extern */ +s32 func_802ABD10(u16); /* extern */ extern s32 D_80162DF8; extern ? D_80164438; extern s32 D_80164490; -extern f32 D_802B9618; -extern f32 D_802B961C; -extern f32 D_802B9620; -extern ? gPlayers; +static f32 D_802B9618 = 2.3f; +static f32 D_802B961C = 0.7f; +static f32 D_802B9620 = 0.3f; -void update_obj_kiwano_fruit(void *arg0) { - void *sp24; +void update_obj_kiwano_fruit(struct KiwanoFruit *fruit) { + Player *sp24; f32 sp20; f32 sp1C; f32 sp18; + Player *temp_v1; f32 temp_f12; f32 temp_f12_2; f32 temp_f14; @@ -752,149 +729,137 @@ void update_obj_kiwano_fruit(void *arg0) { f32 temp_f2; f32 temp_f2_2; s16 temp_a0; - s32 temp_t7; + s16 temp_t6; s32 temp_v0_2; - void *temp_a2; - void *temp_a2_2; + struct KiwanoFruit *temp_a2; void *temp_v0; - void *temp_v1; - void *phi_a2; s16 phi_a0; - void *phi_a2_2; - void *phi_a2_3; + struct KiwanoFruit *phi_a2; + struct KiwanoFruit *phi_a2_2; - temp_t7 = arg0->unk4 * 0xDD8; - temp_v1 = temp_t7 + &gPlayers; - temp_a2 = arg0; - phi_a2 = temp_a2; - phi_a2_2 = temp_a2; - phi_a2_3 = temp_a2; - if (((temp_v1->unk0 & 0x1000) != 0) || (temp_v1->unk114 == 0)) { - temp_a2->unk6 = 0; + temp_t6 = fruit->targetPlayer; + temp_v1 = &gPlayers[temp_t6]; + phi_a2 = fruit; + phi_a2_2 = fruit; + if (((temp_v1->unk_000 & 0x1000) != 0) || (temp_v1->unk_110.unk34 == 0)) { + fruit->state = 0; return; } - temp_a0 = temp_a2->unk6; + temp_a0 = fruit->state; phi_a0 = temp_a0; - if (temp_a0 != 0) { - if (temp_a0 != 1) { - if (temp_a0 != 2) { - - } else { - temp_a2->unk28 = temp_a2->unk28 - D_802B9620; - temp_a2->unk18 = temp_a2->unk18 + temp_a2->unk24; - temp_a2->unk1C = temp_a2->unk1C + temp_a2->unk28; - temp_a2->unk20 = temp_a2->unk20 + temp_a2->unk2C; - temp_a2->unk8 = temp_a2->unk8 - 1.0f; - if (temp_a2->unk8 < 0.0f) { - temp_a2->unk6 = 0; - } - goto block_17; - } - } else { - goto block_9; - } - goto block_18; - } - arg0 = temp_a2; - sp24 = temp_v1; - phi_a2 = arg0; - if ((func_802ABD10(temp_v1->unk11A, temp_a2) & 0xFF) == 8) { - arg0->unk6 = 1; - arg0->unk24 = 80.0f; -block_9: - temp_v0 = D_80164490 + (*(&D_80164438 + (((((temp_t7 + &gPlayers) - gPlayerOne) / 0xDD8) & 0xFFFF) * 2)) * 8); - temp_f2 = (temp_t7 + &gPlayers)->unk14 - temp_v0->unk0; - arg0 = phi_a2; - sp20 = temp_f2; - sp24 = temp_t7 + &gPlayers; - temp_f16 = (temp_t7 + &gPlayers)->unk18 - temp_v0->unk2; - sp1C = temp_f16; - temp_f14 = (temp_t7 + &gPlayers)->unk1C - temp_v0->unk4; - sp18 = temp_f14; - temp_a2_2 = arg0; - temp_f18 = temp_a2_2->unk24; - temp_f12 = temp_f18 / sqrtf((temp_f2 * temp_f2) + (temp_f16 * temp_f16) + (temp_f14 * temp_f14)); - temp_f2_2 = temp_f2 * temp_f12; - temp_f16_2 = temp_f16 * temp_f12; - temp_a2_2->unk18 = (temp_t7 + &gPlayers)->unk14 + temp_f2_2; - temp_f14_2 = temp_f14 * temp_f12; - temp_a2_2->unk1C = (temp_t7 + &gPlayers)->unk18 + temp_f16_2; - temp_a2_2->unk24 = temp_f18 - 2.0f; - temp_a2_2->unk20 = (temp_t7 + &gPlayers)->unk1C + temp_f14_2; - phi_a2_3 = temp_a2_2; - if (temp_a2_2->unk24 <= 0.0f) { - temp_a2_2->unk6 = 2; - temp_a2_2->unk8 = 30.0f; - temp_a2_2->unk24 = 0.0f; - temp_a2_2->unk28 = D_802B9618; - temp_a2_2->unk2C = 0.0f; - temp_v0_2 = (temp_t7 + &gPlayers)->unkBC; - if ((temp_v0_2 & 0x200) != 0) { - arg0 = temp_a2_2; - func_800C9060(temp_f12, temp_f14_2, (((temp_t7 + &gPlayers) - gPlayerOne) / 0xDD8) & 0xFF, 0x1900A052, temp_a2_2, &gPlayerOne); - phi_a2_3 = arg0; - } else { - temp_f12_2 = D_802B961C; - (temp_t7 + &gPlayers)->unkBC = temp_v0_2 | 0x8000; - (temp_t7 + &gPlayers)->unk14 = (temp_t7 + &gPlayers)->unk14 - (temp_f2_2 * 4.0f); - (temp_t7 + &gPlayers)->unk1C = (temp_t7 + &gPlayers)->unk1C - (temp_f14_2 * 4.0f); - (temp_t7 + &gPlayers)->unk34 = (temp_t7 + &gPlayers)->unk34 - (temp_f2_2 * temp_f12_2); - (temp_t7 + &gPlayers)->unk3C = (temp_t7 + &gPlayers)->unk3C - (temp_f14_2 * temp_f12_2); - arg0 = temp_a2_2; - func_800C9060(temp_f12_2, temp_f14_2, (((temp_t7 + &gPlayers) - gPlayerOne) / 0xDD8) & 0xFF, 0x19007018, temp_a2_2, &gPlayerOne); - phi_a2_3 = arg0; - if (gModeSelection != GRAND_PRIX) { - D_80162DF8 = 1; + switch (temp_a0) { /* irregular */ + case 0: + fruit = fruit; + sp24 = temp_v1; + if ((func_802ABD10(temp_v1->unk_110.unk3A) & 0xFF) == 8) { + fruit->state = 1; + fruit->velocity[0] = 80.0f; + case 1: + temp_v0 = D_80164490 + (*(&D_80164438 + ((((s32) (&gPlayers[temp_t6] - gPlayerOne) / 3544) & 0xFFFF) * 2)) * 8); + temp_f2 = gPlayers[temp_t6].pos[0] - (f32) temp_v0->unk0; + fruit = fruit; + sp20 = temp_f2; + sp24 = &gPlayers[temp_t6]; + temp_f16 = gPlayers[temp_t6].pos[1] - (f32) temp_v0->unk2; + sp1C = temp_f16; + temp_f14 = gPlayers[temp_t6].pos[2] - (f32) temp_v0->unk_04; + sp18 = temp_f14; + temp_a2 = fruit; + temp_f18 = temp_a2->velocity[0]; + temp_f12 = temp_f18 / sqrtf((temp_f2 * temp_f2) + (temp_f16 * temp_f16) + (temp_f14 * temp_f14)); + temp_f2_2 = temp_f2 * temp_f12; + temp_f16_2 = temp_f16 * temp_f12; + temp_a2->pos[0] = gPlayers[temp_t6].pos[0] + temp_f2_2; + temp_f14_2 = temp_f14 * temp_f12; + temp_a2->pos[1] = gPlayers[temp_t6].pos[1] + temp_f16_2; + temp_a2->velocity[0] = temp_f18 - 2.0f; + temp_a2->pos[2] = gPlayers[temp_t6].pos[2] + temp_f14_2; + phi_a2_2 = temp_a2; + if (temp_a2->velocity[0] <= 0.0f) { + temp_a2->state = 2; + temp_a2->bonkTimer = 30.0f; + temp_a2->velocity[0] = 0.0f; + temp_a2->velocity[1] = D_802B9618; + temp_a2->velocity[2] = 0.0f; + temp_v0_2 = gPlayers[temp_t6].unk_0BC; + if ((temp_v0_2 & 0x200) != 0) { + fruit = temp_a2; + func_800C9060(temp_f12, temp_f14_2, ((s32) (&gPlayers[temp_t6] - gPlayerOne) / 3544) & 0xFF, 0x1900A052, temp_a2, &gPlayerOne); + phi_a2_2 = fruit; + } else { + temp_f12_2 = D_802B961C; + gPlayers[temp_t6].unk_0BC = temp_v0_2 | 0x8000; + gPlayers[temp_t6].pos[0] -= temp_f2_2 * 4.0f; + gPlayers[temp_t6].pos[2] -= temp_f14_2 * 4.0f; + gPlayers[temp_t6].unk_034 -= temp_f2_2 * temp_f12_2; + gPlayers[temp_t6].unk_03C -= temp_f14_2 * temp_f12_2; + fruit = temp_a2; + func_800C9060(temp_f12_2, temp_f14_2, ((s32) (&gPlayers[temp_t6] - gPlayerOne) / 3544) & 0xFF, 0x19007018, temp_a2, &gPlayerOne); + phi_a2_2 = fruit; + if (gModeSelection != 0) { + D_80162DF8 = 1; + } } } - } block_17: - phi_a0 = phi_a2_3->unk6; - phi_a2_2 = phi_a2_3; -block_18: - if (phi_a0 != 0) { - phi_a2_2->unk12 = phi_a2_2->unk12 + 1; - if (phi_a2_2->unk12 == 8) { - phi_a2_2->unk12 = 0; - phi_a2_2->unk10 = phi_a2_2->unk10 + 1; - if (phi_a2_2->unk10 == 3) { - phi_a2_2->unk10 = 0; + phi_a0 = phi_a2_2->state; + phi_a2 = phi_a2_2; + default: + if (phi_a0 != 0) { + phi_a2->animTimer += 1; + if (phi_a2->animTimer == 8) { + phi_a2->animTimer = 0; + phi_a2->animState += 1; + if (phi_a2->animState == 3) { + phi_a2->animState = 0; + } } } } + break; + case 2: + fruit->velocity[1] -= D_802B9620; + fruit->pos[0] += fruit->velocity[0]; + fruit->pos[1] += fruit->velocity[1]; + fruit->pos[2] += fruit->velocity[2]; + fruit->bonkTimer -= 1.0f; + if (fruit->bonkTimer < 0.0f) { + fruit->state = 0; + } + goto block_17; } } #else GLOBAL_ASM("asm/non_matchings/code_actors/update_obj_kiwano_fruit.s") #endif -void update_obj_paddle_wheel(struct Actor *arg0) { - arg0->unk6 += 0x38E; +void update_obj_paddle_wheel(struct PaddleWheelBoat *boat) { + boat->wheelRot += 0x38E; } extern void func_800C9D80(Vec3f *arg0, Vec3f *arg1, u32 arg2); // extern // wheels -void update_obj_train_engine(struct Actor *arg0) { - arg0->unk6 -= 0x666; +void update_obj_train_engine(struct TrainCar *arg0) { + arg0->wheelRot -= 0x666; - if (arg0->unk8 != 0.0f) { - arg0->unk8 = 0.0f; - func_800C9D80(&arg0->unk18, &arg0->unk24, 0x51018000); + if (arg0->unk_08 != 0.0f) { + arg0->unk_08 = 0.0f; + func_800C9D80(arg0->pos, arg0->velocity, 0x51018000); } } // wheels -void update_obj_train_car1(struct Actor *arg0) { - arg0->unk6 -= 0x4FA; +void update_obj_train_car1(struct TrainCar *arg0) { + arg0->wheelRot -= 0x4FA; } // wheels -void update_obj_train_car2(struct Actor *arg0) { - arg0->unk6 -= 0x666; +void update_obj_train_car2(struct TrainCar *arg0) { + arg0->wheelRot -= 0x666; } -void update_obj_piranha_plant(struct piranha_plant *arg0) { +void update_obj_piranha_plant(struct PiranhaPlant *arg0) { if ((arg0->flags & 0x800) == 0) { if ((arg0->flags & 0x400) != 0) { arg0->pos[1] += 4.0f; @@ -940,167 +905,157 @@ void update_obj_piranha_plant(struct piranha_plant *arg0) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_802B4FF8(void *, ?); // extern -f32 func_802B80D0(void *, u16, ?, f32, f32); // extern +//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd +s32 func_802B4FF8(f32 (*)[4], ?); /* extern */ +f32 func_802B80D0(f32 *, u16, ?, f32, f32); /* extern */ extern ? D_06006990; -extern f32 D_802B9624; -extern f32 D_802B9628; +extern ? D_80150130; extern s32 D_802BA058; +static f32 D_802B9624 = 1000000.0f; +static f32 D_802B9628 = 90000.0f; +s16 gCurrentCourseId; /* unable to generate initializer */ - -void func_80298328(void *arg0, void *arg1, void *arg2) { +void func_80298328(Camera *camera, Mat4 arg1, struct PiranhaPlant *actor) { s16 sp36; f32 sp2C; + Gfx *temp_v0; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; f32 temp_f0; f32 temp_f2; s32 temp_lo; s32 temp_lo_2; - void *temp_v0; - void *temp_v0_2; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - void *temp_v0_6; - void *temp_v0_7; - void *temp_v0_8; - void *temp_v0_9; - s32 phi_t4; + s16 phi_t4; s16 phi_t4_2; - temp_lo = (arg0 - camera1) / 0xB8; - if ((arg2->unk2 & 0x800) == 0) { - sp36 = temp_lo; - temp_f0 = func_802B80D0(arg2 + 0x18, arg0->unk26, 0, (&D_80150130)[temp_lo], D_802B9624); + temp_lo = (s32) (camera - camera1) / 184; + if ((actor->flags & 0x800) == 0) { + sp36 = (s16) temp_lo; + temp_f0 = func_802B80D0(actor->pos, (u16) camera->rotX2, 0, *(&D_80150130 + (temp_lo * 4)), D_802B9624); temp_f2 = temp_f0; if (temp_f0 < 0.0f) { - if (sp36 != 0) { - if (sp36 != 1) { - if (sp36 != 2) { - if (sp36 != 3) { - return; - } - arg2->unkA = -1; - return; + switch (sp36) { /* switch 2; irregular */ + case 0: /* switch 2 */ + actor->visibilityStates[0] = -1; + return; + case 1: /* switch 2 */ + actor->visibilityStates[1] = -1; + return; + case 2: /* switch 2 */ + actor->visibilityStates[2] = -1; + return; + case 3: /* switch 2 */ + actor->visibilityStates[3] = -1; + return; + } + } else { + arg1->unk30 = (f32) actor->pos[0]; + arg1->unk34 = (f32) actor->pos[1]; + arg1->unk38 = (f32) actor->pos[2]; + sp2C = temp_f2; + sp36 = sp36; + if (func_802B4FF8(arg1, 0) != 0) { + if (D_802B9628 < temp_f2) { + phi_t4 = 0; + switch (sp36) { /* switch 1; irregular */ + case 0: /* switch 1 */ + actor->visibilityStates[0] = 0; + break; + case 1: /* switch 1 */ + actor->visibilityStates[1] = 0; + break; + case 2: /* switch 1 */ + actor->visibilityStates[2] = 0; + break; + case 3: /* switch 1 */ + actor->visibilityStates[3] = 0; + break; } - arg2->unk8 = -1; + } else { + switch (sp36) { /* irregular */ + case 0: + actor->visibilityStates[0] = 1; + break; + case 1: + actor->visibilityStates[1] = 1; + break; + case 2: + actor->visibilityStates[2] = 1; + break; + case 3: + actor->visibilityStates[3] = 1; + break; + } + if (sp36 != 0) { + if (sp36 != 1) { + if (sp36 != 2) { + if (sp36 != 3) { + phi_t4 = sp34; + } else { + phi_t4 = actor->timers[3]; + } + } else { + phi_t4 = actor->timers[2]; + } + } else { + phi_t4 = actor->timers[1]; + } + } else { + phi_t4 = actor->timers[0]; + } + } + temp_lo_2 = phi_t4 / 6; + phi_t4_2 = (s16) temp_lo_2; + if ((s16) temp_lo_2 >= 9) { + phi_t4_2 = 8; + } + temp_v0 = gDisplayListHead; + gDisplayListHead = temp_v0 + 8; + temp_v0->words.w0 = 0xFD500000; + temp_v0->words.w1 = ((phi_t4_2 << 0xB) + D_802BA058) & 0x1FFFFFFF; + temp_v0_2 = gDisplayListHead; + gDisplayListHead = temp_v0_2 + 8; + temp_v0_2->words.w0 = 0xF5500000; + temp_v0_2->words.w1 = 0x07080100; + temp_v0_3 = gDisplayListHead; + gDisplayListHead = temp_v0_3 + 8; + temp_v0_3->words.w1 = 0; + temp_v0_3->words.w0 = 0xE6000000; + temp_v0_4 = gDisplayListHead; + gDisplayListHead = temp_v0_4 + 8; + temp_v0_4->words.w1 = 0x073FF200; + temp_v0_4->words.w0 = 0xF3000000; + temp_v0_5 = gDisplayListHead; + gDisplayListHead = temp_v0_5 + 8; + temp_v0_5->words.w1 = 0; + temp_v0_5->words.w0 = 0xE7000000; + temp_v0_6 = gDisplayListHead; + gDisplayListHead = temp_v0_6 + 8; + temp_v0_6->words.w0 = 0xF5480800; + temp_v0_6->words.w1 = 0x00080100; + temp_v0_7 = gDisplayListHead; + gDisplayListHead = temp_v0_7 + 8; + temp_v0_7->words.w0 = 0xF2000000; + temp_v0_7->words.w1 = 0x0007C0FC; + if (gCurrentCourseId == 0) { + temp_v0_8 = gDisplayListHead; + gDisplayListHead = temp_v0_8 + 8; + temp_v0_8->words.w1 = (u32) &D_06006990; + temp_v0_8->words.w0 = 0x06000000; return; } - arg2->unk6 = -1; - return; + temp_v0_9 = gDisplayListHead; + gDisplayListHead = temp_v0_9 + 8; + temp_v0_9->words.w1 = 0x0600D850; + temp_v0_9->words.w0 = 0x06000000; } - arg2->unk4 = -1; - return; } - arg1->unk30 = arg2->unk18; - arg1->unk34 = arg2->unk1C; - arg1->unk38 = arg2->unk20; - sp2C = temp_f2; - sp36 = sp36; - if (func_802B4FF8(arg1, 0) != 0) { - if (D_802B9628 < temp_f2) { - phi_t4 = 0; - if (sp36 != 0) { - if (sp36 != 1) { - if (sp36 != 2) { - if (sp36 != 3) { - - } else { - arg2->unkA = 0; - } - } else { - arg2->unk8 = 0; - } - } else { - arg2->unk6 = 0; - } - } else { - arg2->unk4 = 0; - } - } else { - if (sp36 != 0) { - if (sp36 != 1) { - if (sp36 != 2) { - if (sp36 != 3) { - - } else { - arg2->unkA = 1; - } - } else { - arg2->unk8 = 1; - } - } else { - arg2->unk6 = 1; - } - } else { - arg2->unk4 = 1; - } - if (sp36 != 0) { - if (sp36 != 1) { - if (sp36 != 2) { - if (sp36 != 3) { - phi_t4 = sp34; - } else { - phi_t4 = arg2->unk2A; - } - } else { - phi_t4 = arg2->unk28; - } - } else { - phi_t4 = arg2->unk26; - } - } else { - phi_t4 = arg2->unk24; - } - } - temp_lo_2 = phi_t4 / 6; - phi_t4_2 = temp_lo_2; - if (temp_lo_2 >= 9) { - phi_t4_2 = 8; - } - temp_v0 = gDisplayListHead; - gDisplayListHead = temp_v0 + 8; - temp_v0->unk0 = 0xFD500000; - temp_v0->unk4 = ((phi_t4_2 << 0xB) + D_802BA058) & 0x1FFFFFFF; - temp_v0_2 = gDisplayListHead; - gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0xF5500000; - temp_v0_2->unk4 = 0x7080100; - temp_v0_3 = gDisplayListHead; - gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = 0; - temp_v0_3->unk0 = 0xE6000000; - temp_v0_4 = gDisplayListHead; - gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x73FF200; - temp_v0_4->unk0 = 0xF3000000; - temp_v0_5 = gDisplayListHead; - gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0; - temp_v0_5->unk0 = 0xE7000000; - temp_v0_6 = gDisplayListHead; - gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk0 = 0xF5480800; - temp_v0_6->unk4 = 0x80100; - temp_v0_7 = gDisplayListHead; - gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk0 = 0xF2000000; - temp_v0_7->unk4 = 0x7C0FC; - if (gCurrentCourseId == 0) { - temp_v0_8 = gDisplayListHead; - gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = &D_06006990; - temp_v0_8->unk0 = 0x6000000; - return; - } - temp_v0_9 = gDisplayListHead; - gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk4 = 0x600D850; - temp_v0_9->unk0 = 0x6000000; - // Duplicate return node #45. Try simplifying control flow for better match - return; - } - // Duplicate return node #45. Try simplifying control flow for better match } } #else @@ -1108,21 +1063,30 @@ GLOBAL_ASM("asm/non_matchings/code_actors/func_80298328.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 +//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd ? func_800C98B8(? *, ? *, ?); /* extern */ ? func_800C99E0(? *, ?); /* extern */ -s32 func_802B4FF8(void *, ?); /* extern */ +s32 func_802B4FF8(f32 (*)[4], ?); /* extern */ +f32 func_802B80D0(Camera *, f32 *, u16, f32, f32, f32); /* extern */ extern ? D_06013C00; extern ? D_06013CA0; extern ? D_06013D20; extern ? D_06013DA0; extern ? D_06013E20; extern ? D_06014200; +extern u16 D_80150112; extern ? D_80150130; +extern u16 D_8015F700; +extern u16 D_8015F702; +extern f32 D_8015F704; extern ? D_8015F708; +extern f32 gCourseDirection; static ? D_802B91C8; /* unable to generate initializer */ +static f32 D_802B962C = 6.4e7f; +static f32 D_802B9630 = 4000000.0f; +static f32 D_802B9648 = 160000.0f; -void func_802986B4(Camera *camera, void *arg1, void *arg2) { +void func_802986B4(Camera *camera, f32 (*arg1)[4], struct Actor *arg2) { s16 *sp9C; f32 sp90; f32 sp8C; @@ -1150,19 +1114,19 @@ void func_802986B4(Camera *camera, void *arg1, void *arg2) { s16 *phi_s5_2; s16 *phi_s5_3; - temp_t1 = gSegmentTable[&D_06014200 >> 0x18] + (&D_06014200 & 0xFFFFFF) + 0x80000000; + temp_t1 = gSegmentTable[(u32) &D_06014200 >> 0x18] + ((s32) &D_06014200 & 0xFFFFFF) + 0x80000000; D_8015F704 = D_802B962C; temp_v0 = gDisplayListHead; gDisplayListHead = temp_v0 + 8; - temp_v0->words.w1 = -1; + temp_v0->words.w1 = -1U; temp_v0->words.w0 = 0xBB000001; temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->words.w1 = -0xC07; + temp_v0_2->words.w1 = -0x00000C07U; temp_v0_2->words.w0 = 0xFC127E24; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->words.w1 = 0x553078; + temp_v0_3->words.w1 = 0x00553078; temp_v0_3->words.w0 = 0xB900031D; phi_s1 = temp_t1; phi_s5 = NULL; @@ -1173,10 +1137,10 @@ void func_802986B4(Camera *camera, void *arg1, void *arg2) { phi_v0 = *temp_t1; loop_2: temp_a1 = &sp88; - sp88 = phi_v0 * gCourseDirection; - sp8C = phi_s1->unk2; - sp90 = phi_s1->unk4; - temp_f0 = func_802B80D0(camera, temp_a1, camera->rotX2, 0.0f, *(&D_80150130 + (((camera - camera1) / 184) * 4)), D_802B9630); + sp88 = (f32) phi_v0 * gCourseDirection; + sp8C = (f32) phi_s1->unk2; + sp90 = (f32) phi_s1->unk_04; + temp_f0 = func_802B80D0(camera, temp_a1, (u16) camera->rotX2, 0.0f, *(&D_80150130 + (((s32) (camera - camera1) / 184) * 4)), D_802B9630); phi_s5_2 = phi_s5_3; phi_s5_2 = phi_s5_3; if (temp_f0 > 0.0f) { @@ -1187,79 +1151,76 @@ loop_2: arg1->unk30 = sp88; arg1->unk34 = sp8C; arg1->unk38 = sp90; - if ((D_80150112 < 0x80) && (func_802B4FF8(arg1, 0) != 0)) { + if (((s32) D_80150112 < 0x80) && (func_802B4FF8(arg1, 0) != 0)) { temp_t4 = phi_s1->unk6; switch (temp_t4) { case 0: temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->words.w1 = &D_06013C00; + temp_v0_4->words.w1 = (u32) &D_06013C00; phi_v0_2 = temp_v0_4; block_14: - phi_v0_2->words.w0 = 0x6000000; + phi_v0_2->words.w0 = 0x06000000; break; case 1: temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->words.w1 = &D_06013CA0; + temp_v0_5->words.w1 = (u32) &D_06013CA0; phi_v0_2 = temp_v0_5; goto block_14; case 2: temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->words.w1 = &D_06013D20; + temp_v0_6->words.w1 = (u32) &D_06013D20; phi_v0_2 = temp_v0_6; goto block_14; case 3: temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->words.w1 = &D_06013DA0; + temp_v0_7->words.w1 = (u32) &D_06013DA0; phi_v0_2 = temp_v0_7; goto block_14; case 4: temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->words.w1 = &D_06013E20; + temp_v0_8->words.w1 = (u32) &D_06013E20; phi_v0_2 = temp_v0_8; goto block_14; } goto block_15; } - /* Duplicate return node #24. Try simplifying control flow for better match */ - return; - } + } else { block_15: - temp_v0_9 = phi_s1->unk8; - phi_v0 = temp_v0_9; - phi_s1 += 8; - phi_s5 = phi_s5_2; - phi_s5_3 = phi_s5_2; - if (temp_v0_9 == -0x8000) { - phi_t1 = sp9C; - goto block_17; - } - goto loop_2; - } -block_17: - if ((camera == camera1) && (phi_s5 != 0)) { - temp_v0_10 = D_8015F700; - if (temp_v0_10 == 0) { - temp_s1 = ((phi_s5 - phi_t1) >> 3) & 0xFFFF; - if ((D_8015F702 != temp_s1) && (D_8015F704 < D_802B9648)) { - func_800C99E0(&D_8015F708, 0x1901904D); - D_8015F708.unk0 = phi_s5->unk0 * gCourseDirection; - D_8015F708.unk4 = phi_s5->unk2; - D_8015F708.unk8 = phi_s5->unk4; - D_8015F702 = temp_s1; - func_800C98B8(&D_8015F708, &D_802B91C8, 0x1901904D); - D_8015F700 = 0xF0; - return; + temp_v0_9 = phi_s1->unk_08; + phi_v0 = temp_v0_9; + phi_s1 += 8; + phi_s5 = phi_s5_2; + phi_s5_3 = phi_s5_2; + if (temp_v0_9 == -0x8000) { + phi_t1 = sp9C; + goto block_17; + } + goto loop_2; + } + } else { +block_17: + if ((camera == camera1) && (phi_s5 != NULL)) { + temp_v0_10 = D_8015F700; + if (temp_v0_10 == 0) { + temp_s1 = ((s32) (phi_s5 - phi_t1) >> 3) & 0xFFFF; + if ((D_8015F702 != temp_s1) && (D_8015F704 < D_802B9648)) { + func_800C99E0(&D_8015F708, 0x1901904D); + D_8015F708.unk0 = (f32) ((f32) phi_s5->unk0 * gCourseDirection); + D_8015F708.unk4 = (f32) phi_s5->unk2; + D_8015F708.unk8 = (f32) phi_s5->unk_04; + D_8015F702 = temp_s1; + func_800C98B8(&D_8015F708, &D_802B91C8, 0x1901904D); + D_8015F700 = 0x00F0; + } + } else { + D_8015F700 = temp_v0_10 - 1; } - /* Duplicate return node #24. Try simplifying control flow for better match */ - return; } - D_8015F700 = temp_v0_10 - 1; - /* Duplicate return node #24. Try simplifying control flow for better match */ } } #else @@ -1267,17 +1228,16 @@ GLOBAL_ASM("asm/non_matchings/code_actors/func_802986B4.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_800C9060(s32, ?); // extern -? func_800C90F4(s32, s32); // extern -? func_800C98B8(void *, void *, ?); // extern -s32 func_8029EEB8(void *, f32 *, ?, ?, f32); // extern +//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd +? func_800C9060(s32, ?); /* extern */ +? func_800C90F4(s32, s32); /* extern */ +? func_800C98B8(f32 *, f32 *, ?); /* extern */ +s32 func_8029EEB8(Player *, f32 *, ?, ?, f32); /* extern */ extern ? D_06013F78; -extern f32 D_802B964C; extern f32 gCourseDirection; -extern ? gSegmentTable; +static f32 D_802B964C = 0.8f; -void func_80298AC0(void *arg0) { +void func_80298AC0(Player *player) { f32 sp6C; f32 sp68; f32 sp64; @@ -1288,37 +1248,35 @@ void func_80298AC0(void *arg0) { s16 phi_v0; s16 *phi_s0; - temp_s0 = *(&gSegmentTable + ((&D_06013F78 >> 0x18) * 4)) + (&D_06013F78 & 0xFFFFFF) + 0x80000000; + temp_s0 = gSegmentTable[(u32) &D_06013F78 >> 0x18] + ((s32) &D_06013F78 & 0xFFFFFF) + 0x80000000; temp_v0 = *temp_s0; phi_v0 = temp_v0; phi_s0 = temp_s0; if (temp_v0 != -0x8000) { loop_2: temp_a1 = &sp64; - sp64 = phi_v0 * gCourseDirection; - sp68 = phi_s0->unk2; - sp6C = phi_s0->unk4; - if (func_8029EEB8(arg0, temp_a1, 0x40A00000, 0x42200000, D_802B964C) == 1) { - if ((arg0->unkBC & 0x200) != 0) { - func_800C98B8(arg0 + 0x14, arg0 + 0x34, 0x19018010); - func_800C90F4(((arg0 - gPlayerOne) / 0xDD8) & 0xFF, (arg0->unk254 * 0x10) + 0x2900800D); - phi_s0->unk6 = phi_s0->unk6 | 0x400; + sp64 = (f32) phi_v0 * gCourseDirection; + sp68 = (f32) phi_s0->unk2; + sp6C = (f32) phi_s0->unk_04; + if (func_8029EEB8(player, temp_a1, 0x40A00000, 0x42200000, D_802B964C) == 1) { + if ((player->unk_0BC & 0x200) != 0) { + func_800C98B8(player->pos, &player->unk_034, 0x19018010); + func_800C90F4(((s32) (player - gPlayerOne) / 3544) & 0xFF, (player->characterId * 0x10) + 0x2900800D); + phi_s0->unk6 = (s16) (phi_s0->unk6 | 0x400); } - if ((arg0->unk0 & 0x100) == 0) { - func_800C9060(((arg0 - gPlayerOne) / 0xDD8) & 0xFF, 0x19007018); - return; + if ((player->unk_000 & 0x100) == 0) { + func_800C9060(((s32) (player - gPlayerOne) / 3544) & 0xFF, 0x19007018); + } + } else { + temp_v0_2 = phi_s0->unkA; + phi_v0 = temp_v0_2; + phi_s0 += 0xA; + if (temp_v0_2 == -0x8000) { + + } else { + goto loop_2; } - // Duplicate return node #8. Try simplifying control flow for better match - return; } - temp_v0_2 = phi_s0->unkA; - phi_v0 = temp_v0_2; - phi_s0 += 0xA; - if (temp_v0_2 == -0x8000) { - // Duplicate return node #8. Try simplifying control flow for better match - return; - } - goto loop_2; } } #else @@ -1369,7 +1327,7 @@ void func_80298D10(void) { do { phi_v1->unk6 = phi_v1->unk6 & 0xF; temp_v1_2 = phi_v1 + 0xA; - temp_v1_2->unk-8 = phi_v1->unk8; + temp_v1_2->unk-8 = phi_v1->unk_08; phi_v1 = temp_v1_2; } while (phi_v1->unkA != -0x8000); } @@ -1379,69 +1337,66 @@ GLOBAL_ASM("asm/non_matchings/code_actors/func_80298D10.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_802B4FF8(? *, ?); // extern -? func_802B5F74(? *, f32 *, ? *); // extern -f32 func_802B80D0(void *, f32 *, u16, f32, f32, f32); // extern +//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd +? func_802B4FF8(f32 (*)[4], ?); /* extern */ +? func_802B5F74(f32 (*)[4], f32 *, ? *); /* extern */ +f32 func_802B80D0(Camera *, f32 *, u16, f32, f32, f32); /* extern */ extern ? D_06010CC0; extern ? D_06011DC8; extern ? D_06012EF0; extern ? D_060138D0; extern ? D_06013F78; -extern u16 D_800DC5FC; extern u16 D_80150112; -extern ? D_802B87E0; -extern f32 D_802B9650; -extern f32 D_802B9654; +extern ? D_80150130; extern f32 gCourseDirection; +static ? D_802B87E0; /* unable to generate initializer */ +static f32 D_802B9650 = 9e6.0f; +static f32 D_802B9654 = 1000000.0f; -extern ? gSegmentTable; - -void func_80298D7C(void *arg0, ? *arg1, ? arg2) { +void func_80298D7C(Camera *camera, f32 (*arg1)[4], struct Actor *arg2) { f32 spDC; f32 spD8; f32 spD4; - ? sp90; ? sp88; + Gfx *temp_v0; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; f32 *temp_a1; f32 *temp_s7; s16 *temp_s1; s16 *temp_s1_2; s16 temp_s0; s16 temp_t0; - s32 *temp_v0; - s32 *temp_v0_2; - s32 *temp_v0_3; - s32 *temp_v0_4; - s32 *temp_v0_5; - s32 *temp_v0_6; - s32 *temp_v0_7; - s32 *temp_v0_8; s16 *phi_s1; f32 phi_f22; - s32 *phi_v0; + Gfx *phi_v0; - temp_s1 = *(&gSegmentTable + ((&D_06013F78 >> 0x18) * 4)) + (&D_06013F78 & 0xFFFFFF) + 0x80000000; - sp88.unk0 = D_802B87E0.unk0; - sp88.unk4 = D_802B87E0.unk4; + temp_s1 = gSegmentTable[(u32) &D_06013F78 >> 0x18] + ((s32) &D_06013F78 & 0xFFFFFF) + 0x80000000; + sp88.unk0 = (s32) D_802B87E0.unk0; + sp88.unk4 = (u16) D_802B87E0.unk4; phi_s1 = temp_s1; - if (D_800DC50C == CREDITS_SEQUENCE) { + if (D_800DC50C == 9) { phi_f22 = D_802B9650; } else { phi_f22 = D_802B9654; } temp_v0 = gDisplayListHead; gDisplayListHead = temp_v0 + 8; - temp_v0->unk4 = -1; - temp_v0->unk0 = 0xBB000001; + temp_v0->words.w1 = -1U; + temp_v0->words.w0 = 0xBB000001; temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk4 = -0xC07; - temp_v0_2->unk0 = 0xFC127E24; + temp_v0_2->words.w1 = -0x00000C07U; + temp_v0_2->words.w0 = 0xFC127E24; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0xB900031D; - temp_v0_3->unk4 = 0x553078; + temp_v0_3->words.w0 = 0xB900031D; + temp_v0_3->words.w1 = 0x00553078; temp_s7 = &spD4; if (*temp_s1 != -0x8000) { loop_5: @@ -1449,70 +1404,64 @@ loop_5: if ((temp_s0 & 0x800) != 0) { goto block_29; } - if (((temp_s0 & 0x400) != 0) && ((D_800DC5FC == 0) || (arg0 == camera1))) { - phi_s1->unk2 = phi_s1->unk2 + 0xA; + if (((temp_s0 & 0x400) != 0) && ((D_800DC5FC == 0) || (camera == camera1))) { + phi_s1->unk2 = (s16) (phi_s1->unk2 + 0xA); if (phi_s1->unk2 >= 0x321) { - phi_s1->unk6 = phi_s1->unk6 | 0x800; + phi_s1->unk6 = (s16) (phi_s1->unk6 | 0x800); } } temp_a1 = temp_s7; - spD4 = phi_s1->unk0 * gCourseDirection; - spD8 = phi_s1->unk2; - spDC = phi_s1->unk4; + spD4 = (f32) phi_s1->unk0 * gCourseDirection; + spD8 = (f32) phi_s1->unk2; + spDC = (f32) phi_s1->unk_04; temp_t0 = temp_s0 & 0xF; - if (func_802B80D0(arg0, temp_a1, arg0->unk26, 0.0f, (&D_80150130)[(arg0 - camera1) / 0xB8], phi_f22) < 0.0f) { + if (func_802B80D0(camera, temp_a1, (u16) camera->rotX2, 0.0f, *(&D_80150130 + (((s32) (camera - camera1) / 184) * 4)), phi_f22) < 0.0f) { goto block_29; } if (temp_t0 == 6) { - func_802B5F74(&sp90, temp_s7, &sp88); - if (D_80150112 < 0x80) { - func_802B4FF8(&sp90, 0); + func_802B5F74((f32 (*)[4]) &sp90[0], temp_s7, &sp88); + if ((s32) D_80150112 < 0x80) { + func_802B4FF8((f32 (*)[4]) &sp90[0], 0); goto block_19; } } else { arg1->unk30 = spD4; arg1->unk34 = spD8; arg1->unk38 = spDC; - if (D_80150112 < 0x80) { + if ((s32) D_80150112 < 0x80) { func_802B4FF8(arg1, 0); block_19: temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x20000; - temp_v0_4->unk0 = 0xB6000000; - if (temp_t0 != 0) { - if (temp_t0 != 4) { - if (temp_t0 != 5) { - if (temp_t0 != 6) { - - } else { - temp_v0_5 = gDisplayListHead; - gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = &D_060138D0; - phi_v0 = temp_v0_5; - goto block_28; - } - } else { - temp_v0_6 = gDisplayListHead; - gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = &D_06012EF0; - phi_v0 = temp_v0_6; - goto block_28; - } - } else { - temp_v0_7 = gDisplayListHead; - gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = &D_06011DC8; - phi_v0 = temp_v0_7; - goto block_28; - } - } else { + temp_v0_4->words.w1 = 0x00020000; + temp_v0_4->words.w0 = 0xB6000000; + switch (temp_t0) { /* irregular */ + case 0: + temp_v0_5 = gDisplayListHead; + gDisplayListHead = temp_v0_5 + 8; + temp_v0_5->words.w1 = (u32) &D_06010CC0; + phi_v0 = temp_v0_5; +block_28: + phi_v0->words.w0 = 0x06000000; + break; + case 4: + temp_v0_6 = gDisplayListHead; + gDisplayListHead = temp_v0_6 + 8; + temp_v0_6->words.w1 = (u32) &D_06011DC8; + phi_v0 = temp_v0_6; + goto block_28; + case 5: + temp_v0_7 = gDisplayListHead; + gDisplayListHead = temp_v0_7 + 8; + temp_v0_7->words.w1 = (u32) &D_06012EF0; + phi_v0 = temp_v0_7; + goto block_28; + case 6: temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = &D_06010CC0; + temp_v0_8->words.w1 = (u32) &D_060138D0; phi_v0 = temp_v0_8; -block_28: - *phi_v0 = 0x6000000; + goto block_28; } block_29: temp_s1_2 = phi_s1 + 0xA; @@ -1529,72 +1478,72 @@ GLOBAL_ASM("asm/non_matchings/code_actors/func_80298D7C.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_8029794C(void *, void *, ?, void *); // extern -s32 func_802B4FF8(void *, ?); // extern -f32 func_802B80D0(void *, u16, ?, f32, f32); // extern +//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd +? func_8029794C(f32 *, s16 *, ?, f32 (*)[4]); /* extern */ +s32 func_802B4FF8(f32 (*)[4], ?); /* extern */ +f32 func_802B80D0(f32 *, u16, ?, f32, f32); /* extern */ extern ? D_06006A68; extern ? D_0D004C68; -extern f32 D_802B9658; -extern f32 D_802B965C; +extern ? D_80150130; +static f32 D_802B9658 = 1.6e7f; +static f32 D_802B965C = 250000.0f; - -void func_80299144(void *arg0, void *arg1, void *arg2) { +void func_80299144(Camera *camera, f32 (*arg1)[4], struct Actor *arg2) { s16 sp4A; - void *sp28; + f32 *sp28; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + f32 *temp_a1; f32 temp_f0; s16 temp_v0; - void *temp_a1; - void *temp_v0_2; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - void *temp_v0_6; - void *temp_v0_7; - void *temp_v0_8; - temp_v0 = arg2->unk2; - temp_a1 = arg2 + 0x18; + temp_v0 = arg2->flags; + temp_a1 = arg2->pos; if ((temp_v0 & 0x800) == 0) { sp28 = temp_a1; sp4A = temp_v0; - temp_f0 = func_802B80D0(temp_a1, arg0->unk26, 0, (&D_80150130)[(arg0 - camera1) / 0xB8], D_802B9658); + temp_f0 = func_802B80D0(temp_a1, (u16) camera->rotX2, 0, *(&D_80150130 + (((s32) (camera - camera1) / 184) * 4)), D_802B9658); if (!(temp_f0 < 0.0f)) { if (((temp_v0 & 0x400) == 0) && (temp_f0 < D_802B965C)) { - func_8029794C(sp28, arg2 + 0x10, 0x40400000, arg1); + func_8029794C(sp28, arg2->rot, 0x40400000, arg1); } - arg1->unk30 = arg2->unk18; - arg1->unk34 = arg2->unk1C; - arg1->unk38 = arg2->unk20; + arg1->unk30 = (f32) arg2->pos[0]; + arg1->unk34 = (f32) arg2->pos[1]; + arg1->unk38 = (f32) arg2->pos[2]; if (func_802B4FF8(arg1, 0) != 0) { temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0xFD100000; - temp_v0_2->unk4 = &D_0D004C68; + temp_v0_2->words.w0 = 0xFD100000; + temp_v0_2->words.w1 = (u32) &D_0D004C68; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = 0; - temp_v0_3->unk0 = 0xE8000000; + temp_v0_3->words.w1 = 0; + temp_v0_3->words.w0 = 0xE8000000; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x7000000; - temp_v0_4->unk0 = 0xF5000100; + temp_v0_4->words.w1 = 0x07000000; + temp_v0_4->words.w0 = 0xF5000100; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0; - temp_v0_5->unk0 = 0xE6000000; + temp_v0_5->words.w1 = 0; + temp_v0_5->words.w0 = 0xE6000000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0x73FC000; - temp_v0_6->unk0 = 0xF0000000; + temp_v0_6->words.w1 = 0x073FC000; + temp_v0_6->words.w0 = 0xF0000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0; - temp_v0_7->unk0 = 0xE7000000; + temp_v0_7->words.w1 = 0; + temp_v0_7->words.w0 = 0xE7000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = &D_06006A68; - temp_v0_8->unk0 = 0x6000000; + temp_v0_8->words.w1 = (u32) &D_06006A68; + temp_v0_8->words.w0 = 0x06000000; } } } @@ -1638,37 +1587,37 @@ void func_8029930C(void *arg0, void *arg1, void *arg2) { if (((temp_v0 & 0x400) == 0) && (temp_f0 < D_802B9664)) { func_8029794C(sp28, arg2 + 0x10, 0x40333333, arg1); } - arg1->unk30 = arg2->unk18; + arg1->unk30 = arg2->pos; arg1->unk34 = arg2->unk1C; arg1->unk38 = arg2->unk20; if (func_802B4FF8(arg1, 0) != 0) { temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; temp_v0_2->unk0 = 0xFD100000; - temp_v0_2->unk4 = &D_0D004C68; + temp_v0_2->unk_04 = &D_0D004C68; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = 0; + temp_v0_3->unk_04 = 0; temp_v0_3->unk0 = 0xE8000000; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x7000000; + temp_v0_4->unk_04 = 0x7000000; temp_v0_4->unk0 = 0xF5000100; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0; + temp_v0_5->unk_04 = 0; temp_v0_5->unk0 = 0xE6000000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0x73FC000; + temp_v0_6->unk_04 = 0x73FC000; temp_v0_6->unk0 = 0xF0000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0; + temp_v0_7->unk_04 = 0; temp_v0_7->unk0 = 0xE7000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = &D_06015B48; + temp_v0_8->unk_04 = &D_06015B48; temp_v0_8->unk0 = 0x6000000; } } @@ -1713,37 +1662,37 @@ void func_802994D4(void *arg0, void *arg1, void *arg2) { if (((temp_v0 & 0x400) == 0) && (temp_f0 < D_802B966C)) { func_8029794C(sp28, arg2 + 0x10, 0x40333333, arg1); } - arg1->unk30 = arg2->unk18; + arg1->unk30 = arg2->pos; arg1->unk34 = arg2->unk1C; arg1->unk38 = arg2->unk20; if (func_802B4FF8(arg1, 0) != 0) { temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; temp_v0_2->unk0 = 0xFD100000; - temp_v0_2->unk4 = &D_0D004C68; + temp_v0_2->unk_04 = &D_0D004C68; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = 0; + temp_v0_3->unk_04 = 0; temp_v0_3->unk0 = 0xE8000000; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x7000000; + temp_v0_4->unk_04 = 0x7000000; temp_v0_4->unk0 = 0xF5000100; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0; + temp_v0_5->unk_04 = 0; temp_v0_5->unk0 = 0xE6000000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0x73FC000; + temp_v0_6->unk_04 = 0x73FC000; temp_v0_6->unk0 = 0xF0000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0; + temp_v0_7->unk_04 = 0; temp_v0_7->unk0 = 0xE7000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = &D_0600D4A0; + temp_v0_8->unk_04 = &D_0600D4A0; temp_v0_8->unk0 = 0x6000000; } } @@ -1787,37 +1736,37 @@ void func_8029969C(void *arg0, void *arg1, void *arg2) { if (((temp_v0 & 0x400) == 0) && (temp_f0 < 600.0f)) { func_8029794C(sp28, arg2 + 0x10, 0x40A00000, arg1); } - arg1->unk30 = arg2->unk18; + arg1->unk30 = arg2->pos; arg1->unk34 = arg2->unk1C; arg1->unk38 = arg2->unk20; if (func_802B4FF8(arg1, 0) != 0) { temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; temp_v0_2->unk0 = 0xFD100000; - temp_v0_2->unk4 = &D_0D004C68; + temp_v0_2->unk_04 = &D_0D004C68; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = 0; + temp_v0_3->unk_04 = 0; temp_v0_3->unk0 = 0xE8000000; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x7000000; + temp_v0_4->unk_04 = 0x7000000; temp_v0_4->unk0 = 0xF5000100; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0; + temp_v0_5->unk_04 = 0; temp_v0_5->unk0 = 0xE6000000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0x73FC000; + temp_v0_6->unk_04 = 0x73FC000; temp_v0_6->unk0 = 0xF0000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0; + temp_v0_7->unk_04 = 0; temp_v0_7->unk0 = 0xE7000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = &D_06013F20; + temp_v0_8->unk_04 = &D_06013F20; temp_v0_8->unk0 = 0x6000000; } } @@ -1862,37 +1811,37 @@ void func_80299864(void *arg0, void *arg1, void *arg2) { if (((temp_v0 & 0x400) == 0) && (temp_f0 < D_802B9678)) { func_8029794C(sp28, arg2 + 0x10, 0x40333333, arg1); } - arg1->unk30 = arg2->unk18; + arg1->unk30 = arg2->pos; arg1->unk34 = arg2->unk1C; arg1->unk38 = arg2->unk20; if (func_802B4FF8(arg1, 0) != 0) { temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; temp_v0_2->unk0 = 0xFD100000; - temp_v0_2->unk4 = &D_0D004C68; + temp_v0_2->unk_04 = &D_0D004C68; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = 0; + temp_v0_3->unk_04 = 0; temp_v0_3->unk0 = 0xE8000000; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x7000000; + temp_v0_4->unk_04 = 0x7000000; temp_v0_4->unk0 = 0xF5000100; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0; + temp_v0_5->unk_04 = 0; temp_v0_5->unk0 = 0xE6000000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0x73FC000; + temp_v0_6->unk_04 = 0x73FC000; temp_v0_6->unk0 = 0xF0000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0; + temp_v0_7->unk_04 = 0; temp_v0_7->unk0 = 0xE7000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = &D_0600FC70; + temp_v0_8->unk_04 = &D_0600FC70; temp_v0_8->unk0 = 0x6000000; } } @@ -1937,37 +1886,37 @@ void func_80299A2C(void *arg0, void *arg1, void *arg2) { if (((temp_v0 & 0x400) == 0) && (temp_f0 < D_802B9680)) { func_8029794C(sp28, arg2 + 0x10, 0x40333333, arg1); } - arg1->unk30 = arg2->unk18; + arg1->unk30 = arg2->pos; arg1->unk34 = arg2->unk1C; arg1->unk38 = arg2->unk20; if (func_802B4FF8(arg1, 0) != 0) { temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; temp_v0_2->unk0 = 0xFD100000; - temp_v0_2->unk4 = &D_0D004C68; + temp_v0_2->unk_04 = &D_0D004C68; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = 0; + temp_v0_3->unk_04 = 0; temp_v0_3->unk0 = 0xE8000000; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x7000000; + temp_v0_4->unk_04 = 0x7000000; temp_v0_4->unk0 = 0xF5000100; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0; + temp_v0_5->unk_04 = 0; temp_v0_5->unk0 = 0xE6000000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0x73FC000; + temp_v0_6->unk_04 = 0x73FC000; temp_v0_6->unk0 = 0xF0000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0; + temp_v0_7->unk_04 = 0; temp_v0_7->unk0 = 0xE7000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = &D_0600D578; + temp_v0_8->unk_04 = &D_0600D578; temp_v0_8->unk0 = 0x6000000; } } @@ -2012,37 +1961,37 @@ void func_80299BF4(void *arg0, void *arg1, void *arg2) { if (((temp_v0 & 0x400) == 0) && (temp_f0 < D_802B9688)) { func_8029794C(sp28, arg2 + 0x10, 0x40333333, arg1); } - arg1->unk30 = arg2->unk18; + arg1->unk30 = arg2->pos; arg1->unk34 = arg2->unk1C; arg1->unk38 = arg2->unk20; if (func_802B4FF8(arg1, 0) != 0) { temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; temp_v0_2->unk0 = 0xFD100000; - temp_v0_2->unk4 = &D_0D004C68; + temp_v0_2->unk_04 = &D_0D004C68; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = 0; + temp_v0_3->unk_04 = 0; temp_v0_3->unk0 = 0xE8000000; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x7000000; + temp_v0_4->unk_04 = 0x7000000; temp_v0_4->unk0 = 0xF5000100; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0; + temp_v0_5->unk_04 = 0; temp_v0_5->unk0 = 0xE6000000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0x73FC000; + temp_v0_6->unk_04 = 0x73FC000; temp_v0_6->unk0 = 0xF0000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0; + temp_v0_7->unk_04 = 0; temp_v0_7->unk0 = 0xE7000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = &D_060090C8; + temp_v0_8->unk_04 = &D_060090C8; temp_v0_8->unk0 = 0x6000000; } } @@ -2080,14 +2029,14 @@ void func_80299DBC(void *arg0, void *arg1, void *arg2) { if (((temp_v0 & 0x400) == 0) && (temp_f0 < D_802B9690)) { func_8029794C(sp28, arg2 + 0x10, 0x40333333, arg1); } - arg1->unk30 = arg2->unk18; + arg1->unk30 = arg2->pos; arg1->unk34 = arg2->unk1C; arg1->unk38 = arg2->unk20; if (func_802B4FF8(arg1, 0) != 0) { temp_v1 = gDisplayListHead; gDisplayListHead = temp_v1 + 8; temp_v1->unk0 = 0x6000000; - temp_v1->unk4 = &D_060075A0; + temp_v1->unk_04 = &D_060075A0; } } } @@ -2124,14 +2073,14 @@ void func_80299EDC(void *arg0, void *arg1, void *arg2) { if (((temp_v0 & 0x400) == 0) && (temp_f0 < D_802B9698)) { func_8029794C(sp28, arg2 + 0x10, 0x3F800000, arg1); } - arg1->unk30 = arg2->unk18; + arg1->unk30 = arg2->pos; arg1->unk34 = arg2->unk1C; arg1->unk38 = arg2->unk20; if (func_802B4FF8(arg1, 0) != 0) { temp_v1 = gDisplayListHead; gDisplayListHead = temp_v1 + 8; temp_v1->unk0 = 0x6000000; - temp_v1->unk4 = &D_06008528; + temp_v1->unk_04 = &D_06008528; } } } @@ -2168,14 +2117,14 @@ void func_80299FFC(void *arg0, void *arg1, void *arg2) { if (((temp_v0 & 0x400) == 0) && (temp_f0 < D_802B96A0)) { func_8029794C(sp28, arg2 + 0x10, 0x3F800000, arg1); } - arg1->unk30 = arg2->unk18; + arg1->unk30 = arg2->pos; arg1->unk34 = arg2->unk1C; arg1->unk38 = arg2->unk20; if (func_802B4FF8(arg1, 0) != 0) { temp_v1 = gDisplayListHead; gDisplayListHead = temp_v1 + 8; temp_v1->unk0 = 0x6000000; - temp_v1->unk4 = &D_06008628; + temp_v1->unk_04 = &D_06008628; } } } @@ -2212,14 +2161,14 @@ void func_8029A11C(void *arg0, void *arg1, void *arg2) { if (((temp_v0 & 0x400) == 0) && (temp_f0 < D_802B96A8)) { func_8029794C(sp28, arg2 + 0x10, 0x3F4CCCCD, arg1); } - arg1->unk30 = arg2->unk18; + arg1->unk30 = arg2->pos; arg1->unk34 = arg2->unk1C; arg1->unk38 = arg2->unk20; if (func_802B4FF8(arg1, 0) != 0) { temp_v1 = gDisplayListHead; gDisplayListHead = temp_v1 + 8; temp_v1->unk0 = 0x6000000; - temp_v1->unk4 = &D_06008728; + temp_v1->unk_04 = &D_06008728; } } } @@ -2245,42 +2194,42 @@ void func_8029A23C(s32 arg0, void *arg1, void *arg2) { void *temp_v0_8; if (arg2->unk6 != 0) { - arg1->unk30 = arg2->unk18; + arg1->unk30 = arg2->pos; arg1->unk34 = arg2->unk1C; arg1->unk38 = arg2->unk20; if (func_802B4FF8(arg1, 0) != 0) { temp_v0 = gDisplayListHead; gDisplayListHead = temp_v0 + 8; temp_v0->unk0 = 0xFD500000; - temp_v0->unk4 = ((arg2->unk10 << 0xA) + 0x3009000) & 0x1FFFFFFF; + temp_v0->unk_04 = ((arg2->rot << 0xA) + 0x3009000) & 0x1FFFFFFF; temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; temp_v0_2->unk0 = 0xF5500000; - temp_v0_2->unk4 = 0x7080200; + temp_v0_2->unk_04 = 0x7080200; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = 0; + temp_v0_3->unk_04 = 0; temp_v0_3->unk0 = 0xE6000000; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x71FF200; + temp_v0_4->unk_04 = 0x71FF200; temp_v0_4->unk0 = 0xF3000000; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0; + temp_v0_5->unk_04 = 0; temp_v0_5->unk0 = 0xE7000000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; temp_v0_6->unk0 = 0xF5480800; - temp_v0_6->unk4 = 0x80200; + temp_v0_6->unk_04 = 0x80200; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; temp_v0_7->unk0 = 0xF2000000; - temp_v0_7->unk4 = 0x7C07C; + temp_v0_7->unk_04 = 0x7C07C; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; temp_v0_8->unk0 = 0x6000000; - temp_v0_8->unk4 = &D_06013BB8; + temp_v0_8->unk_04 = &D_06013BB8; } } } @@ -2290,9 +2239,9 @@ GLOBAL_ASM("asm/non_matchings/code_actors/func_8029A23C.s") #ifdef MIPS_TO_C //generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd -? func_80297230(Camera *, struct shell_actor *); /* extern */ -? func_802972B8(Camera *, struct shell_actor *); /* extern */ -? func_802979F8(struct shell_actor *, ?, f32 (*)[4]); /* extern */ +? func_80297230(Camera *, struct ShellActor *); /* extern */ +? func_802972B8(Camera *, struct ShellActor *); /* extern */ +? func_802979F8(struct ShellActor *, ?, f32 (*)[4]); /* extern */ s32 func_802B4FF8(f32 (*)[4], ?, f32 (*)[4]); /* extern */ f32 func_802B80D0(f32 *, u16, ?, f32, f32); /* extern */ extern ? D_0D005338; @@ -2304,7 +2253,7 @@ static ? D_802B87E8; /* unable to generate initia static f32 D_802B96AC = 490000.0f; static f32 D_802B96B0 = 40000.0f; -void func_8029A3AC(Camera *camera, Mat4 arg1, struct shell_actor *shell) { +void func_8029A3AC(Camera *camera, Mat4 arg1, struct ShellActor *shell) { u16 sp7C; ? sp58; s32 sp54; @@ -2341,7 +2290,7 @@ void func_8029A3AC(Camera *camera, Mat4 arg1, struct shell_actor *shell) { if (temp_f0 < D_802B96B0) { func_802979F8(shell, 0x4059999A, arg1); } - if (shell->type == 0x002A) { + if (shell->type == ACTOR_BLUE_SPINY_SHELL) { phi_t3 = D_802BA054; } else { phi_t3 = D_802BA050; @@ -2430,39 +2379,39 @@ extern f32 D_802B96B4; extern s16 D_8015F6EE; extern s16 D_8015F6EC; -void func_8029A8F4(Camera *arg0, Mat4 arg1, struct Actor *arg2) { +void func_8029A8F4(Camera *arg0, Mat4 arg1, struct BananaActor *arg2) { s32 pad[3]; Vec3s sp7C; Mat4 sp3C; - f32 temp = func_802B80D0(arg0->pos, arg2->unk18, arg0->rotX[1], 0, D_80150130[arg0 - camera1], D_802B96B4); + f32 temp = func_802B80D0(arg0->pos, arg2->pos, arg0->rotX[1], 0, D_80150130[arg0 - camera1], D_802B96B4); if (temp < 0.0f) { func_80297230(arg0, arg2); return; } - if ((arg2->unk18[1] > D_8015F6EC + 800.0f)) { + if ((arg2->pos[1] > D_8015F6EC + 800.0f)) { func_80297230(arg0, arg2); return; } - if (arg2->unk18[1] < (D_8015F6EE - 800.0f)) { + if (arg2->pos[1] < (D_8015F6EE - 800.0f)) { func_80297230(arg0, arg2); return; } func_802972B8(arg0, arg2); - if (arg2->unk6 == 5) { - func_802B5F74(sp3C, arg2->unk18, arg2->unk10); + if (arg2->state == 5) { + func_802B5F74(sp3C, arg2->pos, arg2->rot); } else { sp7C[0] = 0; sp7C[1] = 0; sp7C[2] = 0; - func_802B5F74(sp3C, arg2->unk18, sp7C); + func_802B5F74(sp3C, arg2->pos, sp7C); } if (func_802B4FF8(sp3C, 0) == 0) { return; } - if (arg2->unk6 != 5) { + if (arg2->state != 5) { gSPDisplayList(gDisplayListHead++, &D_0D004B48); } else { gSPDisplayList(gDisplayListHead++, &D_0D004BD8); @@ -2470,38 +2419,38 @@ void func_8029A8F4(Camera *arg0, Mat4 arg1, struct Actor *arg2) { } void update_obj_wario_stadium_sign(struct Actor *arg0) { - arg0->unk10[1] += 0xB6; + arg0->rot[1] += 0xB6; } /** * If train close activate bell sound according to timing **/ -void update_obj_railroad_crossing(struct Actor *arg0) { +void update_obj_railroad_crossing(struct RailroadCrossing *arg0) { // If train close? - if (D_801637B8[arg0->unk6] != 0) { + if (D_801637B8[arg0->crossingId] != 0) { // Timer++ - arg0->unk4++; + arg0->someTimer++; // Reset timer - if (arg0->unk4 > 40) { - arg0->unk4 = 1; + if (arg0->someTimer > 40) { + arg0->someTimer = 1; } // Play Bell sound when timer hits 20 or 1. - if ((arg0->unk4 == 1) || (arg0->unk4 == 20)) { - func_800C98B8(arg0->unk18, arg0->unk24, 0x19017016); + if ((arg0->someTimer == 1) || (arg0->someTimer == 20)) { + func_800C98B8(arg0->pos, arg0->velocity, 0x19017016); } } } void update_obj_mario_raceway_sign(struct Actor *arg0) { - if ((arg0->unk2 & 0x800) == 0) { - if ((arg0->unk2 & 0x400) != 0) { - arg0->unk18[1] += 4.0f; - if (arg0->unk18[1] > 800.0f) { - arg0->unk2 |= 0x800; - arg0->unk10[1] += 1820; + if ((arg0->flags & 0x800) == 0) { + if ((arg0->flags & 0x400) != 0) { + arg0->pos[1] += 4.0f; + if (arg0->pos[1] > 800.0f) { + arg0->flags |= 0x800; + arg0->rot[1] += 1820; } } else { - arg0->unk10[1] += 182; + arg0->rot[1] += 182; } } } @@ -2527,17 +2476,17 @@ extern f32 D_802B96B8; void func_8029AC18(Camera *camera, Mat4 arg1, struct Actor *arg2) { f32 temp; - temp = func_802B80D0(camera->pos, arg2->unk18, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B96B8); + temp = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B96B8); if (temp < 0.0f) { return; } - arg1[3][0] = arg2->unk18[0]; // unk30 - arg1[3][1] = arg2->unk18[1] - arg2->unkC; // unk34 - arg1[3][2] = arg2->unk18[2]; // unk38 + arg1[3][0] = arg2->pos[0]; // unk30 + arg1[3][1] = arg2->pos[1] - arg2->boundingBoxSize; // unk34 + arg1[3][2] = arg2->pos[2]; // unk38 if (func_802B4FF8(arg1, 0) != 0) { gSPDisplayList(gDisplayListHead++, &D_0D001750); - switch (arg2->unk6) { + switch (arg2->state) { case 0: gSPDisplayList(gDisplayListHead++, &D_0D001780); break; @@ -2580,7 +2529,7 @@ extern s8 D_800DC628[]; extern s8 D_800DC630[]; extern f32 D_802B96DC; -void func_8029AE1C(Camera *arg0, struct Actor *arg1, Mat4 arg2, u16 arg3) { +void func_8029AE1C(Camera *arg0, struct PaddleWheelBoat *boat, Mat4 arg2, u16 arg3) { s32 pad[3]; Vec3f sp120; Mat4 spE0; @@ -2589,20 +2538,20 @@ void func_8029AE1C(Camera *arg0, struct Actor *arg1, Mat4 arg2, u16 arg3) { f32 temp; if ((arg3 > 20) && (arg3 < 25)) { return; } - temp = func_802B80D0(arg0->pos, arg1->unk18, arg0->rotX[1], 90000.0f, D_80150130[arg0 - camera1], D_802B96DC); + temp = func_802B80D0(arg0->pos, boat->pos, arg0->rotX[1], 90000.0f, D_80150130[arg0 - camera1], D_802B96DC); if (temp < 0.0f) { return; } gSPSetLights1(gDisplayListHead++, D_800DC610[1]); gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_LIGHTING | G_SHADING_SMOOTH); - func_802B5F74(spE0, arg1->unk18, arg1->unk10); + func_802B5F74(spE0, boat->pos, boat->boatRot); if (func_802B4FF8(spE0, 1) != 0) { gSPDisplayList(gDisplayListHead++, &D_0600E730); gSPDisplayList(gDisplayListHead++, &D_0600E058); - func_802B59DC(spE0, arg1->unk6); + func_802B59DC(spE0, boat->wheelRot); load_giant_egg(sp120, 0, 16.0f, -255.0f); mtxf_translate(spA0, sp120); func_802B71CC(sp60, spE0, spA0); @@ -2631,16 +2580,16 @@ void func_8029B06C(Camera *arg0, struct Actor *arg1) { s32 pad[6]; Mat4 spD8; s32 pad2[32]; - f32 temp_f0 = func_802B80D0(arg0->pos, arg1->unk18, arg0->rotX[1], 2500.0f, D_80150130[arg0 - camera1], D_802B96E0); + f32 temp_f0 = func_802B80D0(arg0->pos, arg1->pos, arg0->rotX[1], 2500.0f, D_80150130[arg0 - camera1], D_802B96E0); if (temp_f0 < 0.0f) { return; } gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); - func_802B5F74(spD8, arg1->unk18, arg1->unk10); + func_802B5F74(spD8, arg1->pos, arg1->rot); if (func_802B4FF8(spD8, 0) != 0) { - switch(arg1->unk6) { + switch(arg1->state) { case 0: gSPDisplayList(gDisplayListHead++, &D_06023858); break; @@ -2684,14 +2633,14 @@ void func_8029B2E4(Camera *arg0, struct Actor *arg1) { s32 pad2[32]; f32 temp_f0; - temp_f0 = func_802B80D0(arg0->pos, arg1->unk18, arg0->rotX[1], 2500.0f, D_80150130[arg0 - camera1], D_802B96F0); + temp_f0 = func_802B80D0(arg0->pos, arg1->pos, arg0->rotX[1], 2500.0f, D_80150130[arg0 - camera1], D_802B96F0); if (temp_f0 < 0.0f) { return; } gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); - func_802B5F74(spC8, arg1->unk18, arg1->unk10); + func_802B5F74(spC8, arg1->pos, arg1->rot); if (func_802B4FF8(spC8, 0) != 0) { if (gActiveScreenMode == 0) { @@ -2724,7 +2673,7 @@ void func_8029B4E0(Camera *arg0, struct Actor *arg1) { s32 pad[6]; Mat4 spC8; s32 pad2[32]; - f32 temp_f0 = func_802B80D0(arg0->pos,arg1->unk18, arg0->rotX[1], 2500.0f, D_80150130[arg0 - camera1], D_802B9700); + f32 temp_f0 = func_802B80D0(arg0->pos,arg1->pos, arg0->rotX[1], 2500.0f, D_80150130[arg0 - camera1], D_802B9700); if (!(temp_f0 < 0.0f)) { @@ -2732,7 +2681,7 @@ void func_8029B4E0(Camera *arg0, struct Actor *arg1) { gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); - func_802B5F74(spC8, arg1->unk18, arg1->unk10); + func_802B5F74(spC8, arg1->pos, arg1->rot); func_802B5F00(spC8, 0.1f); if (func_802B4FF8(spC8, 0) != 0) { @@ -2766,14 +2715,14 @@ void func_8029B6EC(Camera *arg0, struct Actor* arg1) { s32 pad[6]; Mat4 spC8; s32 pad2[32]; - f32 temp_f0 = func_802B80D0(arg0->pos, arg1->unk18, arg0->rotX[1], 2500.0f, D_80150130[arg0 - camera1], D_802B9710); + f32 temp_f0 = func_802B80D0(arg0->pos, arg1->pos, arg0->rotX[1], 2500.0f, D_80150130[arg0 - camera1], D_802B9710); if (!(temp_f0 < 0.0f)) { gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); - func_802B5F74(spC8, arg1->unk18, arg1->unk10); + func_802B5F74(spC8, arg1->pos, arg1->rot); if (func_802B4FF8(spC8, 0) != 0) { if (gActiveScreenMode == 0) { @@ -2795,14 +2744,12 @@ void func_8029B6EC(Camera *arg0, struct Actor* arg1) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_802B4FF8(? *, ?); // extern -? mtxf_translate(? *, ? *); // extern -? func_802B59DC(? *, s16); // extern -? func_802B5F74(? *, ? *, s32); // extern -? func_802B71CC(? *, ? *, ? *); // extern -f32 func_802B80D0(? *, u16, ?, f32, f32); // extern -? load_giant_egg(? *, ?, ?, ?); // extern +//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd +s32 func_802B4FF8(f32 (*)[4], ?); /* extern */ +? func_802B59DC(f32 (*)[4], s16); /* extern */ +? func_802B5F74(f32 (*)[4], f32 *, s16 *); /* extern */ +f32 func_802B80D0(f32 *, u16, ?, f32, f32); /* extern */ +? load_giant_egg(f32 *, ?, ?, ?); /* extern */ extern ? D_0601B978; extern ? D_0601C0F0; extern ? D_0601D160; @@ -2810,210 +2757,207 @@ extern ? D_0601D670; extern ? D_0601E480; extern ? D_0601E910; extern ? D_06022D28; -extern ? D_06022D70; -extern ? D_06022DB8; -extern f32 D_802B9720; -extern f32 D_802B9724; -extern f32 D_802B9728; -extern f32 D_802B972C; +extern f32 D_06022D70; +extern f32 D_06022DB8; +extern ? D_80150130; +static f32 D_802B9720 = 9e6.0f; +static f32 D_802B9724 = 122500.0f; +static f32 D_802B9728 = 640000.0f; +static f32 D_802B972C = 1440000.0f; - -void func_8029B8E8(void *arg0, void *arg1) { - ? sp160; - ? sp120; - ? spE0; - ? spA0; +void func_8029B8E8(Camera *camera, struct TrainCar *actor) { + f32 sp160; f32 sp9C; - ? *sp30; - ? *temp_a1; + f32 *sp30; + Gfx *temp_v0; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_14; + Gfx *temp_v0_15; + Gfx *temp_v0_16; + Gfx *temp_v0_17; + Gfx *temp_v0_18; + Gfx *temp_v0_19; + Gfx *temp_v0_20; + Gfx *temp_v0_21; + Gfx *temp_v0_22; + Gfx *temp_v0_23; + Gfx *temp_v0_24; + Gfx *temp_v0_25; + Gfx *temp_v0_26; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; + f32 *temp_a1; f32 temp_f0; f32 temp_f2; - void *temp_v0; - void *temp_v0_10; - void *temp_v0_11; - void *temp_v0_12; - void *temp_v0_13; - void *temp_v0_14; - void *temp_v0_15; - void *temp_v0_16; - void *temp_v0_17; - void *temp_v0_18; - void *temp_v0_19; - void *temp_v0_20; - void *temp_v0_21; - void *temp_v0_22; - void *temp_v0_23; - void *temp_v0_24; - void *temp_v0_25; - void *temp_v0_26; - void *temp_v0_2; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - void *temp_v0_6; - void *temp_v0_7; - void *temp_v0_8; - void *temp_v0_9; - temp_a1 = arg1 + 0x18; + temp_a1 = actor->pos; sp30 = temp_a1; - temp_f0 = func_802B80D0(temp_a1, arg0->unk26, 0x451C4000, (&D_80150130)[(arg0 - camera1) / 0xB8], D_802B9720); + temp_f0 = func_802B80D0(temp_a1, (u16) camera->rotX2, 0x451C4000, *(&D_80150130 + (((s32) (camera - camera1) / 184) * 4)), D_802B9720); temp_f2 = temp_f0; if (!(temp_f0 < 0.0f)) { temp_v0 = gDisplayListHead; gDisplayListHead = temp_v0 + 8; - temp_v0->unk4 = 0x20000; - temp_v0->unk0 = 0xB6000000; + temp_v0->words.w1 = 0x00020000; + temp_v0->words.w0 = 0xB6000000; sp9C = temp_f2; - func_802B5F74(&sp120, temp_a1, arg1 + 0x10); - if (func_802B4FF8(&sp120, 0) != 0) { - if (temp_f2 < D_802B9724) { + func_802B5F74((f32 (*)[4]) &sp120[0], temp_a1, actor->rot); + if (func_802B4FF8((f32 (*)[4]) &sp120[0], 0) != 0) { + if (sp9C < D_802B9724) { temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk4 = &D_0601C0F0; - temp_v0_2->unk0 = 0x6000000; + temp_v0_2->words.w1 = (u32) &D_0601C0F0; + temp_v0_2->words.w0 = 0x06000000; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = &D_0601B978; - temp_v0_3->unk0 = 0x6000000; - } else if (temp_f2 < D_802B9728) { + temp_v0_3->words.w1 = (u32) &D_0601B978; + temp_v0_3->words.w0 = 0x06000000; + } else if (sp9C < D_802B9728) { temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = &D_0601D670; - temp_v0_4->unk0 = 0x6000000; + temp_v0_4->words.w1 = (u32) &D_0601D670; + temp_v0_4->words.w0 = 0x06000000; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = &D_0601D160; - temp_v0_5->unk0 = 0x6000000; + temp_v0_5->words.w1 = (u32) &D_0601D160; + temp_v0_5->words.w0 = 0x06000000; } else { temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = &D_0601E910; - temp_v0_6->unk0 = 0x6000000; + temp_v0_6->words.w1 = (u32) &D_0601E910; + temp_v0_6->words.w0 = 0x06000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = &D_0601E480; - temp_v0_7->unk0 = 0x6000000; + temp_v0_7->words.w1 = (u32) &D_0601E480; + temp_v0_7->words.w0 = 0x06000000; } - if (!(D_802B972C < temp_f2)) { + if (!(D_802B972C < sp9C)) { temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0x2000; - temp_v0_8->unk0 = 0xB6000000; + temp_v0_8->words.w1 = 0x00002000; + temp_v0_8->words.w0 = 0xB6000000; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk4 = &D_06022D28; - temp_v0_9->unk0 = 0x6000000; - func_802B59DC(&sp120, arg1->unk6); + temp_v0_9->words.w1 = (u32) &D_06022D28; + temp_v0_9->words.w0 = 0x06000000; + func_802B59DC((f32 (*)[4]) &sp120[0], actor->wheelRot); load_giant_egg(&sp160, 0x41880000, 0x40C00000, 0x42000000); - mtxf_translate(&spE0, &sp160); - func_802B71CC(&spA0, &sp120, &spE0); - if (func_802B4FF8(&spA0, 3) != 0) { + mtxf_translate((f32 (*)[4]) &spE0[0], &sp160); + func_802B71CC((f32 (*)[4]) &spA0[0], (f32 (*)[4]) &sp120[0], (f32 (*)[4]) &spE0[0]); + if (func_802B4FF8((f32 (*)[4]) &spA0[0], 3) != 0) { temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk4 = &D_06022DB8; - temp_v0_10->unk0 = 0x6000000; + temp_v0_10->words.w1 = (u32) &D_06022DB8; + temp_v0_10->words.w0 = 0x06000000; temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk4 = 0; - temp_v0_11->unk0 = 0xBD000000; + temp_v0_11->words.w1 = 0; + temp_v0_11->words.w0 = 0xBD000000; sp30 = &D_06022DB8; - func_802B59DC(&sp120, arg1->unk6); + func_802B59DC((f32 (*)[4]) &sp120[0], actor->wheelRot); load_giant_egg(&sp160, 0xC1880000, 0x40C00000, 0x42000000); - mtxf_translate(&spE0, &sp160); - func_802B71CC(&spA0, &sp120, &spE0); - if (func_802B4FF8(&spA0, 3) != 0) { + mtxf_translate((f32 (*)[4]) &spE0[0], &sp160); + func_802B71CC((f32 (*)[4]) &spA0[0], (f32 (*)[4]) &sp120[0], (f32 (*)[4]) &spE0[0]); + if (func_802B4FF8((f32 (*)[4]) &spA0[0], 3) != 0) { temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk0 = 0x6000000; - temp_v0_12->unk4 = sp30; + temp_v0_12->words.w0 = 0x06000000; + temp_v0_12->words.w1 = (u32) sp30; temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk4 = 0; - temp_v0_13->unk0 = 0xBD000000; - func_802B59DC(&sp120, arg1->unk6 + 0x16C); + temp_v0_13->words.w1 = 0; + temp_v0_13->words.w0 = 0xBD000000; + func_802B59DC((f32 (*)[4]) &sp120[0], (s16) (actor->wheelRot + 0x16C)); load_giant_egg(&sp160, 0x41880000, 0x40C00000, 0x41800000); - mtxf_translate(&spE0, &sp160); - func_802B71CC(&spA0, &sp120, &spE0); - if (func_802B4FF8(&spA0, 3) != 0) { + mtxf_translate((f32 (*)[4]) &spE0[0], &sp160); + func_802B71CC((f32 (*)[4]) &spA0[0], (f32 (*)[4]) &sp120[0], (f32 (*)[4]) &spE0[0]); + if (func_802B4FF8((f32 (*)[4]) &spA0[0], 3) != 0) { temp_v0_14 = gDisplayListHead; gDisplayListHead = temp_v0_14 + 8; - temp_v0_14->unk0 = 0x6000000; - temp_v0_14->unk4 = sp30; + temp_v0_14->words.w0 = 0x06000000; + temp_v0_14->words.w1 = (u32) sp30; temp_v0_15 = gDisplayListHead; gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk4 = 0; - temp_v0_15->unk0 = 0xBD000000; - func_802B59DC(&sp120, arg1->unk6 + 0x16C); + temp_v0_15->words.w1 = 0; + temp_v0_15->words.w0 = 0xBD000000; + func_802B59DC((f32 (*)[4]) &sp120[0], (s16) (actor->wheelRot + 0x16C)); load_giant_egg(&sp160, 0xC1880000, 0x40C00000, 0x41800000); - mtxf_translate(&spE0, &sp160); - func_802B71CC(&spA0, &sp120, &spE0); - if (func_802B4FF8(&spA0, 3) != 0) { + mtxf_translate((f32 (*)[4]) &spE0[0], &sp160); + func_802B71CC((f32 (*)[4]) &spA0[0], (f32 (*)[4]) &sp120[0], (f32 (*)[4]) &spE0[0]); + if (func_802B4FF8((f32 (*)[4]) &spA0[0], 3) != 0) { temp_v0_16 = gDisplayListHead; gDisplayListHead = temp_v0_16 + 8; - temp_v0_16->unk0 = 0x6000000; - temp_v0_16->unk4 = sp30; + temp_v0_16->words.w0 = 0x06000000; + temp_v0_16->words.w1 = (u32) sp30; temp_v0_17 = gDisplayListHead; gDisplayListHead = temp_v0_17 + 8; - temp_v0_17->unk4 = 0; - temp_v0_17->unk0 = 0xBD000000; - func_802B59DC(&sp120, arg1->unk6 + 0x444); + temp_v0_17->words.w1 = 0; + temp_v0_17->words.w0 = 0xBD000000; + func_802B59DC((f32 (*)[4]) &sp120[0], (s16) (actor->wheelRot + 0x444)); load_giant_egg(&sp160, 0x41880000, 0x41400000, 0xC1400000); - mtxf_translate(&spE0, &sp160); - func_802B71CC(&spA0, &sp120, &spE0); - if (func_802B4FF8(&spA0, 3) != 0) { + mtxf_translate((f32 (*)[4]) &spE0[0], &sp160); + func_802B71CC((f32 (*)[4]) &spA0[0], (f32 (*)[4]) &sp120[0], (f32 (*)[4]) &spE0[0]); + if (func_802B4FF8((f32 (*)[4]) &spA0[0], 3) != 0) { temp_v0_18 = gDisplayListHead; gDisplayListHead = temp_v0_18 + 8; - temp_v0_18->unk4 = &D_06022D70; - temp_v0_18->unk0 = 0x6000000; + temp_v0_18->words.w1 = (u32) &D_06022D70; + temp_v0_18->words.w0 = 0x06000000; temp_v0_19 = gDisplayListHead; gDisplayListHead = temp_v0_19 + 8; - temp_v0_19->unk4 = 0; - temp_v0_19->unk0 = 0xBD000000; + temp_v0_19->words.w1 = 0; + temp_v0_19->words.w0 = 0xBD000000; sp30 = &D_06022D70; - func_802B59DC(&sp120, arg1->unk6 + 0x444); + func_802B59DC((f32 (*)[4]) &sp120[0], (s16) (actor->wheelRot + 0x444)); load_giant_egg(&sp160, 0xC1880000, 0x41400000, 0xC1400000); - mtxf_translate(&spE0, &sp160); - func_802B71CC(&spA0, &sp120, &spE0); - if (func_802B4FF8(&spA0, 3) != 0) { + mtxf_translate((f32 (*)[4]) &spE0[0], &sp160); + func_802B71CC((f32 (*)[4]) &spA0[0], (f32 (*)[4]) &sp120[0], (f32 (*)[4]) &spE0[0]); + if (func_802B4FF8((f32 (*)[4]) &spA0[0], 3) != 0) { temp_v0_20 = gDisplayListHead; gDisplayListHead = temp_v0_20 + 8; - temp_v0_20->unk0 = 0x6000000; - temp_v0_20->unk4 = sp30; + temp_v0_20->words.w0 = 0x06000000; + temp_v0_20->words.w1 = (u32) sp30; temp_v0_21 = gDisplayListHead; gDisplayListHead = temp_v0_21 + 8; - temp_v0_21->unk4 = 0; - temp_v0_21->unk0 = 0xBD000000; - func_802B59DC(&sp120, arg1->unk6 + 0x2D8); + temp_v0_21->words.w1 = 0; + temp_v0_21->words.w0 = 0xBD000000; + func_802B59DC((f32 (*)[4]) &sp120[0], (s16) (actor->wheelRot + 0x2D8)); load_giant_egg(&sp160, 0x41880000, 0x41400000, 0xC2080000); - mtxf_translate(&spE0, &sp160); - func_802B71CC(&spA0, &sp120, &spE0); - if (func_802B4FF8(&spA0, 3) != 0) { + mtxf_translate((f32 (*)[4]) &spE0[0], &sp160); + func_802B71CC((f32 (*)[4]) &spA0[0], (f32 (*)[4]) &sp120[0], (f32 (*)[4]) &spE0[0]); + if (func_802B4FF8((f32 (*)[4]) &spA0[0], 3) != 0) { temp_v0_22 = gDisplayListHead; gDisplayListHead = temp_v0_22 + 8; - temp_v0_22->unk0 = 0x6000000; - temp_v0_22->unk4 = sp30; + temp_v0_22->words.w0 = 0x06000000; + temp_v0_22->words.w1 = (u32) sp30; temp_v0_23 = gDisplayListHead; gDisplayListHead = temp_v0_23 + 8; - temp_v0_23->unk4 = 0; - temp_v0_23->unk0 = 0xBD000000; - func_802B59DC(&sp120, arg1->unk6 + 0x2D8); + temp_v0_23->words.w1 = 0; + temp_v0_23->words.w0 = 0xBD000000; + func_802B59DC((f32 (*)[4]) &sp120[0], (s16) (actor->wheelRot + 0x2D8)); load_giant_egg(&sp160, 0xC1880000, 0x41400000, 0xC2080000); - mtxf_translate(&spE0, &sp160); - func_802B71CC(&spA0, &sp120, &spE0); - if (func_802B4FF8(&spA0, 3) != 0) { + mtxf_translate((f32 (*)[4]) &spE0[0], &sp160); + func_802B71CC((f32 (*)[4]) &spA0[0], (f32 (*)[4]) &sp120[0], (f32 (*)[4]) &spE0[0]); + if (func_802B4FF8((f32 (*)[4]) &spA0[0], 3) != 0) { temp_v0_24 = gDisplayListHead; gDisplayListHead = temp_v0_24 + 8; - temp_v0_24->unk0 = 0x6000000; - temp_v0_24->unk4 = sp30; + temp_v0_24->words.w0 = 0x06000000; + temp_v0_24->words.w1 = (u32) sp30; temp_v0_25 = gDisplayListHead; gDisplayListHead = temp_v0_25 + 8; - temp_v0_25->unk4 = 0; - temp_v0_25->unk0 = 0xBD000000; + temp_v0_25->words.w1 = 0; + temp_v0_25->words.w0 = 0xBD000000; temp_v0_26 = gDisplayListHead; gDisplayListHead = temp_v0_26 + 8; - temp_v0_26->unk4 = 0x2000; - temp_v0_26->unk0 = 0xB7000000; + temp_v0_26->words.w1 = 0x00002000; + temp_v0_26->words.w0 = 0xB7000000; } } } @@ -3083,7 +3027,7 @@ void func_8029BFB0(void *arg0, void *arg1) { if (!(temp_f0 < 0.0f)) { temp_v0 = gDisplayListHead; gDisplayListHead = temp_v0 + 8; - temp_v0->unk4 = 0x20000; + temp_v0->unk_04 = 0x20000; temp_v0->unk0 = 0xB6000000; sp70 = temp_f2; func_802B5F74(&sp100, temp_a1, arg1 + 0x10); @@ -3091,27 +3035,27 @@ void func_8029BFB0(void *arg0, void *arg1) { if (temp_f2 < D_802B9734) { temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk4 = &D_0601F228; + temp_v0_2->unk_04 = &D_0601F228; temp_v0_2->unk0 = 0x6000000; } else if (temp_f2 < D_802B9738) { temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = &D_0601F708; + temp_v0_3->unk_04 = &D_0601F708; temp_v0_3->unk0 = 0x6000000; } else { temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = &D_0601FAF8; + temp_v0_4->unk_04 = &D_0601FAF8; temp_v0_4->unk0 = 0x6000000; } if (!(D_802B973C < temp_f2)) { temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0x2000; + temp_v0_5->unk_04 = 0x2000; temp_v0_5->unk0 = 0xB6000000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = &D_06022D28; + temp_v0_6->unk_04 = &D_06022D28; temp_v0_6->unk0 = 0x6000000; func_802B59DC(&sp100, arg1->unk6); load_giant_egg(&spF4, 0x41880000, 0x40C00000, 0x41000000); @@ -3120,11 +3064,11 @@ void func_8029BFB0(void *arg0, void *arg1) { if (func_802B4FF8(&sp74, 3) != 0) { temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = &D_06022DB8; + temp_v0_7->unk_04 = &D_06022DB8; temp_v0_7->unk0 = 0x6000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0; + temp_v0_8->unk_04 = 0; temp_v0_8->unk0 = 0xBD000000; sp30 = &D_06022DB8; func_802B59DC(&sp100, arg1->unk6); @@ -3135,10 +3079,10 @@ void func_8029BFB0(void *arg0, void *arg1) { temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; temp_v0_9->unk0 = 0x6000000; - temp_v0_9->unk4 = sp30; + temp_v0_9->unk_04 = sp30; temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk4 = 0; + temp_v0_10->unk_04 = 0; temp_v0_10->unk0 = 0xBD000000; func_802B59DC(&sp100, arg1->unk6 + 0x444); load_giant_egg(&spF4, 0x41880000, 0x40C00000, 0xC1000000); @@ -3148,10 +3092,10 @@ void func_8029BFB0(void *arg0, void *arg1) { temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; temp_v0_11->unk0 = 0x6000000; - temp_v0_11->unk4 = sp30; + temp_v0_11->unk_04 = sp30; temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk4 = 0; + temp_v0_12->unk_04 = 0; temp_v0_12->unk0 = 0xBD000000; func_802B59DC(&sp100, arg1->unk6 + 0x444); load_giant_egg(&spF4, 0xC1880000, 0x40C00000, 0xC1000000); @@ -3161,14 +3105,14 @@ void func_8029BFB0(void *arg0, void *arg1) { temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; temp_v0_13->unk0 = 0x6000000; - temp_v0_13->unk4 = sp30; + temp_v0_13->unk_04 = sp30; temp_v0_14 = gDisplayListHead; gDisplayListHead = temp_v0_14 + 8; - temp_v0_14->unk4 = 0; + temp_v0_14->unk_04 = 0; temp_v0_14->unk0 = 0xBD000000; temp_v0_15 = gDisplayListHead; gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk4 = 0x2000; + temp_v0_15->unk_04 = 0x2000; temp_v0_15->unk0 = 0xB7000000; } } @@ -3249,7 +3193,7 @@ void func_8029C3CC(void *arg0, void *arg1) { if (!(temp_f0 < 0.0f)) { temp_v0 = gDisplayListHead; gDisplayListHead = temp_v0 + 8; - temp_v0->unk4 = 0x20000; + temp_v0->unk_04 = 0x20000; temp_v0->unk0 = 0xB6000000; sp98 = temp_f2; func_802B5F74(&sp128, temp_a1, arg1 + 0x10); @@ -3257,39 +3201,39 @@ void func_8029C3CC(void *arg0, void *arg1) { if (temp_f2 < D_802B9744) { temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk4 = &D_06020A20; + temp_v0_2->unk_04 = &D_06020A20; temp_v0_2->unk0 = 0x6000000; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = &D_06020A08; + temp_v0_3->unk_04 = &D_06020A08; temp_v0_3->unk0 = 0x6000000; } else if (temp_f2 < D_802B9748) { temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = &D_06021550; + temp_v0_4->unk_04 = &D_06021550; temp_v0_4->unk0 = 0x6000000; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = &D_06021220; + temp_v0_5->unk_04 = &D_06021220; temp_v0_5->unk0 = 0x6000000; } else { temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = &D_06021C90; + temp_v0_6->unk_04 = &D_06021C90; temp_v0_6->unk0 = 0x6000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = &D_06021A80; + temp_v0_7->unk_04 = &D_06021A80; temp_v0_7->unk0 = 0x6000000; } if (!(D_802B974C < temp_f2)) { temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0x2000; + temp_v0_8->unk_04 = 0x2000; temp_v0_8->unk0 = 0xB6000000; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk4 = &D_06022D28; + temp_v0_9->unk_04 = &D_06022D28; temp_v0_9->unk0 = 0x6000000; func_802B59DC(&sp128, arg1->unk6); load_giant_egg(&sp11C, 0x41880000, 0x40C00000, 0x41E00000); @@ -3298,11 +3242,11 @@ void func_8029C3CC(void *arg0, void *arg1) { if (func_802B4FF8(&sp9C, 3) != 0) { temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk4 = &D_06022DB8; + temp_v0_10->unk_04 = &D_06022DB8; temp_v0_10->unk0 = 0x6000000; temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk4 = 0; + temp_v0_11->unk_04 = 0; temp_v0_11->unk0 = 0xBD000000; sp2C = &D_06022DB8; func_802B59DC(&sp128, arg1->unk6); @@ -3313,10 +3257,10 @@ void func_8029C3CC(void *arg0, void *arg1) { temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; temp_v0_12->unk0 = 0x6000000; - temp_v0_12->unk4 = sp2C; + temp_v0_12->unk_04 = sp2C; temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk4 = 0; + temp_v0_13->unk_04 = 0; temp_v0_13->unk0 = 0xBD000000; func_802B59DC(&sp128, arg1->unk6 + 0x222); load_giant_egg(&sp11C, 0x41880000, 0x40C00000, 0x41400000); @@ -3326,10 +3270,10 @@ void func_8029C3CC(void *arg0, void *arg1) { temp_v0_14 = gDisplayListHead; gDisplayListHead = temp_v0_14 + 8; temp_v0_14->unk0 = 0x6000000; - temp_v0_14->unk4 = sp2C; + temp_v0_14->unk_04 = sp2C; temp_v0_15 = gDisplayListHead; gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk4 = 0; + temp_v0_15->unk_04 = 0; temp_v0_15->unk0 = 0xBD000000; func_802B59DC(&sp128, arg1->unk6 + 0x222); load_giant_egg(&sp11C, 0xC1880000, 0x40C00000, 0x41400000); @@ -3339,10 +3283,10 @@ void func_8029C3CC(void *arg0, void *arg1) { temp_v0_16 = gDisplayListHead; gDisplayListHead = temp_v0_16 + 8; temp_v0_16->unk0 = 0x6000000; - temp_v0_16->unk4 = sp2C; + temp_v0_16->unk_04 = sp2C; temp_v0_17 = gDisplayListHead; gDisplayListHead = temp_v0_17 + 8; - temp_v0_17->unk4 = 0; + temp_v0_17->unk_04 = 0; temp_v0_17->unk0 = 0xBD000000; func_802B59DC(&sp128, arg1->unk6 + 0x5B0); load_giant_egg(&sp11C, 0x41880000, 0x40C00000, 0xC1000000); @@ -3352,10 +3296,10 @@ void func_8029C3CC(void *arg0, void *arg1) { temp_v0_18 = gDisplayListHead; gDisplayListHead = temp_v0_18 + 8; temp_v0_18->unk0 = 0x6000000; - temp_v0_18->unk4 = sp2C; + temp_v0_18->unk_04 = sp2C; temp_v0_19 = gDisplayListHead; gDisplayListHead = temp_v0_19 + 8; - temp_v0_19->unk4 = 0; + temp_v0_19->unk_04 = 0; temp_v0_19->unk0 = 0xBD000000; func_802B59DC(&sp128, arg1->unk6 + 0x5B0); load_giant_egg(&sp11C, 0xC1880000, 0x40C00000, 0xC1000000); @@ -3365,10 +3309,10 @@ void func_8029C3CC(void *arg0, void *arg1) { temp_v0_20 = gDisplayListHead; gDisplayListHead = temp_v0_20 + 8; temp_v0_20->unk0 = 0x6000000; - temp_v0_20->unk4 = sp2C; + temp_v0_20->unk_04 = sp2C; temp_v0_21 = gDisplayListHead; gDisplayListHead = temp_v0_21 + 8; - temp_v0_21->unk4 = 0; + temp_v0_21->unk_04 = 0; temp_v0_21->unk0 = 0xBD000000; func_802B59DC(&sp128, arg1->unk6 + 0x16C); load_giant_egg(&sp11C, 0x41880000, 0x40C00000, 0xC1C00000); @@ -3378,10 +3322,10 @@ void func_8029C3CC(void *arg0, void *arg1) { temp_v0_22 = gDisplayListHead; gDisplayListHead = temp_v0_22 + 8; temp_v0_22->unk0 = 0x6000000; - temp_v0_22->unk4 = sp2C; + temp_v0_22->unk_04 = sp2C; temp_v0_23 = gDisplayListHead; gDisplayListHead = temp_v0_23 + 8; - temp_v0_23->unk4 = 0; + temp_v0_23->unk_04 = 0; temp_v0_23->unk0 = 0xBD000000; func_802B59DC(&sp128, arg1->unk6 + 0x16C); load_giant_egg(&sp11C, 0xC1880000, 0x40C00000, 0xC1C00000); @@ -3391,14 +3335,14 @@ void func_8029C3CC(void *arg0, void *arg1) { temp_v0_24 = gDisplayListHead; gDisplayListHead = temp_v0_24 + 8; temp_v0_24->unk0 = 0x6000000; - temp_v0_24->unk4 = sp2C; + temp_v0_24->unk_04 = sp2C; temp_v0_25 = gDisplayListHead; gDisplayListHead = temp_v0_25 + 8; - temp_v0_25->unk4 = 0; + temp_v0_25->unk_04 = 0; temp_v0_25->unk0 = 0xBD000000; temp_v0_26 = gDisplayListHead; gDisplayListHead = temp_v0_26 + 8; - temp_v0_26->unk4 = 0x2000; + temp_v0_26->unk_04 = 0x2000; temp_v0_26->unk0 = 0xB7000000; } } @@ -3417,41 +3361,41 @@ GLOBAL_ASM("asm/non_matchings/code_actors/func_8029C3CC.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -f32 func_802ABE30(f32, f32, ?32, u16); // extern -s32 func_802B4FF8(? *, ?); // extern -? func_802B5F74(? *, f32 *, s16 *); // extern -f32 func_802B80D0(f32 *, u16, ?, f32, f32); // extern +//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd +f32 func_802ABE30(f32, f32, f32, u16); /* extern */ +s32 func_802B4FF8(? *, ?); /* extern */ +? func_802B5F74(? *, f32 *, s16 *); /* extern */ +f32 func_802B80D0(f32 *, u16, ?, f32, f32); /* extern */ extern ? D_06006F88; extern ? D_06006FE0; -extern f32 D_802B9750; -extern f32 D_802B9754; +extern ? D_80150130; +static f32 D_802B9750 = 4000000.0f; +static f32 D_802B9754 = 250000.0f; - -void func_8029CA90(void *arg0, void *arg1) { +void func_8029CA90(Camera *camera, struct FallingRock *rock) { s16 sp9C; s16 sp9A; s16 sp98; - ?32 sp94; + f32 sp94; f32 sp90; f32 sp8C; ? sp4C; f32 *sp2C; + Gfx *temp_v1; + Gfx *temp_v1_2; f32 *temp_a1; f32 temp_f0; f32 temp_f0_2; - void *temp_v1; - void *temp_v1_2; - temp_a1 = arg1 + 0x18; - if (arg1->unk4 == 0) { + temp_a1 = rock->pos; + if (rock->respawnTimer == 0) { sp2C = temp_a1; - temp_f0 = func_802B80D0(temp_a1, arg0->unk26, 0x43C80000, (&D_80150130)[(arg0 - camera1) / 0xB8], D_802B9750); + temp_f0 = func_802B80D0(temp_a1, (u16) camera->rotX2, 0x43C80000, *(&D_80150130 + (((s32) (camera - camera1) / 184) * 4)), D_802B9750); if (!(temp_f0 < 0.0f)) { - if ((temp_f0 < D_802B9754) && (arg1->unk34 == 1)) { - sp8C = arg1->unk18; - sp94 = arg1->unk20; - temp_f0_2 = func_802ABE30(sp8C, arg1->unk1C, sp94, arg1->unk3A); + if ((temp_f0 < D_802B9754) && (rock->unk30.unk34 == 1)) { + sp8C = rock->pos[0]; + sp94 = rock->pos[2]; + temp_f0_2 = func_802ABE30(sp8C, rock->pos[1], sp94, rock->unk30.unk3A); sp98 = 0; sp9A = 0; sp9C = 0; @@ -3460,18 +3404,18 @@ void func_8029CA90(void *arg0, void *arg1) { if (func_802B4FF8(&sp4C, 0) != 0) { temp_v1 = gDisplayListHead; gDisplayListHead = temp_v1 + 8; - temp_v1->unk0 = 0x6000000; - temp_v1->unk4 = &D_06006F88; + temp_v1->words.w0 = 0x06000000; + temp_v1->words.w1 = (u32) &D_06006F88; goto block_6; } } else { block_6: - func_802B5F74(&sp4C, sp2C, arg1 + 0x10); + func_802B5F74(&sp4C, sp2C, rock->rot); if (func_802B4FF8(&sp4C, 0) != 0) { temp_v1_2 = gDisplayListHead; gDisplayListHead = temp_v1_2 + 8; - temp_v1_2->unk4 = &D_06006FE0; - temp_v1_2->unk0 = 0x6000000; + temp_v1_2->words.w1 = (u32) &D_06006FE0; + temp_v1_2->words.w0 = 0x06000000; } } } @@ -3516,14 +3460,14 @@ void place_piranha_plants(u32 arg0) { temp_a0 = &sp60; sp60 = phi_s1 * gCourseDirection; sp64 = phi_s0->unk2; - sp68 = phi_s0->unk4; + sp68 = phi_s0->unk_04; temp_s0_2 = phi_s0 + 8; temp_v1 = &D_8015F9B8 + (func_8029EC88(temp_a0, &sp4C, &sp54, 0xA) * 0x70); - temp_v1->unk4 = 0; + temp_v1->unk_04 = 0; temp_v1->unk6 = 0; - temp_v1->unk8 = 0; + temp_v1->unk_08 = 0; temp_v1->unkA = 0; - temp_v1->unk24 = 0; + temp_v1->velocity = 0; temp_v1->unk26 = 0; temp_v1->unk28 = 0; temp_v1->unk2A = 0; @@ -3576,15 +3520,15 @@ void place_palm_trees(u32 arg0) { temp_a0 = &sp6C; sp6C = phi_v0 * gCourseDirection; sp70 = phi_s0->unk2; - sp74 = phi_s0->unk4; + sp74 = phi_s0->unk_04; temp_s1 = &D_8015F9B8 + (func_8029EC88(temp_a0, &sp58, &sp60, 0x19) * 0x70); temp_f8 = temp_s1->unk20; - temp_a2 = temp_s1->unk18; + temp_a2 = temp_s1->pos; temp_a3 = temp_s1->unk1C; - temp_s1->unk4 = phi_s0->unk6; + temp_s1->unk_04 = phi_s0->unk6; func_802ADDC8(temp_s1 + 0x30, 0x40A00000, temp_a2, temp_a3, temp_f8); func_802976EC(temp_s1 + 0x30, temp_s1 + 0x10); - temp_v0_2 = phi_s0->unk8; + temp_v0_2 = phi_s0->unk_08; phi_v0 = temp_v0_2; phi_s0 += 8; } while (temp_v0_2 != -0x8000); @@ -3611,10 +3555,10 @@ void func_8029CF0C(u32 arg0, void *arg1) { sp24.unk4 = D_802B8848.unk4; temp_v1 = arg1->unk6; temp_v0 = *(&gSegmentTable + ((arg0 >> 0x18) * 4)) + (arg0 & 0xFFFFFF) + 0x80000000 + (temp_v1 * 8); - arg1->unk4 = *(&sp24 + (temp_v1 * 2)); - arg1->unk18 = temp_v0->unk0 * gCourseDirection; + arg1->unk_04 = *(&sp24 + (temp_v1 * 2)); + arg1->pos = temp_v0->unk0 * gCourseDirection; arg1->unk1C = temp_v0->unk2 + 10.0f; - arg1->unk20 = temp_v0->unk4; + arg1->unk20 = temp_v0->unk_04; load_giant_egg(arg1 + 0x24, 0, 0, 0); func_802B52BC(arg1 + 0x10, 0, 0, 0); } @@ -3656,14 +3600,14 @@ void place_falling_rocks(u32 arg0) { do { sp64 = phi_v0 * gCourseDirection; sp68 = phi_s0->unk2 + 10.0f; - sp6C = phi_s0->unk4; + sp6C = phi_s0->unk_04; load_giant_egg(&sp58, 0, 0, 0); func_802B52BC(&sp50, 0, 0, 0); temp_v1 = &D_8015F9B8 + (func_8029EC88(temp_s4, &sp50, &sp58, 5) * 0x70); temp_a0 = temp_v1 + 0x30; temp_v1->unk6 = phi_s0->unk6; func_802AAAAC(temp_a0); - temp_v0_2 = phi_s0->unk8; + temp_v0_2 = phi_s0->unk_08; phi_v0 = temp_v0_2; phi_s0 += 8; } while (temp_v0_2 != -0x8000); @@ -3674,122 +3618,122 @@ GLOBAL_ASM("asm/non_matchings/code_actors/place_falling_rocks.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -//? func_800C98B8(void *, void *, ?); // extern -void func_8029CF0C(s8, struct Actor*); // extern -void func_802ADDC8(UnkActorInner, f32, f32, f32, f32); -//? func_802AC114(f32, f32 *, f32, void *, ?); // extern -//? func_802ADDC8(f32, f32, void *, ?, f32, f32, f32); // extern -extern s8 D_06007230[]; -extern f32 D_802B9758; -extern f64 D_802B9760; -extern f32 D_802B9768; -extern f32 D_802B976C; -extern f32 D_802B9770; -extern f32 D_802B9774; -extern f32 D_802B9778; +//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd +? func_800C98B8(f32 *, f32 *, ?); /* extern */ +? func_8029CF0C(? *, struct FallingRock *); /* extern */ +? func_802AC114(f32, f32 *, f32, f32 *, ?); /* extern */ +? func_802ADDC8(f32, f32, UnkActorInner *, ?, f32, f32, f32); /* extern */ +extern ? D_06007230; extern f32 D_8015F8E4; +static f32 D_802B9758 = 5461.0f; +static f64 D_802B9760 = 0.1; +static f32 D_802B9768 = -1.2f; +static f32 D_802B976C = -1.2f; +static f32 D_802B9770 = -1.2f; +static f32 D_802B9774 = -1.2f; +static f32 D_802B9778 = -1.2f; -void update_obj_falling_rocks(struct Actor *arg0) { +void update_obj_falling_rocks(struct FallingRock *rock) { f32 sp4C; f32 sp48; f32 sp44; f32 sp3C; f32 sp34; - void *sp30; + f32 *sp30; + f32 *temp_s1; + f32 *temp_s1_2; + f32 *temp_s1_3; f32 temp_f0; f32 temp_f0_2; f32 temp_f0_3; f32 temp_f10; + f32 temp_f14; f32 temp_f2; f32 temp_f2_2; f32 temp_f2_3; f32 temp_f4; - void *temp_s1; - void *temp_s1_2; - void *temp_s1_3; + s16 temp_v0; f32 phi_f12; - //temp_v0 = arg0->unk4; - if (arg0->unk4 != 0) { - arg0->unk4--; + temp_v0 = rock->respawnTimer; + if (temp_v0 != 0) { + rock->respawnTimer = temp_v0 - 1; return; } - if (arg0->unk18[1] < D_8015F8E4) { - func_8029CF0C(&D_06007230, arg0); + if (rock->pos[1] < D_8015F8E4) { + func_8029CF0C(&D_06007230, rock); } - //temp_f14 = D_802B9758; - arg0->unk10[0] += ((arg0->unk24[2] * D_802B9758) / 20.0f); - arg0->unk10[2] += ((arg0->unk24[0] * D_802B9758) / 20.0f); - arg0->unk24[1] -= D_802B9760; - if (arg0->unk24[1] < -2.0f) { - arg0->unk24[1] = -2.0f; + temp_f14 = D_802B9758; + rock->rot[0] += (s32) ((rock->velocity[2] * temp_f14) / 20.0f); + rock->rot[2] += (s32) ((rock->velocity[0] * temp_f14) / 20.0f); + rock->velocity[1] = (f32) ((f64) rock->velocity[1] - D_802B9760); + if (rock->velocity[1] < -2.0f) { + rock->velocity[1] = -2.0f; } - arg0->unk18[0] += arg0->unk24[0]; - arg0->unk18[1] += arg0->unk24[1]; - arg0->unk18[2] += arg0->unk24[2]; - sp3C = arg0->unk24[1]; - func_802ADDC8(&arg0->unk30, 10.0f, arg0->unk18[0], arg0->unk18[1], arg0->unk18[2]); - temp_f2 = arg0->unk30.unkC; //unk44; + rock->pos[0] += rock->velocity[0]; + rock->pos[1] += rock->velocity[1]; + rock->pos[2] += rock->velocity[2]; + sp3C = rock->velocity[1]; + func_802ADDC8(rock->velocity[0], temp_f14, &rock->unk30, 0x41200000, rock->pos[0], rock->pos[1], rock->pos[2]); + temp_f2 = rock->unk30.unk44; phi_f12 = 0.0f; if (temp_f2 < 0.0f) { - temp_s1 = arg0 + 0x24; - sp44 = -arg0->unk60; - sp48 = -arg0->unk64; - sp4C = -arg0->unk68; - temp_f0 = arg0->unk44; - arg0->unk18[0] = arg0->unk18[0] + (sp44 * temp_f0); - arg0->unk18[1] = arg0->unk18[1] + (sp48 * temp_f0); - arg0->unk18[2] = arg0->unk18[2] + (sp4C * temp_f0); + temp_s1 = rock->velocity; + sp44 = -rock->unk30.unk60[0]; + sp48 = -rock->unk30.unk60[1]; + sp4C = -rock->unk30.unk60[2]; + temp_f0 = rock->unk30.unk44; + rock->pos[0] += sp44 * temp_f0; + rock->pos[1] += sp48 * temp_f0; + rock->pos[2] += sp4C * temp_f0; func_802AC114(0.0f, &sp44, temp_f2, temp_s1, 0x40000000); - arg0->unk24[1] = D_802B9768 * sp3C; - func_800C98B8(arg0 + 0x18, temp_s1, 0x1900800F); + rock->velocity[1] = D_802B9768 * sp3C; + func_800C98B8(rock->pos, temp_s1, 0x1900800F); } - temp_f2_2 = arg0->unk3C; + temp_f2_2 = rock->unk30.unk3C; phi_f12 = 0.0f; if (temp_f2_2 < 0.0f) { - sp48 = -arg0->unk4C; + sp48 = -rock->unk30.unk48[1]; if (sp48 == 0.0f) { - arg0->unk24[1] *= D_802B976C; + rock->velocity[1] *= D_802B976C; return; } - temp_f4 = -arg0->unk48; - temp_s1_2 = arg0->unk24[0]; + temp_f4 = -rock->unk30.unk48[0]; + temp_s1_2 = rock->velocity; sp44 = temp_f4; - sp4C = -arg0->unk50; - temp_f0_2 = arg0->unk3C; - arg0->unk18[0] += (temp_f4 * temp_f0_2); - arg0->unk18[1] += (sp48 * temp_f0_2); - arg0->unk18[2] += (sp4C * temp_f0_2); - sp30 = arg0 + 0x18; + sp4C = -rock->unk30.unk48[2]; + temp_f0_2 = rock->unk30.unk3C; + rock->pos[0] += temp_f4 * temp_f0_2; + rock->pos[1] += sp48 * temp_f0_2; + rock->pos[2] += sp4C * temp_f0_2; + sp30 = rock->pos; sp34 = D_802B9770 * sp3C; func_802AC114(0.0f, &sp44, temp_f2_2, temp_s1_2, 0x40000000); - arg0->unk24[1] = sp34; + rock->velocity[1] = sp34; func_800C98B8(sp30, temp_s1_2, 0x1900800F); - //goto block_12; + goto block_12; } -//block_12: - temp_f2_3 = arg0->unk40; +block_12: + temp_f2_3 = rock->unk30.unk40; if (temp_f2_3 < phi_f12) { - sp48 = -arg0->unk58; + sp48 = -rock->unk30.unk54[1]; if (phi_f12 == sp48) { - arg0->unk24[1] *= D_802B9774; + rock->velocity[1] *= D_802B9774; return; } - temp_s1_3 = arg0->unk24[0]; - temp_f10 = -arg0->unk54; + temp_s1_3 = rock->velocity; + temp_f10 = -rock->unk30.unk54[0]; sp44 = temp_f10; - sp4C = -arg0->unk5C; - temp_f0_3 = arg0->unk40; - arg0->unk18[0] += (temp_f10 * temp_f0_3); - arg0->unk18[1] += (sp48 * temp_f0_3); - arg0->unk18[2] += (sp4C * temp_f0_3); - sp30 = arg0->unk18[0]; - sp3C = arg0->unk24[1]; + sp4C = -rock->unk30.unk54[2]; + temp_f0_3 = rock->unk30.unk40; + rock->pos[0] += temp_f10 * temp_f0_3; + rock->pos[1] += sp48 * temp_f0_3; + rock->pos[2] += sp4C * temp_f0_3; + sp30 = rock->pos; + sp3C = rock->velocity[1]; func_802AC114(phi_f12, &sp44, temp_f2_3, temp_s1_3, 0x40000000); - arg0->unk24[1] = D_802B9778 * sp3C; + rock->velocity[1] = D_802B9778 * sp3C; func_800C98B8(sp30, temp_s1_3, 0x1900800F); - // Duplicate return node #16. Try simplifying control flow for better match } } #else @@ -3844,7 +3788,7 @@ void place_segment_06(u32 arg0) { do { temp_t3 = gCurrentCourseId; sp8C = (f32) phi_v0 * gCourseDirection; - sp94 = (f32) phi_s3->unk4; + sp94 = (f32) phi_s3->unk_04; sp90 = (f32) phi_s3->unk2; switch (temp_t3) { case 0: @@ -3899,13 +3843,13 @@ void place_segment_06(u32 arg0) { func_802976D8(temp_s0 + 0x10); } else { temp_s1 = temp_s0 + 0x30; - func_802ADDC8(temp_s1, 0x40A00000, temp_s0->unk18, temp_s0->unk1C, temp_s0->unk20); - if (temp_s0->unk44 < 0.0f) { - temp_s0->unk1C = func_802ABE30(temp_s0->unk18, temp_s0->unk1C, temp_s0->unk20, temp_s0->unk3A); + func_802ADDC8(temp_s1, 0x40A00000, temp_s0->pos, temp_s0->unk1C, temp_s0->unk20); + if (temp_s0->unk_044 < 0.0f) { + temp_s0->unk1C = func_802ABE30(temp_s0->pos, temp_s0->unk1C, temp_s0->unk20, temp_s0->unk3A); } func_802976EC(temp_s1, temp_s0 + 0x10); } - temp_v0_4 = phi_s3->unk8; + temp_v0_4 = phi_s3->unk_08; phi_v0 = temp_v0_4; phi_s3 += 8; } while (temp_v0_4 != -0x8000); @@ -3917,14 +3861,13 @@ GLOBAL_ASM("asm/non_matchings/code_actors/place_segment_06.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s16 func_8029EC88(f32 *, s16 *, ? *, ?); // extern -? load_giant_egg(? *, ?, ?, ?); // extern -s16 random_u16(); // extern -extern s16 gPlaceItemBoxes; -extern ? D_8015F9B8; +//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd +s16 func_8029EC88(f32 *, s16 *, ? *, ?); /* extern */ +f32 func_802AE1C0(f32, f32, f32); /* extern */ +? load_giant_egg(? *, ?, ?, ?); /* extern */ +s16 random_u16(); /* extern */ extern f32 gCourseDirection; -extern ? gSegmentTable; +extern s16 gPlaceItemBoxes; void place_all_item_boxes(u32 arg0) { f32 sp74; @@ -3943,13 +3886,13 @@ void place_all_item_boxes(u32 arg0) { s16 temp_s1; s16 temp_v1; s16 temp_v1_2; - void *temp_v0; + struct ItemBox *temp_v0; s16 phi_v1; s16 *phi_s0; - temp_s0 = *(&gSegmentTable + ((arg0 >> 0x18) * 4)) + (arg0 & 0xFFFFFF) + 0x80000000; + temp_s0 = gSegmentTable[arg0 >> 0x18] + (arg0 & 0xFFFFFF) + 0x80000000; phi_s0 = temp_s0; - if ((gModeSelection != TIME_TRIALS) && (gPlaceItemBoxes != 0)) { + if ((gModeSelection != 1) && (gPlaceItemBoxes != 0)) { load_giant_egg(&sp60, 0, 0, 0); temp_v1 = *temp_s0; phi_v1 = temp_v1; @@ -3957,9 +3900,9 @@ void place_all_item_boxes(u32 arg0) { temp_s6 = &sp58; temp_s5 = &sp6C; do { - sp6C = phi_v1 * gCourseDirection; - sp70 = phi_s0->unk2; - sp74 = phi_s0->unk4; + sp6C = (f32) phi_v1 * gCourseDirection; + sp70 = (f32) phi_s0->unk2; + sp74 = (f32) phi_s0->unk_04; sp58 = random_u16(); sp5A = random_u16(); sp5C = random_u16(); @@ -3967,10 +3910,10 @@ void place_all_item_boxes(u32 arg0) { temp_f0 = func_802AE1C0(sp6C, sp70 + 10.0f, sp74); temp_f16 = temp_f0 - 20.0f; temp_s0_2 = phi_s0 + 8; - temp_v0 = &D_8015F9B8 + (temp_s1 * 0x70); - temp_v0->unk8 = temp_f0; - temp_v0->unk1C = temp_f16; - temp_v0->unk24 = sp70; + temp_v0 = &D_8015F9B8[temp_s1]; + temp_v0->resetDistance = temp_f0; + temp_v0->pos[1] = temp_f16; + temp_v0->origY = sp70; temp_v1_2 = *temp_s0_2; phi_v1 = temp_v1_2; phi_s0 = temp_s0_2; @@ -4002,7 +3945,7 @@ void func_8029D9F8(void) { do { temp_v0 = *phi_s1; if (((temp_v0 & 0x4000) != 0) && ((temp_v0 & 0x100) == 0)) { - (&D_8015F9B8 + (func_8029EC88(&sp64, &sp50, &sp58, 0x2D) * 0x70))->unk4 = phi_s0; + (&D_8015F9B8 + (func_8029EC88(&sp64, &sp50, &sp58, 0x2D) * 0x70))->unk_04 = phi_s0; } temp_s0 = phi_s0 + 1; phi_s1 += 0xDD8; @@ -4027,9 +3970,9 @@ void func_8029DAB8(void) { temp_v1 = &D_8015F9B8[i]; temp_v1->unk2 = 0; temp_v1->unk0 = 0; - temp_v1->unk4 = 0; + temp_v1->unk_04 = 0; temp_v1->unk6 = 0; - temp_v1->unk8 = 0.0f; + temp_v1->unk_08 = 0.0f; temp_v1->unkC = 0.0f; } } @@ -4117,7 +4060,7 @@ void func_8029DB44(void) { temp_t9 = gCurrentCourseId; D_8015F900 = 0; switch (temp_t9) { - case 0: + case COURSE_MARIO_RACEWAY: place_segment_06(&D_06009570); place_piranha_plants(&D_06009518); place_all_item_boxes(&D_06009498); @@ -4131,18 +4074,18 @@ void func_8029DB44(void) { temp_v1 = (func_8029EC88(temp_a0_2, &sp2C, &sp34, 0x17) * 0x70) + &D_8015F9B8; temp_v1->unk2 = temp_v1->unk2 | 0x4000; break; - case 1: + case COURSE_CHOCO_MOUNTAIN: place_all_item_boxes(&D_06007250); place_falling_rocks(&D_06007230); break; - case 2: + case COURSE_BOWSER_CASTLE: place_segment_06(&D_06009290); place_all_item_boxes(&D_06009370); break; - case 3: + case COURSE_BANSHEE_BOARDWALK: place_all_item_boxes(&D_0600B3D0); break; - case 4: + case COURSE_YOSHI_VALLEY: place_segment_06(&D_060180A0); place_all_item_boxes(&D_06018110); load_giant_egg(&sp40, 0xC50FC000, 0, 0x441E8000); @@ -4150,34 +4093,34 @@ void func_8029DB44(void) { sp40 *= gCourseDirection; func_8029EC88(temp_a0_3, &sp2C, &sp34, 9); break; - case 5: + case COURSE_FRAPPE_SNOWLAND: place_segment_06(&D_06007718); place_all_item_boxes(&D_06007810); break; - case 6: + case COURSE_KOOPA_BEACH: func_802A14BC(328.0f * gCourseDirection, 0x428C0000, 0x451ED000); place_all_item_boxes(&D_06018E78); place_palm_trees(&D_06018F70); break; - case 7: + case COURSE_ROYAL_RACEWAY: place_segment_06(&D_0600DA78); place_all_item_boxes(&D_0600DB80); place_piranha_plants(&D_0600D9F0); break; - case 8: + case COURSE_LUIGI_RACEWAY: place_segment_06(&D_0600FE80); place_all_item_boxes(&D_0600FDE8); break; - case 9: + case COURSE_MOO_MOO_FARM: if (gPlayerCountSelection1 != 4) { place_segment_06(&D_06014330); } place_all_item_boxes(&D_060143E0); break; - case 10: + case COURSE_TOADS_TURNPIKE: place_all_item_boxes(&D_06023AE0); break; - case 11: + case COURSE_KALAMARI_DESERT: place_segment_06(&D_06022F08); place_all_item_boxes(&D_06022E88); load_giant_egg(&sp40, 0xC4D20000, 0x40000000, 0x420C0000); @@ -4198,13 +4141,13 @@ void func_8029DB44(void) { sp40 *= gCourseDirection; *(&D_8015F9BE + (func_8029EC88(temp_a0_7, &sp2C, &sp34, 0x27) * 0x70)) = 0; break; - case 12: + case COURSE_SHERBET_LAND: place_all_item_boxes(&D_06009B80); break; - case 13: + case COURSE_RAINBOW_ROAD: place_all_item_boxes(&D_06016338); break; - case 14: + case COURSE_WARIO_STADIUM: place_all_item_boxes(&D_0600CB40); load_giant_egg(&sp40, 0xC3030000, 0x42A60000, 0x438F0000); temp_a0_8 = &sp40; @@ -4219,21 +4162,21 @@ void func_8029DB44(void) { sp40 *= gCourseDirection; func_8029EC88(temp_a0_10, &sp2C, &sp34, 0x23); break; - case 15: + case COURSE_BLOCK_FORT: place_all_item_boxes(&D_06000038); break; - case 16: + case COURSE_SKYSCRAPER: place_all_item_boxes(&D_06000080); break; - case 17: + case COURSE_DOUBLE_DECK: place_all_item_boxes(&D_06000028); break; - case 18: + case COURSE_DK_JUNGLE: place_all_item_boxes(&D_06013EC0); func_8029D9F8(); func_80298D10(); break; - case 19: + case COURSE_BIG_DONUT: place_all_item_boxes(&D_06000058); break; } @@ -4464,13 +4407,15 @@ GLOBAL_ASM("asm/non_matchings/code_actors/func_8029E854.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 -? func_8000EE58(s16, s32, s32, s32); /* extern */ -? func_80296D10(void *, s32, s32, s32, s32); /* extern */ -? func_8029E7DC(void *, s32, s32, s32); /* extern */ -extern ? D_8015F9B8; +//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd +? func_8000EE58(s16, s16, s32, s32); /* extern */ +? func_80296D10(struct Actor *, s32, s16 *, f32 *, s32); /* extern */ +? func_8029E7DC(struct Actor *, s16, s32, s32); /* extern */ +extern u16 D_8015F900; -s16 func_8029E890(s32 arg0, s32 arg1, s32 arg2, s16 arg3) { +s16 func_8029E890(s32 arg0, s16 *arg1, f32 *arg2, s16 actorType) { + s16 temp_s1; + s16 temp_s1_2; s16 temp_t4; s16 temp_t4_2; s16 temp_v0; @@ -4481,69 +4426,62 @@ s16 func_8029E890(s32 arg0, s32 arg1, s32 arg2, s16 arg3) { s16 temp_v0_6; s16 temp_v0_7; s16 temp_v0_8; - s32 temp_s1; - s32 temp_s1_2; u16 temp_t3; - void *phi_s0; + struct Actor *phi_s0; s16 phi_s1; - void *phi_s0_2; + struct Actor *phi_s0_2; s16 phi_s1_2; temp_t3 = D_8015F900; - phi_s1 = temp_t3; - if (temp_t3 < 0x64) { - phi_s0 = (temp_t3 * 0x70) + &D_8015F9B8; + phi_s1 = (s16) temp_t3; + if ((s32) temp_t3 < 0x64) { + phi_s0 = &D_8015F9B8[temp_t3]; loop_2: - if ((phi_s0->unk2 & 0xF) == 0) { - temp_v0 = phi_s0->unk0; - if (temp_v0 != 6) { - if (temp_v0 != 7) { - if (temp_v0 != 8) { - if (temp_v0 != 0xD) { - goto block_24; - } - temp_v0_2 = phi_s0->unk6; - if ((temp_v0_2 == 1) || (temp_v0_2 == 2)) { - func_8029E7DC(phi_s0, 2, 6, 8); - func_80296D10(phi_s0, arg0, arg1, arg2, arg3); - return phi_s1; - } - goto block_24; - } - temp_t4 = phi_s0->unk6; - switch (temp_t4) { /* switch 1 */ - case 2: /* switch 1 */ - case 3: /* switch 1 */ - case 4: /* switch 1 */ - case 5: /* switch 1 */ - case 8: /* switch 1 */ - case 9: /* switch 1 */ - func_8000EE58(phi_s1, 2, 6, 8); - /* fallthrough */ - case 7: /* switch 1 */ - func_8029E7DC(phi_s0); - func_80296D10(phi_s0, arg0, arg1, arg2, arg3); - return phi_s1; - } - } else { - temp_v0_3 = phi_s0->unk6; - if (temp_v0_3 != 2) { - if (temp_v0_3 != 7) { - goto block_24; - } - goto block_16; - } + if ((phi_s0->flags & 0xF) == 0) { + temp_v0 = phi_s0->type; + switch (temp_v0) { /* switch 5; irregular */ + case ACTOR_RED_SHELL: /* switch 5 */ + temp_t4 = phi_s0->state; + switch (temp_t4) { /* switch 1 */ + case 2: /* switch 1 */ + case 3: /* switch 1 */ + case 4: /* switch 1 */ + case 5: /* switch 1 */ + case 8: /* switch 1 */ + case 9: /* switch 1 */ func_8000EE58(phi_s1, 2, 6, 8); -block_16: + /* fallthrough */ + case 7: /* switch 1 */ func_8029E7DC(phi_s0); - func_80296D10(phi_s0, arg0, arg1, arg2, arg3); + func_80296D10(phi_s0, arg0, arg1, arg2, (s32) actorType); return phi_s1; } - } else { - temp_v0_4 = phi_s0->unk6; - if ((temp_v0_4 == 1) || (temp_v0_4 == 4) || (temp_v0_4 == 5)) { + break; + case ACTOR_GREEN_SHELL: /* switch 5 */ + temp_v0_2 = phi_s0->state; + switch (temp_v0_2) { /* switch 6; irregular */ + case 2: /* switch 6 */ + func_8000EE58(phi_s1, 2, 6, 8); + /* fallthrough */ + case 7: /* switch 6 */ + func_8029E7DC(phi_s0); + func_80296D10(phi_s0, arg0, arg1, arg2, (s32) actorType); + return phi_s1; + } + break; + case ACTOR_BANANA: /* switch 5 */ + temp_v0_3 = phi_s0->state; + if ((temp_v0_3 == 1) || (temp_v0_3 == 4) || (temp_v0_3 == 5)) { func_8029E7DC(phi_s0, 2, 6, 8); - func_80296D10(phi_s0, arg0, arg1, arg2, arg3); + func_80296D10(phi_s0, arg0, arg1, arg2, (s32) actorType); + return phi_s1; + } + goto block_24; + case ACTOR_FAKE_ITEM_BOX: /* switch 5 */ + temp_v0_4 = phi_s0->state; + if ((temp_v0_4 == 1) || (temp_v0_4 == 2)) { + func_8029E7DC(phi_s0, 2, 6, 8); + func_80296D10(phi_s0, arg0, arg1, arg2, (s32) actorType); return phi_s1; } goto block_24; @@ -4561,70 +4499,67 @@ block_24: } } else { block_26: - phi_s1_2 = D_8015F900; - if (D_8015F900 < 0x64) { - phi_s0_2 = (D_8015F900 * 0x70) + &D_8015F9B8; + phi_s1_2 = (s16) D_8015F900; + if ((s16) D_8015F900 < 0x64) { + phi_s0_2 = &D_8015F9B8[(s16) D_8015F900]; loop_28: - temp_v0_5 = phi_s0_2->unk0; - if (temp_v0_5 != 6) { - if (temp_v0_5 != 7) { - if (temp_v0_5 != 8) { - if (temp_v0_5 != 0xD) { - goto block_49; - } - temp_v0_6 = phi_s0_2->unk6; - if ((temp_v0_6 == 1) || (temp_v0_6 == 2)) { - func_8029E7DC(phi_s0_2, 2, 6, 8); - func_80296D10(phi_s0_2, arg0, arg1, arg2, arg3); - return phi_s1_2; - } - goto block_49; - } - temp_t4_2 = phi_s0_2->unk6; - switch (temp_t4_2) { /* switch 2 */ - case 2: /* switch 2 */ - case 3: /* switch 2 */ - case 4: /* switch 2 */ - case 5: /* switch 2 */ - case 8: /* switch 2 */ - case 9: /* switch 2 */ - func_8000EE58(phi_s1_2, 2, 6, 8); - /* fallthrough */ - case 7: /* switch 2 */ - func_8029E7DC(phi_s0_2); - func_80296D10(phi_s0_2, arg0, arg1, arg2, arg3); - return phi_s1_2; - } - } else { - temp_v0_7 = phi_s0_2->unk6; - if (temp_v0_7 != 2) { - if (temp_v0_7 != 7) { - goto block_49; - } - goto block_41; - } + temp_v0_5 = phi_s0_2->type; + switch (temp_v0_5) { /* switch 3; irregular */ + case ACTOR_RED_SHELL: /* switch 3 */ + temp_t4_2 = phi_s0_2->state; + switch (temp_t4_2) { /* switch 2 */ + case 2: /* switch 2 */ + case 3: /* switch 2 */ + case 4: /* switch 2 */ + case 5: /* switch 2 */ + case 8: /* switch 2 */ + case 9: /* switch 2 */ func_8000EE58(phi_s1_2, 2, 6, 8); -block_41: + /* fallthrough */ + case 7: /* switch 2 */ func_8029E7DC(phi_s0_2); - func_80296D10(phi_s0_2, arg0, arg1, arg2, arg3); + func_80296D10(phi_s0_2, arg0, arg1, arg2, (s32) actorType); return phi_s1_2; - } - } else { - temp_v0_8 = phi_s0_2->unk6; - if ((temp_v0_8 == 1) || (temp_v0_8 == 4) || (temp_v0_8 == 5)) { - func_8029E7DC(phi_s0_2, 2, 6, 8); - func_80296D10(phi_s0_2, arg0, arg1, arg2, arg3); - return phi_s1_2; - } - default: /* switch 2 */ + default: /* switch 3 */ + default: /* switch 2 */ block_49: - temp_s1_2 = phi_s1_2 + 1; - phi_s0_2 += 0x70; - phi_s1_2 = temp_s1_2; - if (temp_s1_2 >= 0x64) { - goto block_50; + temp_s1_2 = phi_s1_2 + 1; + phi_s0_2 += 0x70; + phi_s1_2 = temp_s1_2; + if (temp_s1_2 >= 0x64) { + goto block_50; + } + goto loop_28; } - goto loop_28; + break; + case ACTOR_GREEN_SHELL: /* switch 3 */ + temp_v0_6 = phi_s0_2->state; + switch (temp_v0_6) { /* switch 4; irregular */ + case 2: /* switch 4 */ + func_8000EE58(phi_s1_2, 2, 6, 8); + /* fallthrough */ + case 7: /* switch 4 */ + func_8029E7DC(phi_s0_2); + func_80296D10(phi_s0_2, arg0, arg1, arg2, (s32) actorType); + return phi_s1_2; + } + break; + case ACTOR_BANANA: /* switch 3 */ + temp_v0_7 = phi_s0_2->state; + if ((temp_v0_7 == 1) || (temp_v0_7 == 4) || (temp_v0_7 == 5)) { + func_8029E7DC(phi_s0_2, 2, 6, 8); + func_80296D10(phi_s0_2, arg0, arg1, arg2, (s32) actorType); + return phi_s1_2; + } + goto block_49; + case ACTOR_FAKE_ITEM_BOX: /* switch 3 */ + temp_v0_8 = phi_s0_2->state; + if ((temp_v0_8 == 1) || (temp_v0_8 == 2)) { + func_8029E7DC(phi_s0_2, 2, 6, 8); + func_80296D10(phi_s0_2, arg0, arg1, arg2, (s32) actorType); + return phi_s1_2; + } + goto block_49; } } else { block_50: @@ -4736,14 +4671,14 @@ extern f32 D_802B9898; if (temp_f20 < temp_f2) { return 0; } - temp_f0_2 = arg1->unk4 - arg0->unk18; + temp_f0_2 = arg1->unk_04 - arg0->pos; if (temp_f12 < temp_f0_2) { return 0; } if (temp_f0_2 < -temp_f12) { return 0; } - temp_f14 = arg1->unk8 - arg0->unk1C; + temp_f14 = arg1->unk_08 - arg0->unk1C; if (temp_f22 < temp_f14) { return 0; } @@ -4796,7 +4731,7 @@ extern f32 D_802B9898; arg0->unk14 = arg1->unk0 - (temp_f20_2 * temp_f22 * temp_f0_6); arg0->unk34 = 0.0f; arg0->unk3C = 0.0f; - arg0->unk1C = arg1->unk8 - (temp_f14_2 * temp_f22 * temp_f0_6); + arg0->unk1C = arg1->unk_08 - (temp_f14_2 * temp_f22 * temp_f0_6); return 1; } temp_f2_2 = temp_f0_5 * (((temp_f20_2 * temp_f16) + (temp_f14_2 * temp_f18)) / temp_f0_5) * arg4 * D_802B9898; @@ -5004,9 +4939,9 @@ extern f32 D_802B98A8; void *phi_a3_2; temp_f6 = arg0->unk14; - temp_f4 = arg1->unk18; + temp_f4 = arg1->pos; temp_f18 = temp_f4 - temp_f6; - temp_f16 = arg1->unk8; + temp_f16 = arg1->unk_08; if ((temp_f18 < 0.0f) && (temp_f18 < -temp_f16)) { return 0; } @@ -5022,7 +4957,7 @@ extern f32 D_802B98A8; if (temp_f16 < temp_f14) { return 0; } - temp_f0 = arg0->unk18 - arg1->unk1C; + temp_f0 = arg0->pos - arg1->unk1C; if (temp_f0 < 0.0f) { return 0; } @@ -5082,7 +5017,7 @@ block_23: phi_a3->unkBC = temp_v0_2 | 0x8000; } temp_v0_3 = gCurrentCourseId; - sp20 = arg1->unk18; + sp20 = arg1->pos; sp24 = arg1->unk1C; sp28 = arg1->unk20; if (((temp_v0_3 == 0) || (temp_v0_3 == 4) || (temp_v0_3 == 7) || (temp_v0_3 == 8)) && (phi_a3->unk94 > 1.0f)) { @@ -5143,22 +5078,22 @@ s32 func_8029FB80(Player *arg0, struct Actor *arg1) { f32 temp_f16; f32 temp_f2; - temp_f0 = arg0->boundingBoxSize + arg1->unkC; - temp_f2 = arg1->unk18[0] - arg0->pos[0]; + temp_f0 = arg0->boundingBoxSize + arg1->boundingBoxSize; + temp_f2 = arg1->pos[0] - arg0->pos[0]; if (temp_f0 < temp_f2) { return 0; } if (temp_f2 < -temp_f0) { return 0; } - temp_f14 = arg1->unk18[1] - arg0->pos[1]; + temp_f14 = arg1->pos[1] - arg0->pos[1]; if (temp_f0 < temp_f14) { return 0; } if (temp_f14 < -temp_f0) { return 0; } - temp_f16 = arg1->unk18[2] - arg0->pos[2]; + temp_f16 = arg1->pos[2] - arg0->pos[2]; if (temp_f0 < temp_f16) { return 0; } @@ -5184,22 +5119,22 @@ s32 func_8029FCA4(struct Actor *arg0, struct Actor *arg1) { f32 temp_f16; f32 temp_f2; - temp_f0 = arg0->unkC + arg1->unkC; - temp_f2 = arg0->unk18[0] - arg1->unk18[0]; + temp_f0 = arg0->boundingBoxSize + arg1->boundingBoxSize; + temp_f2 = arg0->pos[0] - arg1->pos[0]; if (temp_f0 < temp_f2) { return 0; } if (temp_f2 < -temp_f0) { return 0; } - temp_f14 = arg0->unk18[1] - arg1->unk18[1]; + temp_f14 = arg0->pos[1] - arg1->pos[1]; if (temp_f0 < temp_f14) { return 0; } if (temp_f14 < -temp_f0) { return 0; } - temp_f16 = arg0->unk18[2] - arg1->unk18[2]; + temp_f16 = arg0->pos[2] - arg1->pos[2]; if (temp_f0 < temp_f16) { return 0; } @@ -5217,229 +5152,215 @@ s32 func_8029FCA4(struct Actor *arg0, struct Actor *arg1) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 +//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd ? func_8000EE58(s32); /* extern */ -? func_800C9EF4(void *, ?, void *, s16); /* extern */ -? func_802B02B4(void *, ?, void *, s16); /* extern */ -? func_802B0570(void *); /* extern */ -extern ? D_8015F9B8; +? func_800C9EF4(f32 *, ?, struct Actor *, s16); /* extern */ +? func_802B02B4(struct Actor *, ?, struct Actor *, s16); /* extern */ +? func_802B0570(struct Actor *); /* extern */ -void func_8029FDC8(void *arg0) { - s16 temp_t7; +void func_8029FDC8(struct Actor *actor) { + Player *temp_v0_2; + Player *temp_v0_3; + f32 *temp_a0; s16 temp_v0; s16 temp_v1; s16 temp_v1_2; s16 temp_v1_3; - s32 temp_f18; + struct Actor *temp_a2; u16 temp_t6; - void *temp_a0; - void *temp_a2; - void *phi_a2; - void *phi_a2_2; - void *phi_a2_3; + struct Actor *phi_a2; + struct Actor *phi_a2_2; + struct Actor *phi_a2_3; - temp_v0 = arg0->unk0; - temp_a2 = arg0; + temp_v0 = actor->type; + temp_a2 = actor; phi_a2 = temp_a2; phi_a2_2 = temp_a2; phi_a2_3 = temp_a2; - if (temp_v0 != 6) { - if (temp_v0 != 7) { - if (temp_v0 != 8) { - if (temp_v0 != 0xD) { - if (temp_v0 != 0x2A) { - return; - } - temp_v1 = temp_a2->unk6; - if (temp_v1 != 7) { - switch (temp_v1) { /* switch 2 */ - case 2: /* switch 2 */ - case 3: /* switch 2 */ - case 4: /* switch 2 */ - case 5: /* switch 2 */ - case 8: /* switch 2 */ - case 9: /* switch 2 */ - temp_a0 = temp_a2 + 0x18; - arg0 = temp_a2; - func_800C9EF4(temp_a0, 0x51018008, temp_a2, 7); - func_8000EE58((arg0 - &D_8015F9B8) / 112); - phi_a2 = arg0; - /* fallthrough */ - case 0: /* switch 2 */ - case 1: /* switch 2 */ - phi_a2->unk2 = -0x8000; - phi_a2->unk12 = 0; - phi_a2->unk4 = 0x3C; - phi_a2->unk6 = 7; - phi_a2->unk28 = 3.0f; - return; - } - } else { - /* Duplicate return node #34. Try simplifying control flow for better match */ - } - } else { - temp_f18 = temp_a2->unk24; - if (temp_a2->unk6 == 0) { - gPlayers[temp_f18].unk_00C &= 0xFFFBFFFF; - } - temp_a2->unk6 = 2; - temp_a2->unk2 = -0x8000; - temp_a2->unk4 = 0; - /* Duplicate return node #34. Try simplifying control flow for better match */ - } - } else { - temp_v1_2 = temp_a2->unk6; - if (temp_v1_2 != 7) { - switch (temp_v1_2) { /* switch 3 */ - case 2: /* switch 3 */ - case 3: /* switch 3 */ - case 4: /* switch 3 */ - case 5: /* switch 3 */ - case 8: /* switch 3 */ - case 9: /* switch 3 */ - arg0 = temp_a2; - func_8000EE58((temp_a2 - &D_8015F9B8) / 112); - phi_a2_2 = arg0; - /* fallthrough */ - case 0: /* switch 3 */ - case 1: /* switch 3 */ - phi_a2_2->unk2 = -0x8000; - phi_a2_2->unk12 = 0; - phi_a2_2->unk4 = 0x3C; - phi_a2_2->unk6 = 7; - phi_a2_2->unk28 = 3.0f; - return; - case 6: /* switch 3 */ - func_802B02B4(temp_a2, 8, temp_a2, 7); - return; - } - } else { - /* Duplicate return node #34. Try simplifying control flow for better match */ - } - } - } else { - temp_v1_3 = temp_a2->unk6; - if (temp_v1_3 != 5) { - if ((temp_v1_3 != 0) && (temp_v1_3 != 1)) { - if (temp_v1_3 != 2) { - if (temp_v1_3 != 4) { - return; - } - func_802B02B4(temp_a2, 7, temp_a2, 7); - return; - } - arg0 = temp_a2; - func_8000EE58((temp_a2 - &D_8015F9B8) / 112); - phi_a2_3 = arg0; - goto block_18; - } -block_18: - phi_a2_3->unk2 = -0x8000; - phi_a2_3->unk12 = 0; - phi_a2_3->unk4 = 0x3C; - phi_a2_3->unk6 = 5; - phi_a2_3->unk28 = 3.0f; - return; - } - /* Duplicate return node #34. Try simplifying control flow for better match */ - } - } else { - temp_t6 = temp_a2->unk6; + switch (temp_v0) { /* switch 4; irregular */ + case ACTOR_BANANA: /* switch 4 */ + temp_t6 = (u16) temp_a2->state; switch (temp_t6) { /* switch 1 */ case 2: /* switch 1 */ case 3: /* switch 1 */ func_802B0570(temp_a2); return; case 0: /* switch 1 */ - temp_t7 = temp_a2->unk10; - gPlayers[temp_t7].unk_00C &= 0xFFFBFFFF; + temp_v0_2 = &gPlayers[temp_a2->rot[0]]; + temp_v0_2->unk_00C &= 0xFFFBFFFF; /* fallthrough */ case 4: /* switch 1 */ - temp_a2->unk2 = -0x8000; - temp_a2->unk4 = 0x3C; - temp_a2->unk6 = 5; - temp_a2->unk28 = 3.0f; + temp_a2->flags = -0x8000; + temp_a2->unk_04 = 0x003C; + temp_a2->state = 5; + temp_a2->velocity[1] = 3.0f; return; default: /* switch 1 */ - default: /* switch 3 */ + case 5: /* switch 5 */ default: /* switch 2 */ + default: /* switch 3 */ return; } + break; + case ACTOR_GREEN_SHELL: /* switch 4 */ + temp_v1 = temp_a2->state; + switch (temp_v1) { /* switch 5; irregular */ + case 2: /* switch 5 */ + actor = temp_a2; + func_8000EE58((s32) (temp_a2 - D_8015F9B8) / 112); + phi_a2_3 = actor; + /* fallthrough */ + case 0: /* switch 5 */ + case 1: /* switch 5 */ + phi_a2_3->flags = -0x8000; + phi_a2_3->rot[1] = 0; + phi_a2_3->unk_04 = 0x003C; + phi_a2_3->state = 5; + phi_a2_3->velocity[1] = 3.0f; + return; + case 4: /* switch 5 */ + func_802B02B4(temp_a2, 7, temp_a2, 7); + return; + } + break; + case ACTOR_BLUE_SPINY_SHELL: /* switch 4 */ + temp_v1_2 = temp_a2->state; + if (temp_v1_2 != 7) { + switch (temp_v1_2) { /* switch 2 */ + case 2: /* switch 2 */ + case 3: /* switch 2 */ + case 4: /* switch 2 */ + case 5: /* switch 2 */ + case 8: /* switch 2 */ + case 9: /* switch 2 */ + temp_a0 = temp_a2->pos; + actor = temp_a2; + func_800C9EF4(temp_a0, 0x51018008, temp_a2, 7); + func_8000EE58((s32) (actor - D_8015F9B8) / 112); + phi_a2 = actor; + /* fallthrough */ + case 0: /* switch 2 */ + case 1: /* switch 2 */ + phi_a2->flags = -0x8000; + phi_a2->rot[1] = 0; + phi_a2->unk_04 = 0x003C; + phi_a2->state = 7; + phi_a2->velocity[1] = 3.0f; + return; + } + } + break; + case ACTOR_RED_SHELL: /* switch 4 */ + temp_v1_3 = temp_a2->state; + if (temp_v1_3 != 7) { + switch (temp_v1_3) { /* switch 3 */ + case 2: /* switch 3 */ + case 3: /* switch 3 */ + case 4: /* switch 3 */ + case 5: /* switch 3 */ + case 8: /* switch 3 */ + case 9: /* switch 3 */ + actor = temp_a2; + func_8000EE58((s32) (temp_a2 - D_8015F9B8) / 112); + phi_a2_2 = actor; + /* fallthrough */ + case 0: /* switch 3 */ + case 1: /* switch 3 */ + phi_a2_2->flags = -0x8000; + phi_a2_2->rot[1] = 0; + phi_a2_2->unk_04 = 0x003C; + phi_a2_2->state = 7; + phi_a2_2->velocity[1] = 3.0f; + return; + case 6: /* switch 3 */ + func_802B02B4(temp_a2, 8, temp_a2, 7); + return; + } + } + break; + case ACTOR_FAKE_ITEM_BOX: /* switch 4 */ + temp_v0_3 = &gPlayers[(s16) (s32) temp_a2->velocity[0]]; + if (temp_a2->state == 0) { + temp_v0_3->unk_00C &= 0xFFFBFFFF; + } + temp_a2->state = 2; + temp_a2->flags = -0x8000; + temp_a2->unk_04 = 0; + break; } } #else GLOBAL_ASM("asm/non_matchings/code_actors/func_8029FDC8.s") #endif - void func_802A00E8(struct Actor *arg0, struct Actor *arg1) { - switch(arg0->unk0) { - case 7: - if ((arg0->unk6 == 0) || (arg0->unk6 == 4)) { - arg0->unk2 |= 0x200; - func_800C98B8(arg0->unk18, arg0->unk24, 0x19019053); + switch(arg0->type) { + case ACTOR_GREEN_SHELL: + if ((arg0->state == 0) || (arg0->state == 4)) { + arg0->flags |= 0x200; + func_800C98B8(arg0->pos, arg0->velocity, 0x19019053); return; } break; - case 8: - if ((arg0->unk6 == 0) || (arg0->unk6 == 6)) { - arg0->unk2 |= 0x200; - func_800C98B8(arg0->unk18, arg0->unk24, 0x19019053); + case ACTOR_RED_SHELL: + if ((arg0->state == 0) || (arg0->state == 6)) { + arg0->flags |= 0x200; + func_800C98B8(arg0->pos, arg0->velocity, 0x19019053); return; } break; - case 42: - if (arg0->unk6 == 0) { - arg0->unk2 |= 0x200; - func_800C98B8(arg0->unk18, arg0->unk24, 0x19019053); + case ACTOR_BLUE_SPINY_SHELL: + if (arg0->state == 0) { + arg0->flags |= 0x200; + func_800C98B8(arg0->pos, arg0->velocity, 0x19019053); return; } break; - case 13: - if (arg0->unk6 == 0) { - arg0->unk2 = arg0->unk2 | 0x200; - func_800C98B8(arg0->unk18, arg0->unk24, 0x19019053); + case ACTOR_FAKE_ITEM_BOX: + if (arg0->state == 0) { + arg0->flags |= 0x200; + func_800C98B8(arg0->pos, arg0->velocity, 0x19019053); return; } break; } - switch(arg1->unk0) { - case 7: - if ((arg1->unk6 == 0) || (arg1->unk6 == 4)) { - arg1->unk2 |= 0x200; - func_800C98B8(arg1->unk18, arg1->unk24, 0x19019053); + switch(arg1->type) { + case ACTOR_GREEN_SHELL: + if ((arg1->state == 0) || (arg1->state == 4)) { + arg1->flags |= 0x200; + func_800C98B8(arg1->pos, arg1->velocity, 0x19019053); return; } break; - case 8: - if ((arg1->unk6 == 0) || (arg1->unk6 == 6)) { - arg1->unk2 = arg1->unk2 | 0x200; - func_800C98B8(arg1->unk18, arg1->unk24, 0x19019053); + case ACTOR_RED_SHELL: + if ((arg1->state == 0) || (arg1->state == 6)) { + arg1->flags |= 0x200; + func_800C98B8(arg1->pos, arg1->velocity, 0x19019053); return; } break; - case 42: - if (arg1->unk6 == 0) { - arg1->unk2 = arg1->unk2 | 0x200; - func_800C98B8(arg1->unk18, arg1->unk24, 0x19019053); + case ACTOR_BLUE_SPINY_SHELL: + if (arg1->state == 0) { + arg1->flags |= 0x200; + func_800C98B8(arg1->pos, arg1->velocity, 0x19019053); return; } break; - case 13: - if (arg1->unk6 == 0) { - arg1->unk2 = arg1->unk2 | 0x200; - func_800C98B8(arg1->unk18, arg1->unk24, 0x19019053); + case ACTOR_FAKE_ITEM_BOX: + if (arg1->state == 0) { + arg1->flags |= 0x200; + func_800C98B8(arg1->pos, arg1->velocity, 0x19019053); return; } break; } - arg0->unk2 |= 0x100; - func_800C98B8(arg0->unk18, arg0->unk24, 0x19018010); + arg0->flags |= 0x100; + func_800C98B8(arg0->pos, arg0->velocity, 0x19018010); } s32 func_8029FCA4(struct Actor*, struct Actor*); // extern @@ -5447,22 +5368,22 @@ void func_8029FDC8(struct Actor*); void func_802A0350(struct Actor *arg0, struct Actor *arg1) { if (func_8029FCA4(arg0, arg1) == 1) { - if ((arg0->unk0 == 42) && (arg1->unk0 == 42)) { + if ((arg0->type == ACTOR_BLUE_SPINY_SHELL) && (arg1->type == ACTOR_BLUE_SPINY_SHELL)) { func_8029FDC8(arg0); func_8029FDC8(arg1); - arg0->unk2 |= 256; - func_800C98B8(arg0->unk18, arg0->unk24, 0x19018010); + arg0->flags |= 256; + func_800C98B8(arg0->pos, arg0->velocity, 0x19018010); return; } - if (arg0->unk0 == 42) { - if (arg0->unk6 == 0) { + if (arg0->type == ACTOR_BLUE_SPINY_SHELL) { + if (arg0->state == 0) { func_8029FDC8(arg0); } } else { func_8029FDC8(arg0); } - if (arg1->unk0 == 42) { - if (arg1->unk6 == 0) { + if (arg1->type == ACTOR_BLUE_SPINY_SHELL) { + if (arg1->state == 0) { func_8029FDC8(arg1); } } else { @@ -5476,21 +5397,24 @@ void func_802A0350(struct Actor *arg0, struct Actor *arg1) { //#endif #ifdef MIPS_TO_C -//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 +//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd ? func_8007ABFC(s32, ?); /* extern */ -? func_8008DABC(Player *, s8); /* extern */ ? func_800C90F4(s32, s32); /* extern */ ? func_800C98B8(f32 *, f32 *, ?, Player *); /* extern */ -? func_8029F1F8(Player *, void *); /* extern */ -? func_8029F2FC(Player *, void *); /* extern */ -? func_8029F408(Player *, void *); /* extern */ -? func_8029F69C(Player *, void *); /* extern */ -? func_8029FDC8(void *); /* extern */ +? func_8029F1F8(Player *, struct Actor *); /* extern */ +? func_8029F2FC(Player *, struct Actor *); /* extern */ +? func_8029F408(Player *, struct Actor *); /* extern */ +? func_8029F69C(Player *, struct Actor *); /* extern */ +s16 func_8029FB80(Player *, struct Actor *); /* extern */ +? func_8029FDC8(struct Actor *); /* extern */ +extern s32 D_80162DF8; +static f32 D_802B99C4 = 360000.0f; +static f32 D_802B99C8 = 360000.0f; -void func_802A0450(Player *player, void *arg1) { +void func_802A0450(Player *player, struct Actor *actor) { s16 sp42; s16 sp36; - void *sp24; + Player *sp24; Player *temp_a0; Player *temp_a0_2; Player *temp_a0_3; @@ -5500,6 +5424,11 @@ void func_802A0450(Player *player, void *arg1) { Player *temp_a0_7; Player *temp_a0_8; Player *temp_a3; + Player *temp_v0; + Player *temp_v0_2; + Player *temp_v0_3; + Player *temp_v0_4; + Player *temp_v0_5; f32 temp_f0; f32 temp_f0_2; f32 temp_f2; @@ -5513,102 +5442,113 @@ void func_802A0450(Player *player, void *arg1) { s32 temp_f16; Player *phi_v0; - temp_t2 = arg1->unk0; - temp_t0 = (player - gPlayerOne) / 3544; + temp_t2 = actor->type; + temp_t0 = (s16) ((s32) (player - gPlayerOne) / 3544); switch (temp_t2) { - case 9: + case ACTOR_YOSHI_VALLEY_EGG: if (((player->unk_0BC << 0) >= 0) && ((player->unk_000 & 0x100) == 0)) { - func_8029F408(player, arg1); + func_8029F408(player, actor); return; } default: return; - case 6: - if (((player->unk_0BC & 0x800008C0) == 0) && ((player->unk_00C & 1) == 0) && ((temp_v1 = arg1->unk10, temp_a0 = player, (temp_t0 != temp_v1)) || ((arg1->unk2 & 0x1000) == 0)) && (sp36 = temp_v1, player = player, sp42 = temp_t0, (func_8029FB80(temp_a0, arg1, MIPS2C_ERROR(Read from unset register $a2)) == 1))) { - player->unk_00C |= 1; - if ((gPlayers[temp_v1].unk_000 & 0x4000) != 0) { - if ((arg1->unk2 & 0xF) != 0) { - if (temp_t0 != temp_v1) { - func_800C90F4(temp_v1 & 0xFF, (gPlayers[temp_v1].characterId * 0x10) + 0x29008006); - } - } else { - temp_f0 = arg1->unk18 - gPlayers[temp_v1].posX; - temp_f2 = arg1->unk20 - gPlayers[temp_v1].posZ; - if ((((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) < D_802B99C4) && (temp_t0 != temp_v1)) { - func_800C90F4(temp_v1 & 0xFF, (gPlayers[temp_v1].characterId * 0x10) + 0x29008006); + case ACTOR_BANANA: + if (((player->unk_0BC & 0x800008C0) == 0) && ((player->unk_00C & 1) == 0) && ((temp_v1 = actor->rot[0], temp_a0 = player, (temp_t0 != temp_v1)) || ((actor->flags & 0x1000) == 0))) { + sp36 = temp_v1; + player = player; + sp42 = temp_t0; + if (func_8029FB80(temp_a0, actor) == 1) { + player->unk_00C |= 1; + temp_v0 = &gPlayers[temp_v1]; + if ((temp_v0->unk_000 & 0x4000) != 0) { + if ((actor->flags & 0xF) != 0) { + if (temp_t0 != temp_v1) { + func_800C90F4(temp_v1 & 0xFF, (temp_v0->characterId * 0x10) + 0x29008006); + } + } else { + temp_f0 = actor->pos[0] - temp_v0->pos[0]; + temp_f2 = actor->pos[2] - temp_v0->pos[2]; + if ((((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) < D_802B99C4) && (temp_t0 != temp_v1)) { + func_800C90F4(temp_v1 & 0xFF, (temp_v0->characterId * 0x10) + 0x29008006); + } } } + func_8029FDC8(actor); + return; } - func_8029FDC8(arg1); - return; } - /* Duplicate return node #90. Try simplifying control flow for better match */ - return; - case 7: - if (((player->unk_0BC & 0x80000400) == 0) && ((player->unk_00C & 4) == 0) && ((temp_v1_2 = arg1->unk14, temp_a0_2 = player, (temp_t0 != temp_v1_2)) || ((arg1->unk2 & 0x1000) == 0)) && (sp36 = temp_v1_2, player = player, sp42 = temp_t0, (func_8029FB80(temp_a0_2, arg1, MIPS2C_ERROR(Read from unset register $a2)) == 1))) { - player->unk_00C |= 4; - sp42 = temp_t0; + break; + case ACTOR_GREEN_SHELL: + if (((player->unk_0BC & 0x80000400) == 0) && ((player->unk_00C & 4) == 0) && ((temp_v1_2 = actor->rot[2], temp_a0_2 = player, (temp_t0 != temp_v1_2)) || ((actor->flags & 0x1000) == 0))) { sp36 = temp_v1_2; - func_800C98B8(&player->posX, &player->unk_034, 0x19018010, player); - if (((gPlayers[temp_v1_2].unk_000 & 0x4000) != 0) && (temp_t0 != temp_v1_2)) { - func_800C90F4(temp_v1_2 & 0xFF, (gPlayers[temp_v1_2].characterId * 0x10) + 0x29008006); + player = player; + sp42 = temp_t0; + if (func_8029FB80(temp_a0_2, actor) == 1) { + player->unk_00C |= 4; + sp42 = temp_t0; + sp36 = temp_v1_2; + func_800C98B8(player->pos, &player->unk_034, 0x19018010, player); + temp_v0_2 = &gPlayers[temp_v1_2]; + if (((temp_v0_2->unk_000 & 0x4000) != 0) && (temp_t0 != temp_v1_2)) { + func_800C90F4(temp_v1_2 & 0xFF, (temp_v0_2->characterId * 0x10) + 0x29008006); + } + func_8029FDC8(actor); + return; } - func_8029FDC8(arg1); - return; } - /* Duplicate return node #90. Try simplifying control flow for better match */ - return; - case 42: - if (((player->unk_00C & 2) == 0) && ((temp_v1_3 = arg1->unk14, temp_a0_3 = player, (temp_t0 != temp_v1_3)) || ((arg1->unk2 & 0x1000) == 0)) && (sp36 = temp_v1_3, player = player, sp42 = temp_t0, (func_8029FB80(temp_a0_3, arg1, MIPS2C_ERROR(Read from unset register $a2)) == 1))) { + break; + case ACTOR_BLUE_SPINY_SHELL: + if (((player->unk_00C & 2) == 0) && ((temp_v1_3 = actor->rot[2], temp_a0_3 = player, (temp_t0 != temp_v1_3)) || ((actor->flags & 0x1000) == 0)) && (sp36 = temp_v1_3, player = player, sp42 = temp_t0, (func_8029FB80(temp_a0_3, actor) == 1))) { if ((player->unk_0BC << 0) >= 0) { player->unk_00C |= 2; sp42 = temp_t0; sp36 = temp_v1_3; - func_800C98B8(&player->posX, &player->unk_034, 0x19018010, player); + func_800C98B8(player->pos, &player->unk_034, 0x19018010, player); } - if (((gPlayers[arg1->unk14].unk_000 & 0x4000) != 0) && (temp_t0 != arg1->unk14)) { + temp_v0_3 = &gPlayers[actor->rot[2]]; + if (((temp_v0_3->unk_000 & 0x4000) != 0) && (temp_t0 != actor->rot[2])) { sp42 = temp_t0; - func_800C90F4(arg1->unk14 & 0xFF, (gPlayers[arg1->unk14].characterId * 0x10) + 0x29008006); + func_800C90F4(actor->rot[2] & 0xFF, (temp_v0_3->characterId * 0x10) + 0x29008006); } - if (temp_t0 == arg1->unk4) { - func_8029FDC8(arg1); + if (temp_t0 == actor->unk_04) { + func_8029FDC8(actor); return; } - /* Duplicate return node #90. Try simplifying control flow for better match */ - return; } - /* Duplicate return node #90. Try simplifying control flow for better match */ - return; - case 8: - if (((player->unk_0BC << 7) >= 0) && ((player->unk_00C & 2) == 0) && ((temp_v1_4 = arg1->unk14, temp_a0_4 = player, (temp_t0 != temp_v1_4)) || ((arg1->unk2 & 0x1000) == 0)) && (sp36 = temp_v1_4, player = player, sp42 = temp_t0, (func_8029FB80(temp_a0_4, arg1, MIPS2C_ERROR(Read from unset register $a2)) == 1))) { - if ((player->unk_0BC << 0) >= 0) { - player->unk_00C |= 2; - sp42 = temp_t0; - sp36 = temp_v1_4; - func_800C98B8(&player->posX, &player->unk_034, 0x19018010, player); + break; + case ACTOR_RED_SHELL: + if (((player->unk_0BC << 7) >= 0) && ((player->unk_00C & 2) == 0) && ((temp_v1_4 = actor->rot[2], temp_a0_4 = player, (temp_t0 != temp_v1_4)) || ((actor->flags & 0x1000) == 0))) { + sp36 = temp_v1_4; + player = player; + sp42 = temp_t0; + if (func_8029FB80(temp_a0_4, actor) == 1) { + if ((player->unk_0BC << 0) >= 0) { + player->unk_00C |= 2; + sp42 = temp_t0; + sp36 = temp_v1_4; + func_800C98B8(player->pos, &player->unk_034, 0x19018010, player); + } + temp_v0_4 = &gPlayers[actor->rot[2]]; + if (((temp_v0_4->unk_000 & 0x4000) != 0) && (temp_t0 != actor->rot[2])) { + func_800C90F4(actor->rot[2] & 0xFF, (temp_v0_4->characterId * 0x10) + 0x29008006); + } + func_8029FDC8(actor); + return; } - if (((gPlayers[arg1->unk14].unk_000 & 0x4000) != 0) && (temp_t0 != arg1->unk14)) { - func_800C90F4(arg1->unk14 & 0xFF, (gPlayers[arg1->unk14].characterId * 0x10) + 0x29008006); - } - func_8029FDC8(arg1); - return; } - /* Duplicate return node #90. Try simplifying control flow for better match */ - return; - case 10: + break; + case ACTOR_PIRANHA_PLANT: if ((player->unk_0BC << 0) >= 0) { - func_8029F2FC(player, arg1); + func_8029F2FC(player, actor); return; } - /* Duplicate return node #90. Try simplifying control flow for better match */ - return; - case 23: + break; + case ACTOR_MARIO_RACEWAY_SIGN: if ((player->unk_0BC << 0) >= 0) { - func_8029F1F8(player, arg1); + func_8029F1F8(player, actor); return; } - /* Duplicate return node #90. Try simplifying control flow for better match */ - return; + break; case 2: case 3: case 4: @@ -5622,100 +5562,100 @@ void func_802A0450(Player *player, void *arg1) { case 32: case 33: if ((player->unk_0BC << 0) >= 0) { - func_8029F69C(player, arg1); + func_8029F69C(player, actor); return; } - /* Duplicate return node #90. Try simplifying control flow for better match */ - return; - case 5: - if (((player->unk_0BC << 0) >= 0) && (temp_a0_5 = player, ((player->unk_000 & 0x100) == 0)) && (player = player, temp_a3 = player, (func_8029FB80(temp_a0_5, arg1, MIPS2C_ERROR(Read from unset register $a2)) == 1))) { - player = temp_a3; - func_800C98B8(arg1 + 0x18, arg1 + 0x24, 0x19009005, temp_a3); - if ((gModeSelection == TIME_TRIALS) && ((player->unk_000 & 0x1000) == 0)) { - D_80162DF8 = 1; + break; + case ACTOR_FALLING_ROCK: + if ((player->unk_0BC << 0) >= 0) { + temp_a0_5 = player; + if ((player->unk_000 & 0x100) == 0) { + player = player; + temp_a3 = player; + if (func_8029FB80(temp_a0_5, actor) == 1) { + player = temp_a3; + func_800C98B8(actor->pos, actor->velocity, 0x19009005, temp_a3); + if ((gModeSelection == 1) && ((player->unk_000 & 0x1000) == 0)) { + D_80162DF8 = 1; + } + if ((player->unk_0BC & 0x200) != 0) { + actor->velocity[1] = 10.0f; + return; + } + func_8008DABC(player, (s8) ((s32) (player - gPlayerOne) / 3544)); + return; + } } - if ((player->unk_0BC & 0x200) != 0) { - arg1->unk28 = 10.0f; + } + break; + case ACTOR_FAKE_ITEM_BOX: + if (((player->unk_0BC << 0) >= 0) && ((temp_a0_6 = player, temp_f16 = (s32) actor->velocity[0], (temp_t0 != (s16) temp_f16)) || ((actor->flags & 0x1000) == 0))) { + sp36 = (s16) temp_f16; + player = player; + sp42 = temp_t0; + if (func_8029FB80(temp_a0_6, actor) == 1) { + player->unk_00C |= 0x400000; + temp_v0_5 = &gPlayers[(s16) temp_f16]; + phi_v0 = temp_v0_5; + if ((temp_v0_5->unk_000 & 0x4000) != 0) { + if ((actor->flags & 0xF) != 0) { + if (temp_t0 != (s16) temp_f16) { + sp24 = temp_v0_5; + func_800C90F4((s16) temp_f16 & 0xFF, (temp_v0_5->characterId * 0x10) + 0x29008006); + phi_v0 = sp24; + } + } else { + temp_f0_2 = actor->pos[0] - temp_v0_5->pos[0]; + temp_f2_2 = actor->pos[2] - temp_v0_5->pos[2]; + if ((((temp_f0_2 * temp_f0_2) + (temp_f2_2 * temp_f2_2)) < D_802B99C8) && (temp_t0 != (s16) temp_f16)) { + sp24 = temp_v0_5; + func_800C90F4((s16) temp_f16 & 0xFF, (temp_v0_5->characterId * 0x10) + 0x29008006); + phi_v0 = sp24; + } + } + if (actor->state == 0) { + phi_v0->unk_00C &= 0xFFFBFFFF; + } + } + actor->state = 2; + actor->flags = -0x8000; + actor->unk_04 = 0; return; } - func_8008DABC(player, (player - gPlayerOne) / 3544); - return; } - /* Duplicate return node #90. Try simplifying control flow for better match */ - return; - case 13: - if (((player->unk_0BC << 0) >= 0) && ((temp_a0_6 = player, temp_f16 = arg1->unk24, (temp_t0 != temp_f16)) || ((arg1->unk2 & 0x1000) == 0)) && (sp36 = temp_f16, player = player, sp42 = temp_t0, (func_8029FB80(temp_a0_6, arg1, MIPS2C_ERROR(Read from unset register $a2)) == 1))) { - player->unk_00C |= 0x400000; - phi_v0 = &gPlayers[temp_f16]; - if ((gPlayers[temp_f16].unk_000 & 0x4000) != 0) { - if ((arg1->unk2 & 0xF) != 0) { - if (temp_t0 != temp_f16) { - sp24 = &gPlayers[temp_f16]; - func_800C90F4(temp_f16 & 0xFF, (gPlayers[temp_f16].characterId * 0x10) + 0x29008006); - goto block_75; - } - } else { - temp_f0_2 = arg1->unk18 - gPlayers[temp_f16].posX; - temp_f2_2 = arg1->unk20 - gPlayers[temp_f16].posZ; - if ((((temp_f0_2 * temp_f0_2) + (temp_f2_2 * temp_f2_2)) < D_802B99C8) && (temp_t0 != temp_f16)) { - sp24 = &gPlayers[temp_f16]; - func_800C90F4(temp_f16 & 0xFF, (gPlayers[temp_f16].characterId * 0x10) + 0x29008006); -block_75: - phi_v0 = sp24; - } - } - if (arg1->unk6 == 0) { - phi_v0->unk_00C &= 0xFFFBFFFF; - } - } - arg1->unk6 = 2; - arg1->unk2 = -0x8000; - arg1->unk4 = 0; - return; - } - /* Duplicate return node #90. Try simplifying control flow for better match */ - return; - case 43: + break; + case ACTOR_HOT_AIR_BALLOON_ITEM_BOX: temp_a0_7 = player; player = player; - if (func_8029FB80(temp_a0_7, arg1, MIPS2C_ERROR(Read from unset register $a2)) == 1) { - arg1->unk6 = 3; - arg1->unk2 = -0x8000; - arg1->unk4 = 0; + if (func_8029FB80(temp_a0_7, actor) == 1) { + actor->state = 3; + actor->flags = -0x8000; + actor->unk_04 = 0; if ((player->unk_000 & 0x4000) != 0) { - func_8007ABFC((player - gPlayerOne) / 3544, 7); + func_8007ABFC((s32) (player - gPlayerOne) / 3544, 7); return; } - /* Duplicate return node #90. Try simplifying control flow for better match */ - return; + } else if (actor->state == 0) { + actor->state = 1; + actor->flags = -0x8000; } - if (arg1->unk6 == 0) { - arg1->unk6 = 1; -block_89: - arg1->unk2 = -0x8000; - } - /* Duplicate return node #90. Try simplifying control flow for better match */ - return; - case 12: + break; + case ACTOR_ITEM_BOX: temp_a0_8 = player; player = player; - if (func_8029FB80(temp_a0_8, arg1, MIPS2C_ERROR(Read from unset register $a2)) == 1) { - arg1->unk6 = 3; - arg1->unk2 = -0x8000; - arg1->unk4 = 0; + if (func_8029FB80(temp_a0_8, actor) == 1) { + actor->state = 3; + actor->flags = -0x8000; + actor->unk_04 = 0; if ((player->unk_000 & 0x4000) != 0) { - func_8007ABFC((player - gPlayerOne) / 3544, 0); + func_8007ABFC((s32) (player - gPlayerOne) / 3544, 0); return; } - /* Duplicate return node #90. Try simplifying control flow for better match */ - return; + } else if (actor->state == 0) { + actor->state = 1; + actor->flags = -0x8000; } - if (arg1->unk6 == 0) { - arg1->unk6 = 1; - goto block_89; - } - /* Duplicate return node #90. Try simplifying control flow for better match */ - return; + break; } } #else @@ -5739,7 +5679,7 @@ void func_802A0D54(void) { if ((phi_s1->unk_0BC & 0x4000000) == 0) { // temp_v0 = temp_a1->unk2; - if (((temp_a1->unk2 & 0x8000) != 0) && ((temp_a1->unk2 & 0x4000) != 0)) { + if (((temp_a1->flags & 0x8000) != 0) && ((temp_a1->flags & 0x4000) != 0)) { func_802A0450(phi_s1, temp_a1); } } @@ -5760,10 +5700,10 @@ void func_802A0E44(void) { for (i = D_8015F900; i < 99; i++) { phi_s0 = &D_8015F9B8[i]; - if ((phi_s0->unk2 & 0x8000) == 0) { continue; } - if ((phi_s0->unk2 & 0x4000) == 0) { continue; } + if ((phi_s0->flags & 0x8000) == 0) { continue; } + if ((phi_s0->flags & 0x4000) == 0) { continue; } - switch(phi_s0->unk0) { + switch(phi_s0->type) { case 6: case 7: case 8: @@ -5773,32 +5713,32 @@ void func_802A0E44(void) { for (j = i + 1; j < 100; j++) { temp_a1 = &D_8015F9B8[j]; - if ((phi_s0->unk2 & 0x8000) == 0) {continue;} - if ((phi_s0->unk2 & 0x4000) == 0) {continue;} + if ((phi_s0->flags & 0x8000) == 0) {continue;} + if ((phi_s0->flags & 0x4000) == 0) {continue;} - if ((temp_a1->unk2 & 0x8000) == 0) { continue; } - if ((temp_a1->unk2 & 0x4000) == 0) { continue; } + if ((temp_a1->flags & 0x8000) == 0) { continue; } + if ((temp_a1->flags & 0x4000) == 0) { continue; } - switch(temp_a1->unk0) { - case 6: - if (phi_s0->unk0 == 6) { continue; } + switch(temp_a1->type) { + case ACTOR_BANANA: + if (phi_s0->type == 6) { continue; } func_802A0350(phi_s0, temp_a1); break; - case 7: - if (phi_s0->unk0 == 7) { - if (phi_s0->unk10[2] == temp_a1->unk10[2]) { continue; } + case ACTOR_GREEN_SHELL: + if (phi_s0->type == 7) { + if (phi_s0->rot[2] == temp_a1->rot[2]) { continue; } } func_802A0350(phi_s0, temp_a1); break; - case 8: - if (phi_s0->unk0 == 8) { - if (phi_s0->unk10[2] == temp_a1->unk10[2]) { continue; } + case ACTOR_RED_SHELL: + if (phi_s0->type == 8) { + if (phi_s0->rot[2] == temp_a1->rot[2]) { continue; } } func_802A0350(phi_s0, temp_a1); break; - case 42: - case 13: + case ACTOR_BLUE_SPINY_SHELL: + case ACTOR_FAKE_ITEM_BOX: func_802A0350(phi_s0, temp_a1); break; } @@ -5812,11 +5752,11 @@ void func_802A0E44(void) { f32 func_802ABEAC(UnkActorInner*, Vec3f); extern f32 D_802B99CC; -void func_802A1064(struct fake_item_box *fake_item_box) { - if (fake_item_box - (struct fake_item_box*)D_8015F9B8 > 100u) { return; } +void func_802A1064(struct FakeItemBox *fake_item_box) { + if (fake_item_box - (struct FakeItemBox*)D_8015F9B8 > 100u) { return; } if ((fake_item_box->flags & 0x8000) == 0) { return; } - if (fake_item_box->type == 13) { + if (fake_item_box->type == ACTOR_FAKE_ITEM_BOX) { fake_item_box->state = 1; fake_item_box->targetY = func_802ABEAC(&fake_item_box->unk30, fake_item_box->pos) + D_802B99CC; fake_item_box->someTimer = 100; @@ -5827,7 +5767,7 @@ extern f32 D_802B99D0; extern f32 D_802B99D4; void func_802ADDC8(UnkActorInner*, f32, f32, f32, f32); void func_802B4E30(struct Actor*); -void update_obj_fake_item_box(struct fake_item_box *fake_item_box) { +void update_obj_fake_item_box(struct FakeItemBox *fake_item_box) { u32 temp_v1 = fake_item_box->playerId; Player *temp_v0_4 = &gPlayers[temp_v1]; struct Controller *temp_v1_3; @@ -5929,7 +5869,7 @@ void func_802A14BC(f32 arg0, f32 arg1, f32 arg2) { } } -void update_obj_item_box_hot_air_balloon(struct item_box *itemBox) { +void update_obj_item_box_hot_air_balloon(struct ItemBox *itemBox) { switch(itemBox->state) { case 5: itemBox->rot[0] += 0xB6; @@ -5953,7 +5893,7 @@ void update_obj_item_box_hot_air_balloon(struct item_box *itemBox) { extern f32 D_802B99D8; extern f32 D_802B99DC; -void update_obj_item_box(struct item_box *itemBox) { +void update_obj_item_box(struct ItemBox *itemBox) { switch (itemBox->state) { case 0: itemBox->state = 1; @@ -5988,15 +5928,12 @@ void update_obj_item_box(struct item_box *itemBox) { } #ifdef MIPS_TO_C -/* -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_80297230(void *, void *); // extern -? func_802972B8(void *, void *); // extern -s32 func_802B4FF8(f32 *, ?); // extern -? func_802B5450(f32 *, f32 *, f32 *, f32 *); // extern -? func_802B5F00(f32 *, f32 *, f32); // extern -? func_802B5F74(f32 *, s32, s16 *); // extern -f32 func_802B80D0(s32, u16, ?, f32, f32); // extern +//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd +? func_80297230(Camera *, struct Actor *); /* extern */ +? func_802972B8(Camera *, struct Actor *); /* extern */ +s32 func_802B4FF8(f32 *, ?); /* extern */ +? func_802B5F74(f32 (*)[4], f32 *, s16 *); /* extern */ +f32 func_802B80D0(f32 *, u16, ?, f32, f32); /* extern */ extern ? D_0D002F80; extern ? D_0D003090; extern ? D_0D0030F8; @@ -6005,30 +5942,55 @@ extern ? D_0D003158; extern ? D_0D003188; extern ? D_0D0031B8; extern ? D_0D0031E8; -extern f32 D_802B99E0; -extern f32 D_802B99E4; -extern f32 D_802B99E8; -extern f32 D_802B99EC; -extern f32 D_802B99F0; -extern f32 D_802B99F4; -extern f32 D_802B99F8; -extern f32 D_802B99FC; +extern ? D_80150130; +extern s16 D_8015F6EC; +extern s16 D_8015F6EE; +static f32 D_802B99E0 = 1000000.0f; +static f32 D_802B99E4 = 0.1f; +static f32 D_802B99E8 = 0.8f; +static f32 D_802B99EC = 2.3f; +static f32 D_802B99F0 = 1.2f; +static f32 D_802B99F4 = 1.8f; +static f32 D_802B99F8 = -0.8f; +static f32 D_802B99FC = 0.6f; - -void func_802A171C(void *arg0, void *arg1) { +void func_802A171C(Camera *camera, struct Actor *actor) { s16 sp184; s16 sp182; s16 sp180; f32 sp170; f32 sp16C; f32 sp168; - f32 sp128; - f32 spE8; f32 spA4; - s32 sp38; + f32 *sp38; /* compiler-managed */ f32 sp34; f32 sp30; f32 sp2C; + Gfx *temp_v0; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_14; + Gfx *temp_v0_15; + Gfx *temp_v0_16; + Gfx *temp_v0_17; + Gfx *temp_v0_18; + Gfx *temp_v0_19; + Gfx *temp_v0_20; + Gfx *temp_v0_21; + Gfx *temp_v0_22; + Gfx *temp_v0_23; + Gfx *temp_v0_24; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; + f32 *temp_a1; f32 *temp_a2; f32 *temp_a2_2; f32 *temp_a2_3; @@ -6040,218 +6002,199 @@ void func_802A171C(void *arg0, void *arg1) { f32 temp_f2; f32 temp_f2_2; s16 temp_v1; - s32 temp_a1; - void *temp_v0; - void *temp_v0_10; - void *temp_v0_11; - void *temp_v0_12; - void *temp_v0_13; - void *temp_v0_14; - void *temp_v0_15; - void *temp_v0_16; - void *temp_v0_17; - void *temp_v0_18; - void *temp_v0_19; - void *temp_v0_20; - void *temp_v0_21; - void *temp_v0_22; - void *temp_v0_23; - void *temp_v0_24; - void *temp_v0_2; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - void *temp_v0_6; - void *temp_v0_7; - void *temp_v0_8; - void *temp_v0_9; f32 phi_f0; - temp_a1 = arg1 + 0x18; + temp_a1 = actor->pos; sp38 = temp_a1; - if (func_802B80D0(temp_a1, arg0->unk26, 0x451C4000, (&D_80150130)[(arg0 - camera1) / 0xB8], D_802B99E0) < 0.0f) { - func_80297230(arg0, arg1); + if (func_802B80D0(temp_a1, (u16) camera->rotX2, 0x451C4000, *(&D_80150130 + (((s32) (camera - camera1) / 184) * 4)), D_802B99E0) < 0.0f) { + func_80297230(camera, actor); return; } - temp_f0 = arg1->unk1C; - if ((D_8015F6EC + 800.0f) < temp_f0) { - func_80297230(arg0, arg1); + temp_f0 = actor->pos[1]; + if (((f32) D_8015F6EC + 800.0f) < temp_f0) { + func_80297230(camera, actor); return; } - if (temp_f0 < (D_8015F6EE - 800.0f)) { - func_80297230(arg0, arg1); + if (temp_f0 < ((f32) D_8015F6EE - 800.0f)) { + func_80297230(camera, actor); return; } - func_802972B8(arg0, arg1); + func_802972B8(camera, actor); sp180 = 0; sp184 = 0; - sp182 = arg1->unk12; - func_802B5F74(&sp128, sp38, &sp180); - func_802B5F00(&sp128, arg1->unk8); - if (arg1->unk6 != 2) { - if ((func_802B4FF8(&sp128, 0) != 0) && (temp_v0 = gDisplayListHead, gDisplayListHead = temp_v0 + 8, temp_v0->unk0 = 0x6000000, temp_v0->unk4 = &D_0D002F80, func_802B5F74(&sp128, sp38, arg1 + 0x10), func_802B5F00(&sp128, arg1->unk8), (func_802B4FF8(&sp128, 0) != 0))) { - temp_v0_2 = gDisplayListHead; - gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk4 = 0x20000; - temp_v0_2->unk0 = 0xB6000000; - temp_v0_3 = gDisplayListHead; - gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0xFC121824; - temp_v0_3->unk4 = 0xFF33FFFF; - temp_v1 = arg1->unk12; - if ((temp_v1 < 0xAA1) && (temp_v1 > 0)) { - temp_v0_4 = gDisplayListHead; - gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk0 = 0xB900031D; - temp_v0_4->unk4 = 0x552078; - } else if ((temp_v1 >= 0x6AA5) && (temp_v1 < 0x754E)) { - temp_v0_5 = gDisplayListHead; - gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk0 = 0xB900031D; - temp_v0_5->unk4 = 0x552078; - } else if ((temp_v1 >= 0x38E1) && (temp_v1 < 0x438A)) { - temp_v0_6 = gDisplayListHead; - gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk0 = 0xB900031D; - temp_v0_6->unk4 = 0x552078; - } else if ((temp_v1 >= 0xC711) && (temp_v1 < 0xD1BA)) { - temp_v0_7 = gDisplayListHead; - gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk0 = 0xB900031D; - temp_v0_7->unk4 = 0x552078; - } else { - temp_v0_8 = gDisplayListHead; - gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0; - temp_v0_8->unk0 = 0xC0000000; - temp_v0_9 = gDisplayListHead; - gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk4 = 0x504B50; - temp_v0_9->unk0 = 0xB900031D; - } - temp_v0_10 = gDisplayListHead; - gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk0 = 0x6000000; - temp_v0_10->unk4 = &D_0D003090; - return; - } - // Duplicate return node #39. Try simplifying control flow for better match - return; - } - temp_v0_11 = gDisplayListHead; - gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk4 = 0x20000; - temp_v0_11->unk0 = 0xB6000000; - temp_v0_12 = gDisplayListHead; - gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk4 = 0x2000; - temp_v0_12->unk0 = 0xB6000000; - temp_v0_13 = gDisplayListHead; - gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk4 = 0; - temp_v0_13->unk0 = 0xC0000000; - spA4 = arg1->unk4; - func_802B5F74(&sp128, sp38, arg1 + 0x10); - if (spA4 < 10.0f) { - phi_f0 = 1.0f; - } else { - phi_f0 = 1.0f - ((spA4 - 10.0f) * D_802B99E4); - } - func_802B5F00((bitwise f32 *) spA4, &sp128, phi_f0); - if ((arg1->unk4 & 1) != 0) { - temp_v0_14 = gDisplayListHead; - gDisplayListHead = temp_v0_14 + 8; - temp_v0_14->unk4 = 0x552078; - temp_v0_14->unk0 = 0xB900031D; - } else { - temp_v0_15 = gDisplayListHead; - gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk4 = 0x4045D8; - temp_v0_15->unk0 = 0xB900031D; - } - sp168 = 0.0f; - temp_f2 = 2.0f * spA4; - sp170 = spA4; - sp16C = temp_f2; - sp38 = (bitwise s32) temp_f2; - func_802B5450(&sp128, &spE8, &sp168); - if (func_802B4FF8(&spE8, 0) != 0) { - temp_v0_16 = gDisplayListHead; - gDisplayListHead = temp_v0_16 + 8; - temp_v0_16->unk0 = 0x6000000; - temp_v0_16->unk4 = &D_0D003158; - temp_f2_2 = D_802B99E8 * spA4; - temp_f12 = 0.5f * spA4; - sp168 = temp_f2_2; - sp34 = temp_f2_2; - sp16C = D_802B99EC * spA4; - sp170 = temp_f12; - sp30 = temp_f12; - func_802B5450((bitwise f32 *) temp_f12, &sp128, &spE8, &sp168); - if (func_802B4FF8(&spE8, 0) != 0) { - temp_v0_17 = gDisplayListHead; - gDisplayListHead = temp_v0_17 + 8; - temp_v0_17->unk0 = 0x6000000; - temp_v0_17->unk4 = &D_0D0031B8; - temp_f0_2 = -0.5f * spA4; - temp_a2 = &sp168; - sp168 = sp34; - sp16C = D_802B99F0 * spA4; - sp170 = temp_f0_2; - sp2C = temp_f0_2; - func_802B5450(&sp128, &spE8, temp_a2); - if (func_802B4FF8(&spE8, 0) != 0) { - temp_v0_18 = gDisplayListHead; - gDisplayListHead = temp_v0_18 + 8; - temp_v0_18->unk4 = &D_0D003128; - temp_v0_18->unk0 = 0x6000000; - if ((arg1->unk4 & 1) == 0) { - temp_v0_19 = gDisplayListHead; - gDisplayListHead = temp_v0_19 + 8; - temp_v0_19->unk4 = 0x552078; - temp_v0_19->unk0 = 0xB900031D; + sp182 = actor->rot[1]; + func_802B5F74((f32 (*)[4]) &sp128[0], sp38, &sp180); + func_802B5F00((f32 (*)[4]) &sp128[0], actor->unk_08); + if (actor->state != 2) { + if (func_802B4FF8(&sp128[0], 0) != 0) { + temp_v0 = gDisplayListHead; + gDisplayListHead = temp_v0 + 8; + temp_v0->words.w0 = 0x06000000; + temp_v0->words.w1 = (u32) &D_0D002F80; + func_802B5F74((f32 (*)[4]) &sp128[0], sp38, actor->rot); + func_802B5F00((f32 (*)[4]) &sp128[0], actor->unk_08); + if (func_802B4FF8(&sp128[0], 0) != 0) { + temp_v0_2 = gDisplayListHead; + gDisplayListHead = temp_v0_2 + 8; + temp_v0_2->words.w1 = 0x00020000; + temp_v0_2->words.w0 = 0xB6000000; + temp_v0_3 = gDisplayListHead; + gDisplayListHead = temp_v0_3 + 8; + temp_v0_3->words.w0 = 0xFC121824; + temp_v0_3->words.w1 = 0xFF33FFFF; + temp_v1 = actor->rot[1]; + if ((temp_v1 < 0xAA1) && (temp_v1 > 0)) { + temp_v0_4 = gDisplayListHead; + gDisplayListHead = temp_v0_4 + 8; + temp_v0_4->words.w0 = 0xB900031D; + temp_v0_4->words.w1 = 0x00552078; + } else if ((temp_v1 >= 0x6AA5) && (temp_v1 < 0x754E)) { + temp_v0_5 = gDisplayListHead; + gDisplayListHead = temp_v0_5 + 8; + temp_v0_5->words.w0 = 0xB900031D; + temp_v0_5->words.w1 = 0x00552078; + } else if ((temp_v1 >= 0x38E1) && (temp_v1 < 0x438A)) { + temp_v0_6 = gDisplayListHead; + gDisplayListHead = temp_v0_6 + 8; + temp_v0_6->words.w0 = 0xB900031D; + temp_v0_6->words.w1 = 0x00552078; + } else if ((temp_v1 >= 0xC711) && (temp_v1 < 0xD1BA)) { + temp_v0_7 = gDisplayListHead; + gDisplayListHead = temp_v0_7 + 8; + temp_v0_7->words.w0 = 0xB900031D; + temp_v0_7->words.w1 = 0x00552078; } else { - temp_v0_20 = gDisplayListHead; - gDisplayListHead = temp_v0_20 + 8; - temp_v0_20->unk4 = 0x4045D8; - temp_v0_20->unk0 = 0xB900031D; + temp_v0_8 = gDisplayListHead; + gDisplayListHead = temp_v0_8 + 8; + temp_v0_8->words.w1 = 0; + temp_v0_8->words.w0 = 0xC0000000; + temp_v0_9 = gDisplayListHead; + gDisplayListHead = temp_v0_9 + 8; + temp_v0_9->words.w1 = 0x00504B50; + temp_v0_9->words.w0 = 0xB900031D; } - temp_a2_2 = &sp168; - sp168 = 0.0f; - sp16C = D_802B99F4 * spA4; - sp170 = -1.0f * spA4; - func_802B5450(&sp128, &spE8, temp_a2_2); - if (func_802B4FF8(&spE8, 0) != 0) { - temp_v0_21 = gDisplayListHead; - gDisplayListHead = temp_v0_21 + 8; - temp_v0_21->unk4 = &D_0D0031E8; - temp_v0_21->unk0 = 0x6000000; - temp_f0_3 = D_802B99F8 * spA4; - temp_a2_3 = &sp168; - sp170 = sp2C; - sp168 = temp_f0_3; - sp34 = temp_f0_3; - sp16C = D_802B99FC * spA4; - func_802B5450(&sp128, &spE8, temp_a2_3); - if (func_802B4FF8(&spE8, 0) != 0) { - temp_v0_22 = gDisplayListHead; - gDisplayListHead = temp_v0_22 + 8; - temp_v0_22->unk4 = &D_0D003188; - temp_v0_22->unk0 = 0x6000000; - temp_a2_4 = &sp168; - sp168 = sp34; - sp16C = (bitwise f32) sp38; - sp170 = sp30; - func_802B5450(&sp128, &spE8, temp_a2_4); - if (func_802B4FF8(&spE8, 0) != 0) { - temp_v0_23 = gDisplayListHead; - gDisplayListHead = temp_v0_23 + 8; - temp_v0_23->unk4 = &D_0D0030F8; - temp_v0_23->unk0 = 0x6000000; - temp_v0_24 = gDisplayListHead; - gDisplayListHead = temp_v0_24 + 8; - temp_v0_24->unk4 = 0x2000; - temp_v0_24->unk0 = 0xB7000000; + temp_v0_10 = gDisplayListHead; + gDisplayListHead = temp_v0_10 + 8; + temp_v0_10->words.w0 = 0x06000000; + temp_v0_10->words.w1 = (u32) &D_0D003090; + } + } + } else { + temp_v0_11 = gDisplayListHead; + gDisplayListHead = temp_v0_11 + 8; + temp_v0_11->words.w1 = 0x00020000; + temp_v0_11->words.w0 = 0xB6000000; + temp_v0_12 = gDisplayListHead; + gDisplayListHead = temp_v0_12 + 8; + temp_v0_12->words.w1 = 0x00002000; + temp_v0_12->words.w0 = 0xB6000000; + temp_v0_13 = gDisplayListHead; + gDisplayListHead = temp_v0_13 + 8; + temp_v0_13->words.w1 = 0; + temp_v0_13->words.w0 = 0xC0000000; + spA4 = (f32) actor->unk_04; + func_802B5F74((f32 (*)[4]) &sp128[0], sp38, actor->rot); + if (spA4 < 10.0f) { + phi_f0 = 1.0f; + } else { + phi_f0 = 1.0f - ((spA4 - 10.0f) * D_802B99E4); + } + func_802B5F00((f32 (*)[4]) &sp128[0], phi_f0); + if ((actor->unk_04 & 1) != 0) { + temp_v0_14 = gDisplayListHead; + gDisplayListHead = temp_v0_14 + 8; + temp_v0_14->words.w1 = 0x00552078; + temp_v0_14->words.w0 = 0xB900031D; + } else { + temp_v0_15 = gDisplayListHead; + gDisplayListHead = temp_v0_15 + 8; + temp_v0_15->words.w1 = 0x004045D8; + temp_v0_15->words.w0 = 0xB900031D; + } + sp168 = 0.0f; + temp_f2 = 2.0f * spA4; + sp170 = spA4; + sp16C = temp_f2; + sp38 = temp_f2; + func_802B5450((f32 (*)[4]) &sp128[0], (f32 (*)[4]) &spE8[0], (f32 (*)[4]) &sp168); + if (func_802B4FF8(&spE8[0], 0) != 0) { + temp_v0_16 = gDisplayListHead; + gDisplayListHead = temp_v0_16 + 8; + temp_v0_16->words.w0 = 0x06000000; + temp_v0_16->words.w1 = (u32) &D_0D003158; + temp_f2_2 = D_802B99E8 * spA4; + temp_f12 = 0.5f * spA4; + sp168 = temp_f2_2; + sp34 = temp_f2_2; + sp16C = D_802B99EC * spA4; + sp170 = temp_f12; + sp30 = temp_f12; + func_802B5450((f32 (*)[4]) &sp128[0], (f32 (*)[4]) &spE8[0], (f32 (*)[4]) &sp168); + if (func_802B4FF8(&spE8[0], 0) != 0) { + temp_v0_17 = gDisplayListHead; + gDisplayListHead = temp_v0_17 + 8; + temp_v0_17->words.w0 = 0x06000000; + temp_v0_17->words.w1 = (u32) &D_0D0031B8; + temp_f0_2 = -0.5f * spA4; + temp_a2 = &sp168; + sp168 = sp34; + sp16C = D_802B99F0 * spA4; + sp170 = temp_f0_2; + sp2C = temp_f0_2; + func_802B5450((f32 (*)[4]) &sp128[0], (f32 (*)[4]) &spE8[0], (f32 (*)[4]) temp_a2); + if (func_802B4FF8(&spE8[0], 0) != 0) { + temp_v0_18 = gDisplayListHead; + gDisplayListHead = temp_v0_18 + 8; + temp_v0_18->words.w1 = (u32) &D_0D003128; + temp_v0_18->words.w0 = 0x06000000; + if ((actor->unk_04 & 1) == 0) { + temp_v0_19 = gDisplayListHead; + gDisplayListHead = temp_v0_19 + 8; + temp_v0_19->words.w1 = 0x00552078; + temp_v0_19->words.w0 = 0xB900031D; + } else { + temp_v0_20 = gDisplayListHead; + gDisplayListHead = temp_v0_20 + 8; + temp_v0_20->words.w1 = 0x004045D8; + temp_v0_20->words.w0 = 0xB900031D; + } + temp_a2_2 = &sp168; + sp168 = 0.0f; + sp16C = D_802B99F4 * spA4; + sp170 = -1.0f * spA4; + func_802B5450((f32 (*)[4]) &sp128[0], (f32 (*)[4]) &spE8[0], (f32 (*)[4]) temp_a2_2); + if (func_802B4FF8(&spE8[0], 0) != 0) { + temp_v0_21 = gDisplayListHead; + gDisplayListHead = temp_v0_21 + 8; + temp_v0_21->words.w1 = (u32) &D_0D0031E8; + temp_v0_21->words.w0 = 0x06000000; + temp_f0_3 = D_802B99F8 * spA4; + temp_a2_3 = &sp168; + sp170 = sp2C; + sp168 = temp_f0_3; + sp34 = temp_f0_3; + sp16C = D_802B99FC * spA4; + func_802B5450((f32 (*)[4]) &sp128[0], (f32 (*)[4]) &spE8[0], (f32 (*)[4]) temp_a2_3); + if (func_802B4FF8(&spE8[0], 0) != 0) { + temp_v0_22 = gDisplayListHead; + gDisplayListHead = temp_v0_22 + 8; + temp_v0_22->words.w1 = (u32) &D_0D003188; + temp_v0_22->words.w0 = 0x06000000; + temp_a2_4 = &sp168; + sp168 = sp34; + sp16C = sp38; + sp170 = sp30; + func_802B5450((f32 (*)[4]) &sp128[0], (f32 (*)[4]) &spE8[0], (f32 (*)[4]) temp_a2_4); + if (func_802B4FF8(&spE8[0], 0) != 0) { + temp_v0_23 = gDisplayListHead; + gDisplayListHead = temp_v0_23 + 8; + temp_v0_23->words.w1 = (u32) &D_0D0030F8; + temp_v0_23->words.w0 = 0x06000000; + temp_v0_24 = gDisplayListHead; + gDisplayListHead = temp_v0_24 + 8; + temp_v0_24->words.w1 = 0x00002000; + temp_v0_24->words.w0 = 0xB7000000; + } } } } @@ -6259,40 +6202,37 @@ void func_802A171C(void *arg0, void *arg1) { } } } -*/ #else GLOBAL_ASM("asm/non_matchings/code_actors/func_802A171C.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -//s32 func_802B4FF8(f32 *, ?); // extern -//? func_802B5450(f32 *, f32 *, f32 *, f32 *); // extern -//? func_802B5F00(f32, f32 *, f32); // extern -//? func_802B5F74(f32 *, f32 *, s16 *, void *); // extern -//f32 func_802B80D0(f32 *, u16, ?, f32, f32); // extern -extern s8 D_0D002EE8[]; -extern s8 D_0D003008[]; -extern s8 D_0D003090[]; -extern s8 D_0D0030F8[]; -extern s8 D_0D003128[]; -extern s8 D_0D003158[]; -extern s8 D_0D003188[]; -extern s8 D_0D0031B8[]; -extern s8 D_0D0031E8[]; -extern f32 D_802B9A00; -extern f32 D_802B9A04; -extern f32 D_802B9A08; -extern f32 D_802B9A0C; -extern f32 D_802B9A10; -extern f32 D_802B9A14; -extern f32 D_802B9A18; -extern f32 D_802B9A1C; -extern f32 D_802B9A20; -extern f32 D_802B9A24; +//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd +s32 func_802B4FF8(f32 (*)[4], ?); /* extern */ +? func_802B5F74(f32 (*)[4], f32 *, s16 *, struct ItemBox *); /* extern */ +f32 func_802B80D0(f32 *, u16, ?, f32, f32); /* extern */ +extern ? D_0D002EE8; +extern ? D_0D003008; +extern ? D_0D003090; +extern ? D_0D0030F8; +extern ? D_0D003128; +extern ? D_0D003158; +extern ? D_0D003188; +extern ? D_0D0031B8; +extern ? D_0D0031E8; +extern ? D_80150130; +static f32 D_802B9A00 = 4000000.0f; +static f32 D_802B9A04 = 600000.0f; +static f32 D_802B9A08 = 100000.0f; +static f32 D_802B9A0C = 0.1f; +static f32 D_802B9A10 = 0.8f; +static f32 D_802B9A14 = 2.3f; +static f32 D_802B9A18 = 1.2f; +static f32 D_802B9A1C = 1.8f; +static f32 D_802B9A20 = -0.8f; +static f32 D_802B9A24 = 0.6f; - -void func_802A1EA0(void *arg0, void *arg1) { +void func_802A1EA0(Camera *camera, struct ItemBox *item_box) { f32 sp17C; f32 sp178; f32 sp174; @@ -6303,12 +6243,38 @@ void func_802A1EA0(void *arg0, void *arg1) { s16 sp162; s16 sp160; f32 sp15C; - f32 sp118; - f32 spD8; - f32 *sp38; + f32 *sp38; /* compiler-managed */ f32 sp34; f32 sp30; f32 sp2C; + Gfx *temp_v0; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_14; + Gfx *temp_v0_15; + Gfx *temp_v0_16; + Gfx *temp_v0_17; + Gfx *temp_v0_18; + Gfx *temp_v0_19; + Gfx *temp_v0_20; + Gfx *temp_v0_21; + Gfx *temp_v0_22; + Gfx *temp_v0_23; + Gfx *temp_v0_24; + Gfx *temp_v0_25; + Gfx *temp_v0_26; + Gfx *temp_v0_27; + Gfx *temp_v0_28; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; f32 *temp_a1; f32 *temp_a2_2; f32 *temp_a2_3; @@ -6323,111 +6289,155 @@ void func_802A1EA0(void *arg0, void *arg1) { s16 *temp_a2; s16 temp_a0; s16 temp_v1; - s16 phi_a0; s16 phi_a0_2; - void *phi_t1; + struct ItemBox *phi_t1; f32 phi_f0; - temp_a1 = arg1 + 0x18; + temp_a1 = item_box->pos; sp38 = temp_a1; - temp_f0 = func_802B80D0(temp_a1, arg0->unk26, 0, (&D_80150130)[(arg0 - camera1) / 0xB8], D_802B9A00); + temp_f0 = func_802B80D0(temp_a1, (u16) camera->rotX2, 0, *(&D_80150130 + (((s32) (camera - camera1) / 184) * 4)), D_802B9A00); if (!(temp_f0 < 0.0f) && !(D_802B9A04 < temp_f0)) { - temp_a0 = arg1->unk6; + temp_a0 = item_box->state; phi_a0 = temp_a0; if ((temp_a0 == 2) && (temp_f0 < D_802B9A08)) { sp160 = 0; sp164 = 0; - sp162 = arg1->unk12; - sp168 = arg1->unk18; - sp16C = arg1->unk8 + 2.0f; - sp170 = arg1->unk20; - func_802B5F74(&sp118, &sp168, &sp160); - if (func_802B4FF8(&sp118, 0) != 0) { - - gSPDisplayList(gDisplayListHead++, D_0D002EE8); - sp162 = arg1->unk12 * 2; - sp16C = arg1->unk1C; - func_802B5F74(&sp118, &sp168, &sp160, arg1); - if (func_802B4FF8(&sp118, 0) != 0) { - gSPDisplayList(gDisplayListHead++, D_0D003008); - phi_a0 = arg1->unk6; + sp162 = item_box->rot[1]; + sp168 = item_box->pos[0]; + sp16C = item_box->resetDistance + 2.0f; + sp170 = item_box->pos[2]; + func_802B5F74((f32 (*)[4]) &sp118[0], &sp168, &sp160); + if (func_802B4FF8((f32 (*)[4]) &sp118[0], 0) != 0) { + temp_v0 = gDisplayListHead; + gDisplayListHead = temp_v0 + 8; + temp_v0->words.w0 = 0x06000000; + temp_v0->words.w1 = (u32) &D_0D002EE8; + sp162 = item_box->rot[1] * 2; + sp16C = item_box->pos[1]; + func_802B5F74((f32 (*)[4]) &sp118[0], &sp168, &sp160, item_box); + if (func_802B4FF8((f32 (*)[4]) &sp118[0], 0) != 0) { + temp_v0_2 = gDisplayListHead; + gDisplayListHead = temp_v0_2 + 8; + temp_v0_2->words.w1 = (u32) &D_0D003008; + temp_v0_2->words.w0 = 0x06000000; + phi_a0 = item_box->state; goto block_7; } } } else { block_7: phi_a0_2 = phi_a0; - phi_t1 = arg1; + phi_t1 = item_box; if (phi_a0 == 5) { - func_802B5F74(&sp118, sp38, arg1 + 0x10); - if (func_802B4FF8(&sp118, 0) != 0) { - gSPDisplayList(gDisplayListHead++, D_0D003008); - phi_a0_2 = arg1->unk6; - phi_t1 = arg1; + func_802B5F74((f32 (*)[4]) &sp118[0], sp38, item_box + 0x10); + if (func_802B4FF8((f32 (*)[4]) &sp118[0], 0) != 0) { + temp_v0_3 = gDisplayListHead; + gDisplayListHead = temp_v0_3 + 8; + temp_v0_3->words.w1 = (u32) &D_0D003008; + temp_v0_3->words.w0 = 0x06000000; + phi_a0_2 = item_box->state; + phi_t1 = item_box; goto block_10; } } else { block_10: temp_a2 = phi_t1 + 0x10; if (phi_a0_2 != 3) { - func_802B5F74(&sp118, sp38, temp_a2); - if (func_802B4FF8(&sp118, 0) != 0) { - - gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); - gDPSetCombineLERP(gDisplayListHead++, TEXEL0, SHADE, SHADE, 1, TEXEL0, PRIMITIVE, LOD_FRACTION, 0, 0, 0, TEXEL1, 0, 0, 0, SHADE, 0); - temp_v1 = arg1->unk12; + func_802B5F74((f32 (*)[4]) &sp118[0], sp38, temp_a2); + if (func_802B4FF8((f32 (*)[4]) &sp118[0], 0) != 0) { + temp_v0_4 = gDisplayListHead; + gDisplayListHead = temp_v0_4 + 8; + temp_v0_4->words.w1 = 0x00020000; + temp_v0_4->words.w0 = 0xB6000000; + temp_v0_5 = gDisplayListHead; + gDisplayListHead = temp_v0_5 + 8; + temp_v0_5->words.w0 = 0xFC121824; + temp_v0_5->words.w1 = 0xFF33FFFF; + temp_v1 = item_box->rot[1]; if ((temp_v1 < 0xAA1) && (temp_v1 > 0)) { - gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); + temp_v0_6 = gDisplayListHead; + gDisplayListHead = temp_v0_6 + 8; + temp_v0_6->words.w0 = 0xB900031D; + temp_v0_6->words.w1 = 0x00552078; } else if ((temp_v1 >= 0x6AA5) && (temp_v1 < 0x754E)) { - gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); + temp_v0_7 = gDisplayListHead; + gDisplayListHead = temp_v0_7 + 8; + temp_v0_7->words.w0 = 0xB900031D; + temp_v0_7->words.w1 = 0x00552078; } else if ((temp_v1 >= 0x38E1) && (temp_v1 < 0x438A)) { - gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); + temp_v0_8 = gDisplayListHead; + gDisplayListHead = temp_v0_8 + 8; + temp_v0_8->words.w0 = 0xB900031D; + temp_v0_8->words.w1 = 0x00552078; } else if ((temp_v1 >= 0xC711) && (temp_v1 < 0xD1BA)) { - gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); + temp_v0_9 = gDisplayListHead; + gDisplayListHead = temp_v0_9 + 8; + temp_v0_9->words.w0 = 0xB900031D; + temp_v0_9->words.w1 = 0x00552078; } else { - gDPNoOp(gDisplayListHead++); - gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2); -/* - - temp_v0_11->unk4 = 0x504B50; - temp_v0_11->unk0 = 0xB900031D; - */ + temp_v0_10 = gDisplayListHead; + gDisplayListHead = temp_v0_10 + 8; + temp_v0_10->words.w1 = 0; + temp_v0_10->words.w0 = 0xC0000000; + temp_v0_11 = gDisplayListHead; + gDisplayListHead = temp_v0_11 + 8; + temp_v0_11->words.w1 = 0x00504B50; + temp_v0_11->words.w0 = 0xB900031D; } - gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); - gSPDisplayList(gDisplayListHead++, D_0D003090); + temp_v0_12 = gDisplayListHead; + gDisplayListHead = temp_v0_12 + 8; + temp_v0_12->words.w1 = 0x00000200; + temp_v0_12->words.w0 = 0xB7000000; + temp_v0_13 = gDisplayListHead; + gDisplayListHead = temp_v0_13 + 8; + temp_v0_13->words.w0 = 0x06000000; + temp_v0_13->words.w1 = (u32) &D_0D003090; goto block_42; } } else { - gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); - gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); - gDPNoOp(gDisplayListHead++); - sp15C = phi_t1->unk4; - func_802B5F74(&sp118, sp38, temp_a2); + temp_v0_14 = gDisplayListHead; + gDisplayListHead = temp_v0_14 + 8; + temp_v0_14->words.w1 = 0x00020000; + temp_v0_14->words.w0 = 0xB6000000; + temp_v0_15 = gDisplayListHead; + gDisplayListHead = temp_v0_15 + 8; + temp_v0_15->words.w1 = 0x00002000; + temp_v0_15->words.w0 = 0xB6000000; + temp_v0_16 = gDisplayListHead; + gDisplayListHead = temp_v0_16 + 8; + temp_v0_16->words.w1 = 0; + temp_v0_16->words.w0 = 0xC0000000; + sp15C = (f32) phi_t1->someTimer; + func_802B5F74((f32 (*)[4]) &sp118[0], sp38, temp_a2); if (sp15C < 10.0f) { phi_f0 = 1.0f; } else { phi_f0 = 1.0f - ((sp15C - 10.0f) * D_802B9A0C); } - func_802B5F00(sp15C, &sp118, phi_f0); - if ((arg1->unk4 & 1) != 0) { - gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); - - + func_802B5F00((f32 (*)[4]) &sp118[0], phi_f0); + if ((item_box->someTimer & 1) != 0) { + temp_v0_17 = gDisplayListHead; + gDisplayListHead = temp_v0_17 + 8; + temp_v0_17->words.w1 = 0x00552078; + temp_v0_17->words.w0 = 0xB900031D; } else { - gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2); - - //temp_v0_18->unk4 = 0x4045D8; - //temp_v0_18->unk0 = 0xB900031D; + temp_v0_18 = gDisplayListHead; + gDisplayListHead = temp_v0_18 + 8; + temp_v0_18->words.w1 = 0x004045D8; + temp_v0_18->words.w0 = 0xB900031D; } sp174 = 0.0f; temp_f2 = 2.0f * sp15C; sp17C = sp15C; sp178 = temp_f2; - sp38 = (bitwise f32 *) temp_f2; - func_802B5450(&sp118, &spD8, &sp174); - if (func_802B4FF8(&spD8, 0) != 0) { - gSPDisplayList(gDisplayListHead++, D_0D003158); + sp38 = temp_f2; + func_802B5450((f32 (*)[4]) &sp118[0], (f32 (*)[4]) &spD8[0], (f32 (*)[4]) &sp174); + if (func_802B4FF8((f32 (*)[4]) &spD8[0], 0) != 0) { + temp_v0_19 = gDisplayListHead; + gDisplayListHead = temp_v0_19 + 8; + temp_v0_19->words.w0 = 0x06000000; + temp_v0_19->words.w1 = (u32) &D_0D003158; temp_f2_2 = D_802B9A10 * sp15C; temp_f12 = 0.5f * sp15C; sp174 = temp_f2_2; @@ -6435,49 +6445,76 @@ block_10: sp178 = D_802B9A14 * sp15C; sp17C = temp_f12; sp30 = temp_f12; - func_802B5450((bitwise f32 *) temp_f12, &sp118, &spD8, &sp174); - if (func_802B4FF8(&spD8, 0) != 0) { - gSPDisplayList(gDisplayListHead++, D_0D0031B8); + func_802B5450((f32 (*)[4]) &sp118[0], (f32 (*)[4]) &spD8[0], (f32 (*)[4]) &sp174); + if (func_802B4FF8((f32 (*)[4]) &spD8[0], 0) != 0) { + temp_v0_20 = gDisplayListHead; + gDisplayListHead = temp_v0_20 + 8; + temp_v0_20->words.w0 = 0x06000000; + temp_v0_20->words.w1 = (u32) &D_0D0031B8; temp_f0_2 = -0.5f * sp15C; temp_a2_2 = &sp174; sp174 = sp34; sp178 = D_802B9A18 * sp15C; sp17C = temp_f0_2; sp2C = temp_f0_2; - func_802B5450(&sp118, &spD8, temp_a2_2); - if (func_802B4FF8(&spD8, 0) != 0) { - gSPDisplayList(gDisplayListHead++, D_0D003128); - if ((arg1->unk4 & 1) == 0) { - gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); + func_802B5450((f32 (*)[4]) &sp118[0], (f32 (*)[4]) &spD8[0], (f32 (*)[4]) temp_a2_2); + if (func_802B4FF8((f32 (*)[4]) &spD8[0], 0) != 0) { + temp_v0_21 = gDisplayListHead; + gDisplayListHead = temp_v0_21 + 8; + temp_v0_21->words.w1 = (u32) &D_0D003128; + temp_v0_21->words.w0 = 0x06000000; + if ((item_box->someTimer & 1) == 0) { + temp_v0_22 = gDisplayListHead; + gDisplayListHead = temp_v0_22 + 8; + temp_v0_22->words.w1 = 0x00552078; + temp_v0_22->words.w0 = 0xB900031D; } else { - gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2); + temp_v0_23 = gDisplayListHead; + gDisplayListHead = temp_v0_23 + 8; + temp_v0_23->words.w1 = 0x004045D8; + temp_v0_23->words.w0 = 0xB900031D; } temp_a2_3 = &sp174; sp174 = 0.0f; sp178 = D_802B9A1C * sp15C; sp17C = -1.0f * sp15C; - func_802B5450(&sp118, &spD8, temp_a2_3); - if (func_802B4FF8(&spD8, 0) != 0) { - gSPDisplayList(gDisplayListHead++, D_0D0031E8); + func_802B5450((f32 (*)[4]) &sp118[0], (f32 (*)[4]) &spD8[0], (f32 (*)[4]) temp_a2_3); + if (func_802B4FF8((f32 (*)[4]) &spD8[0], 0) != 0) { + temp_v0_24 = gDisplayListHead; + gDisplayListHead = temp_v0_24 + 8; + temp_v0_24->words.w1 = (u32) &D_0D0031E8; + temp_v0_24->words.w0 = 0x06000000; temp_f0_3 = D_802B9A20 * sp15C; temp_a2_4 = &sp174; sp17C = sp2C; sp174 = temp_f0_3; sp34 = temp_f0_3; sp178 = D_802B9A24 * sp15C; - func_802B5450(&sp118, &spD8, temp_a2_4); - if (func_802B4FF8(&spD8, 0) != 0) { - gSPDisplayList(gDisplayListHead++, D_0D003188); + func_802B5450((f32 (*)[4]) &sp118[0], (f32 (*)[4]) &spD8[0], (f32 (*)[4]) temp_a2_4); + if (func_802B4FF8((f32 (*)[4]) &spD8[0], 0) != 0) { + temp_v0_25 = gDisplayListHead; + gDisplayListHead = temp_v0_25 + 8; + temp_v0_25->words.w1 = (u32) &D_0D003188; + temp_v0_25->words.w0 = 0x06000000; temp_a2_5 = &sp174; sp174 = sp34; - sp178 = (bitwise f32) sp38; + sp178 = sp38; sp17C = sp30; - func_802B5450(&sp118, &spD8, temp_a2_5); - if (func_802B4FF8(&spD8, 0) != 0) { - gSPDisplayList(gDisplayListHead++, D_0D0030F8); - gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK); - gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); + func_802B5450((f32 (*)[4]) &sp118[0], (f32 (*)[4]) &spD8[0], (f32 (*)[4]) temp_a2_5); + if (func_802B4FF8((f32 (*)[4]) &spD8[0], 0) != 0) { + temp_v0_26 = gDisplayListHead; + gDisplayListHead = temp_v0_26 + 8; + temp_v0_26->words.w1 = (u32) &D_0D0030F8; + temp_v0_26->words.w0 = 0x06000000; + temp_v0_27 = gDisplayListHead; + gDisplayListHead = temp_v0_27 + 8; + temp_v0_27->words.w1 = 0x00002000; + temp_v0_27->words.w0 = 0xB7000000; block_42: + temp_v0_28 = gDisplayListHead; + gDisplayListHead = temp_v0_28 + 8; + temp_v0_28->words.w1 = -1U; + temp_v0_28->words.w0 = 0xBB000001; } } } @@ -6498,13 +6535,13 @@ extern f32 D_802B9A28; void func_802A269C(Camera *arg0, struct Actor *arg1) { Mat4 sp38; - f32 unk = func_802B80D0(arg0->pos, arg1->unk18, arg0->rotX[1], 0, D_80150130[arg0 - camera1], D_802B9A28); + f32 unk = func_802B80D0(arg0->pos, arg1->pos, arg0->rotX[1], 0, D_80150130[arg0 - camera1], D_802B9A28); if (!(unk < 0.0f)) { gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); - func_802B5F74(sp38, arg1->unk18, arg1->unk10); + func_802B5F74(sp38, arg1->pos, arg1->rot); if (func_802B4FF8(sp38, 0) != 0) { gSPDisplayList(gDisplayListHead++, D_0600CA60); @@ -6517,14 +6554,14 @@ extern s8 D_06017FA8[]; extern f32 D_802B9A2C; extern s32 D_800DC50C; -void func_802A27A0(Camera *arg0, Mat4 arg1, struct Actor *arg2, u16 arg3) { +void func_802A27A0(Camera *arg0, Mat4 arg1, struct YoshiValleyEgg *egg, u16 arg3) { Mat4 sp60; Vec3s sp5C; Vec3f sp54; f32 temp_f0; if (D_800DC50C != CREDITS_SEQUENCE) { - temp_f0 = func_802B80D0(arg0->pos, arg2->unk18, arg0->rotX[1], 200.0f, D_80150130[arg0 - camera1], D_802B9A2C); + temp_f0 = func_802B80D0(arg0->pos, egg->pos, arg0->rotX[1], 200.0f, D_80150130[arg0 - camera1], D_802B9A2C); if (temp_f0 < 0.0f) { return; } @@ -6536,25 +6573,25 @@ void func_802A27A0(Camera *arg0, Mat4 arg1, struct Actor *arg2, u16 arg3) { gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); if ((arg3 > 12) && (arg3 < 20)) { if (temp_f0 < 640000.0f) { - sp54[0] = arg2->unk18[0]; + sp54[0] = egg->pos[0]; sp54[1] = 3.0f; - sp54[2] = arg2->unk18[2]; + sp54[2] = egg->pos[2]; func_802976D8(sp5C); func_8029794C(sp54, sp5C, 10.0f); } sp5C[0] = 0; - sp5C[1] = arg2->unk10[1]; + sp5C[1] = egg->eggRot; sp5C[2] = 0; - func_802B5F74(sp60, arg2->unk18, sp5C); + func_802B5F74(sp60, egg->pos, sp5C); if (func_802B4FF8(sp60, 0) == 0) { return; } gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING); gSPDisplayList(gDisplayListHead++, D_06016D70); } else { - arg1[3][0] = arg2->unk18[0]; - arg1[3][1] = arg2->unk18[1]; - arg1[3][2] = arg2->unk18[2]; + arg1[3][0] = egg->pos[0]; + arg1[3][1] = egg->pos[1]; + arg1[3][2] = egg->pos[2]; if (func_802B4FF8(arg1, 0) != 0) { gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); @@ -6569,14 +6606,14 @@ extern s8 D_06009330[]; void func_802A29BC(Camera *arg0, Mat4 arg1, struct Actor *arg2) { Mat4 sp40; f32 unk; - s16 temp = arg2->unk2; + s16 temp = arg2->flags; if (temp & 0x800) { return; } - unk = func_802B80D0(arg0->pos, arg2->unk18, arg0->rotX[1], 0, D_80150130[arg0 - camera1], 16000000.0f); + unk = func_802B80D0(arg0->pos, arg2->pos, arg0->rotX[1], 0, D_80150130[arg0 - camera1], 16000000.0f); if (!(unk < 0.0f)) { gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); - func_802B5F74(&sp40, arg2->unk18, arg2->unk10); + func_802B5F74(&sp40, arg2->pos, arg2->rot); if (func_802B4FF8(&sp40, 0) != 0) { gSPDisplayList(gDisplayListHead++, D_06009330); } @@ -6596,18 +6633,18 @@ extern s8 D_802B8864[]; void func_802A2AD0(Camera *arg0, struct Actor *arg1) { Vec3s sp80 = {0, 0, 0}; Mat4 sp40; - f32 unk = func_802B80D0(arg0->pos, arg1->unk18, arg0->rotX[1], 0.0f, D_80150130[arg0 - camera1], 4000000.0f); + f32 unk = func_802B80D0(arg0->pos, arg1->pos, arg0->rotX[1], 0.0f, D_80150130[arg0 - camera1], 4000000.0f); if (unk < 0.0f) { return; } - func_802B5F74(sp40, arg1->unk18, arg1->unk10); + func_802B5F74(sp40, arg1->pos, arg1->rot); if (func_802B4FF8(sp40, 0) == 0) { return; } gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING); gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK); - if (D_801637B8[arg1->unk6]) { + if (D_801637B8[arg1->state]) { - if (arg1->unk4 < 20) { + if (arg1->unk_04 < 20) { gSPDisplayList(gDisplayListHead++, D_06010AE8); } else { gSPDisplayList(gDisplayListHead++, D_06010C10); @@ -6630,25 +6667,25 @@ void func_802A2C78(Camera *arg0, Mat4 arg1, struct Actor *arg2) { Vec3s spA8 = {0, 0, 0}; Mat4 sp68; f32 temp_f0; - s16 temp_v0 = arg2->unk2; + s16 temp_v0 = arg2->flags; if ((temp_v0 & 0x800)) { return; } - temp_f0 = func_802B80D0(arg0->pos, arg2->unk18, arg0->rotX[1], 0.0f, D_80150130[arg0 - camera1], 4000000.0f); + temp_f0 = func_802B80D0(arg0->pos, arg2->pos, arg0->rotX[1], 0.0f, D_80150130[arg0 - camera1], 4000000.0f); if (!(temp_f0 < 0.0f)) { if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) { - func_8029794C(arg2->unk18, arg2->unk10, 2.0f); + func_8029794C(arg2->pos, arg2->rot, 2.0f); } - func_802B5F74(sp68, arg2->unk18, spA8); + func_802B5F74(sp68, arg2->pos, spA8); if (func_802B4FF8(sp68, 0) != 0) { gDPSetTextureLUT(gDisplayListHead++, G_TT_NONE); gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING); - switch(arg2->unk4) { + switch(arg2->unk_04) { case 0: gSPDisplayList(gDisplayListHead++, &D_060186B8); gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK); @@ -6688,18 +6725,18 @@ void func_802A2F34(struct UnkStruct_800DC5EC *arg0) { for (i = 0; i < 100; i++) { phi_s0 = &D_8015F9B8[i]; - if (phi_s0->unk2 == 0) { + if (phi_s0->flags == 0) { continue; } - switch(phi_s0->unk0) { - case 13: + switch(phi_s0->type) { + case ACTOR_FAKE_ITEM_BOX: func_802A171C(temp_s1, phi_s0); break; - case 12: + case ACTOR_ITEM_BOX: func_802A1EA0(temp_s1, phi_s0); break; - case 43: + case ACTOR_HOT_AIR_BALLOON_ITEM_BOX: func_802A1EA0(temp_s1, phi_s0); break; } @@ -6708,7 +6745,7 @@ void func_802A2F34(struct UnkStruct_800DC5EC *arg0) { void func_802986B4(Camera*, Mat4, struct Actor*); void func_80298D7C(Camera*, Mat4, struct Actor*); -void func_802A27A0(Camera*, Mat4, struct Actor*, u16); +void func_802A27A0(Camera*, Mat4, struct YoshiValleyEgg*, u16); //void func_8029AE1C(Camera*, Mat4, struct Actor*, u16); extern Mat4 D_801502C0; @@ -6729,7 +6766,7 @@ void func_8029A690(Camera *, Mat4, struct Actor*); /* extern */ void func_8029A23C(Camera *, Mat4, struct Actor*); /* extern */ void func_8029A75C(Camera *, Mat4, struct Actor*); /* extern */ void func_8029A828(Camera *, Mat4, struct Actor*); /* extern */ -void func_8029A8F4(Camera *, Mat4, struct Actor*); /* extern */ +void func_8029A8F4(Camera *, Mat4, struct BananaActor*); /* extern */ void func_80298328(Camera *, Mat4, struct Actor*); void func_8029AC18(Camera *, Mat4, struct Actor*); /* extern */ //void func_8029AE1C(Camera *, struct Actor*, Mat4, u16); /* extern */ @@ -6743,7 +6780,6 @@ void func_8029C3CC(Camera *, struct Actor*); /* extern */ void func_8029CA90(Camera *, struct Actor*); /* extern */ void func_80297A50(Camera *, Mat4, struct Actor*); void func_802A269C(Camera *, struct Actor*); /* extern */ -void func_802A27A0(Camera *, Mat4, struct Actor*, u16); /* extern */ void func_802A29BC(Camera *, Mat4, struct Actor*); /* extern */ void func_802A2AD0(Camera *, struct Actor*); /* extern */ void func_802A2C78(Camera *, Mat4, struct Actor*); /* extern */ @@ -6788,10 +6824,10 @@ void func_802A3008(struct UnkStruct_800DC5EC *arg0) { for (i = 0; i < 100; i++) { phi_s0 = &D_8015F9B8[i]; - if (phi_s0->unk2 == 0) { + if (phi_s0->flags == 0) { continue; } - switch (phi_s0->unk0) { + switch (phi_s0->type) { case 2: func_80299144(temp_s1, D_801502C0, phi_s0); break; @@ -6825,34 +6861,34 @@ void func_802A3008(struct UnkStruct_800DC5EC *arg0) { case 32: func_8029A11C(temp_s1, D_801502C0, phi_s0); break; - case 5: + case ACTOR_FALLING_ROCK: func_8029CA90(temp_s1, phi_s0); break; - case 45: + case ACTOR_KIWANO_FRUIT: func_8029A23C(temp_s1, D_801502C0, phi_s0); break; - case 6: + case ACTOR_BANANA: func_8029A8F4(temp_s1, D_801502C0, phi_s0); break; - case 7: + case ACTOR_GREEN_SHELL: func_8029A690(temp_s1, D_801502C0, phi_s0); break; - case 8: + case ACTOR_RED_SHELL: func_8029A75C(temp_s1, D_801502C0, phi_s0); break; - case 42: + case ACTOR_BLUE_SPINY_SHELL: func_8029A828(temp_s1, D_801502C0, phi_s0); break; - case 10: + case ACTOR_PIRANHA_PLANT: func_80298328(temp_s1, D_801502C0, phi_s0); break; - case 15: + case ACTOR_TRAIN_ENGINE: func_8029B8E8(temp_s1, phi_s0); break; - case 16: + case ACTOR_TRAIN_TENDER: func_8029BFB0(temp_s1, phi_s0); break; - case 17: + case ACTOR_TRAIN_PASSENGER_CAR: func_8029C3CC(temp_s1, phi_s0); break; case 18: @@ -6861,16 +6897,16 @@ void func_802A3008(struct UnkStruct_800DC5EC *arg0) { case 20: func_8029AC18(temp_s1, D_801502C0, phi_s0); break; - case 23: + case ACTOR_MARIO_RACEWAY_SIGN: func_802A29BC(temp_s1, D_801502C0, phi_s0); break; - case 35: + case ACTOR_WARIO_STADIUM_SIGN: func_802A269C(temp_s1, phi_s0); break; case 25: func_802A2C78(temp_s1, D_801502C0, phi_s0); break; - case 38: + case ACTOR_PADDLE_WHEEL_BOAT: func_8029AE1C(temp_s1, phi_s0, D_801502C0, sp92); break; case 37: @@ -6888,7 +6924,7 @@ void func_802A3008(struct UnkStruct_800DC5EC *arg0) { case 39: func_802A2AD0(temp_s1, phi_s0); break; - case 9: + case ACTOR_YOSHI_VALLEY_EGG: func_802A27A0(temp_s1, D_801502C0, phi_s0, sp92); break; } @@ -6909,69 +6945,69 @@ void update_simple_objects(void) { for (i = 0; i < 100; i++) { phi_s0 = &D_8015F9B8[i]; - if (phi_s0->unk2 == 0) { + if (phi_s0->flags == 0) { continue; } - switch (phi_s0->unk0) { - case 5: + switch (phi_s0->type) { + case ACTOR_FALLING_ROCK: update_obj_falling_rocks(phi_s0); break; - case 7: + case ACTOR_GREEN_SHELL: update_obj_green_shell(phi_s0); break; - case 8: + case ACTOR_RED_SHELL: update_obj_red_blue_shell(phi_s0); break; - case 42: + case ACTOR_BLUE_SPINY_SHELL: update_obj_red_blue_shell(phi_s0); break; - case 45: + case ACTOR_KIWANO_FRUIT: update_obj_kiwano_fruit(phi_s0); break; - case 6: + case ACTOR_BANANA: update_obj_banana(phi_s0); break; - case 38: + case ACTOR_PADDLE_WHEEL_BOAT: update_obj_paddle_wheel(phi_s0); break; - case 15: + case ACTOR_TRAIN_ENGINE: update_obj_train_engine(phi_s0); break; - case 16: + case ACTOR_TRAIN_TENDER: update_obj_train_car1(phi_s0); break; - case 17: + case ACTOR_TRAIN_PASSENGER_CAR: update_obj_train_car2(phi_s0); break; - case 12: + case ACTOR_ITEM_BOX: update_obj_item_box(phi_s0); break; - case 43: + case ACTOR_HOT_AIR_BALLOON_ITEM_BOX: update_obj_item_box_hot_air_balloon(phi_s0); break; - case 13: + case ACTOR_FAKE_ITEM_BOX: update_obj_fake_item_box(phi_s0); break; - case 10: + case ACTOR_PIRANHA_PLANT: update_obj_piranha_plant(phi_s0); break; - case 14: + case ACTOR_BANANA_BUNCH: update_obj_banana_bunch(phi_s0); break; - case 21: - update_obj_triple_shell(phi_s0, 7); + case ACTOR_TRIPLE_GREEN_SHELL: + update_obj_triple_shell(phi_s0, ACTOR_GREEN_SHELL); break; - case 22: - update_obj_triple_shell(phi_s0, 8); + case ACTOR_TRIPLE_RED_SHELL: + update_obj_triple_shell(phi_s0, ACTOR_RED_SHELL); break; - case 23: + case ACTOR_MARIO_RACEWAY_SIGN: update_obj_mario_raceway_sign(phi_s0); break; - case 35: + case ACTOR_WARIO_STADIUM_SIGN: update_obj_wario_stadium_sign(phi_s0); break; - case 39: + case ACTOR_RAILROAD_CROSSING: update_obj_railroad_crossing(phi_s0); break; case 2: @@ -6989,7 +7025,7 @@ void update_simple_objects(void) { case 33: update_obj_trees_cacti_shrubs(phi_s0); break; - case 9: + case ACTOR_YOSHI_VALLEY_EGG: update_obj_yoshi_valley_egg(phi_s0); break; } @@ -6997,7 +7033,3 @@ void update_simple_objects(void) { func_802A0E44(); func_802B30EC(); } - -//#else -//GLOBAL_ASM("asm/non_matchings/code_actors/update_simple_objects.s") -//#endif diff --git a/src/code_802B0210.c b/src/code_802B0210.c index 2bbb901a1..48f889e50 100644 --- a/src/code_802B0210.c +++ b/src/code_802B0210.c @@ -25,34 +25,34 @@ extern struct Actor D_8015F9B8[]; void func_802B02B4(struct Actor *arg0, s32 arg1) { s32 temp_f6; - struct Actor *temp_v0 = &D_8015F9B8[arg0->unk4]; + struct Actor *temp_v0 = &D_8015F9B8[arg0->unk_04]; - temp_v0->unk4--; + temp_v0->unk_04--; - switch((s16)arg0->unk8) { + switch((s16)arg0->unk_08) { case 0: - temp_v0->unk24[0] = -1.0f; + temp_v0->velocity[0] = -1.0f; break; case 1: - temp_v0->unk24[1] = -1.0f; + temp_v0->velocity[1] = -1.0f; break; case 2: - temp_v0->unk24[2] = -1.0f; + temp_v0->velocity[2] = -1.0f; break; } - arg0->unk2 = 0x8000; // bitflag - arg0->unk10[1] = 0; - arg0->unk24[1] = 3.0f; - arg0->unk4 = 60; + arg0->flags = 0x8000; // bitflag + arg0->rot[1] = 0; + arg0->velocity[1] = 3.0f; + arg0->unk_04 = 60; switch(arg1) { case 7: - arg0->unk6 = 5; + arg0->state = 5; break; case 8: - arg0->unk6 = 7; + arg0->state = 7; break; } } @@ -69,8 +69,8 @@ void func_802B039C(void *arg0) { f32 phi_f6; arg0->unk6 = 1; - arg0->unk4 = 0xB4; - arg0->unk24 = (random_int(0xC8) - 0x64) * D_802B9E80; + arg0->unk_04 = 0xB4; + arg0->velocity = (random_int(0xC8) - 0x64) * D_802B9E80; temp_v0 = random_int(0xC8); temp_f6 = temp_v0; phi_f6 = temp_f6; @@ -146,19 +146,19 @@ void func_802B0570(void *arg0) { func_802B0464(arg0->unk14); func_802B04E8(arg0, arg0->unk12); - temp_v0 = arg0->unk10; + temp_v0 = arg0->rot; if ((*(&gPlayers + (temp_v0 * 0xDD8)) & 0x4000) != 0) { func_800C9060(temp_v0 & 0xFF, 0x19019053); } arg0->unk2 = -0x8000; - arg0->unk4 = 0x3C; + arg0->unk_04 = 0x3C; arg0->unk6 = 5; - temp_v0_2 = (arg0->unk8 * 0x70) + &D_8015F9B8; + temp_v0_2 = (arg0->unk_08 * 0x70) + &D_8015F9B8; arg0->unk28 = 3.0f; temp_v0_2->unk12 = -1; temp_v0_2->unk14 = -1; temp_v0_2->unk16 = -1; - temp_v0_2->unk18 = -1; + temp_v0_2->pos = -1; temp_v0_2->unk1A = -1; } #else @@ -167,7 +167,7 @@ GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B0570.s") #ifdef MIPS_TO_C //generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd -void func_802B0648(struct banana_bunch_parent *banana_bunch) { +void func_802B0648(struct BananaBunchParent *banana_bunch) { s16 temp_v0; s16 temp_v0_2; s16 temp_v0_3; @@ -218,8 +218,8 @@ void func_802B0648(struct banana_bunch_parent *banana_bunch) { block_10: temp_v0_6 = phi_v1->unk12; phi_v1->unk6 = 1; - phi_v1->unk4 = 0x00B4; - phi_v1->unk24 = 0.0f; + phi_v1->unk_04 = 0x00B4; + phi_v1->velocity = 0.0f; phi_v1->unk2C = 0.0f; phi_v1->unk28 = 1.5f; if (temp_v0_6 != -1) { @@ -236,7 +236,7 @@ GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B0648.s") ? func_802B64C4(f32 *, s16); /* extern */ ? load_giant_egg(f32, f32 *, ?, f32, f32); /* extern */ -void func_802B0788(s16 arg0, struct banana_bunch_parent *banana_bunch, Player *player) { +void func_802B0788(s16 arg0, struct BananaBunchParent *banana_bunch, Player *player) { f32 sp34; void *sp30; f32 temp_f0; @@ -293,7 +293,7 @@ void func_802B0788(s16 arg0, struct banana_bunch_parent *banana_bunch, Player *p block_10: temp_a1 = phi_v0->unk12; phi_v0->unk6 = 1; - phi_v0->unk4 = 0x001E; + phi_v0->unk_04 = 0x001E; if (temp_a1 != -1) { (D_8015F9B8 + (temp_a1 * 0x70))->unk14 = -1; } @@ -309,7 +309,7 @@ block_10: sp30 = phi_v0; load_giant_egg(phi_f12, &sp34, 0, phi_f0, phi_f12); func_802B64C4(&sp34, (s16) (player->unk_02E + player->unk_0C0)); - sp30->unk24 = sp34; + sp30->velocity = sp34; sp30->unk28 = sp38; sp30->unk2C = sp3C; } @@ -319,11 +319,11 @@ GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B0788.s") #endif s32 func_802B09C0(s16 bananaId) { - struct banana_actor *banana; + struct BananaActor *banana; if (bananaId == -1) { return 0; } - banana = (struct banana_actor*) &D_8015F9B8[bananaId]; + banana = (struct BananaActor*) &D_8015F9B8[bananaId]; if (banana->state == 2) { return 1; } @@ -336,13 +336,13 @@ s32 func_802B09C0(s16 bananaId) { #ifdef MIPS_TO_C //generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd ? func_800C9060(s32, ?); /* extern */ -? func_8029E854(struct banana_bunch_parent *, s32); /* extern */ -? func_802B0648(struct banana_bunch_parent *); /* extern */ -? func_802B0788(s16, struct banana_bunch_parent *, Player *, Player *); /* extern */ +? func_8029E854(struct BananaBunchParent *, s32); /* extern */ +? func_802B0648(struct BananaBunchParent *); /* extern */ +? func_802B0788(s16, struct BananaBunchParent *, Player *, Player *); /* extern */ s32 func_802B09C0(s16, s32); /* extern */ -? func_802B2914(struct banana_bunch_parent *, Player *, ?, Player *); /* extern */ +? func_802B2914(struct BananaBunchParent *, Player *, ?, Player *); /* extern */ -void update_obj_banana_bunch(struct banana_bunch_parent *banana_bunch) { +void update_obj_banana_bunch(struct BananaBunchParent *banana_bunch) { Player *sp2C; struct Controller *sp28; s32 sp24; @@ -350,11 +350,11 @@ void update_obj_banana_bunch(struct banana_bunch_parent *banana_bunch) { s16 temp_a0_2; s16 temp_v1_2; struct Controller *temp_v0; - struct banana_actor *temp_a0; - struct banana_actor *temp_a1; - struct banana_actor *temp_a2; - struct banana_actor *temp_a3_2; - struct banana_actor *temp_t0; + struct BananaActor *temp_a0; + struct BananaActor *temp_a1; + struct BananaActor *temp_a2; + struct BananaActor *temp_a3_2; + struct BananaActor *temp_t0; u16 temp_t9; u16 temp_v1; s32 phi_v1; @@ -486,11 +486,11 @@ GLOBAL_ASM("asm/non_matchings/code_802B0210/update_obj_banana_bunch.s") #endif s32 func_802B0E14(s16 arg0) { - struct shell_actor *temp; + struct ShellActor *temp; if (arg0 < 0) { return 0; } - temp = (struct shell_actor*) &D_8015F9B8[arg0]; + temp = (struct ShellActor*) &D_8015F9B8[arg0]; if (temp->type == 7) { if (temp->state == 4) { return 1; @@ -509,14 +509,14 @@ s32 func_802B0E14(s16 arg0) { ? func_8000EDC8(s32); /* extern */ ? func_800C9060(u8, ?); /* extern */ ? func_800C90F4(u8, s32); /* extern */ -? func_8029E854(struct triple_shell_parent *); /* extern */ +? func_8029E854(struct TripleShellParent *); /* extern */ s32 func_802B0E14(s16, s16); /* extern */ -s32 func_802B19EC(struct triple_shell_parent *, Player *, s16, ?); /* extern */ +s32 func_802B19EC(struct TripleShellParent *, Player *, s16, ?); /* extern */ ? func_802B64C4(f32 *, s16); /* extern */ -void update_obj_triple_shell(struct triple_shell_parent *actor, s16 arg1) { +void update_obj_triple_shell(struct TripleShellParent *actor, s16 arg1) { s16 sp4E; - struct shell_actor *sp44; + struct ShellActor *sp44; f32 sp40; f32 sp3C; f32 sp38; @@ -538,12 +538,12 @@ void update_obj_triple_shell(struct triple_shell_parent *actor, s16 arg1) { s16 temp_v1_6; s32 temp_v1; struct Controller *temp_v0_5; - struct shell_actor *temp_v0_2; - struct shell_actor *temp_v0_3; - struct shell_actor *temp_v0_4; - struct shell_actor *temp_v0_6; - struct shell_actor *temp_v0_7; - struct shell_actor *temp_v0_8; + struct ShellActor *temp_v0_2; + struct ShellActor *temp_v0_3; + struct ShellActor *temp_v0_4; + struct ShellActor *temp_v0_6; + struct ShellActor *temp_v0_7; + struct ShellActor *temp_v0_8; u16 temp_t9; s16 phi_v1; s16 phi_v1_2; @@ -768,7 +768,7 @@ s16 func_802B17F4(void *arg0) { } temp_v1 = (temp_v0 * 0x70) + &D_8015F9B8; temp_v1->unk6 = 0; - temp_v1->unk10 = (arg0 - gPlayerOne) / 0xDD8; + temp_v1->rot = (arg0 - gPlayerOne) / 0xDD8; arg0->unkC = arg0->unkC | 0x40000; return temp_v0; } @@ -805,11 +805,11 @@ s16 func_802B18E4(s32 arg0, s16 arg1) { } temp_v1 = (temp_v0 * 0x70) + &D_8015F9B8; temp_v1->unk6 = 0; - temp_v1->unk10 = 0x5B0; + temp_v1->rot = 0x5B0; temp_v1->unk12 = -0x8000; temp_v1->unk14 = (arg0 - gPlayerOne) / 0xDD8; - temp_v1->unk4 = 0; - temp_v1->unk8 = 0.0f; + temp_v1->unk_04 = 0; + temp_v1->unk_08 = 0.0f; return temp_v0; } #else @@ -825,7 +825,7 @@ s16 func_8029EC88(f32 *, ? *, ? *, s16); /* extern */ static ? D_802B9180; /* unable to generate initializer */ static ? D_802B918C; /* unable to generate initializer */ -s32 func_802B19EC(struct triple_shell_parent *arg0, Player *player, s16 arg2, u16 arg3) { +s32 func_802B19EC(struct TripleShellParent *arg0, Player *player, s16 arg2, u16 arg3) { ? sp54; ? sp4C; f32 sp48; @@ -863,7 +863,7 @@ s32 func_802B19EC(struct triple_shell_parent *arg0, Player *player, s16 arg2, u1 temp_s0 = (temp_t3 * 0x10) + D_8015F9B8; sp44 = player->pos[1]; sp48 = player->pos[2]; - func_802AD950(temp_s0 + 0x30, temp_s0->unkC + 1.0f, temp_s0->unk18, temp_s0->unk1C, temp_s0->unk20, sp40, sp44, sp48); + func_802AD950(temp_s0 + 0x30, temp_s0->unkC + 1.0f, temp_s0->pos, temp_s0->unk1C, temp_s0->unk20, sp40, sp44, sp48); func_802B4E30(temp_s0); temp_s0->unk2 = -0x7000; switch (arg2) { /* irregular */ @@ -874,11 +874,11 @@ s32 func_802B19EC(struct triple_shell_parent *arg0, Player *player, s16 arg2, u1 temp_s0->unk6 = 6; break; } - temp_s0->unk10 = 0; + temp_s0->rot = 0; temp_s0->unk12 = -0x8000; temp_s0->unk14 = (s16) ((s32) (player - gPlayerOne) / 3544); - temp_s0->unk4 = (s16) ((s32) (arg0 - D_8015F9B8) / 112); - temp_s0->unk8 = (f32) arg3; + temp_s0->unk_04 = (s16) ((s32) (arg0 - D_8015F9B8) / 112); + temp_s0->unk_08 = (f32) arg3; arg0->shellIndices[arg3] = (f32) ((s32) (temp_s0 - D_8015F9B8) / 112); return 1; } @@ -920,7 +920,7 @@ s16 func_802B1C9C(void *arg0) { func_802B63B8(&sp40, arg0 + 0x174); temp_a0 = &sp40; sp40 = 0.0f + arg0->unk14; - sp44 += arg0->unk18; + sp44 += arg0->pos; sp48 += arg0->unk1C; temp_v0 = func_8029EC88(temp_a0, &sp4C, &sp54, 7); temp_v1 = temp_v0; @@ -930,13 +930,13 @@ s16 func_802B1C9C(void *arg0) { temp_t8 = temp_v1 * 7; sp40 = arg0->unk14; temp_s0 = (temp_t8 * 0x10) + &D_8015F9B8; - sp44 = arg0->unk18; + sp44 = arg0->pos; sp48 = arg0->unk1C; sp3E = temp_v1; - func_802AD950(temp_s0 + 0x30, temp_s0->unkC + 1.0f, temp_s0->unk18, temp_s0->unk1C, temp_s0->unk20, sp40, sp44, sp48); + func_802AD950(temp_s0 + 0x30, temp_s0->unkC + 1.0f, temp_s0->pos, temp_s0->unk1C, temp_s0->unk20, sp40, sp44, sp48); func_802B4E30(temp_s0); temp_s0->unk6 = 0; - temp_s0->unk10 = 0; + temp_s0->rot = 0; temp_s0->unk12 = -0x8000; temp_s0->unk14 = (arg0 - gPlayerOne) / 0xDD8; return sp3E; @@ -979,7 +979,7 @@ s16 func_802B1E48(void *arg0) { func_802B63B8(&sp40, arg0 + 0x174); temp_a0 = &sp40; sp40 = 0.0f + arg0->unk14; - sp44 += arg0->unk18; + sp44 += arg0->pos; sp48 += arg0->unk1C; temp_v0 = func_8029EC88(temp_a0, &sp4C, &sp54, 8); temp_v1 = temp_v0; @@ -989,13 +989,13 @@ s16 func_802B1E48(void *arg0) { temp_t8 = temp_v1 * 7; sp40 = arg0->unk14; temp_s0 = (temp_t8 * 0x10) + &D_8015F9B8; - sp44 = arg0->unk18; + sp44 = arg0->pos; sp48 = arg0->unk1C; sp3E = temp_v1; - func_802AD950(temp_s0 + 0x30, temp_s0->unkC + 1.0f, temp_s0->unk18, temp_s0->unk1C, temp_s0->unk20, sp40, sp44, sp48); + func_802AD950(temp_s0 + 0x30, temp_s0->unkC + 1.0f, temp_s0->pos, temp_s0->unk1C, temp_s0->unk20, sp40, sp44, sp48); func_802B4E30(temp_s0); temp_s0->unk6 = 0; - temp_s0->unk10 = 0; + temp_s0->rot = 0; temp_s0->unk12 = arg0->unk2E - 0x8000; temp_s0->unk14 = (arg0 - gPlayerOne) / 0xDD8; return sp3E; @@ -1019,10 +1019,10 @@ GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B1FFC.s") #ifdef MIPS_TO_C //generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd ? func_800C9060(s32, ?, u16); /* extern */ -? func_8029E854(struct banana_actor *); /* extern */ -? func_8029FDC8(f32, struct banana_actor *); /* extern */ +? func_8029E854(struct BananaActor *); /* extern */ +? func_8029FDC8(f32, struct BananaActor *); /* extern */ ? func_802ADDC8(f32, UnkActorInner *, UnkActorInner *, f32, f32, f32, f32); /* extern */ -? func_802B4E30(struct banana_actor *); /* extern */ +? func_802B4E30(struct BananaActor *); /* extern */ ? func_802B64C4(f32 *, s16); /* extern */ ? load_giant_egg(f32, f32 *, ?, f32, f32); /* extern */ extern s16 D_8015F6E8; @@ -1037,7 +1037,7 @@ static f32 D_802B9EE8 = 0.2f; static f32 D_802B9EEC = 0.2f; static f32 D_802B9EF0 = 0.3f; -void update_obj_banana(struct banana_actor *banana) { +void update_obj_banana(struct BananaActor *banana) { Player *sp88; struct Actor *sp84; struct Controller *sp80; @@ -1295,7 +1295,7 @@ s16 func_8029EC88(f32 *, s16 *, f32 *, ?); /* extern */ ? func_802B4E30(void *); /* extern */ ? func_802B63B8(f32 *, f32 *); /* extern */ -void func_802B2914(struct banana_bunch_parent *banana_bunch, Player *player, s16 bananaId) { +void func_802B2914(struct BananaBunchParent *banana_bunch, Player *player, s16 bananaId) { s16 sp6E; f32 sp68; f32 sp64; @@ -1313,7 +1313,7 @@ void func_802B2914(struct banana_bunch_parent *banana_bunch, Player *player, s16 s16 temp_v0; s32 temp_lo; void *temp_s0; - struct banana_actor *phi_v0; + struct BananaActor *phi_v0; sp4C = 0.0f; sp50 = -player->boundingBoxSize; @@ -1340,13 +1340,13 @@ void func_802B2914(struct banana_bunch_parent *banana_bunch, Player *player, s16 temp_s0 = D_8015F9B8 + temp_lo; sp54 = player->pos[2]; sp6E = temp_t6; - func_802AD950(temp_s0 + 0x30, temp_s0->unkC + 1.0f, temp_s0->unk18, temp_s0->unk1C, temp_s0->unk20, sp4C, sp50, sp54); + func_802AD950(temp_s0 + 0x30, temp_s0->unkC + 1.0f, temp_s0->pos, temp_s0->unk1C, temp_s0->unk20, sp4C, sp50, sp54); func_802B4E30(temp_s0); temp_s0->unk2 = -0x7000; - temp_s0->unk10 = (s16) ((s32) (player - gPlayerOne) / 3544); - temp_s0->unk8 = (s16) ((s32) (banana_bunch - D_8015F9B8) / 112); + temp_s0->rot = (s16) ((s32) (player - gPlayerOne) / 3544); + temp_s0->unk_08 = (s16) ((s32) (banana_bunch - D_8015F9B8) / 112); temp_s0->unk14 = -1; - temp_s0->unk4 = 0x0014; + temp_s0->unk_04 = 0x0014; temp_s0->unkA = bananaId; switch (bananaId) { case 0: @@ -1420,7 +1420,7 @@ s16 func_802B2C40(void *arg0) { temp_a1 = &sp30; temp_a2 = &sp38; sp24 += arg0->unk14; - sp28 += arg0->unk18; + sp28 += arg0->pos; sp2C += arg0->unk1C; sp38 = arg0->unk34; sp3C = arg0->unk38; @@ -1434,7 +1434,7 @@ s16 func_802B2C40(void *arg0) { } temp_v1 = (temp_v0 * 0x70) + &D_8015F9B8; temp_v1->unk6 = 0; - temp_v1->unk24 = (arg0 - gPlayerOne) / 0xDD8; + temp_v1->velocity = (arg0 - gPlayerOne) / 0xDD8; arg0->unkC = arg0->unkC | 0x40000; return temp_v0; } @@ -1479,7 +1479,7 @@ s16 func_802B2D70(void *arg0) { temp_a1 = &sp34; temp_a2 = &sp3C; sp28 += arg0->unk14; - sp2C += arg0->unk18; + sp2C += arg0->pos; sp30 += arg0->unk1C; sp3C = arg0->unk34; sp40 = arg0->unk38; @@ -1492,9 +1492,9 @@ s16 func_802B2D70(void *arg0) { return temp_v0; } temp_v1 = (temp_v0 * 0x70) + &D_8015F9B8; - temp_v1->unk10 = temp_t0; + temp_v1->rot = temp_t0; temp_v1->unk6 = 0; - temp_v1->unk4 = 0x14; + temp_v1->unk_04 = 0x14; arg0->unkC = arg0->unkC | 0x40000; return temp_v0; } @@ -1571,7 +1571,7 @@ void func_802B2FA0(Player *player) { s16 temp_t9; sp1C = (player - gPlayerOne) / 3544; - temp_t9 = player->unk10; + temp_t9 = player->rot; switch (temp_t9) { case 3: func_802B1C9C(); @@ -1658,7 +1658,7 @@ void func_802B30EC(void) { phi_s1 = gControllerEight; } } - if (((temp_v0 & 0x4000) != 0) && (phi_s0->unk10 != 0) && ((temp_v0 & 0x2000) == 0)) { + if (((temp_v0 & 0x4000) != 0) && (phi_s0->rot != 0) && ((temp_v0 & 0x2000) == 0)) { temp_v0_2 = phi_s1->unk6; if ((temp_v0_2 & 0x2000) != 0) { phi_s1->unk6 = temp_v0_2 & ~0x2000; @@ -1681,13 +1681,13 @@ GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B30EC.s") ? func_800C9060(u8, ?); /* extern */ ? func_800C90F4(u8, s32); /* extern */ ? func_800C98B8(f32 *, f32 *, ?); /* extern */ -? func_8029E854(f32, struct shell_actor *); /* extern */ -? func_8029FDC8(f32, struct shell_actor *); /* extern */ +? func_8029E854(f32, struct ShellActor *); /* extern */ +? func_8029FDC8(f32, struct ShellActor *); /* extern */ f32 func_802ABE30(f32, f32, f32, u16); /* extern */ ? func_802AC098(UnkActorInner *, f32 *); /* extern */ ? func_802AD950(UnkActorInner *, ?, f32, f32, f32, f32, f32, f32); /* extern */ ? func_802B0210(UnkActorInner *, UnkActorInner *); /* extern */ -? func_802B4E30(struct shell_actor *); /* extern */ +? func_802B4E30(struct ShellActor *); /* extern */ ? func_802B63B8(f32 *, f32 *, f32 *); /* extern */ ? func_802B64C4(f32 *, s16); /* extern */ extern s16 D_8015F6E8; @@ -1699,7 +1699,7 @@ static f32 D_802B9F5C = 1.2f; static f32 D_802B9F60 = 1.2f; static f32 D_802B9F64 = 0.3f; -void update_obj_green_shell(struct shell_actor *shell) { +void update_obj_green_shell(struct ShellActor *shell) { f32 sp80; f32 sp7C; f32 sp78; @@ -1725,7 +1725,7 @@ void update_obj_green_shell(struct shell_actor *shell) { s16 temp_v0_2; s16 temp_v0_3; struct Controller *temp_v0; - struct shell_actor *temp_v0_4; + struct ShellActor *temp_v0_4; u16 temp_t3; u16 temp_v1; f32 phi_f2; @@ -1911,11 +1911,11 @@ GLOBAL_ASM("asm/non_matchings/code_802B0210/update_obj_green_shell.s") #ifdef MIPS_TO_C //generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd ? func_802AD950(UnkActorInner *, f32, f32, f32, f32, f32, f32, f32); /* extern */ -? func_802B4E30(struct shell_actor *); /* extern */ +? func_802B4E30(struct ShellActor *); /* extern */ extern u16 D_80164430; extern s32 D_80164490; -void func_802B3B44(struct shell_actor *shell) { +void func_802B3B44(struct ShellActor *shell) { f32 spAC; f32 spA8; f32 spA4; @@ -1970,7 +1970,7 @@ void func_802B3B44(struct shell_actor *shell) { temp_a3 = temp_a1 & 0xFFFF; temp_f2 = (f32) temp_v0->unk0; temp_f12 = (f32) temp_v0->unk2; - temp_f28 = (f32) temp_v0->unk4; + temp_f28 = (f32) temp_v0->unk_04; phi_a2 = temp_a1 & 0xFFFF; if (temp_a3 >= (s32) temp_t0) { phi_a2 = (temp_a3 - temp_t0) & 0xFFFF; @@ -1989,7 +1989,7 @@ void func_802B3B44(struct shell_actor *shell) { if (temp_f14 > 400.0f) { temp_f0_2 = (f32) temp_v0_2->unk0 - sp60; temp_f2_2 = (f32) temp_v0_2->unk2 - sp5C; - temp_f12_2 = (f32) temp_v0_2->unk4 - sp58; + temp_f12_2 = (f32) temp_v0_2->unk_04 - sp58; if (((temp_f0_2 * temp_f0_2) + (temp_f2_2 * temp_f2_2) + (temp_f12_2 * temp_f12_2)) < temp_f14) { shell->rotAngle = phi_a2; return; @@ -2036,7 +2036,7 @@ void func_802B3B44(struct shell_actor *shell) { } temp_f16_3 = (f32) temp_v0_3->unk0; temp_f18_3 = (f32) temp_v0_3->unk2; - temp_f26 = (f32) temp_v0_3->unk4; + temp_f26 = (f32) temp_v0_3->unk_04; shell->pos[0] = (temp_f2 + temp_f16_3) * 0.5f; shell->pos[1] = ((temp_f12 + temp_f18_3) * 0.5f) + shell->boundingBoxSize; shell->pos[2] = (temp_f28 + temp_f26) * 0.5f; @@ -2050,12 +2050,12 @@ GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B3B44.s") #ifdef MIPS_TO_C //generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd -? func_8029FDC8(f32, f32, struct shell_actor *, ?); /* extern */ +? func_8029FDC8(f32, f32, struct ShellActor *, ?); /* extern */ ? func_802AD950(f32, f32, UnkActorInner *, ?, f32, f32, f32, f32, f32, f32); /* extern */ -? func_802B4104(struct shell_actor *); /* extern */ -? func_802B4E30(struct shell_actor *); /* extern */ +? func_802B4104(struct ShellActor *); /* extern */ +? func_802B4E30(struct ShellActor *); /* extern */ -void func_802B3E7C(struct shell_actor *shell, Player *player) { +void func_802B3E7C(struct ShellActor *shell, Player *player) { f32 sp44; f32 sp40; f32 sp38; @@ -2106,7 +2106,7 @@ f32 func_802B51E8(void *, f32 *); /* extern */ extern ? gPlayerBalloonCount; static f32 D_802B9F68 = 2.5e7f; -s16 func_802B3FD0(Player *player, struct shell_actor *shell) { +s16 func_802B3FD0(Player *player, struct ShellActor *shell) { f32 temp_f0; s32 temp_s1; Player *phi_s0; @@ -2145,7 +2145,7 @@ void func_802B4104(void *arg0) { f32 temp_f0; f32 temp_f0_2; - if ((arg0->unk3C < 0.0f) && ((temp_f0 = arg0->unk4C, (temp_f0 < 0.25f)) || (temp_f0 > -0.25f))) { + if ((arg0->unk3C < 0.0f) && ((temp_f0 = arg0->unk_04C, (temp_f0 < 0.25f)) || (temp_f0 > -0.25f))) { func_8029FDC8(arg0); func_800C98B8(arg0 + 0x18, arg0 + 0x24, 0x19008054); arg0->unk2 = arg0->unk2 | 0x80; @@ -2168,16 +2168,16 @@ GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B4104.s") ? func_800C9060(u8, ?); /* extern */ ? func_800C90F4(u8, s32); /* extern */ ? func_800C9D80(f32 *, f32 *, ?); /* extern */ -? func_8029E854(f32, struct shell_actor *); /* extern */ -? func_8029FDC8(f32, struct shell_actor *); /* extern */ +? func_8029E854(f32, struct ShellActor *); /* extern */ +? func_8029FDC8(f32, struct ShellActor *); /* extern */ f32 func_802ABE30(f32, f32, f32, u16); /* extern */ ? func_802AD950(UnkActorInner *, ?, f32, f32, f32, f32, f32, f32); /* extern */ ? func_802B0210(UnkActorInner *, UnkActorInner *); /* extern */ -? func_802B3B44(struct shell_actor *); /* extern */ -? func_802B3E7C(struct shell_actor *, Player *); /* extern */ -s16 func_802B3FD0(Player *, struct shell_actor *); /* extern */ -? func_802B4104(struct shell_actor *); /* extern */ -? func_802B4E30(struct shell_actor *); /* extern */ +? func_802B3B44(struct ShellActor *); /* extern */ +? func_802B3E7C(struct ShellActor *, Player *); /* extern */ +s16 func_802B3FD0(Player *, struct ShellActor *); /* extern */ +? func_802B4104(struct ShellActor *); /* extern */ +? func_802B4E30(struct ShellActor *); /* extern */ ? func_802B63B8(f32 *, f32 *); /* extern */ ? func_802B64C4(f32 *, s16); /* extern */ extern s16 D_8015F6E8; @@ -2194,7 +2194,7 @@ static f32 D_802B9F98 = 40000.0f; static f32 D_802B9F9C = 0.3f; static f32 D_802B9FA0 = 40000.0f; -void update_obj_red_blue_shell(struct shell_actor *shell) { +void update_obj_red_blue_shell(struct ShellActor *shell) { f32 sp94; f32 sp90; f32 sp8C; @@ -2228,7 +2228,7 @@ void update_obj_red_blue_shell(struct shell_actor *shell) { s16 temp_v0_4; s16 temp_v0_5; s16 temp_v0_6; - struct triple_shell_parent *temp_v0_7; + struct TripleShellParent *temp_v0_7; u16 temp_t4; u16 temp_v1; u16 temp_v1_2; @@ -2499,18 +2499,18 @@ GLOBAL_ASM("asm/non_matchings/code_802B0210/update_obj_red_blue_shell.s") void func_802B4E30(struct Actor *arg0) { if ((arg0->unk30.unk44 < 0.0f) && (arg0->unk30.unk34 == 1)) { - arg0->unk18[0] -= (arg0->unk30.unk60[0] * arg0->unk30.unk44); - arg0->unk18[1] -= (arg0->unk30.unk60[1] * arg0->unk30.unk44); - arg0->unk18[2] -= (arg0->unk30.unk60[2] * arg0->unk30.unk44); + arg0->pos[0] -= (arg0->unk30.unk60[0] * arg0->unk30.unk44); + arg0->pos[1] -= (arg0->unk30.unk60[1] * arg0->unk30.unk44); + arg0->pos[2] -= (arg0->unk30.unk60[2] * arg0->unk30.unk44); } if ((arg0->unk30.unk3C < 0.0f) && (arg0->unk30.unk30 == 1)) { - arg0->unk18[0] -= (arg0->unk30.unk48[0] * arg0->unk30.unk3C); - arg0->unk18[1] -= (arg0->unk30.unk48[1] * arg0->unk30.unk3C); - arg0->unk18[2] -= (arg0->unk30.unk48[2] * arg0->unk30.unk3C); + arg0->pos[0] -= (arg0->unk30.unk48[0] * arg0->unk30.unk3C); + arg0->pos[1] -= (arg0->unk30.unk48[1] * arg0->unk30.unk3C); + arg0->pos[2] -= (arg0->unk30.unk48[2] * arg0->unk30.unk3C); } if ((arg0->unk30.unk40 < 0.0f) && (arg0->unk30.unk32 == 1)) { - arg0->unk18[0] -= (arg0->unk30.unk54[0] * arg0->unk30.unk40); - arg0->unk18[1] -= (arg0->unk30.unk54[1] * arg0->unk30.unk40); - arg0->unk18[2] -= (arg0->unk30.unk54[2] * arg0->unk30.unk40); + arg0->pos[0] -= (arg0->unk30.unk54[0] * arg0->unk30.unk40); + arg0->pos[1] -= (arg0->unk30.unk54[1] * arg0->unk30.unk40); + arg0->pos[2] -= (arg0->unk30.unk54[2] * arg0->unk30.unk40); } } diff --git a/src/math_util.c b/src/math_util.c index edc7d5e35..2eef78d56 100644 --- a/src/math_util.c +++ b/src/math_util.c @@ -118,7 +118,7 @@ void *vec3f_copy(Vec3f dest, Vec3f src) { return &dest; //! warning: function returns address of local variable } -void func_802B5304(Vec3s dest, Vec3s src) { +void vec3s_copy(Vec3s dest, Vec3s src) { dest[0] = src[0]; dest[1] = src[1]; dest[2] = src[2];