#include #include #include #include "types.h" #include #include #include #include #include "math_util.h" #include "memory.h" #include "code_802B0210.h" #include "code_80296A50.h" s32 D_802BA050; s32 D_802BA054; s32 D_802BA058; struct Actor *D_802BA05C; s8 D_802BA060[512]; // tlut 256 u16 D_802BA260; extern u16 gNumActors; #ifdef MIPS_TO_C //generated by m2c commit a8f43e46d33dcb7e04d9cdc44a10b3daf4c92c3b ? func_8000EE58(u16, struct Actor *, u16, s16); /* extern */ extern u16 D_8015F6FE; void func_80296A50(struct ShellActor *shell, s16 arg3) { struct Actor *sp1C; s16 temp_t3; s16 temp_t7; s16 temp_v0; s32 temp_a2; s32 temp_a2_2; s32 temp_a2_3; s32 temp_a2_4; u16 temp_t1; struct Actor *phi_a1; u16 phi_a2; struct Actor *phi_a1_2; u16 phi_a2_2; s32 phi_a2_3; struct Actor *phi_a1_3; u16 phi_a2_4; s32 phi_a2_5; struct Actor *phi_a1_4; u16 phi_a2_6; temp_t1 = gNumPermanentActors; phi_a2 = temp_t1; phi_a2_3 = (s32) temp_t1; phi_a2_5 = (s32) temp_t1; if ((s32) temp_t1 < 0x64) { phi_a1 = &gActorList[temp_t1]; loop_2: if ((shell != phi_a1) && ((phi_a1->flags & 0xF) == 0) && (phi_a1->type == 7)) { if (phi_a1->state == 2) { sp1C = phi_a1; func_8000EE58(phi_a2, phi_a1, phi_a2, 2); } D_8015F6FE += -1; destroy_actor(phi_a1); return; } temp_a2 = phi_a2 + 1; phi_a1 += 0x70; phi_a2 = (u16) temp_a2; if (temp_a2 >= 0x64) { goto block_10; } goto loop_2; } block_10: phi_a2_2 = (u16) (s32) temp_t1; phi_a2_3 = (s32) temp_t1; if ((s32) temp_t1 < 0x64) { phi_a1_2 = &gActorList[(s32) temp_t1]; loop_12: if ((shell != phi_a1_2) && ((phi_a1_2->flags & 0xF) == 0) && (phi_a1_2->type == 8)) { temp_t3 = phi_a1_2->state; switch (temp_t3) { /* 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 */ sp1C = phi_a1_2; func_8000EE58(phi_a2_2, phi_a1_2, phi_a2_2); /* fallthrough */ case 7: /* switch 1 */ D_8015F6FE += -1; destroy_actor(phi_a1_2); return; } } else { default: /* switch 1 */ temp_a2_2 = phi_a2_2 + 1; phi_a1_2 += 0x70; phi_a2_2 = (u16) temp_a2_2; if (temp_a2_2 >= 0x64) { goto block_21; } goto loop_12; } } else { block_21: phi_a2_4 = (u16) phi_a2_3; phi_a2_5 = phi_a2_3; if (phi_a2_3 < 0x64) { phi_a1_3 = &gActorList[phi_a2_3]; loop_23: if ((shell != phi_a1_3) && (phi_a1_3->type == 7)) { temp_v0 = phi_a1_3->state; switch (temp_v0) { /* switch 3; irregular */ case 2: /* switch 3 */ sp1C = phi_a1_3; func_8000EE58(phi_a2_4, phi_a1_3, phi_a2_4, 2); /* fallthrough */ case 7: /* switch 3 */ D_8015F6FE += -1; destroy_actor(phi_a1_3); return; } } else { temp_a2_3 = phi_a2_4 + 1; phi_a1_3 += 0x70; phi_a2_4 = (u16) temp_a2_3; if (temp_a2_3 >= 0x64) { goto block_32; } goto loop_23; } } else { block_32: phi_a2_6 = (u16) phi_a2_5; if (phi_a2_5 < 0x64) { phi_a1_4 = &gActorList[phi_a2_5]; loop_34: if ((shell != phi_a1_4) && (phi_a1_4->type == 8)) { temp_t7 = phi_a1_4->state; switch (temp_t7) { /* 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 */ sp1C = phi_a1_4; func_8000EE58(phi_a2_6, phi_a1_4, phi_a2_6); /* fallthrough */ case 7: /* switch 2 */ D_8015F6FE += -1; destroy_actor(phi_a1_4); return; } } else { default: /* switch 2 */ temp_a2_4 = phi_a2_6 + 1; phi_a1_4 += 0x70; phi_a2_6 = (u16) temp_a2_4; if (temp_a2_4 >= 0x64) { } else { goto loop_34; } } } } } } #else GLOBAL_ASM("asm/non_matchings/code_actors/func_80296A50.s") #endif #ifdef MIPS_TO_C //generated by m2c commit a8f43e46d33dcb7e04d9cdc44a10b3daf4c92c3b ? func_80296A50(struct Actor *); /* extern */ ? vec3f_copy(f32 *, f32 *); /* extern */ ? vec3s_copy(s16 *, s16 *); /* extern */ extern u16 D_8015F6FE; extern u16 D_802BA260; static f32 D_802B95F0 = 1.925f; static f32 D_802B95F4 = 0.35f; void func_80296D10(struct Actor *actor, Vec3f startingPos, Vec3s startingRot, Vec3f startingVelocity, s32 actorType) { UnkActorInner *sp2C; UnkActorInner *temp_a0; f32 temp_f0; u16 temp_v0; s16 phi_v0; vec3f_copy(actor->pos, startingPos); vec3s_copy(actor->rot, startingRot); vec3f_copy(actor->velocity, startingVelocity); actor->flags = -0x8000; actor->unk_04 = 0; actor->state = 0; temp_a0 = &actor->unk30; actor->type = (s16) actorType; actor->unk_08 = 0.0f; actor->boundingBoxSize = 0.0f; sp2C = temp_a0; func_802AAAAC(temp_a0); switch ((s16) actorType) { case 37: temp_v0 = D_802BA260; phi_v0 = (s16) temp_v0; if ((s32) temp_v0 >= 3) { D_802BA260 = 0; phi_v0 = 0 & 0xFFFF; } actor->state = phi_v0; D_802BA260 += 1; return; case ACTOR_YOSHI_VALLEY_EGG: actor->flags |= 0x4000; actor->unk_08 = 70.0f; actor->boundingBoxSize = 20.0f; actor->velocity[0] = actor->pos[0]; actor->velocity[1] = actor->pos[1]; actor->velocity[2] = actor->pos[2] + 70.0f; return; 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 ACTOR_FALLING_ROCK: actor->flags |= 0x4000; actor->boundingBoxSize = 10.0f; return; case ACTOR_TRAIN_ENGINE: actor->unk_08 = 10.0f; return; case ACTOR_BANANA: actor->flags |= 0x5000; actor->boundingBoxSize = 2.0f; return; case ACTOR_GREEN_SHELL: D_8015F6FE += 1; actor->unk_04 = 0; actor->boundingBoxSize = 4.0f; actor->flags |= 0x7000; if ((s32) D_8015F6FE >= 0x15) { func_80296A50(actor); return; } default: return; case ACTOR_RED_SHELL: D_8015F6FE += 1; actor->unk_04 = 0; actor->boundingBoxSize = 4.0f; actor->flags |= 0x7000; if ((s32) D_8015F6FE >= 0x15) { func_80296A50(actor); return; } break; case 2: D_8015F6FE += 1; actor->flags |= 0x4000; actor->state = 0x0043; actor->boundingBoxSize = 3.0f; actor->unk_08 = 20.0f; return; case 3: actor->flags |= 0x4000; actor->state = 0x0043; actor->boundingBoxSize = 3.0f; actor->unk_08 = 23.0f; return; case 4: actor->flags |= 0x4000; actor->state = 0x0043; actor->boundingBoxSize = 3.0f; actor->unk_08 = 17.0f; return; case 19: actor->state = 0x0043; actor->flags = -0x8000; actor->boundingBoxSize = 3.0f; actor->unk_08 = 17.0f; return; case 26: actor->flags |= 0x4000; actor->state = 0x0043; actor->boundingBoxSize = 3.0f; actor->unk_08 = 17.0f; return; case 28: actor->state = 0x0043; actor->flags = -0x8000; actor->boundingBoxSize = 3.0f; actor->unk_08 = 17.0f; return; case 33: actor->flags |= 0x4000; actor->state = 0x0043; actor->boundingBoxSize = 3.0f; actor->unk_08 = 17.0f; return; case 29: actor->flags |= 0x4000; actor->state = 0x0043; actor->boundingBoxSize = 3.0f; actor->unk_08 = 17.0f; return; case 30: actor->flags |= 0x4000; actor->state = 0x0019; actor->boundingBoxSize = 3.0f; actor->unk_08 = 7.0f; return; case 31: actor->flags |= 0x4000; actor->state = 0x0019; actor->boundingBoxSize = 3.0f; actor->unk_08 = 7.0f; return; case 32: actor->flags |= 0x4000; actor->state = 0x0019; actor->boundingBoxSize = 3.0f; actor->unk_08 = 7.0f; return; case 25: actor->flags |= 0x4000; actor->state = 0x003C; actor->boundingBoxSize = 3.0f; actor->unk_08 = 13.0f; return; case ACTOR_FAKE_ITEM_BOX: temp_f0 = D_802B95F0; 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 ACTOR_HOT_AIR_BALLOON_ITEM_BOX: actor->flags |= 0x4000; actor->unk_04 = 0; actor->state = 5; actor->boundingBoxSize = 5.5f; return; 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 void func_80297230(Camera *arg0, struct Actor *arg1) { switch(arg0 - camera1) { case 0: arg1->flags &= ~1; break; case 1: arg1->flags &= ~2; break; case 2: arg1->flags &= ~4; break; case 3: arg1->flags &= ~8; break; } } void func_802972B8(Camera *arg0, struct Actor *arg1) { switch(arg0 - camera1) { case 0: arg1->flags |= 1; break; case 1: arg1->flags |= 2; break; case 2: arg1->flags |= 4; break; case 3: arg1->flags |= 8; break; } } void func_80297340(Camera *arg0) { Mat4 sp38; s16 temp = D_8015F8D0[2]; if (D_800DC50C == CREDITS_SEQUENCE) { return; } mtxf_translate(sp38, D_8015F8D0); if (func_802B4FF8(sp38, 0) == 0) { return; } if (temp < arg0->pos[2]) { if (D_800DC5BC != 0) { gDPSetFogColor(gDisplayListHead++, D_801625EC, D_801625F4, D_801625F0, 0xFF); gSPDisplayList(gDisplayListHead++, &D_0D001C20); } else { gSPDisplayList(gDisplayListHead++, &D_0D001B90); } } else if (D_800DC5BC != 0) { gDPSetFogColor(gDisplayListHead++, D_801625EC, D_801625F4, D_801625F0, 0xFF); gSPDisplayList(gDisplayListHead++, &D_0D001C88); } else { gSPDisplayList(gDisplayListHead++, &D_0D001BD8); } } #ifdef NON_MATCHING // Possibly gDPLoadTextureBlock UNUSED void func_80297524(intptr_t addr, s32 a, s32 b) { gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, addr); gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOLOD); gDPLoadSync(gDisplayListHead++); /* if (temp_t4 < 0x7FF) { phi_a0 = temp_t4; } else { phi_a0 = 0x7FF; } temp_t1 = arg1 * 2; temp_v0_4 = temp_t1 / 8; phi_t2 = temp_v0_4; if (temp_v0_4 <= 0) { phi_t2 = 1; } if (temp_v0_4 <= 0) { phi_t3 = 1; } else { phi_t3 = temp_v0_4; } */ gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 0, 0); gDPPipeSync(gDisplayListHead++); gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOLOD); gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, 0, 0); } #else GLOBAL_ASM("asm/non_matchings/code_actors/func_80297524.s") #endif void func_802976D8(Vec3s arg0) { arg0[0] = 0x4000; arg0[1] = 0; arg0[2] = 0; } void func_802976EC(UnkActorInner *arg0, Vec3s arg1) { f32 x, y, z; if (arg0->unk34 == 0) { func_802976D8(arg1); return; } //sp1C = arg0->unk30; x = arg0->unk60[0]; y = arg0->unk60[1]; z = arg0->unk60[2]; arg1[0] = atan2s(z, y) + 0x4000; arg1[1] = 0; arg1[2] = atan2s(x, y); } void func_80297760(struct Actor *arg0, Vec3f arg1) { 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); } void func_802977B0(Player *arg0) { arg0->boundingBoxCorners[1].unk_14 |= 2; arg0->boundingBoxCorners[0].unk_14 |= 2; arg0->boundingBoxCorners[3].unk_14 |= 2; arg0->boundingBoxCorners[2].unk_14 |= 2; } void func_802977E4(Player *arg0) { arg0->boundingBoxCorners[1].unk_14 &= 0xFFFD; arg0->boundingBoxCorners[0].unk_14 &= 0xFFFD; arg0->boundingBoxCorners[3].unk_14 &= 0xFFFD; arg0->boundingBoxCorners[2].unk_14 &= 0xFFFD; } void func_80297818(void) { s16 *phi_v0 = &D_802BA060[0]; s16 *phi_v1 = VIRTUAL_TO_PHYSICAL2(gSegmentTable[SEGMENT_NUMBER2(&D_0D004E38)] + SEGMENT_OFFSET(&D_0D004E38)); s16 temp_a0, temp_a0_2, temp_a0_3, temp_a0_4, temp_a0_5; s32 i; for (i = 0; i < 256; i++) { temp_a0 = *phi_v1; temp_a0_2 = temp_a0 & 0xF800; temp_a0_3 = temp_a0 & 0x7C0; temp_a0_4 = temp_a0 & 0x3E; temp_a0_5 = temp_a0 & 0x1; *phi_v0 = (temp_a0_2 >> 5) | (temp_a0_3 << 5) | temp_a0_4 | temp_a0_5; phi_v1++; phi_v0++; } } UNUSED void func_80297944(void) {}; void func_8029794C(Vec3f arg0, Vec3s arg1, f32 arg2) { Mat4 sp20; arg0[1] += 2.0f; func_802B5F74(sp20, arg0, arg1); func_802B5F00(sp20, arg2); if (func_802B4FF8(sp20, 0) != 0) { gSPDisplayList(gDisplayListHead++, D_0D007B20); arg0[1] -= 2.0f; } } void func_802979F8(struct Actor *arg0, f32 arg1) { Vec3f sp24; Vec3s sp1C; if (arg0->unk30.unk34 != 0) { func_802976EC(&arg0->unk30, sp1C); // arg0 + 0x30 func_80297760(arg0, sp24); func_8029794C(sp24, sp1C, 0.45f); } } #ifdef MISSING_RODATA // jpt_802B95FC void func_80297A50(Camera *camera, Mat4 arg1, struct Actor *arg2) { u16 temp_t0; f32 temp = func_802B80D0(camera->pos, arg2->unk18, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B95F8); if (temp < 0.0f) { return; } arg1[3][0] = arg2->unk18[0]; arg1[3][1] = arg2->unk18[1]; arg1[3][2] = arg2->unk18[2]; if (func_802B4FF8(arg1, 0) != 0) { return; } temp_t0 = arg2->unk6; switch (temp_t0) { case 0: gSPDisplayList(gDisplayListHead++, D_06013C00); break; case 1: gSPDisplayList(gDisplayListHead++, D_06013CA0); break; case 2: gSPDisplayList(gDisplayListHead++, D_06013D20); break; case 3: gSPDisplayList(gDisplayListHead++, D_06013DA0); break; case 4: gSPDisplayList(gDisplayListHead++, D_06013E20); break; } } #endif GLOBAL_ASM("asm/non_matchings/code_actors/func_80297A50.s") 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; } egg->pos[1] += egg->pathCenter[1]; if (egg->pos[1] < 0.0f) { egg->pos[1] = 0.0f; egg->pathCenter[1] = 0.0f; egg->flags &= ~(1 << 10); } egg->eggRot -= 0x4FA; } egg->eggRot -= 0x222; } void update_obj_trees_cacti_shrubs(struct Actor *arg0) { 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 m2c commit a8f43e46d33dcb7e04d9cdc44a10b3daf4c92c3b s32 func_802ABD10(u16); /* extern */ extern s32 D_80162DF8; extern ? D_80164438; extern s32 D_80164490; static f32 D_802B9618 = 2.3f; static f32 D_802B961C = 0.7f; static f32 D_802B9620 = 0.3f; 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; f32 temp_f14_2; f32 temp_f16; f32 temp_f16_2; f32 temp_f18; f32 temp_f2; f32 temp_f2_2; s16 temp_a0; s32 temp_v0_2; void *temp_v0; s16 phi_a0; struct KiwanoFruit *phi_a2; struct KiwanoFruit *phi_a2_2; temp_v1 = &gPlayers[fruit->targetPlayer]; 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 = fruit->state; phi_a0 = temp_a0; switch (temp_a0) { /* irregular */ case 0: 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) (temp_v1 - gPlayerOne) / 3544) & 0xFFFF) * 2)) * 8); temp_f2 = temp_v1->pos[0] - (f32) temp_v0->unk0; fruit = fruit; sp20 = temp_f2; sp24 = temp_v1; temp_f16 = temp_v1->pos[1] - (f32) temp_v0->unk2; sp1C = temp_f16; temp_f14 = temp_v1->pos[2] - (f32) temp_v0->unk4; sp18 = temp_f14; temp_f18 = fruit->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; fruit->pos[0] = temp_v1->pos[0] + temp_f2_2; temp_f14_2 = temp_f14 * temp_f12; fruit->pos[1] = temp_v1->pos[1] + temp_f16_2; fruit->velocity[0] = temp_f18 - 2.0f; fruit->pos[2] = temp_v1->pos[2] + temp_f14_2; if (fruit->velocity[0] <= 0.0f) { fruit->state = 2; fruit->bonkTimer = 30.0f; fruit->velocity[0] = 0.0f; fruit->velocity[1] = D_802B9618; fruit->velocity[2] = 0.0f; temp_v0_2 = temp_v1->unk_0BC; if ((temp_v0_2 & 0x200) != 0) { func_800C9060((Player *) (((s32) (temp_v1 - gPlayerOne) / 3544) & 0xFF), 0x1900A052); } else { temp_f12_2 = D_802B961C; temp_v1->unk_0BC = temp_v0_2 | 0x8000; temp_v1->pos[0] -= temp_f2_2 * 4.0f; temp_v1->pos[2] -= temp_f14_2 * 4.0f; temp_v1->unk_034[0] -= temp_f2_2 * temp_f12_2; temp_v1->unk_034[2] -= temp_f14_2 * temp_f12_2; func_800C9060((Player *) (((s32) (temp_v1 - gPlayerOne) / 3544) & 0xFF), 0x19007018); if (gModeSelection != 0) { D_80162DF8 = 1; } } } phi_a2_2 = fruit; block_17: 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 PaddleWheelBoat *boat) { boat->wheelRot += 0x38E; } // wheels void update_obj_train_engine(struct TrainCar *arg0) { arg0->wheelRot -= 0x666; 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 TrainCar *arg0) { arg0->wheelRot -= 0x4FA; } // wheels void update_obj_train_car2(struct TrainCar *arg0) { arg0->wheelRot -= 0x666; } void update_obj_piranha_plant(struct PiranhaPlant *arg0) { if ((arg0->flags & 0x800) == 0) { if ((arg0->flags & 0x400) != 0) { arg0->pos[1] += 4.0f; if (arg0->pos[1] > 800.0f) { arg0->flags |= 0x800; } } else { // This has to be an unrolled loop if (arg0->visibilityStates[0] == 1) { arg0->timers[0]++; if (arg0->timers[0] > 60) { arg0->timers[0] = 6; } } else { arg0->timers[0] = 0; } if (arg0->visibilityStates[1] == 1) { arg0->timers[1]++; if (arg0->timers[1] > 60) { arg0->timers[1] = 6; } } else { arg0->timers[1] = 0; } if (arg0->visibilityStates[2] == 1) { arg0->timers[2]++; if (arg0->timers[2] > 60) { arg0->timers[2] = 6; } } else { arg0->timers[2] = 0; } if (arg0->visibilityStates[3] == 1) { arg0->timers[3]++; if (arg0->timers[3] > 60) { arg0->timers[3] = 6; } } else { arg0->timers[3] = 0; } } } } // Mario Raceway Load piranha plant textures? void func_80298328(Camera *arg0, Mat4 arg1, struct PiranhaPlant *arg2) { s32 pad; s32 addr; s16 temp_lo = arg0 - camera1; s16 phi_t4; s16 temp = arg2->flags; f32 temp_f0; if (temp & 0x800) { return; } temp_f0 = func_802B80D0(arg0->pos, arg2->pos, arg0->rotX[1], 0, D_80150130[arg0 - camera1], D_802B9624); if (temp_f0 < 0.0f) { switch(temp_lo) { case 0: arg2->visibilityStates[0] = -1; break; case 1: arg2->visibilityStates[1] = -1; break; case 2: arg2->visibilityStates[2] = -1; break; case 3: arg2->visibilityStates[3] = -1; break; } return; } arg1[3][0] = arg2->pos[0]; arg1[3][1] = arg2->pos[1]; arg1[3][2] = arg2->pos[2]; if (func_802B4FF8(arg1, 0) == 0) { return; } if (D_802B9628 < temp_f0) { switch(temp_lo) { case 0: arg2->visibilityStates[0] = 0; break; case 1: arg2->visibilityStates[1] = 0; break; case 2: arg2->visibilityStates[2] = 0; break; case 3: arg2->visibilityStates[3] = 0; break; } phi_t4 = 0; } else { switch(temp_lo) { case 0: arg2->visibilityStates[0] = 1; break; case 1: arg2->visibilityStates[1] = 1; break; case 2: arg2->visibilityStates[2] = 1; break; case 3: arg2->visibilityStates[3] = 1; break; } switch(temp_lo) { case 0: phi_t4 = arg2->timers[0]; break; case 1: phi_t4 = arg2->timers[1]; break; case 2: phi_t4 = arg2->timers[2]; break; case 3: phi_t4 = arg2->timers[3]; break; } } phi_t4 /= 6; if (phi_t4 > 8) { phi_t4 = 8; } addr = D_802BA058 + (phi_t4 << 0xB); gDPLoadTextureBlock(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(addr), G_IM_FMT_CI, G_IM_SIZ_8b, 32, 64, 0, G_TX_MIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); if (gCurrentCourseId == COURSE_MARIO_RACEWAY) { gSPDisplayList(gDisplayListHead++, &D_06006990); } else { gSPDisplayList(gDisplayListHead++, &D_0600D850); } } #ifdef MIPS_TO_C //generated by m2c commit a8f43e46d33dcb7e04d9cdc44a10b3daf4c92c3b s32 func_802B4FF8(f32 (*)[4], ?); /* extern */ f32 func_802B80D0(Camera *, f32 *, u16, f32, f32, f32); /* extern */ extern ? D_06014200; extern u16 D_80150112; extern u16 D_8015F700; extern u16 D_8015F702; extern f32 D_8015F704; extern f32 D_8015F708; static f32 D_802B91C8[6] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f }; static f32 D_802B962C = 6.4e7f; static f32 D_802B9630 = 4000000.0f; static f32 D_802B9648 = 160000.0f; void func_802986B4(Camera *camera, Mat4 arg1, struct Actor *actor) { s16 *sp9C; f32 sp90; f32 sp8C; f32 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_f0; s16 *temp_t1; s16 temp_v0_9; u16 temp_s1; u16 temp_t4; u16 temp_v0_10; s16 phi_v0; s16 *phi_s1; Gfx *phi_v0_2; s16 *phi_s5; s16 *phi_t1; s16 *phi_s5_2; s16 *phi_s5_3; 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 = -1U; temp_v0->words.w0 = 0xBB000001; temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; 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 = 0x00553078; temp_v0_3->words.w0 = 0xB900031D; phi_s1 = temp_t1; phi_s5 = NULL; phi_t1 = temp_t1; phi_s5_3 = NULL; if (*temp_t1 != -0x8000) { sp9C = temp_t1; phi_v0 = *temp_t1; loop_2: sp88 = (f32) phi_v0 * gCourseDirection; sp8C = (f32) phi_s1->unk2; sp90 = (f32) phi_s1->unk4; temp_f0 = func_802B80D0(camera, &sp88, (u16) camera->rotX2, 0.0f, D_80150130[(s32) (camera - camera1) / 184], D_802B9630); phi_s5_2 = phi_s5_3; phi_s5_2 = phi_s5_3; if (temp_f0 > 0.0f) { if (temp_f0 < D_8015F704) { D_8015F704 = temp_f0; phi_s5_2 = phi_s1; } arg1->unk30 = sp88; arg1->unk34 = sp8C; arg1->unk38 = sp90; 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 = (u32) D_06013C00; phi_v0_2 = temp_v0_4; block_14: phi_v0_2->words.w0 = 0x06000000; break; case 1: temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; 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 = (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 = (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 = (u32) D_06013E20; phi_v0_2 = temp_v0_8; goto block_14; } goto block_15; } } 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; } } 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) phi_s5->unk0 * gCourseDirection; D_8015F708.unk4 = (f32) phi_s5->unk2; D_8015F708.unk8 = (f32) phi_s5->unk4; D_8015F702 = temp_s1; func_800C98B8(&D_8015F708, D_802B91C8, (u32) 0x1901904D); D_8015F700 = 0x00F0; } } else { D_8015F700 = temp_v0_10 - 1; } } } } #else GLOBAL_ASM("asm/non_matchings/code_actors/func_802986B4.s") #endif //static f32 D_802B964C = 0.8f; #ifdef RO_DATA // Needs D_802B964C imported to match void func_80298AC0(Player *player) { Vec3f sp64; s32 segment = SEGMENT_NUMBER2(D_06013F78); s32 offset = SEGMENT_OFFSET(D_06013F78); struct UnkActorSpawnData *data = VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset); while (data->pos[0] != -0x8000) { sp64[0] = data->pos[0] * gCourseDirection; sp64[1] = data->pos[1]; sp64[2] = data->pos[2]; if (func_8029EEB8(player, sp64, 5.0f, 40.0f, 0.8f) == 1) { if ((player->unk_0BC & 0x200) != 0) { func_800C98B8(player->pos, player->unk_034, 0x19018010); func_800C90F4((u8) (player - gPlayerOne), (player->characterId * 0x10) + 0x2900800D); data->someId |= 0x400; } if ((player->unk_000 & 0x100) == 0) { func_800C9060((u8) (player - gPlayerOne), 0x19007018); } break; } data++; } } #else GLOBAL_ASM("asm/non_matchings/code_actors/func_80298AC0.s") #endif void func_80298C94(void) { s32 index; for (index = 0; index < 4; index++){ // wtf is up with the << 0x18 >> 0x18? is it some weird type conversion? if (((gPlayers[index].unk_000 & 0xC000) != 0) && (((func_802ABD10(gPlayers[index].unk_110.unk3A) << 0x18) >> 0x18) == 8)) { func_80298AC0(&gPlayers[index]); } } } void func_80298D10(void) { s32 segment = SEGMENT_NUMBER2(D_06013F78); s32 offset = SEGMENT_OFFSET(D_06013F78); struct UnkActorSpawnData80298D10 *temp_v1 = VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset); while (temp_v1->pos[0] != -0x8000) { temp_v1->pos[1] = temp_v1->unk8; temp_v1->someId &= 0xF; temp_v1++; } } // Might just be an s32 array with a u16 in it... However that might work. Vec3s D_802B87E0[] = {0x0000, 0x0000, 0x0000}; #ifdef MIPS_TO_C //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_80150112; 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; void func_80298D7C(Camera *camera, f32 (*arg1)[4], struct Actor *arg2) { f32 spDC; f32 spD8; f32 spD4; ? 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; s16 *phi_s1; f32 phi_f22; Gfx *phi_v0; 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 == 9) { phi_f22 = D_802B9650; } else { phi_f22 = D_802B9654; } temp_v0 = gDisplayListHead; gDisplayListHead = temp_v0 + 8; temp_v0->words.w1 = -1U; temp_v0->words.w0 = 0xBB000001; temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; 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.w0 = 0xB900031D; temp_v0_3->words.w1 = 0x00553078; temp_s7 = &spD4; if (*temp_s1 != -0x8000) { loop_5: temp_s0 = phi_s1->unk6; if ((temp_s0 & 0x800) != 0) { goto block_29; } 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 = (s16) (phi_s1->unk6 | 0x800); } } temp_a1 = temp_s7; 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(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((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 ((s32) D_80150112 < 0x80) { func_802B4FF8(arg1, 0); block_19: temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; 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->words.w1 = (u32) &D_060138D0; phi_v0 = temp_v0_8; goto block_28; } block_29: temp_s1_2 = phi_s1 + 0xA; phi_s1 = temp_s1_2; if (*temp_s1_2 != -0x8000) { goto loop_5; } } } } } #else GLOBAL_ASM("asm/non_matchings/code_actors/func_80298D7C.s") #endif void func_80299144(Camera *camera, Mat4 arg1, struct Actor *arg2) { f32 temp_f0; s16 temp_v0 = arg2->flags; if ((temp_v0 & 0x800) != 0) { return; } temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B9658); if (temp_f0 < 0.0f) { return; } if (((temp_v0 & 0x400) == 0) && (temp_f0 < D_802B965C)) { func_8029794C(arg2->pos, arg2->rot, 3.0f); } arg1[3][0] = arg2->pos[0]; arg1[3][1] = arg2->pos[1]; arg1[3][2] = arg2->pos[2]; if (func_802B4FF8(arg1, 0) != 0) { gDPLoadTLUT_pal256(gDisplayListHead++, D_0D004C68); gSPDisplayList(gDisplayListHead++, D_06006A68); } } void func_8029930C(Camera *camera, Mat4 arg1, struct Actor *arg2) { f32 temp_f0; s16 temp_v0 = arg2->flags; if ((temp_v0 & 0x800) != 0) { return; } temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B9660); if (temp_f0 < 0.0f) { return; } if (((temp_v0 & 0x400) == 0) && (temp_f0 < D_802B9664)) { func_8029794C(arg2->pos, arg2->rot, 2.79999995f); } arg1[3][0] = arg2->pos[0]; arg1[3][1] = arg2->pos[1]; arg1[3][2] = arg2->pos[2]; if (func_802B4FF8(arg1, 0) != 0) { gDPLoadTLUT_pal256(gDisplayListHead++, D_0D004C68); gSPDisplayList(gDisplayListHead++, D_06015B48); } } void func_802994D4(Camera *camera, Mat4 arg1, struct Actor *arg2) { f32 temp_f0; s16 temp_v0 = arg2->flags; if ((temp_v0 & 0x800) != 0) { return; } temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B9668); if (temp_f0 < 0.0f) { return; } if (((temp_v0 & 0x400) == 0) && (temp_f0 < D_802B966C)) { func_8029794C(arg2->pos, arg2->rot, 2.79999995f); } arg1[3][0] = arg2->pos[0]; arg1[3][1] = arg2->pos[1]; arg1[3][2] = arg2->pos[2]; if (func_802B4FF8(arg1, 0) != 0) { gDPLoadTLUT_pal256(gDisplayListHead++, D_0D004C68); gSPDisplayList(gDisplayListHead++, D_0600D4A0); } } void func_8029969C(Camera *camera, Mat4 arg1, struct Actor *arg2) { f32 temp_f0; s16 temp_v0 = arg2->flags; if ((temp_v0 & 0x800) != 0) { return; } temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B9670); if (temp_f0 < 0.0f) { return; } if (((temp_v0 & 0x400) == 0) && (temp_f0 < 600.0f)) { func_8029794C(arg2->pos, arg2->rot, 5.0f); } arg1[3][0] = arg2->pos[0]; arg1[3][1] = arg2->pos[1]; arg1[3][2] = arg2->pos[2]; if (func_802B4FF8(arg1, 0) != 0) { gDPLoadTLUT_pal256(gDisplayListHead++, D_0D004C68); gSPDisplayList(gDisplayListHead++, D_06013F20); } } void func_80299864(Camera *camera, Mat4 arg1, struct Actor *arg2) { f32 temp_f0; s16 temp_v0 = arg2->flags; if ((temp_v0 & 0x800) != 0) { return; } temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B9674); if (temp_f0 < 0.0f) { return; } if (((temp_v0 & 0x400) == 0) && (temp_f0 < D_802B9678)) { func_8029794C(arg2->pos, arg2->rot, 2.79999995f); } arg1[3][0] = arg2->pos[0]; arg1[3][1] = arg2->pos[1]; arg1[3][2] = arg2->pos[2]; if (func_802B4FF8(arg1, 0) != 0) { gDPLoadTLUT_pal256(gDisplayListHead++, D_0D004C68); gSPDisplayList(gDisplayListHead++, D_0600FC70); } } void func_80299A2C(Camera *camera, Mat4 arg1, struct Actor *arg2) { f32 temp_f0; s16 temp_v0 = arg2->flags; if ((temp_v0 & 0x800) != 0) { return; } temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B967C); if (temp_f0 < 0.0f) { return; } if (((temp_v0 & 0x400) == 0) && (temp_f0 < D_802B9680)) { func_8029794C(arg2->pos, arg2->rot, 2.79999995f); } arg1[3][0] = arg2->pos[0]; arg1[3][1] = arg2->pos[1]; arg1[3][2] = arg2->pos[2]; if (func_802B4FF8(arg1, 0) != 0) { gDPLoadTLUT_pal256(gDisplayListHead++, D_0D004C68); gSPDisplayList(gDisplayListHead++, D_0600D578); } } void func_80299BF4(Camera *camera, Mat4 arg1, struct Actor *arg2) { f32 temp_f0; s16 temp_v0 = arg2->flags; if ((temp_v0 & 0x800) != 0) { return; } temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B9684); if (temp_f0 < 0.0f) { return; } if (((temp_v0 & 0x400) == 0) && (temp_f0 < D_802B9688)) { func_8029794C(arg2->pos, arg2->rot, 2.79999995f); } arg1[3][0] = arg2->pos[0]; arg1[3][1] = arg2->pos[1]; arg1[3][2] = arg2->pos[2]; if (func_802B4FF8(arg1, 0) != 0) { gDPLoadTLUT_pal256(gDisplayListHead++, D_0D004C68); gSPDisplayList(gDisplayListHead++, D_060090C8); } } void func_80299DBC(Camera *camera, Mat4 arg1, struct Actor *arg2) { f32 temp_f0; s16 temp_v0 = arg2->flags; if ((temp_v0 & 0x800) != 0) { return; } temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B968C); if (temp_f0 < 0.0f) { return; } if (((temp_v0 & 0x400) == 0) && (temp_f0 < D_802B9690)) { func_8029794C(arg2->pos, arg2->rot, 2.79999995f); } arg1[3][0] = arg2->pos[0]; arg1[3][1] = arg2->pos[1]; arg1[3][2] = arg2->pos[2]; if (func_802B4FF8(arg1, 0) != 0) { gSPDisplayList(gDisplayListHead++, D_060075A0); } } void func_80299EDC(Camera *camera, Mat4 arg1, struct Actor *arg2) { f32 temp_f0; s16 temp_v0 = arg2->flags; if ((temp_v0 & 0x800) != 0) { return; } temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B9694); if (temp_f0 < 0.0f) { return; } if (((temp_v0 & 0x400) == 0) && (temp_f0 < D_802B9698)) { func_8029794C(arg2->pos, arg2->rot, 1.0f); } arg1[3][0] = arg2->pos[0]; arg1[3][1] = arg2->pos[1]; arg1[3][2] = arg2->pos[2]; if (func_802B4FF8(arg1, 0) != 0) { gSPDisplayList(gDisplayListHead++, D_06008528); } } void func_80299FFC(Camera *camera, Mat4 arg1, struct Actor *arg2) { f32 temp_f0; s16 temp_v0 = arg2->flags; if ((temp_v0 & 0x800) != 0) { return; } temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B969C); if (temp_f0 < 0.0f) { return; } if (((temp_v0 & 0x400) == 0) && (temp_f0 < D_802B96A0)) { func_8029794C(arg2->pos, arg2->rot, 1.0f); } arg1[3][0] = arg2->pos[0]; arg1[3][1] = arg2->pos[1]; arg1[3][2] = arg2->pos[2]; if (func_802B4FF8(arg1, 0) != 0) { gSPDisplayList(gDisplayListHead++, D_06008628); } } void func_8029A11C(Camera *camera, Mat4 arg1, struct Actor *arg2) { f32 temp_f0; s16 temp_v0 = arg2->flags; if ((temp_v0 & 0x800) != 0) { return; } temp_f0 = func_802B80D0(camera->pos, arg2->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B96A4); if (temp_f0 < 0.0f) { return; } if (((temp_v0 & 0x400) == 0) && (temp_f0 < D_802B96A8)) { func_8029794C(arg2->pos, arg2->rot, 0.80000001f); } arg1[3][0] = arg2->pos[0]; arg1[3][1] = arg2->pos[1]; arg1[3][2] = arg2->pos[2]; if (func_802B4FF8(arg1, 0) != 0) { gSPDisplayList(gDisplayListHead++, D_06008728); } } void func_8029A23C(Camera *camera, Mat4 arg1, struct Actor *actor) { uintptr_t addr; if (actor->state == 0) { return; } arg1[3][0] = actor->pos[0]; arg1[3][1] = actor->pos[1]; arg1[3][2] = actor->pos[2]; if (func_802B4FF8(arg1, 0) == 0) { return; } addr = (actor->rot[0] << 0xA) + 0x03009000; // Can this be a real symbol? Doesn't match. gDPLoadTextureBlock(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(addr), G_IM_FMT_CI, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPDisplayList(gDisplayListHead++, D_06013BB8); } void func_8029A3AC(Camera *camera, Mat4 arg1, struct ShellActor *shell) { s16 pad; u16 temp_t8; s32 pad2; s16 sp58[15] = // D_802B87E8; { 0x0000, 0x0400, 0x0800, 0x0c00, 0x1000, 0x1400, 0x1800, 0x1c00, 0x1c00, 0x1800, 0x1400, 0x1000, 0x0c00, 0x0800, 0x0400 }; uintptr_t phi_t3; f32 temp_f0 = func_802B80D0(camera->pos, shell->pos, camera->rotX[1], 0, D_80150130[camera - camera1], D_802B96AC); if (temp_f0 < 0.0f) { func_80297230(camera, (struct Actor *)shell); return; } func_802972B8(camera, (struct Actor *) shell); if (temp_f0 < D_802B96B0) { func_802979F8((struct Actor *) shell, 3.4f); } if (shell->type == ACTOR_BLUE_SPINY_SHELL) { phi_t3 = D_802BA054; } else { phi_t3 = D_802BA050; } temp_t8 = (u16) shell->rotVelocity / 4369; phi_t3 += sp58[temp_t8]; arg1[3][0] = shell->pos[0]; arg1[3][1] = (shell->pos[1] - shell->boundingBoxSize) + 1.0f; arg1[3][2] = shell->pos[2]; if (func_802B4FF8(arg1, 0) == 0) { return; } gDPLoadTextureBlock(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(phi_t3), G_IM_FMT_CI, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); if (temp_t8 < 8) { gSPDisplayList(gDisplayListHead++, D_0D005338); } else { gSPDisplayList(gDisplayListHead++, D_0D005368); } } UNUSED s16 D_802B8808[] = { 0x0014, 0x0028, 0x0000, 0x0000 }; UNUSED s16 D_802B8810[] = { 0x0fc0, 0x0000, 0xffff, 0xffff, 0x0014, 0x0000, 0x0000, 0x0000, 0x0fc0, 0x0fc0, 0xffff, 0xffff, 0xffec, 0x0000, 0x0000, 0x0000, 0x0000, 0x0fc0, 0xffff, 0xffff, 0xffec, 0x0028, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff }; void func_8029A690(Camera *arg0, Mat4 arg1, struct ShellActor *arg2) { gDPLoadTLUT_pal256(gDisplayListHead++, &D_0D004E38); func_8029A3AC(arg0, arg1, arg2); } void func_8029A75C(Camera *arg0, Mat4 arg1, struct ShellActor *arg2) { gDPLoadTLUT_pal256(gDisplayListHead++, &D_802BA060); func_8029A3AC(arg0, arg1, arg2); } extern s8 D_0D004E68[]; // Middle of a tlut access void func_8029A828(Camera *arg0, Mat4 arg1, struct ShellActor *arg2) { gDPLoadTLUT_pal256(gDisplayListHead++, &D_0D004E68[0x1D0]); func_8029A3AC(arg0, arg1, 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->pos, arg0->rotX[1], 0, D_80150130[arg0 - camera1], D_802B96B4); if (temp < 0.0f) { func_80297230(arg0, arg2); return; } if ((arg2->pos[1] > D_8015F6EC + 800.0f)) { func_80297230(arg0, arg2); return; } if (arg2->pos[1] < (D_8015F6EE - 800.0f)) { func_80297230(arg0, arg2); return; } func_802972B8(arg0, arg2); 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->pos, sp7C); } if (func_802B4FF8(sp3C, 0) == 0) { return; } if (arg2->state != 5) { gSPDisplayList(gDisplayListHead++, &D_0D004B48); } else { gSPDisplayList(gDisplayListHead++, &D_0D004BD8); } } void update_obj_wario_stadium_sign(struct Actor *arg0) { arg0->rot[1] += 0xB6; } /** * If train close activate bell sound according to timing **/ void update_obj_railroad_crossing(struct RailroadCrossing *arg0) { // If train close? if (D_801637B8[arg0->crossingId] != 0) { // Timer++ arg0->someTimer++; // Reset timer if (arg0->someTimer > 40) { arg0->someTimer = 1; } // Play Bell sound when timer hits 20 or 1. 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->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->rot[1] += 182; } } } #ifdef MIPS_TO_C //generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd extern s16 gNumActors; extern ? D_8015F9BE; void func_8029ABD4(s16 arg1, s32 arg1) { arg1 = M2C_ERROR(Read from unset register $a1); gNumActors = 0; *(&D_8015F9BE + (func_8029ED38((f32 *) arg1, (s16 *)0x00000014) * 0x70)) = (s16) arg1; } #else GLOBAL_ASM("asm/non_matchings/code_actors/func_8029ABD4.s") #endif #ifdef NEEDS_RODATA // needs jmpt table rodata aligned to match. //generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 //s32 func_802B4FF8(void *, ?); /* extern */ //f32 func_802B80D0(void *, u16, ?, f32, f32); /* extern */ extern s8 D_0D001750[]; extern s8 D_0D001780[]; extern s8 D_0D001798[]; extern s8 D_0D0017B0[]; extern s8 D_0D0017C8[]; extern s8 D_0D0017E0[]; extern s8 D_0D0017F8[]; extern s8 D_0D001810[]; extern s8 D_0D001828[]; extern f32 D_802B96B8; void func_8029AC18(Camera *camera, Mat4 arg1, struct Actor *arg2) { f32 temp; 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->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->state) { case 0: gSPDisplayList(gDisplayListHead++, &D_0D001780); break; case 1: gSPDisplayList(gDisplayListHead++, &D_0D001798); break; case 2: gSPDisplayList(gDisplayListHead++, &D_0D0017B0); break; case 3: gSPDisplayList(gDisplayListHead++, &D_0D0017C8); break; case 4: gSPDisplayList(gDisplayListHead++, &D_0D0017E0); break; case 5: gSPDisplayList(gDisplayListHead++, &D_0D0017F8); break; case 6: gSPDisplayList(gDisplayListHead++, &D_0D001810); break; case 7: gSPDisplayList(gDisplayListHead++, &D_0D001828); break; } } } #else GLOBAL_ASM("asm/non_matchings/code_actors/func_8029AC18.s") #endif void func_8029AE1C(Camera *arg0, struct PaddleWheelBoat *boat, Mat4 arg2, u16 arg3) { s32 pad[3]; Vec3f sp120; Mat4 spE0; Mat4 spA0; Mat4 sp60; f32 temp; if ((arg3 > 20) && (arg3 < 25)) { return; } 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, boat->pos, boat->boatRot); if (func_802B4FF8(spE0, 1) != 0) { gSPDisplayList(gDisplayListHead++, &D_0600E730); gSPDisplayList(gDisplayListHead++, &D_0600E058); func_802B59DC(spE0, boat->wheelRot); vec3f_set(sp120, 0, 16.0f, -255.0f); mtxf_translate(spA0, sp120); func_802B71CC(sp60, spE0, spA0); if (func_802B4FF8(sp60, 3) != 0) { gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK); gSPDisplayList(gDisplayListHead++, &D_0600FC28); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK); } } } void func_8029B06C(Camera *arg0, struct Actor *arg1) { s32 pad[6]; Mat4 spD8; s32 pad2[32]; 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->pos, arg1->rot); if (func_802B4FF8(spD8, 0) != 0) { switch(arg1->state) { case 0: gSPDisplayList(gDisplayListHead++, &D_06023858); break; case 1: gSPDisplayList(gDisplayListHead++, &D_060238A0); break; case 2: gSPDisplayList(gDisplayListHead++, &D_060238E8); break; } if (gActiveScreenMode == 0) { if (temp_f0 < D_802B96E4) { gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_0); } else if (temp_f0 < D_802B96E8) { gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_1); } else { gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_2); } } else if (temp_f0 < D_802B96EC) { gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_1); } else { gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_2); } } } void func_8029B2E4(Camera *arg0, struct Actor *arg1) { s32 pad[6]; Mat4 spC8; s32 pad2[32]; f32 temp_f0; 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->pos, arg1->rot); if (func_802B4FF8(spC8, 0) != 0) { if (gActiveScreenMode == 0) { if (temp_f0 < D_802B96F4) { gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_3); } else if (temp_f0 < D_802B96F8) { gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_4); } else { gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_5); } } else if (temp_f0 < D_802B96FC) { gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_4); } else { gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_5); } } } void func_8029B4E0(Camera *arg0, struct Actor *arg1) { s32 pad[6]; Mat4 spC8; s32 pad2[32]; 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)) { gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); func_802B5F74(spC8, arg1->pos, arg1->rot); func_802B5F00(spC8, 0.1f); if (func_802B4FF8(spC8, 0) != 0) { if (gActiveScreenMode == 0) { if (temp_f0 < D_802B9704) { gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_9); } else if (temp_f0 < D_802B9708) { gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_10); } else { gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_11); } } else if (temp_f0 < D_802B970C) { gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_10); } else { gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_11); } } } } void func_8029B6EC(Camera *camera, struct Actor* arg1) { s32 pad[6]; Mat4 spC8; s32 pad2[32]; f32 temp_f0 = func_802B80D0(camera->pos, arg1->pos, camera->rotX[1], 2500.0f, D_80150130[camera - 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->pos, arg1->rot); if (func_802B4FF8(spC8, 0) != 0) { if (gActiveScreenMode == 0) { if (temp_f0 < D_802B9714) { gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_6); } else if (temp_f0 < D_802B9718) { gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_7); } else { gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_8); } } else if (temp_f0 < D_802B971C) { gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_7); } else { gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_8); } } } } void func_8029B8E8(Camera *camera, struct TrainCar *actor) { s32 pad[3]; Vec3f sp160; Mat4 sp120; Mat4 spE0; Mat4 spA0; f32 temp_f0 = func_802B80D0(camera->pos, actor->pos, camera->rotX[1], 2500.0f, D_80150130[camera - camera1], D_802B9720); if (temp_f0 < 0.0f) { return; } gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); func_802B5F74(sp120, actor->pos, actor->rot); if (func_802B4FF8(sp120, 0) == 0) { return; } if (temp_f0 < D_802B9724) { gSPDisplayList(gDisplayListHead++, D_0601C0F0); gSPDisplayList(gDisplayListHead++, D_0601B978); } else if (temp_f0 < D_802B9728) { gSPDisplayList(gDisplayListHead++, D_0601D670); gSPDisplayList(gDisplayListHead++, D_0601D160); } else { gSPDisplayList(gDisplayListHead++, D_0601E910); gSPDisplayList(gDisplayListHead++, D_0601E480); } if (D_802B972C < temp_f0) { return; } gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK); gSPDisplayList(gDisplayListHead++, D_06022D28); func_802B59DC(sp120, actor->wheelRot); vec3f_set(sp160, 17.0f, 6.0f, 32.0f); mtxf_translate(spE0, sp160); func_802B71CC(spA0, sp120, spE0); if (func_802B4FF8(spA0, 3) == 0) { return; } gSPDisplayList(gDisplayListHead++, D_06022DB8); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); func_802B59DC(sp120, actor->wheelRot); vec3f_set(sp160, -17.0, 6.0f, 32.0f); mtxf_translate(spE0, sp160); func_802B71CC(spA0, sp120, spE0); if (func_802B4FF8(spA0, 3) == 0) { return; } gSPDisplayList(gDisplayListHead++, D_06022DB8); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); func_802B59DC(sp120, (s16) (actor->wheelRot + 0x16C)); vec3f_set(sp160, 17.0f, 6.0f, 16.0f); mtxf_translate(spE0, sp160); func_802B71CC(spA0, sp120, spE0); if (func_802B4FF8(spA0, 3) == 0) { return; } gSPDisplayList(gDisplayListHead++, D_06022DB8); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); func_802B59DC(sp120, (s16) (actor->wheelRot + 0x16C)); vec3f_set(sp160, -17.0f, 6.0f, 16.0f); mtxf_translate(spE0, sp160); func_802B71CC(spA0, sp120, spE0); if (func_802B4FF8(spA0, 3) == 0) { return; } gSPDisplayList(gDisplayListHead++, D_06022DB8); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); func_802B59DC(sp120, (s16) (actor->wheelRot + 0x444)); vec3f_set(sp160, 17.0f, 12.0f, -12.0f); mtxf_translate(spE0, &sp160); func_802B71CC(spA0, sp120, spE0); if (func_802B4FF8(spA0, 3) == 0) { return; } gSPDisplayList(gDisplayListHead++, D_06022D70); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); func_802B59DC(sp120, (s16) (actor->wheelRot + 0x444)); vec3f_set(&sp160, -17.0f, 12.0f, -12.0f); mtxf_translate(spE0, sp160); func_802B71CC(spA0, sp120, spE0); if (func_802B4FF8(spA0, 3) == 0) { return; } gSPDisplayList(gDisplayListHead++, D_06022D70); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); func_802B59DC(sp120, (s16) (actor->wheelRot + 0x2D8)); vec3f_set(&sp160, 17.0f, 12.0f, -34.0f); mtxf_translate(spE0, &sp160); func_802B71CC(spA0, sp120, spE0); if (func_802B4FF8(spA0, 3) == 0) { return; } gSPDisplayList(gDisplayListHead++, D_06022D70); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); func_802B59DC(sp120, (s16) (actor->wheelRot + 0x2D8)); vec3f_set(sp160, -17.0f, 12.0f, -34.0f); mtxf_translate(spE0, sp160); func_802B71CC(spA0, sp120, spE0); if (func_802B4FF8(spA0, 3) == 0) { return; } gSPDisplayList(gDisplayListHead++, D_06022D70); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK); } void func_8029BFB0(Camera *camera, struct TrainCar *actor) { Mat4 sp120; Vec3f sp160; Mat4 spE0; Mat4 spA0; f32 temp_f0 = func_802B80D0(camera->pos, actor->pos, camera->rotX[1], 625.0f, D_80150130[camera - camera1], D_802B9730); if (temp_f0 < 0.0f) { return; } gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); func_802B5F74(sp120, actor->pos, actor->rot); if (func_802B4FF8(sp120, 0) == 0) { return; } if (temp_f0 < D_802B9734) { gSPDisplayList(gDisplayListHead++, D_0601F228); } else if (temp_f0 < D_802B9738) { gSPDisplayList(gDisplayListHead++, D_0601F708); } else { gSPDisplayList(gDisplayListHead++, D_0601FAF8); } if (D_802B973C < temp_f0) { return; } gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK); gSPDisplayList(gDisplayListHead++, D_06022D28); func_802B59DC(sp120, actor->wheelRot); vec3f_set(sp160, 17.0f, 6.0f, 8.0f); mtxf_translate(spE0, sp160); func_802B71CC(spA0, sp120, spE0); if (func_802B4FF8(spA0, 3) == 0) { return; } gSPDisplayList(gDisplayListHead++, D_06022DB8); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); func_802B59DC(sp120, actor->wheelRot); vec3f_set(sp160, -17.0, 6.0f, 8.0f); mtxf_translate(spE0, sp160); func_802B71CC(spA0, sp120, spE0); if (func_802B4FF8(spA0, 3) == 0) { return; } gSPDisplayList(gDisplayListHead++, D_06022DB8); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); func_802B59DC(sp120, (s16) (actor->wheelRot + 0x444)); vec3f_set(sp160, 17.0f, 6.0f, -8.0f); mtxf_translate(spE0, sp160); func_802B71CC(spA0, sp120, spE0); if (func_802B4FF8(spA0, 3) == 0) { return; } gSPDisplayList(gDisplayListHead++, D_06022DB8); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); func_802B59DC(sp120, (s16) (actor->wheelRot + 0x444)); vec3f_set(sp160, -17.0f, 6.0f, -8.0f); mtxf_translate(spE0, sp160); func_802B71CC(spA0, sp120, spE0); if (func_802B4FF8(spA0, 3) == 0) { return; } gSPDisplayList(gDisplayListHead++, D_06022DB8); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK); } void func_8029C3CC(Camera *camera, struct TrainCar *actor) { Mat4 sp120; Vec3f sp160; Mat4 spE0; Mat4 spA0; f32 temp_f0 = func_802B80D0(camera->pos, actor->pos, camera->rotX[1], 2025.0f, D_80150130[camera - camera1], D_802B9740); if (temp_f0 < 0.0f) { return; } gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); func_802B5F74(sp120, actor->pos, actor->rot); if (func_802B4FF8(sp120, 0) == 0) { return; } if (temp_f0 < D_802B9744) { gSPDisplayList(gDisplayListHead++, D_06020A20); gSPDisplayList(gDisplayListHead++, D_06020A08); } else if (temp_f0 < D_802B9748) { gSPDisplayList(gDisplayListHead++, D_06021550); gSPDisplayList(gDisplayListHead++, D_06021220); } else { gSPDisplayList(gDisplayListHead++, D_06021C90); gSPDisplayList(gDisplayListHead++, D_06021A80); } if (D_802B974C < temp_f0) { return; } gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK); gSPDisplayList(gDisplayListHead++, D_06022D28); func_802B59DC(sp120, actor->wheelRot); vec3f_set(sp160, 17.0f, 6.0f, 28.0f); mtxf_translate(spE0, sp160); func_802B71CC(spA0, sp120, spE0); if (func_802B4FF8(spA0, 3) == 0) { return; } gSPDisplayList(gDisplayListHead++, D_06022DB8); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); func_802B59DC(sp120, actor->wheelRot); vec3f_set(sp160, -17.0, 6.0f, 28.0f); mtxf_translate(spE0, sp160); func_802B71CC(spA0, sp120, spE0); if (func_802B4FF8(spA0, 3) == 0) { return; } gSPDisplayList(gDisplayListHead++, D_06022DB8); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); func_802B59DC(sp120, (s16) (actor->wheelRot + 0x222)); vec3f_set(sp160, 17.0f, 6.0f, 12.0f); mtxf_translate(spE0, sp160); func_802B71CC(spA0, sp120, spE0); if (func_802B4FF8(spA0, 3) == 0) { return; } gSPDisplayList(gDisplayListHead++, D_06022DB8); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); func_802B59DC(sp120, (s16) (actor->wheelRot + 0x222)); vec3f_set(sp160, -17.0f, 6.0f, 12.0f); mtxf_translate(spE0, sp160); func_802B71CC(spA0, sp120, spE0); if (func_802B4FF8(spA0, 3) == 0) { return; } gSPDisplayList(gDisplayListHead++, D_06022DB8); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); func_802B59DC(sp120, (s16) (actor->wheelRot + 0x5B0)); vec3f_set(sp160, 17.0f, 6.0f, -8.0f); mtxf_translate(spE0, &sp160); func_802B71CC(spA0, sp120, spE0); if (func_802B4FF8(spA0, 3) == 0) { return; } gSPDisplayList(gDisplayListHead++, D_06022DB8); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); func_802B59DC(sp120, (s16) (actor->wheelRot + 0x5B0)); vec3f_set(&sp160, -17.0f, 6.0f, -8.0f); mtxf_translate(spE0, sp160); func_802B71CC(spA0, sp120, spE0); if (func_802B4FF8(spA0, 3) == 0) { return; } gSPDisplayList(gDisplayListHead++, D_06022DB8); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); func_802B59DC(sp120, (s16) (actor->wheelRot + 0x16C)); vec3f_set(&sp160, 17.0f, 6.0f, -24.0f); mtxf_translate(spE0, &sp160); func_802B71CC(spA0, sp120, spE0); if (func_802B4FF8(spA0, 3) == 0) { return; } gSPDisplayList(gDisplayListHead++, D_06022DB8); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); func_802B59DC(sp120, (s16) (actor->wheelRot + 0x16C)); vec3f_set(sp160, -17.0f, 6.0f, -24.0f); mtxf_translate(spE0, sp160); func_802B71CC(spA0, sp120, spE0); if (func_802B4FF8(spA0, 3) == 0) { return; } gSPDisplayList(gDisplayListHead++, D_06022DB8); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK); } void func_8029CA90(Camera *camera, struct FallingRock *rock) { Vec3s sp98; Vec3f sp8C; Mat4 sp4C; f32 temp_f0; s32 pad[4]; if (rock->respawnTimer != 0) { return; } temp_f0 = func_802B80D0(camera->pos, rock->pos, camera->rotX[1], 400.0f, D_80150130[camera - camera1], D_802B9750); if (temp_f0 < 0.0f) { return; } if ((temp_f0 < D_802B9754) && (rock->unk30.unk34 == 1)) { sp8C[0] = rock->pos[0]; sp8C[2] = rock->pos[2]; temp_f0 = func_802ABE30(sp8C[0], rock->pos[1], sp8C[2], rock->unk30.unk3A); sp98[0] = 0; sp98[1] = 0; sp98[2] = 0; sp8C[1] = temp_f0 + 2.0f; func_802B5F74(sp4C, sp8C, sp98); if (func_802B4FF8(sp4C, 0) != 0) { gSPDisplayList(gDisplayListHead++, D_06006F88); goto block_6; } } else { block_6: func_802B5F74(sp4C, rock->pos, rock->rot); if (func_802B4FF8(sp4C, 0) != 0) { gSPDisplayList(gDisplayListHead++, D_06006FE0); } } } void place_piranha_plants(struct ActorSpawnData *spawnData) { s32 segment = SEGMENT_NUMBER2(spawnData); s32 offset = SEGMENT_OFFSET(spawnData); struct ActorSpawnData *temp_s0 = VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset); struct PiranhaPlant *temp_v1; s32 pad; Vec3f startingPos; Vec3f startingVelocity; Vec3s startingRot; s32 temp; vec3f_set(startingVelocity, 0, 0, 0); vec3s_set(startingRot, 0, 0, 0); while (temp_s0->pos[0] != -0x8000) { startingPos[0] = temp_s0->pos[0] * gCourseDirection; startingPos[1] = temp_s0->pos[1]; startingPos[2] = temp_s0->pos[2]; temp = func_8029EC88(startingPos, startingRot, startingVelocity, ACTOR_PIRANHA_PLANT); temp_v1 = (struct PiranhaPlant *) &gActorList[temp]; temp_v1->visibilityStates[0] = 0; temp_v1->visibilityStates[1] = 0; temp_v1->visibilityStates[2] = 0; temp_v1->visibilityStates[3] = 0; temp_v1->timers[0] = 0; temp_v1->timers[1] = 0; temp_v1->timers[2] = 0; temp_v1->timers[3] = 0; temp_s0++; } } void place_palm_trees(struct ActorSpawnData *spawnData) { s32 segment = SEGMENT_NUMBER2(spawnData); s32 offset = SEGMENT_OFFSET(spawnData); struct ActorSpawnData *temp_s0 = VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset); struct PalmTree *temp_v1; Vec3f startingPos; Vec3f startingVelocity; Vec3s startingRot; s32 temp; vec3f_set(startingVelocity, 0, 0, 0); vec3s_set(startingRot, 0, 0, 0); while (temp_s0->pos[0] != -0x8000) { startingPos[0] = temp_s0->pos[0] * gCourseDirection; startingPos[1] = temp_s0->pos[1]; startingPos[2] = temp_s0->pos[2]; temp = func_8029EC88(startingPos, startingRot, startingVelocity, ACTOR_PALM_TREE); temp_v1 = (struct PalmTree *) &gActorList[temp]; temp_v1->visibilityStates[0] = temp_s0->someId; func_802ADDC8((UnkActorInner *) &temp_v1->unk30, 5.0f, temp_v1->pos[0], temp_v1->pos[1], temp_v1->pos[2]); func_802976EC((UnkActorInner *) &temp_v1->unk30, temp_v1->unk10); temp_s0++; } } void func_8029CF0C(struct ActorSpawnData *spawnData, struct FallingRock *rock) { s32 segment = SEGMENT_NUMBER2(spawnData); s32 offset = SEGMENT_OFFSET(spawnData); struct ActorSpawnData *temp_v0 = VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset); // + (temp_v1 * 8); Vec3s sp24 = {60, 120, 180}; temp_v0 += rock->unk_06; rock->respawnTimer = sp24[rock->unk_06]; // * 2 rock->pos[0] = (f32) temp_v0->pos[0] * gCourseDirection; rock->pos[1] = (f32) temp_v0->pos[1] + 10.0f; rock->pos[2] = (f32) temp_v0->pos[2]; vec3f_set(rock->velocity, 0, 0, 0); vec3s_set(rock->rot, 0, 0, 0); } void place_falling_rocks(struct ActorSpawnData *spawnData) { s32 addr = SEGMENT_NUMBER2(spawnData); s32 offset = SEGMENT_OFFSET(spawnData); struct ActorSpawnData *temp_s0 = VIRTUAL_TO_PHYSICAL2(gSegmentTable[addr]) + offset; struct FallingRock *temp_v1; Vec3f startingPos; Vec3f startingVelocity; Vec3s startingRot; s16 temp; while (temp_s0->pos[0] != -0x8000) { startingPos[0] = temp_s0->pos[0] * gCourseDirection; startingPos[1] = temp_s0->pos[1] + 10.0f; startingPos[2] = temp_s0->pos[2]; vec3f_set(startingVelocity, 0, 0, 0); vec3s_set(startingRot, 0, 0, 0); temp = func_8029EC88(startingPos, startingRot, startingVelocity, ACTOR_FALLING_ROCK); temp_v1 = (struct FallingRock *) &gActorList[temp]; temp_v1->unk_06 = temp_s0->someId; func_802AAAAC((UnkActorInner *) &temp_v1->unk30); temp_s0++; } } #ifdef MIPS_TO_C //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 FallingRock *rock) { f32 sp4C; f32 sp48; f32 sp44; f32 sp3C; f32 sp34; 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; s16 temp_v0; f32 phi_f12; if (rock->respawnTimer != 0) { rock->respawnTimer -= 1; return; } if (rock->pos[1] < D_8015F8E4) { func_8029CF0C(&D_06007230, rock); } rock->rot[0] += (s32) ((rock->velocity[2] * D_802B9758) / 20.0f); rock->rot[2] += (s32) ((rock->velocity[0] * D_802B9758) / 20.0f); rock->velocity[1] = (f32) ((f64) rock->velocity[1] - D_802B9760); if (rock->velocity[1] < -2.0f) { rock->velocity[1] = -2.0f; } 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], D_802B9758, &rock->unk30, 10.0f, rock->pos[0], rock->pos[1], rock->pos[2]); temp_f2 = ; phi_f12 = 0.0f; if (rock->unk30.unk44 < 0.0f) { 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, rock->unk30.unk44, rock->velocity, 0x40000000); rock->velocity[1] = D_802B9768 * sp3C; func_800C98B8(rock->pos, rock->velocity, 0x1900800F); } temp_f2_2 = rock->unk30.unk3C; phi_f12 = 0.0f; if (temp_f2_2 < 0.0f) { sp48 = -rock->unk30.unk48[1]; if (sp48 == 0.0f) { rock->velocity[1] *= D_802B976C; return; } temp_f4 = -rock->unk30.unk48[0]; temp_s1_2 = rock->velocity; sp44 = temp_f4; 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); rock->velocity[1] = sp34; func_800C98B8(sp30, temp_s1_2, 0x1900800F); goto block_12; } block_12: temp_f2_3 = rock->unk30.unk40; if (temp_f2_3 < phi_f12) { sp48 = -rock->unk30.unk54[1]; if (phi_f12 == sp48) { rock->velocity[1] *= D_802B9774; return; } temp_s1_3 = rock->velocity; temp_f10 = -rock->unk30.unk54[0]; sp44 = temp_f10; 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); rock->velocity[1] = D_802B9778 * sp3C; func_800C98B8(sp30, temp_s1_3, 0x1900800F); } } #else GLOBAL_ASM("asm/non_matchings/code_actors/update_obj_falling_rocks.s") #endif #ifdef MIPS_TO_C //generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 ? func_802976D8(void *); /* extern */ ? func_802976EC(void *, void *); /* extern */ s32 func_8029EC88(f32 *, s16 *, ? *, s16); /* extern */ f32 func_802ABE30(?32, f32, ?32, u16); /* extern */ ? func_802ADDC8(void *, ?, ?32, f32, ?32); /* extern */ ? vec3f_set(? *, f32, f32, f32); /* extern */ extern s32 D_800DC50C; extern ? gActorList; extern f32 gCourseDirection; extern ? gSegmentTable; static u16 gCurrentCourseId; /* type too large by 2; unable to generate initializer */ void place_segment_06(u32 arg0) { f32 sp94; f32 sp90; f32 sp8C; ? sp80; s16 sp7C; s16 sp7A; s16 sp78; s16 sp74; s16 *temp_s3; s16 temp_v0; s16 temp_v0_2; s16 temp_v0_3; s16 temp_v0_4; u16 temp_t3; void *temp_s0; void *temp_s1; s16 phi_v0; s16 *phi_s3; s16 phi_s2; temp_s3 = *(&gSegmentTable + ((arg0 >> 0x18) * 4)) + (arg0 & 0xFFFFFF) + 0x80000000; vec3f_set(&sp80, 0.0f, 0.0f, 0.0f); sp78 = 0x4000; sp7A = 0; sp7C = 0; temp_v0 = *temp_s3; phi_v0 = temp_v0; if (temp_v0 != -0x8000) { phi_s3 = temp_s3; phi_s2 = sp74; do { temp_t3 = gCurrentCourseId; sp8C = (f32) phi_v0 * gCourseDirection; sp94 = (f32) phi_s3->unk_04; sp90 = (f32) phi_s3->unk2; switch (temp_t3) { case 0: phi_s2 = 2; break; case 2: phi_s2 = 0x21; break; case 4: phi_s2 = 3; break; case 5: phi_s2 = 0x1D; break; case 7: temp_v0_2 = phi_s3->unk6; if (temp_v0_2 != 6) { if (temp_v0_2 != 7) { } else { phi_s2 = 4; } } else { phi_s2 = 0x1C; } break; case 8: phi_s2 = 0x1A; break; case 9: phi_s2 = 0x13; break; case 11: temp_v0_3 = phi_s3->unk6; if (temp_v0_3 != 5) { if (temp_v0_3 != 6) { if (temp_v0_3 != 7) { } else { phi_s2 = 0x20; } } else { phi_s2 = 0x1F; } } else { phi_s2 = 0x1E; } break; } temp_s0 = &gActorList + (func_8029EC88(&sp8C, &sp78, &sp80, phi_s2) * 0x70); if (D_800DC50C == CREDITS_SEQUENCE) { func_802976D8(temp_s0 + 0x10); } else { temp_s1 = temp_s0 + 0x30; 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->unk_08; phi_v0 = temp_v0_4; phi_s3 += 8; } while (temp_v0_4 != -0x8000); sp74 = phi_s2; } } #else GLOBAL_ASM("asm/non_matchings/code_actors/place_segment_06.s") #endif void place_all_item_boxes(struct ActorSpawnData *spawnData) { s16 temp_s1; f32 temp_f0; struct ItemBox *temp_v0; struct ActorSpawnData *temp_s0 = VIRTUAL_TO_PHYSICAL2(gSegmentTable[SEGMENT_NUMBER2(spawnData)]) + SEGMENT_OFFSET(spawnData); Vec3f startingPos; Vec3f startingVelocity; Vec3s startingRot; if ((gModeSelection != TIME_TRIALS) && (gPlaceItemBoxes != 0)) { vec3f_set(startingVelocity, 0, 0, 0); while(temp_s0->pos[0] != -0x8000) { startingPos[0] = temp_s0->pos[0] * gCourseDirection; startingPos[1] = temp_s0->pos[1]; startingPos[2] = temp_s0->pos[2]; startingRot[0] = random_u16(); startingRot[1] = random_u16(); startingRot[2] = random_u16(); temp_s1 = func_8029EC88(startingPos, startingRot, startingVelocity, ACTOR_ITEM_BOX); temp_f0 = func_802AE1C0(startingPos[0], startingPos[1] + 10.0f, startingPos[2]); temp_v0 = (struct ItemBox *) &gActorList[temp_s1]; temp_v0->resetDistance = temp_f0; temp_v0->origY = startingPos[1]; temp_v0->pos[1] = temp_f0 - 20.0f; temp_s0++; } } } void init_kiwano_fruit(void) { Vec3f sp64; Vec3f sp58; Vec3s sp50; Player *phi_s1; struct Actor *actor; s16 phi_s0; s32 i; //phi_s0 = 0; for (i = 0; i < 4; i++) { phi_s1 = &gPlayers[i]; //temp_v0 = *phi_s1; if ((phi_s1->unk_000 & 0x4000) == 0) { continue; } if ((phi_s1->unk_000 & 0x100) != 0) { continue; } phi_s0 = func_8029EC88(sp64, sp50, sp58, ACTOR_KIWANO_FRUIT); actor = &gActorList[phi_s0]; actor->unk_04 = i; } } /** * Destroys actors via zeroing some of the member data * Key word some. When spawning a new actor, * members such as pos and rot should be set to prevent using expired data **/ void destroy_all_actors(void) { s32 i; gNumActors = 0; for (i = 0; i < ACTOR_LIST_SIZE; i++) { gActorList[i].flags = 0; gActorList[i].type = 0; gActorList[i].unk_04 = 0; gActorList[i].state = 0; gActorList[i].unk_08 = 0.0f; gActorList[i].boundingBoxSize = 0.0f; } } #ifdef MIPS_TO_C //generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 ? func_80298D10(); /* extern */ ? init_kiwano_fruit(); /* extern */ s32 func_8029EC88(f32 *, ? *, ? *, ?); /* extern */ ? func_802A14BC(f32, ?, ?); /* extern */ ? vec3s_set(? *, ?, ?, ?); /* extern */ ? vec3f_set(f32 *, ?, ?, ?); /* extern */ ? place_all_item_boxes(? *); /* extern */ ? place_falling_rocks(? *); /* extern */ ? place_palm_trees(? *); /* extern */ ? place_piranha_plants(? *); /* extern */ ? place_segment_06(? *); /* extern */ extern ? D_06000028; extern ? D_06000038; extern ? D_06000058; extern ? D_06000080; extern ? D_06007230; extern ? D_06007250; extern ? D_06007718; extern ? D_06007810; extern ? D_06009290; extern ? D_06009370; extern ? D_06009498; extern ? D_06009518; extern ? D_06009570; extern ? D_06009B80; extern ? D_0600B3D0; extern ? D_0600CB40; extern ? D_0600D9F0; extern ? D_0600DA78; extern ? D_0600DB80; extern ? D_0600FDE8; extern ? D_0600FE80; extern ? D_06013EC0; extern ? D_06014330; extern ? D_060143E0; extern ? D_06016338; extern ? D_060180A0; extern ? D_06018110; extern ? D_06018E78; extern ? D_06018F70; extern ? D_06022E88; extern ? D_06022F08; extern ? D_06023AE0; extern u16 gNumActors; extern u16 gNumPermanentActors; extern ? gActorList; extern ? D_8015F9BE; extern f32 gCourseDirection; extern s32 gPlayerCountSelection1; static ? D_802B8850; /* unable to generate initializer */ static ? D_802B885C; /* unable to generate initializer */ static u16 gCurrentCourseId; /* type too large by 2; unable to generate initializer */ // Place course actors void func_8029DB44(void) { f32 sp40; ? sp34; ? sp2C; f32 *temp_a0; f32 *temp_a0_10; f32 *temp_a0_2; f32 *temp_a0_3; f32 *temp_a0_4; f32 *temp_a0_5; f32 *temp_a0_6; f32 *temp_a0_7; f32 *temp_a0_8; f32 *temp_a0_9; u16 temp_t9; void *temp_v1; sp34.unk0 = D_802B8850.unk0; sp34.unk4 = D_802B8850.unk4; sp34.unk8 = D_802B8850.unk8; sp2C.unk0 = D_802B885C.unk0; sp2C.unk4 = D_802B885C.unk4; temp_t9 = gCurrentCourseId; gNumPermanentActors = 0; switch (temp_t9) { case COURSE_MARIO_RACEWAY: place_segment_06(&D_06009570); place_piranha_plants(&D_06009518); place_all_item_boxes(&D_06009498); vec3f_set(&sp40, 0x43160000, 0x42200000, 0xC4A28000); temp_a0 = &sp40; sp40 *= gCourseDirection; func_8029EC88(temp_a0, &sp2C, &sp34, 0x17); vec3f_set(&sp40, 0x451D8000, 0, 0x449B0000); temp_a0_2 = &sp40; sp40 *= gCourseDirection; temp_v1 = (func_8029EC88(temp_a0_2, &sp2C, &sp34, 0x17) * 0x70) + &gActorList; temp_v1->unk2 = temp_v1->unk2 | 0x4000; break; case COURSE_CHOCO_MOUNTAIN: place_all_item_boxes(&D_06007250); place_falling_rocks(&D_06007230); break; case COURSE_BOWSER_CASTLE: place_segment_06(&D_06009290); place_all_item_boxes(&D_06009370); break; case COURSE_BANSHEE_BOARDWALK: place_all_item_boxes(&D_0600B3D0); break; case COURSE_YOSHI_VALLEY: place_segment_06(&D_060180A0); place_all_item_boxes(&D_06018110); vec3f_set(&sp40, 0xC50FC000, 0, 0x441E8000); temp_a0_3 = &sp40; sp40 *= gCourseDirection; func_8029EC88(temp_a0_3, &sp2C, &sp34, 9); break; case COURSE_FRAPPE_SNOWLAND: place_segment_06(&D_06007718); place_all_item_boxes(&D_06007810); break; case COURSE_KOOPA_BEACH: func_802A14BC(328.0f * gCourseDirection, 0x428C0000, 0x451ED000); place_all_item_boxes(&D_06018E78); place_palm_trees(&D_06018F70); break; case COURSE_ROYAL_RACEWAY: place_segment_06(&D_0600DA78); place_all_item_boxes(&D_0600DB80); place_piranha_plants(&D_0600D9F0); break; case COURSE_LUIGI_RACEWAY: place_segment_06(&D_0600FE80); place_all_item_boxes(&D_0600FDE8); break; case COURSE_MOO_MOO_FARM: if (gPlayerCountSelection1 != 4) { place_segment_06(&D_06014330); } place_all_item_boxes(&D_060143E0); break; case COURSE_TOADS_TURNPIKE: place_all_item_boxes(&D_06023AE0); break; case COURSE_KALAMARI_DESERT: place_segment_06(&D_06022F08); place_all_item_boxes(&D_06022E88); vec3f_set(&sp40, 0xC4D20000, 0x40000000, 0x420C0000); temp_a0_4 = &sp40; sp40 *= gCourseDirection; /* D_8015F9BE is a fake variable. func_8029EC88 returns an index in gActorList and D_8015F9BE represents accessing the member 6 bytes into the actor at that index. In this function, that's the `crossingId` member of a RailroadCrossing actor */ *(&D_8015F9BE + (func_8029EC88(temp_a0_4, &sp2C, &sp34, 0x27) * 0x70)) = 1; vec3f_set(&sp40, 0xC4C80000, 0x40000000, 0x420C0000); temp_a0_5 = &sp40; sp40 *= gCourseDirection; *(&D_8015F9BE + (func_8029EC88(temp_a0_5, &sp2C, &sp34, 0x27) * 0x70)) = 1; vec3s_set(&sp2C, 0, -0x2000, 0); vec3f_set(&sp40, 0xC519B000, 0x40000000, 0x450D7000); temp_a0_6 = &sp40; sp40 *= gCourseDirection; *(&D_8015F9BE + (func_8029EC88(temp_a0_6, &sp2C, &sp34, 0x27) * 0x70)) = 0; vec3f_set(&sp40, 0xC51A3000, 0x40000000, 0x45147000); temp_a0_7 = &sp40; sp40 *= gCourseDirection; *(&D_8015F9BE + (func_8029EC88(temp_a0_7, &sp2C, &sp34, 0x27) * 0x70)) = 0; break; case COURSE_SHERBET_LAND: place_all_item_boxes(&D_06009B80); break; case COURSE_RAINBOW_ROAD: place_all_item_boxes(&D_06016338); break; case COURSE_WARIO_STADIUM: place_all_item_boxes(&D_0600CB40); vec3f_set(&sp40, 0xC3030000, 0x42A60000, 0x438F0000); temp_a0_8 = &sp40; sp40 *= gCourseDirection; func_8029EC88(temp_a0_8, &sp2C, &sp34, 0x23); vec3f_set(&sp40, 0xC5131000, 0x42900000, 0xC4C90000); temp_a0_9 = &sp40; sp40 *= gCourseDirection; func_8029EC88(temp_a0_9, &sp2C, &sp34, 0x23); vec3f_set(&sp40, 0xC523E000, 0x429E0000, 0x4438C000); temp_a0_10 = &sp40; sp40 *= gCourseDirection; func_8029EC88(temp_a0_10, &sp2C, &sp34, 0x23); break; case COURSE_BLOCK_FORT: place_all_item_boxes(&D_06000038); break; case COURSE_SKYSCRAPER: place_all_item_boxes(&D_06000080); break; case COURSE_DOUBLE_DECK: place_all_item_boxes(&D_06000028); break; case COURSE_DK_JUNGLE: place_all_item_boxes(&D_06013EC0); init_kiwano_fruit(); func_80298D10(); break; case COURSE_BIG_DONUT: place_all_item_boxes(&D_06000058); break; } gNumPermanentActors = gNumActors; } #else GLOBAL_ASM("asm/non_matchings/code_actors/func_8029DB44.s") #endif #ifdef MIPS_TO_C //generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 ? func_800122D8(); /* extern */ ? func_80297818(); /* extern */ ? destroy_all_actors(); /* extern */ ? func_8029DB44(); /* extern */ s32 func_802A84F4(? *, ?, ?); /* extern */ ? set_segment_base_addr(?, s32); /* extern */ extern ? D_0F04CBE0; extern ? D_0F04CE30; extern ? D_0F04D080; extern ? D_0F04D2D8; extern ? D_0F04D538; extern ? D_0F04D790; extern ? D_0F04D9FC; extern ? D_0F04DC5C; extern ? D_0F04DEB0; extern ? D_0F04E0DC; extern ? D_0F04E314; extern ? D_0F04E554; extern ? D_0F04E798; extern ? D_0F04E9F0; extern ? D_0F04EC4C; extern ? D_0F04EE88; extern ? D_0F04F45C; extern ? D_0F04F7A4; extern ? D_0F04FB3C; extern ? D_0F04FE28; extern ? D_0F050118; extern ? D_0F050468; extern ? D_0F050678; extern ? D_0F050D50; extern ? D_0F0513CC; extern ? D_0F051820; extern ? D_0F051C54; extern ? D_0F051FD8; extern ? D_0F05232C; extern ? D_0F0526B8; extern ? D_0F052A20; extern ? D_0F052D3C; extern ? D_0F05300C; extern ? D_0F0532F8; extern ? D_0F05363C; extern ? D_0F053950; extern ? D_0F053C34; extern ? D_0F053F74; extern ? D_0F054270; extern ? D_0F054518; extern ? D_0F05488C; extern ? D_0F054C3C; extern ? D_0F054ECC; extern ? D_0F0551C8; extern ? D_0F0554CC; extern ? D_0F055880; extern ? D_0F055BA0; extern ? D_0F055F10; extern ? D_0F0561AC; extern ? D_0F056408; extern ? D_0F05662C; extern ? D_0F05688C; extern ? D_0F056AD0; extern ? D_0F056CF0; extern ? D_0F056EC8; extern ? D_0F057084; extern ? D_0F057288; extern ? D_0F057590; extern ? D_0F057EB4; extern ? D_0F0581E4; extern ? D_0F058550; extern ? gTexture671A88; extern ? gTexture6774D8; extern ? gTextureShrub; u16 gCurrentCourseId; /* unable to generate initializer */ void func_8029E158(void) { u16 temp_t6; set_segment_base_addr(3, gPrevLoadedAddress); D_802BA050 = func_802A84F4(&D_0F04CBE0, 0x257, 0x400); // shell func_802A84F4(&D_0F04CE30, 0x242, 0x400); func_802A84F4(&D_0F04D080, 0x259, 0x400); func_802A84F4(&D_0F04D2D8, 0x256, 0x400); func_802A84F4(&D_0F04D538, 0x246, 0x400); func_802A84F4(&D_0F04D790, 0x25E, 0x400); func_802A84F4(&D_0F04D9FC, 0x25C, 0x400); func_802A84F4(&D_0F04DC5C, 0x254, 0x400); D_802BA054 = func_802A84F4(&D_0F04DEB0, 0x22A, 0x400); func_802A84F4(&D_0F04E0DC, 0x237, 0x400); func_802A84F4(&D_0F04E314, 0x23E, 0x400); func_802A84F4(&D_0F04E554, 0x243, 0x400); func_802A84F4(&D_0F04E798, 0x255, 0x400); func_802A84F4(&D_0F04E9F0, 0x259, 0x400); func_802A84F4(&D_0F04EC4C, 0x239, 0x400); func_802A84F4(&D_0F04EE88, 0x236, 0x400); func_802A84F4(&D_0F054C3C, 0x28E, 0x800); func_802A84F4(&D_0F054ECC, 0x2FB, 0x800); func_802A84F4(&D_0F0551C8, 0x302, 0x800); func_802A84F4(&D_0F0554CC, 0x3B4, 0x800); func_802A84F4(&D_0F055880, 0x31E, 0x800); func_802A84F4(&D_0F055BA0, 0x36E, 0x800); func_802A84F4(&D_0F055F10, 0x29C, 0x800); func_802A84F4(&D_0F0561AC, 0x25B, 0x800); func_802A84F4(&gTexture671A88, 0x400, 0x800); func_802A84F4(&gTexture6774D8, 0x400, 0x800); temp_t6 = gCurrentCourseId; switch (temp_t6) { case 0: func_802A84F4(&D_0F04F45C, 0x35B, 0x800); D_802BA058 = func_802A84F4(&D_0F056408, 0x3E8, 0x800); func_802A84F4(&D_0F05662C, 0x3E8, 0x800); func_802A84F4(&D_0F05688C, 0x3E8, 0x800); func_802A84F4(&D_0F056AD0, 0x3E8, 0x800); func_802A84F4(&D_0F056CF0, 0x3E8, 0x800); func_802A84F4(&D_0F056EC8, 0x3E8, 0x800); func_802A84F4(&D_0F057084, 0x3E8, 0x800); func_802A84F4(&D_0F057288, 0x3E8, 0x800); func_802A84F4(&D_0F057590, 0x3E8, 0x800); break; case 2: func_802A84F4(&gTextureShrub, 0x3FF, 0x800); break; case 4: func_802A84F4(&D_0F04F7A4, 0x3E8, 0x800); break; case 5: func_802A84F4(&D_0F0513CC, 0x454, 0x800); func_802A84F4(&D_0F051820, 0x432, 0x800); break; case 7: func_802A84F4(&D_0F04FB3C, 0x3E8, 0x800); func_802A84F4(&D_0F050D50, 0x3E8, 0x800); D_802BA058 = func_802A84F4(&D_0F056408, 0x3E8, 0x800); func_802A84F4(&D_0F05662C, 0x3E8, 0x800); func_802A84F4(&D_0F05688C, 0x3E8, 0x800); func_802A84F4(&D_0F056AD0, 0x3E8, 0x800); func_802A84F4(&D_0F056CF0, 0x3E8, 0x800); func_802A84F4(&D_0F056EC8, 0x3E8, 0x800); func_802A84F4(&D_0F057084, 0x3E8, 0x800); func_802A84F4(&D_0F057288, 0x3E8, 0x800); func_802A84F4(&D_0F057590, 0x3E8, 0x800); break; case 8: func_802A84F4(&D_0F050468, 0x3E8, 0x800); func_802A84F4(&D_0F050678, 0x3E8, 0x800); break; case 9: func_802A84F4(&D_0F04FE28, 0x3E8, 0x800); func_802A84F4(&D_0F050118, 0x3E8, 0x800); func_802A84F4(&D_0F051C54, 0x400, 0x800); func_802A84F4(&D_0F051FD8, 0x400, 0x800); func_802A84F4(&D_0F05232C, 0x400, 0x800); func_802A84F4(&D_0F0526B8, 0x400, 0x800); func_802A84F4(&D_0F052A20, 0x400, 0x800); func_802A84F4(&D_0F052D3C, 0x400, 0x800); func_802A84F4(&D_0F05300C, 0x400, 0x800); func_802A84F4(&D_0F0532F8, 0x400, 0x800); func_802A84F4(&D_0F05363C, 0x400, 0x800); func_802A84F4(&D_0F053950, 0x400, 0x800); break; case 11: func_802A84F4(&D_0F053C34, 0x33E, 0x800); func_802A84F4(&D_0F053F74, 0x2FB, 0x800); func_802A84F4(&D_0F054270, 0x2A8, 0x800); func_802A84F4(&D_0F054518, 0x374, 0x800); func_802A84F4(&D_0F05488C, 0x3AF, 0x800); break; case 18: func_802A84F4(&D_0F057EB4, 0x32F, 0x400); func_802A84F4(&D_0F0581E4, 0x369, 0x400); func_802A84F4(&D_0F058550, 0x364, 0x400); break; } func_80297818(); destroy_all_actors(); func_8029DB44(); func_800122D8(); } #else GLOBAL_ASM("asm/non_matchings/code_actors/func_8029E158.s") #endif void func_8029E7DC(struct Actor *actor) { s16 temp_v0 = actor->flags; if ((temp_v0 & 0x200) != 0) { func_800C99E0(actor->pos, 0x19019053); return; } if ((temp_v0 & 0x100) != 0) { func_800C99E0(actor->pos, 0x19018010); return; } if ((temp_v0 & 0x80) != 0) { func_800C99E0(actor->pos, 0x19008054); } } /** * This func likely plays an audio track based on flag * Next, it destroys the actor via zeroing its flags and type. * Note that the data from its other members still exist. * Actors are expected to set members such as pos and rot data if used. Not doing so could result in the use of expired data. * * This method does not require modification to gActorList directly. * No popping members of gActorList. The list is always the size of ACTOR_LIST_SIZE. * Actors are members of gActorList by definition. * * @param Actor to destroy */ void destroy_actor(struct Actor *actor) { func_8029E7DC(actor); actor->flags = 0; actor->type = 0; gNumActors--; } #ifdef MIPS_TO_C //generated by m2c commit a8f43e46d33dcb7e04d9cdc44a10b3daf4c92c3b ? func_8000EE58(s16, s16, s32, s32); /* extern */ s16 func_8029E890(f32 *pos, s16 *rot, f32 *velocity, s16 actorType) { s16 temp_s1; s16 temp_s1_2; s16 temp_t4; s16 temp_t4_2; s16 temp_v0; s16 temp_v0_2; s16 temp_v0_3; s16 temp_v0_4; s16 temp_v0_5; s16 temp_v0_6; s16 temp_v0_7; s16 temp_v0_8; u16 temp_t3; struct Actor *phi_s0; s16 phi_s1; struct Actor *phi_s0_2; s16 phi_s1_2; temp_t3 = gNumPermanentActors; phi_s1 = (s16) temp_t3; if ((s32) temp_t3 < 0x64) { phi_s0 = &gActorList[temp_t3]; loop_2: 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); /* fallthrough */ case 7: /* switch 1 */ func_8029E7DC(phi_s0); func_80296D10(phi_s0, pos, rot, velocity, (s32) actorType); return phi_s1; } 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, pos, rot, velocity, (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); func_80296D10(phi_s0, pos, rot, velocity, (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); func_80296D10(phi_s0, pos, rot, velocity, (s32) actorType); return phi_s1; } goto block_24; } } else { default: /* switch 1 */ block_24: temp_s1 = phi_s1 + 1; phi_s0 += 0x70; phi_s1 = temp_s1; if (temp_s1 >= 0x64) { goto block_26; } goto loop_2; } } else { block_26: phi_s1_2 = (s16) temp_t3; if ((s16) temp_t3 < 0x64) { phi_s0_2 = &gActorList[(s16) temp_t3]; loop_28: 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); /* fallthrough */ case 7: /* switch 2 */ func_8029E7DC(phi_s0_2); func_80296D10(phi_s0_2, pos, rot, velocity, (s32) actorType); return phi_s1_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; } 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, pos, rot, velocity, (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); func_80296D10(phi_s0_2, pos, rot, velocity, (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); func_80296D10(phi_s0_2, pos, rot, velocity, (s32) actorType); return phi_s1_2; } goto block_49; } } else { block_50: return -1; } } } #else GLOBAL_ASM("asm/non_matchings/code_actors/func_8029E890.s") #endif s16 func_8029EC88(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) { s32 index; if (gNumActors >= ACTOR_LIST_SIZE) { return func_8029E890(pos, rot, velocity, actorType); } for(index = 0; index < ACTOR_LIST_SIZE; index++){ if (gActorList[index].flags == 0) { gNumActors++; func_80296D10(&gActorList[index], pos, rot, velocity, actorType); return index; } } return -1; } #ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 //void func_8029EC88(s32, s32 *, s32 *, s32); // extern //void vec3s_set(s32 *, s32, s32, s32); // extern void func_8029ED38(Vec3f arg0, Vec3s arg1) { //? sp24; //? sp1C; vec3f_set(arg0, 0, 0, 0); vec3s_set(arg1, 0, 0, 0); func_8029EC88(arg0, arg1, arg0, arg1); } #else GLOBAL_ASM("asm/non_matchings/code_actors/func_8029ED38.s") #endif #ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 extern f32 D_802B988C; extern f32 D_802B9890; extern f32 D_802B9894; extern f32 D_802B9898; ? func_8029EEB8(void *arg0, void *arg1, f32 arg2, f32 arg3, f32 arg4) { f32 sp44; f32 sp40; f32 sp3C; f32 sp28; f32 temp_f0; f32 temp_f0_2; f32 temp_f0_3; f32 temp_f0_4; f32 temp_f0_5; f32 temp_f0_6; f32 temp_f10; f32 temp_f12; f32 temp_f12_2; f32 temp_f14; f32 temp_f14_2; f32 temp_f16; f32 temp_f18; f32 temp_f20; f32 temp_f20_2; f32 temp_f22; f32 temp_f2; f32 temp_f2_2; s32 temp_v0; f32 phi_f2; temp_f0 = arg0->unk70; temp_f22 = temp_f0 + arg2; temp_f20 = arg1->unk0 - arg0->unk14; temp_f12 = temp_f0 + arg3; if (temp_f22 < temp_f20) { return 0; } temp_f2 = -temp_f22; if (temp_f20 < temp_f2) { return 0; } 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->unk_08 - arg0->unk1C; if (temp_f22 < temp_f14) { return 0; } if (temp_f14 < temp_f2) { return 0; } temp_f12_2 = (temp_f20 * temp_f20) + (temp_f0_2 * temp_f0_2) + (temp_f14 * temp_f14); if (temp_f12_2 < D_802B988C) { return 0; } if ((temp_f22 * temp_f22) < temp_f12_2) { return 0; } sp44 = temp_f14; temp_f0_3 = sqrtf(temp_f12_2); sp28 = temp_f0_3 - temp_f22; temp_v0 = arg0->unkBC; temp_f16 = arg0->unk34; temp_f18 = arg0->unk3C; if ((temp_v0 & 0x200) != 0) { goto block_25; } if (temp_f0_3 < D_802B9890) { temp_f10 = temp_f16 * temp_f16; arg0 = arg0; sp40 = temp_f16; sp3C = temp_f18; temp_f0_4 = sqrtf(temp_f10 + (temp_f18 * temp_f18)); phi_f2 = temp_f0_4; if (temp_f0_4 < 0.5f) { phi_f2 = 0.5f; } arg0->unk34 = 0.0f; arg0->unk3C = 0.0f; arg0->unk14 = arg0->unk14 + ((temp_f16 / phi_f2) * temp_f22); arg0->unk1C = arg0->unk1C + ((temp_f18 / phi_f2) * temp_f22); goto block_25; } temp_f14_2 = temp_f14 / temp_f0_3; arg0->unkBC = temp_v0 | 0x8000; sp3C = temp_f18; sp40 = temp_f16; arg1 = arg1; arg0 = arg0; temp_f20_2 = temp_f20 / temp_f0_3; sp44 = temp_f14_2; temp_f0_5 = sqrtf((temp_f16 * temp_f16) + (temp_f18 * temp_f18)); if (temp_f0_5 < 0.25f) { temp_f0_6 = D_802B9894; arg0->unk14 = arg1->unk0 - (temp_f20_2 * temp_f22 * temp_f0_6); arg0->unk34 = 0.0f; arg0->unk3C = 0.0f; 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; arg0->unk34 = arg0->unk34 - (temp_f20_2 * temp_f2_2); arg0->unk3C = arg0->unk3C - (temp_f14_2 * temp_f2_2); arg0->unk14 = arg0->unk14 + (temp_f20_2 * sp28 * 0.5f); arg0->unk1C = arg0->unk1C + (temp_f14_2 * sp28 * 0.5f); block_25: return 1; } #else GLOBAL_ASM("asm/non_matchings/code_actors/func_8029EEB8.s") #endif #ifdef MIPS_TO_C //generated by m2c commit a8f43e46d33dcb7e04d9cdc44a10b3daf4c92c3b static f32 D_802B989C = 0.8f; s32 func_8029F1F8(Player *player, struct Actor *actor) { u16 temp_v0; if (func_8029EEB8(player, actor->pos, 7.0f, 200.0f, D_802B989C) == 1) { temp_v0 = player->unk_000; if ((temp_v0 & 0x4000) != 0) { if ((player->unk_0BC & 0x200) != 0) { actor->flags |= 0x400; func_800C98B8(player->pos, player->unk_034, 0x19018010U); func_800C90F4((Player *) (((s32) (player - gPlayerOne) / 3544) & 0xFF), (player->characterId * 0x10) + 0x2900800D); return 1; } if ((temp_v0 & 0x100) == 0) { func_800C9060((Player *) (((s32) (player - gPlayerOne) / 3544) & 0xFF), 0x1900701A); } goto block_6; } block_6: return 1; } return 0; } #else GLOBAL_ASM("asm/non_matchings/code_actors/func_8029F1F8.s") #endif #ifdef MIPS_TO_C //generated by m2c commit a8f43e46d33dcb7e04d9cdc44a10b3daf4c92c3b s32 func_8029F2FC(Player *player, struct PiranhaPlant *plant) { f32 temp_f0; u16 temp_v0; temp_f0 = plant->boundingBoxSize; if (func_8029EEB8(player, plant->pos, temp_f0, temp_f0, 2.5f) == 1) { temp_v0 = player->unk_000; if ((temp_v0 & 0x4000) != 0) { if ((player->unk_0BC & 0x200) != 0) { plant->flags |= 0x400; func_800C98B8(player->pos, player->unk_034, 0x1901A24AU); func_800C90F4((Player *) (((s32) (player - gPlayerOne) / 3544) & 0xFF), (player->characterId * 0x10) + 0x2900800D); return 1; } if ((temp_v0 & 0x100) == 0) { func_800C9060((Player *) (((s32) (player - gPlayerOne) / 3544) & 0xFF), 0x1900A052); } goto block_6; } block_6: return 1; } return 0; } #else GLOBAL_ASM("asm/non_matchings/code_actors/func_8029F2FC.s") #endif s32 func_8029F408(Player *player, struct YoshiValleyEgg *egg) { f32 pad[5]; f32 z_dist; f32 xz_dist; f32 x_dist; f32 y_dist; f32 totalBox; f32 thing = 60.0f; f32 thing2 = 0.0f; x_dist = egg->pos[0] - player->pos[0]; if ((x_dist < thing2) && (x_dist < -thing)) { return 0; } if (x_dist > thing) { return 0; } z_dist = egg->pos[2] - player->pos[2]; if ((z_dist < thing2) && (z_dist < -thing)) { return 0; } if (z_dist > thing) { return 0; } xz_dist = sqrtf((x_dist * x_dist) + (z_dist * z_dist)); if (xz_dist > thing) { return 0; } func_802977B0(player); y_dist = player->pos[1] - egg->pos[1]; if (y_dist < thing2) { return 0; } totalBox = player->boundingBoxSize + egg->boundingBoxSize; if (totalBox < xz_dist) { return 0; } if ((player->unk_000 & 0x4000) != 0) { if ((player->unk_0BC & 0x200) != 0) { egg->flags |= 0x400; egg->pathCenter[1] = 8.0f; func_800C98B8(player->pos, player->unk_034, 0x19018010); func_800C90F4(player - gPlayerOne, (player->characterId * 0x10) + 0x2900800D); } else { func_8008DABC(player, ((player - gPlayerOne) << 0x18) >> 0x18); if ((gModeSelection == TIME_TRIALS) && ((player->unk_000 & 0x1000) == 0)) { D_80162DF8 = 1; } } } else { func_8008DABC(player, ((player - gPlayerOne) << 0x18) >> 0x18); } return 1; } #ifdef MIPS_TO_C //generated by m2c commit a8f43e46d33dcb7e04d9cdc44a10b3daf4c92c3b ? func_80077AB0(f32 *, ?); /* extern */ static f32 D_802B98A0 = 0.1f; static f32 D_802B98A4 = 1.2f; static f32 D_802B98A8 = 1.2f; s16 gCurrentCourseId; /* unable to generate initializer */ s32 func_8029F69C(Player *player, struct Actor *actor) { f32 sp54; f32 sp4C; f32 sp48; f32 sp44; f32 sp40; f32 sp3C; f32 sp28; f32 sp24; f32 sp20; f32 temp_f0; f32 temp_f0_2; f32 temp_f0_3; f32 temp_f0_4; f32 temp_f0_5; f32 temp_f12; f32 temp_f14; f32 temp_f14_2; f32 temp_f16; f32 temp_f16_2; f32 temp_f18; f32 temp_f18_2; f32 temp_f2; s16 temp_v0_3; s32 temp_cond; s32 temp_v0_2; u16 temp_v0; Player *phi_a3; f32 phi_f14; f32 phi_f16; f32 phi_f18; temp_f18 = actor->pos[0] - player->pos[0]; temp_f16 = actor->unk_08; phi_a3 = player; if ((temp_f18 < 0.0f) && (temp_f18 < -temp_f16)) { return 0; } if (temp_f16 < temp_f18) { return 0; } temp_f14 = actor->pos[2] - player->pos[2]; if ((temp_f14 < 0.0f) && (temp_f14 < -temp_f16)) { return 0; } if (temp_f16 < temp_f14) { return 0; } temp_f0 = player->pos[1] - actor->pos[1]; if (temp_f0 < 0.0f) { return 0; } if ((f32) actor->state < temp_f0) { return 0; } sp4C = temp_f14; sp40 = temp_f16; sp54 = temp_f18; temp_f0_2 = sqrtf((temp_f18 * temp_f18) + (temp_f14 * temp_f14)); temp_cond = temp_f16 < temp_f0_2; sp3C = temp_f0_2; if (temp_cond) { return 0; } sp4C = temp_f14; sp54 = temp_f18; func_802977B0(player); temp_f16_2 = player->boundingBoxSize + actor->boundingBoxSize; if (temp_f16_2 < sp3C) { return 0; } sp48 = player->unk_034[0]; sp44 = player->unk_034[2]; temp_v0 = player->unk_000; if ((temp_v0 & 0x4000) != 0) { if ((player->unk_0BC & 0x200) != 0) { actor->flags |= 0x400; func_800C98B8(player->pos, player->unk_034, 0x19018010U); func_800C90F4((Player *) (((s32) (player - gPlayerOne) / 3544) & 0xFF), (player->characterId * 0x10) + 0x2900800D); goto block_36; } if ((temp_v0 & 0x100) == 0) { sp4C = temp_f14; sp40 = temp_f16_2; sp54 = temp_f18; func_800C9060((Player *) (((s32) (player - gPlayerOne) / 3544) & 0xFF), 0x19007018); } goto block_23; } block_23: temp_v0_2 = player->unk_0BC; phi_a3 = player; phi_f14 = temp_f14; phi_f16 = temp_f16_2; phi_f18 = temp_f18; if ((temp_v0_2 & 0x200) == 0) { player->unk_0BC = temp_v0_2 | 0x8000; } temp_v0_3 = gCurrentCourseId; sp20 = actor->pos[0]; sp24 = actor->pos[1]; sp28 = actor->pos[2]; if (((temp_v0_3 == 0) || (temp_v0_3 == 4) || (temp_v0_3 == 7) || (temp_v0_3 == 8)) && (player->unk_094 > 1.0f)) { player = player; sp4C = temp_f14; sp40 = temp_f16_2; sp54 = temp_f18; func_80077AB0(&sp20, 0); phi_f14 = sp4C; phi_f16 = sp40; phi_f18 = sp54; } if (sp3C < D_802B98A0) { player = phi_a3; sp4C = phi_f14; sp40 = phi_f16; sp54 = phi_f18; sqrtf((sp48 * sp48) + (sp44 * sp44)); temp_f0_3 = D_802B98A4; player->unk_034[0] = 0.0f; player->unk_034[2] = 0.0f; player->pos[0] = sp20 - (phi_f18 * phi_f16 * temp_f0_3); player->pos[2] = sp28 - (phi_f14 * phi_f16 * temp_f0_3); goto block_36; } player = phi_a3; sp4C = phi_f14; sp40 = phi_f16; sp54 = phi_f18; temp_f0_4 = sqrtf((sp48 * sp48) + (sp44 * sp44)); temp_f14_2 = phi_f14 / sp3C; temp_f18_2 = phi_f18 / sp3C; if (temp_f0_4 < 0.25f) { temp_f0_5 = D_802B98A8; player->pos[0] = sp20 - (temp_f18_2 * phi_f16 * temp_f0_5); player->unk_034[0] = 0.0f; player->unk_034[2] = 0.0f; player->pos[2] = sp28 - (temp_f14_2 * phi_f16 * temp_f0_5); return 1; } temp_f12 = temp_f0_4 * (((temp_f18_2 * sp48) + (temp_f14_2 * sp44)) / temp_f0_4) * 1.5f; player->unk_034[0] -= temp_f18_2 * temp_f12; player->unk_034[2] -= temp_f14_2 * temp_f12; temp_f2 = sp3C - phi_f16; player->pos[0] += temp_f18_2 * temp_f2 * 0.5f; player->pos[2] += temp_f14_2 * temp_f2 * 0.5f; block_36: return 1; } #else GLOBAL_ASM("asm/non_matchings/code_actors/func_8029F69C.s") #endif s32 func_8029FB80(Player *arg0, struct Actor *arg1) { f32 temp_f0; f32 temp_f12_2; f32 temp_f14; f32 temp_f16; f32 temp_f2; 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->pos[1] - arg0->pos[1]; if (temp_f0 < temp_f14) { return 0; } if (temp_f14 < -temp_f0) { return 0; } temp_f16 = arg1->pos[2] - arg0->pos[2]; if (temp_f0 < temp_f16) { return 0; } if (temp_f16 < -temp_f0) { return 0; } temp_f12_2 = (temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16); if (temp_f12_2 < D_802B98AC) { return 0; } if ((temp_f0 * temp_f0) < temp_f12_2) { return 0; } return 1; } s32 func_8029FCA4(struct Actor *arg0, struct Actor *arg1) { f32 temp_f0; f32 temp_f12_2; f32 temp_f14; f32 temp_f16; f32 temp_f2; 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->pos[1] - arg1->pos[1]; if (temp_f0 < temp_f14) { return 0; } if (temp_f14 < -temp_f0) { return 0; } temp_f16 = arg0->pos[2] - arg1->pos[2]; if (temp_f0 < temp_f16) { return 0; } if (temp_f16 < -temp_f0) { return 0; } temp_f12_2 = (temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16); if (temp_f12_2 < D_802B98B0) { return 0; } if ((temp_f0 * temp_f0) < temp_f12_2) { return 0; } return 1; } #ifdef MIPS_TO_C //generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd ? func_8000EE58(s32); /* extern */ ? func_800C9EF4(f32 *, ?, struct Actor *, s16); /* extern */ ? func_802B02B4(struct Actor *, ?, struct Actor *, s16); /* extern */ ? func_802B0570(struct Actor *); /* extern */ 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; struct Actor *temp_a2; u16 temp_t6; struct Actor *phi_a2; struct Actor *phi_a2_2; struct Actor *phi_a2_3; temp_v0 = actor->type; temp_a2 = actor; phi_a2 = temp_a2; phi_a2_2 = temp_a2; phi_a2_3 = temp_a2; 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_v0_2 = &gPlayers[temp_a2->rot[0]]; temp_v0_2->unk_00C &= 0xFFFBFFFF; /* fallthrough */ case 4: /* switch 1 */ temp_a2->flags = -0x8000; temp_a2->unk_04 = 0x003C; temp_a2->state = 5; temp_a2->velocity[1] = 3.0f; return; default: /* switch 1 */ 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 - gActorList) / 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->someTimer = 0x003C; phi_a2_3->state = 5; phi_a2_3->velocity[1] = 3.0f; return; case 4: /* switch 5 */ func_802B02B4(temp_a2, ACTOR_GREEN_SHELL, temp_a2, ACTOR_GREEN_SHELL); 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 - gActorList) / 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 - gActorList) / 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->someTimer = 0x003C; phi_a2_2->state = 7; phi_a2_2->velocity[1] = 3.0f; return; case 6: /* switch 3 */ func_802B02B4(temp_a2, ACTOR_RED_SHELL, temp_a2, ACTOR_GREEN_SHELL); 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->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 ACTOR_RED_SHELL: if ((arg0->state == 0) || (arg0->state == 6)) { arg0->flags |= 0x200; func_800C98B8(arg0->pos, arg0->velocity, 0x19019053); return; } break; case ACTOR_BLUE_SPINY_SHELL: if (arg0->state == 0) { arg0->flags |= 0x200; func_800C98B8(arg0->pos, arg0->velocity, 0x19019053); return; } break; case ACTOR_FAKE_ITEM_BOX: if (arg0->state == 0) { arg0->flags |= 0x200; func_800C98B8(arg0->pos, arg0->velocity, 0x19019053); return; } break; } 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 ACTOR_RED_SHELL: if ((arg1->state == 0) || (arg1->state == 6)) { arg1->flags |= 0x200; func_800C98B8(arg1->pos, arg1->velocity, 0x19019053); return; } break; case ACTOR_BLUE_SPINY_SHELL: if (arg1->state == 0) { arg1->flags |= 0x200; func_800C98B8(arg1->pos, arg1->velocity, 0x19019053); return; } break; case ACTOR_FAKE_ITEM_BOX: if (arg1->state == 0) { arg1->flags |= 0x200; func_800C98B8(arg1->pos, arg1->velocity, 0x19019053); return; } break; } arg0->flags |= 0x100; func_800C98B8(arg0->pos, arg0->velocity, 0x19018010); } void func_802A0350(struct Actor *arg0, struct Actor *arg1) { if (func_8029FCA4(arg0, arg1) == 1) { if ((arg0->type == ACTOR_BLUE_SPINY_SHELL) && (arg1->type == ACTOR_BLUE_SPINY_SHELL)) { func_8029FDC8(arg0); func_8029FDC8(arg1); arg0->flags |= 256; func_800C98B8(arg0->pos, arg0->velocity, 0x19018010); return; } if (arg0->type == ACTOR_BLUE_SPINY_SHELL) { if (arg0->state == 0) { func_8029FDC8(arg0); } } else { func_8029FDC8(arg0); } if (arg1->type == ACTOR_BLUE_SPINY_SHELL) { if (arg1->state == 0) { func_8029FDC8(arg1); } } else { func_8029FDC8(arg1); } func_802A00E8(arg0, arg1); } } #ifdef MIPS_TO_C //generated by m2c commit a8f43e46d33dcb7e04d9cdc44a10b3daf4c92c3b ? func_8007ABFC(s32, ?); /* 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 */ extern s32 D_80162DF8; static f32 D_802B99C4 = 360000.0f; static f32 D_802B99C8 = 360000.0f; void func_802A0450(Player *player, struct Actor *actor) { s16 sp42; s16 sp36; Player *sp24; 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; f32 temp_f2_2; s16 temp_t2; s16 temp_v1; s16 temp_v1_2; s16 temp_v1_3; s16 temp_v1_4; s32 temp_f16; s32 temp_lo; Player *phi_v0; temp_lo = (s32) (player - gPlayerOne) / 3544; temp_t2 = actor->type; switch (temp_t2) { case ACTOR_YOSHI_VALLEY_EGG: if (((player->unk_0BC << 0) >= 0) && ((player->unk_000 & 0x100) == 0)) { func_8029F408(player, actor); return; } default: return; case ACTOR_BANANA: if (((player->unk_0BC & 0x800008C0) == 0) && ((player->unk_00C & 1) == 0) && ((temp_v1 = actor->rot[0], ((s16) temp_lo != temp_v1)) || ((actor->flags & 0x1000) == 0))) { sp36 = temp_v1; sp42 = (s16) temp_lo; if (func_8029FB80(player, actor) == 1) { player->unk_00C |= 1; temp_v0 = &gPlayers[temp_v1]; if ((temp_v0->unk_000 & 0x4000) != 0) { if ((actor->flags & 0xF) != 0) { if ((s16) temp_lo != temp_v1) { func_800C90F4((Player *) (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) && ((s16) temp_lo != temp_v1)) { func_800C90F4((Player *) (temp_v1 & 0xFF), (temp_v0->characterId * 0x10) + 0x29008006); } } } func_8029FDC8(actor); return; } } break; case ACTOR_GREEN_SHELL: if (((player->unk_0BC & 0x80000400) == 0) && ((player->unk_00C & 4) == 0) && ((temp_v1_2 = actor->rot[2], ((s16) temp_lo != temp_v1_2)) || ((actor->flags & 0x1000) == 0))) { sp36 = temp_v1_2; sp42 = (s16) temp_lo; if (func_8029FB80(player, actor) == 1) { player->unk_00C |= 4; sp42 = (s16) temp_lo; sp36 = temp_v1_2; func_800C98B8(player->pos, player->unk_034, 0x19018010U); temp_v0_2 = &gPlayers[temp_v1_2]; if (((temp_v0_2->unk_000 & 0x4000) != 0) && ((s16) temp_lo != temp_v1_2)) { func_800C90F4((Player *) (temp_v1_2 & 0xFF), (temp_v0_2->characterId * 0x10) + 0x29008006); } func_8029FDC8(actor); return; } } break; case ACTOR_BLUE_SPINY_SHELL: if (((player->unk_00C & 2) == 0) && ((temp_v1_3 = actor->rot[2], ((s16) temp_lo != temp_v1_3)) || ((actor->flags & 0x1000) == 0)) && (sp36 = temp_v1_3, sp42 = (s16) temp_lo, (func_8029FB80(player, actor) == 1))) { if ((player->unk_0BC << 0) >= 0) { player->unk_00C |= 2; sp42 = (s16) temp_lo; sp36 = temp_v1_3; func_800C98B8(player->pos, player->unk_034, 0x19018010U); } temp_v0_3 = &gPlayers[temp_v1_3]; if (((temp_v0_3->unk_000 & 0x4000) != 0) && ((s16) temp_lo != temp_v1_3)) { sp42 = (s16) temp_lo; func_800C90F4((Player *) (temp_v1_3 & 0xFF), (temp_v0_3->characterId * 0x10) + 0x29008006); } if ((s16) temp_lo == actor->unk_04) { func_8029FDC8(actor); return; } } break; case ACTOR_RED_SHELL: if (((player->unk_0BC << 7) >= 0) && ((player->unk_00C & 2) == 0) && ((temp_v1_4 = actor->rot[2], ((s16) temp_lo != temp_v1_4)) || ((actor->flags & 0x1000) == 0))) { sp36 = temp_v1_4; sp42 = (s16) temp_lo; if (func_8029FB80(player, actor) == 1) { if ((player->unk_0BC << 0) >= 0) { player->unk_00C |= 2; sp42 = (s16) temp_lo; sp36 = temp_v1_4; func_800C98B8(player->pos, player->unk_034, 0x19018010U); } temp_v0_4 = &gPlayers[temp_v1_4]; if (((temp_v0_4->unk_000 & 0x4000) != 0) && ((s16) temp_lo != temp_v1_4)) { func_800C90F4((Player *) (temp_v1_4 & 0xFF), (temp_v0_4->characterId * 0x10) + 0x29008006); } func_8029FDC8(actor); return; } } break; case ACTOR_PIRANHA_PLANT: if ((player->unk_0BC << 0) >= 0) { func_8029F2FC(player, actor); return; } break; case ACTOR_MARIO_RACEWAY_SIGN: if ((player->unk_0BC << 0) >= 0) { func_8029F1F8(player, actor); return; } break; case 2: case 3: case 4: case 19: case 25: case 26: case 28: case 29: case 30: case 31: case 32: case 33: if ((player->unk_0BC << 0) >= 0) { func_8029F69C(player, actor); return; } break; case ACTOR_FALLING_ROCK: if (((player->unk_0BC << 0) >= 0) && ((player->unk_000 & 0x100) == 0) && (func_8029FB80(player, actor) == 1)) { func_800C98B8(actor->pos, actor->velocity, 0x19009005U); 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; } break; case ACTOR_FAKE_ITEM_BOX: if (((player->unk_0BC << 0) >= 0) && ((temp_f16 = (s32) actor->velocity[0], ((s16) temp_lo != (s16) temp_f16)) || ((actor->flags & 0x1000) == 0))) { sp36 = (s16) temp_f16; sp42 = (s16) temp_lo; if (func_8029FB80(player, 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 ((s16) temp_lo != (s16) temp_f16) { sp24 = temp_v0_5; func_800C90F4((Player *) ((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) && ((s16) temp_lo != (s16) temp_f16)) { sp24 = temp_v0_5; func_800C90F4((Player *) ((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; } } break; case ACTOR_HOT_AIR_BALLOON_ITEM_BOX: if (func_8029FB80(player, actor) == (s32) 1) { actor->state = 3; actor->flags = -0x8000; actor->unk_04 = 0; if ((player->unk_000 & 0x4000) != 0) { func_8007ABFC((s32) (player - gPlayerOne) / 3544, 7); return; } } else if (actor->state == 0) { actor->state = 1; actor->flags = -0x8000; } break; case ACTOR_ITEM_BOX: if (func_8029FB80(player, actor) == (s32) 1) { actor->state = 3; actor->flags = -0x8000; actor->unk_04 = 0; if ((player->unk_000 & 0x4000) != 0) { func_8007ABFC((s32) (player - gPlayerOne) / 3544, 0); return; } } else if (actor->state == 0) { actor->state = 1; actor->flags = -0x8000; } break; } } #else GLOBAL_ASM("asm/non_matchings/code_actors/func_802A0450.s") #endif void func_802A0D54(void) { struct Actor *temp_a1; s32 i, j; Player *phi_s1; for (i = 0; i < 8; i++) { phi_s1 = &gPlayers[i]; if (((phi_s1->unk_000 & 0x8000) != 0) && ((phi_s1->unk_0BC & 0x4000000) == 0)) { func_802977E4(phi_s1); for (j = 0; j < ACTOR_LIST_SIZE; j++) { temp_a1 = &gActorList[j]; if ((phi_s1->unk_0BC & 0x4000000) == 0) { // temp_v0 = temp_a1->unk2; if (((temp_a1->flags & 0x8000) != 0) && ((temp_a1->flags & 0x4000) != 0)) { func_802A0450(phi_s1, temp_a1); } } } } } } void func_802A0E44(void) { struct Actor *phi_s0; struct Actor *temp_a1; s32 i, j; s32 pad; for (i = gNumPermanentActors; i < (ACTOR_LIST_SIZE - 1); i++) { phi_s0 = &gActorList[i]; if ((phi_s0->flags & 0x8000) == 0) { continue; } if ((phi_s0->flags & 0x4000) == 0) { continue; } switch(phi_s0->type) { case ACTOR_BANANA: case ACTOR_GREEN_SHELL: case ACTOR_RED_SHELL: case ACTOR_BLUE_SPINY_SHELL: case ACTOR_FAKE_ITEM_BOX: for (j = i + 1; j < ACTOR_LIST_SIZE; j++) { temp_a1 = &gActorList[j]; if ((phi_s0->flags & 0x8000) == 0) {continue;} if ((phi_s0->flags & 0x4000) == 0) {continue;} if ((temp_a1->flags & 0x8000) == 0) { continue; } if ((temp_a1->flags & 0x4000) == 0) { continue; } switch(temp_a1->type) { case ACTOR_BANANA: if (phi_s0->type == ACTOR_BANANA) { continue; } func_802A0350(phi_s0, temp_a1); break; case ACTOR_GREEN_SHELL: if (phi_s0->type == ACTOR_GREEN_SHELL) { if (phi_s0->rot[2] == temp_a1->rot[2]) { continue; } } func_802A0350(phi_s0, temp_a1); break; case ACTOR_RED_SHELL: if (phi_s0->type == ACTOR_RED_SHELL) { if (phi_s0->rot[2] == temp_a1->rot[2]) { continue; } } func_802A0350(phi_s0, temp_a1); break; case ACTOR_BLUE_SPINY_SHELL: case ACTOR_FAKE_ITEM_BOX: func_802A0350(phi_s0, temp_a1); break; } } break; } } } void func_802A1064(struct FakeItemBox *fake_item_box) { if (fake_item_box - (struct FakeItemBox*)gActorList <= (u32)ACTOR_LIST_SIZE) { if (((fake_item_box->flags & 0x8000) != 0) && (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; } } } 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; s32 pad[7]; f32 temp_f2_2; f32 temp_f14; f32 temp_f16; f32 temp_f18; s32 pad2[3]; switch(fake_item_box->state) { case 0: fake_item_box->boundingBoxSize = fake_item_box->sizeScaling * 5.5f; fake_item_box->rot[0] -= 0xB6; fake_item_box->rot[1] += 0x16C; fake_item_box->rot[2] -= 0xB6; temp_f14 = temp_v0_4->pos[0] - fake_item_box->pos[0]; temp_f16 = temp_v0_4->pos[1] - fake_item_box->pos[1]; temp_f18 = temp_v0_4->pos[2] - fake_item_box->pos[2]; temp_f2_2 = sqrtf((temp_f14 * temp_f14) + (temp_f16 * temp_f16) + (temp_f18 * temp_f18)) / 10.0f; temp_f14 /= temp_f2_2; temp_f16 /= temp_f2_2; temp_f18 /= temp_f2_2; fake_item_box->pos[0] = temp_v0_4->pos[0] - temp_f14; fake_item_box->pos[1] = (temp_v0_4->pos[1] - temp_f16) - 1.0f; fake_item_box->pos[2] = temp_v0_4->pos[2] - temp_f18; func_802ADDC8(&fake_item_box->unk30, fake_item_box->boundingBoxSize, fake_item_box->pos[0], fake_item_box->pos[1], fake_item_box->pos[2]); func_802B4E30(fake_item_box); temp_v1_3 = &gControllers[temp_v1]; if ((temp_v0_4->unk_000 & 0x4000) != 0) { if ((temp_v1_3->buttonDepressed & Z_TRIG) != 0) { temp_v1_3->buttonDepressed &= 0xDFFF; func_802A1064(fake_item_box); temp_v0_4->unk_00C &= 0xFFFBFFFF; func_800C9060((u8)(temp_v0_4 - gPlayerOne), 0x19008012); } } break; case 1: if (fake_item_box->sizeScaling < 1.0f) { fake_item_box->sizeScaling += D_802B99D0; } else if (fake_item_box->sizeScaling >= 1.0f) { fake_item_box->sizeScaling = 1.0f; } fake_item_box->boundingBoxSize = fake_item_box->sizeScaling * 5.5f; if (fake_item_box->targetY <= fake_item_box->pos[1]) { fake_item_box->pos[1] = fake_item_box->targetY; } else { fake_item_box->pos[1] += D_802B99D4; } if ((fake_item_box->flags & 0x1000) != 0) { if ((fake_item_box->someTimer <= 0) || (fake_item_box->someTimer >= 0x12D)) { fake_item_box->flags &= 0xEFFF; fake_item_box->someTimer = 0; } else { fake_item_box->someTimer--; } } fake_item_box->rot[0] -= 0xB6; fake_item_box->rot[1] += 0x16C; fake_item_box->rot[2] -= 0xB6; break; case 2: if ((fake_item_box->someTimer >= 0x14) || (fake_item_box->someTimer < 0)) { destroy_actor(fake_item_box); } else { fake_item_box->someTimer++; fake_item_box->rot[0] += 0x444; fake_item_box->rot[1] -= 0x2D8; fake_item_box->rot[2] += 0x16C; } break; default: destroy_actor(fake_item_box); break; } } void func_802A14BC(f32 arg0, f32 arg1, f32 arg2) { Vec3f sp34; Vec3f sp28; Vec3s sp20; s16 temp_a0; if (gModeSelection != TIME_TRIALS) { vec3s_set(sp20, 0, 0, 0); vec3f_set(sp28, 0, 0, 0); sp34[0] = arg0; sp34[1] = arg1; sp34[2] = arg2; temp_a0 = func_8029EC88(sp34, sp20, sp28, 43); D_802BA05C = &gActorList[temp_a0]; } } void update_obj_item_box_hot_air_balloon(struct ItemBox *itemBox) { switch(itemBox->state) { case 5: itemBox->rot[0] += 0xB6; itemBox->rot[1] -= 0x16C; itemBox->rot[2] += 0xB6; break; case 3: if (itemBox->someTimer == 0x14) { itemBox->state = 5; itemBox->flags = -0x4000; } else { itemBox->someTimer++; itemBox->rot[0] += 0x444; itemBox->rot[1] -= 0x2D8; itemBox->rot[2] += 0x16C; } break; } } void update_obj_item_box(struct ItemBox *itemBox) { switch (itemBox->state) { case 0: itemBox->state = 1; break; case 1: if ((itemBox->pos[1] - itemBox->origY) < D_802B99D8) { itemBox->pos[1] += D_802B99DC; } else { itemBox->pos[1] = itemBox->origY + D_802B99D8; itemBox->state = 2; itemBox->flags = 0xC000; } break; case 2: itemBox->rot[0] += 0xB6; itemBox->rot[1] -= 0x16C; itemBox->rot[2] += 0xB6; break; case 3: if (itemBox->someTimer == 20) { itemBox->state = 0; itemBox->pos[1] = itemBox->resetDistance - 20.0f; itemBox->flags = 0xC000; } else { itemBox->someTimer++; itemBox->rot[0] += 0x444; itemBox->rot[1] -= 0x2D8; itemBox->rot[2] += 0x16C; } break; } } #ifdef MIPS_TO_C //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; extern ? D_0D003128; extern ? D_0D003158; extern ? D_0D003188; extern ? D_0D0031B8; extern ? D_0D0031E8; 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(Camera *camera, struct Actor *actor) { s16 sp184; s16 sp182; s16 sp180; f32 sp170; f32 sp16C; f32 sp168; f32 spA4; 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; f32 *temp_a2_4; f32 temp_f0; f32 temp_f0_2; f32 temp_f0_3; f32 temp_f12; f32 temp_f2; f32 temp_f2_2; s16 temp_v1; f32 phi_f0; temp_a1 = actor->pos; sp38 = temp_a1; 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 = actor->pos[1]; if (((f32) D_8015F6EC + 800.0f) < temp_f0) { func_80297230(camera, actor); return; } if (temp_f0 < ((f32) D_8015F6EE - 800.0f)) { func_80297230(camera, actor); return; } func_802972B8(camera, actor); sp180 = 0; sp184 = 0; 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_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_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; } } } } } } } } #else GLOBAL_ASM("asm/non_matchings/code_actors/func_802A171C.s") #endif #ifdef MIPS_TO_C //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(Camera *camera, struct ItemBox *item_box) { f32 sp17C; f32 sp178; f32 sp174; f32 sp170; f32 sp16C; f32 sp168; s16 sp164; s16 sp162; s16 sp160; f32 sp15C; 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; f32 *temp_a2_4; f32 *temp_a2_5; f32 temp_f0; f32 temp_f0_2; f32 temp_f0_3; f32 temp_f12; f32 temp_f2; f32 temp_f2_2; s16 *temp_a2; s16 temp_a0; s16 temp_v1; s16 phi_a0; s16 phi_a0_2; struct ItemBox *phi_t1; f32 phi_f0; temp_a1 = item_box->pos; sp38 = temp_a1; 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 = item_box->state; phi_a0 = temp_a0; if ((temp_a0 == 2) && (temp_f0 < D_802B9A08)) { sp160 = 0; sp164 = 0; 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 = item_box; if (phi_a0 == 5) { 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((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)) { 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)) { 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)) { 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)) { temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; temp_v0_9->words.w0 = 0xB900031D; temp_v0_9->words.w1 = 0x00552078; } else { 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; } 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 { 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((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 { 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 = 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; sp34 = temp_f2_2; sp178 = D_802B9A14 * sp15C; sp17C = temp_f12; sp30 = temp_f12; 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((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 { 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((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((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 = sp38; sp17C = sp30; 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; } } } } } } } } } } } #else GLOBAL_ASM("asm/non_matchings/code_actors/func_802A1EA0.s") #endif void func_802A269C(Camera *arg0, struct Actor *arg1) { Mat4 sp38; 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->pos, arg1->rot); if (func_802B4FF8(sp38, 0) != 0) { gSPDisplayList(gDisplayListHead++, D_0600CA60); } } } 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, egg->pos, arg0->rotX[1], 200.0f, D_80150130[arg0 - camera1], D_802B9A2C); if (temp_f0 < 0.0f) { return; } } else { arg3 = 15; temp_f0 = 0.0f; } gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); if ((arg3 > 12) && (arg3 < 20)) { if (temp_f0 < 640000.0f) { sp54[0] = egg->pos[0]; sp54[1] = 3.0f; sp54[2] = egg->pos[2]; func_802976D8(sp5C); func_8029794C(sp54, sp5C, 10.0f); } sp5C[0] = 0; sp5C[1] = egg->eggRot; sp5C[2] = 0; 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] = 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); gSPDisplayList(gDisplayListHead++, D_06017FA8); } } } void func_802A29BC(Camera *arg0, Mat4 arg1, struct Actor *arg2) { Mat4 sp40; f32 unk; s16 temp = arg2->flags; if (temp & 0x800) { return; } 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->pos, arg2->rot); if (func_802B4FF8(&sp40, 0) != 0) { gSPDisplayList(gDisplayListHead++, D_06009330); } } } s32 D_802B8850[] = {0, 0, 0}; s16 D_802B885C[] = {0, 0, 0}; void func_802A2AD0(Camera *arg0, struct Actor *arg1) { Vec3s sp80 = {0, 0, 0}; Mat4 sp40; 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->pos, arg1->rot); if (func_802B4FF8(sp40, 0) == 0) { return; } gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING); gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK); if (D_801637B8[arg1->state]) { if (arg1->unk_04 < 20) { gSPDisplayList(gDisplayListHead++, D_06010AE8); } else { gSPDisplayList(gDisplayListHead++, D_06010C10); } } else { gSPDisplayList(gDisplayListHead++, D_06010D38); } gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK); } void func_802A2C78(Camera *arg0, Mat4 arg1, struct Actor *arg2) { Vec3s spA8 = {0, 0, 0}; Mat4 sp68; f32 temp_f0; s16 temp_v0 = arg2->flags; if ((temp_v0 & 0x800)) { return; } 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->pos, arg2->rot, 2.0f); } func_802B5F74(sp68, arg2->pos, spA8); if (func_802B4FF8(sp68, 0) != 0) { gDPSetTextureLUT(gDisplayListHead++, G_TT_NONE); gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING); switch(arg2->unk_04) { case 0: gSPDisplayList(gDisplayListHead++, &D_060186B8); gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK); gSPDisplayList(gDisplayListHead++, &D_060185F8); gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK); break; case 1: gSPDisplayList(gDisplayListHead++, &D_06018A08); gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK); gSPDisplayList(gDisplayListHead++, &D_06018948); gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK); break; case 2: gSPDisplayList(gDisplayListHead++, &D_06018D58); gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK); gSPDisplayList(gDisplayListHead++, &D_06018C98); gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK); break; } } } } void func_802A2F34(struct UnkStruct_800DC5EC *arg0) { Camera *temp_s1 = arg0->camera; struct Actor *phi_s0; s32 i; D_8015F8DC = 0; for (i = 0; i < ACTOR_LIST_SIZE; i++) { phi_s0 = &gActorList[i]; if (phi_s0->flags == 0) { continue; } switch(phi_s0->type) { case ACTOR_FAKE_ITEM_BOX: func_802A171C(temp_s1, phi_s0); break; case ACTOR_ITEM_BOX: func_802A1EA0(temp_s1, phi_s0); break; case ACTOR_HOT_AIR_BALLOON_ITEM_BOX: func_802A1EA0(temp_s1, phi_s0); break; } } } void func_802A3008(struct UnkStruct_800DC5EC *arg0) { Camera *temp_s1 = arg0->camera; u16 sp92 = arg0->pathCounter; s32 pad[12]; s32 i; struct Actor *phi_s0; Vec3f sp4C = {0.0f, 5.0f, 10.0f}; f32 sp48 = sins(temp_s1->rotX[1] - 0x8000); // unk26; f32 temp_f0 = coss(temp_s1->rotX[1] - 0x8000); D_801502C0[0][0] = temp_f0; D_801502C0[0][2] = -sp48; D_801502C0[2][2] = temp_f0; D_801502C0[1][0] = 0.0f; D_801502C0[0][1] = 0.0f; D_801502C0[2][1] = 0.0f; D_801502C0[1][2] = 0.0f; D_801502C0[0][3] = 0.0f; D_801502C0[1][3] = 0.0f; D_801502C0[2][3] = 0.0f; // 2c D_801502C0[2][0] = sp48; D_801502C0[1][1] = 1.0f; D_801502C0[3][3] = 1.0f; // unk3c gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); gSPSetLights1(gDisplayListHead++, D_800DC610[1]); gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); if (gModeSelection != BATTLE) { func_80297340(temp_s1); } D_8015F8E0 = 0; for (i = 0; i < ACTOR_LIST_SIZE; i++) { phi_s0 = &gActorList[i]; if (phi_s0->flags == 0) { continue; } switch (phi_s0->type) { case 2: func_80299144(temp_s1, D_801502C0, phi_s0); break; case 3: func_8029930C(temp_s1, D_801502C0, phi_s0); break; case 4: func_802994D4(temp_s1, D_801502C0, phi_s0); break; case 19: func_8029969C(temp_s1, D_801502C0, phi_s0); break; case 26: func_80299864(temp_s1, D_801502C0, phi_s0); break; case 28: func_80299A2C(temp_s1, D_801502C0, phi_s0); break; case 33: func_80299BF4(temp_s1, D_801502C0, phi_s0); break; case 29: func_80299DBC(temp_s1, D_801502C0, phi_s0); break; case 30: func_80299EDC(temp_s1, D_801502C0, phi_s0); break; case 31: func_80299FFC(temp_s1, D_801502C0, phi_s0); break; case 32: func_8029A11C(temp_s1, D_801502C0, phi_s0); break; case ACTOR_FALLING_ROCK: func_8029CA90(temp_s1, (struct FallingRock *) phi_s0); break; case ACTOR_KIWANO_FRUIT: func_8029A23C(temp_s1, D_801502C0, phi_s0); break; case ACTOR_BANANA: func_8029A8F4(temp_s1, D_801502C0, phi_s0); break; case ACTOR_GREEN_SHELL: func_8029A690(temp_s1, D_801502C0, (struct ShellActor *) phi_s0); break; case ACTOR_RED_SHELL: func_8029A75C(temp_s1, D_801502C0, (struct ShellActor *) phi_s0); break; case ACTOR_BLUE_SPINY_SHELL: func_8029A828(temp_s1, D_801502C0, (struct ShellActor *) phi_s0); break; case ACTOR_PIRANHA_PLANT: func_80298328(temp_s1, D_801502C0, phi_s0); break; case ACTOR_TRAIN_ENGINE: func_8029B8E8(temp_s1, (struct TrainCar *) phi_s0); break; case ACTOR_TRAIN_TENDER: func_8029BFB0(temp_s1, (struct TrainCar *) phi_s0); break; case ACTOR_TRAIN_PASSENGER_CAR: func_8029C3CC(temp_s1, (struct TrainCar *) phi_s0); break; case 18: func_80297A50(temp_s1, D_801502C0, phi_s0); break; case 20: func_8029AC18(temp_s1, D_801502C0, phi_s0); break; case ACTOR_MARIO_RACEWAY_SIGN: func_802A29BC(temp_s1, D_801502C0, phi_s0); break; case ACTOR_WARIO_STADIUM_SIGN: func_802A269C(temp_s1, phi_s0); break; case 25: func_802A2C78(temp_s1, D_801502C0, phi_s0); break; case ACTOR_PADDLE_WHEEL_BOAT: func_8029AE1C(temp_s1, phi_s0, D_801502C0, sp92); break; case 37: func_8029B06C(temp_s1, phi_s0); break; case 40: func_8029B2E4(temp_s1, phi_s0); break; case 41: func_8029B6EC(temp_s1, phi_s0); break; case 44: func_8029B4E0(temp_s1, phi_s0); break; case 39: func_802A2AD0(temp_s1, phi_s0); break; case ACTOR_YOSHI_VALLEY_EGG: func_802A27A0(temp_s1, D_801502C0, phi_s0, sp92); break; } } switch (gCurrentCourseId) { case COURSE_MOO_MOO_FARM: func_802986B4(temp_s1, D_801502C0, phi_s0); break; case COURSE_DK_JUNGLE: func_80298D7C(temp_s1, D_801502C0, phi_s0); break; } } void update_simple_objects(void) { struct Actor *phi_s0; s32 i; for (i = 0; i < ACTOR_LIST_SIZE; i++) { phi_s0 = &gActorList[i]; if (phi_s0->flags == 0) { continue; } switch (phi_s0->type) { case ACTOR_FALLING_ROCK: update_obj_falling_rocks(phi_s0); break; case ACTOR_GREEN_SHELL: update_obj_green_shell(phi_s0); break; case ACTOR_RED_SHELL: update_obj_red_blue_shell(phi_s0); break; case ACTOR_BLUE_SPINY_SHELL: update_obj_red_blue_shell(phi_s0); break; case ACTOR_KIWANO_FRUIT: update_obj_kiwano_fruit(phi_s0); break; case ACTOR_BANANA: update_obj_banana(phi_s0); break; case ACTOR_PADDLE_WHEEL_BOAT: update_obj_paddle_wheel(phi_s0); break; case ACTOR_TRAIN_ENGINE: update_obj_train_engine(phi_s0); break; case ACTOR_TRAIN_TENDER: update_obj_train_car1(phi_s0); break; case ACTOR_TRAIN_PASSENGER_CAR: update_obj_train_car2(phi_s0); break; case ACTOR_ITEM_BOX: update_obj_item_box(phi_s0); break; case ACTOR_HOT_AIR_BALLOON_ITEM_BOX: update_obj_item_box_hot_air_balloon(phi_s0); break; case ACTOR_FAKE_ITEM_BOX: update_obj_fake_item_box(phi_s0); break; case ACTOR_PIRANHA_PLANT: update_obj_piranha_plant(phi_s0); break; case ACTOR_BANANA_BUNCH: update_obj_banana_bunch(phi_s0); break; case ACTOR_TRIPLE_GREEN_SHELL: update_obj_triple_shell(phi_s0, ACTOR_GREEN_SHELL); break; case ACTOR_TRIPLE_RED_SHELL: update_obj_triple_shell(phi_s0, ACTOR_RED_SHELL); break; case ACTOR_MARIO_RACEWAY_SIGN: update_obj_mario_raceway_sign(phi_s0); break; case ACTOR_WARIO_STADIUM_SIGN: update_obj_wario_stadium_sign(phi_s0); break; case ACTOR_RAILROAD_CROSSING: update_obj_railroad_crossing(phi_s0); break; case 2: case 3: case 4: case 19: case 25: case 26: case 27: case 28: case 29: case 30: case 31: case 32: case 33: update_obj_trees_cacti_shrubs(phi_s0); break; case ACTOR_YOSHI_VALLEY_EGG: update_obj_yoshi_valley_egg(phi_s0); break; } } func_802A0E44(); func_802B30EC(); }