diff options
| author | MegaMech <MegaMech@users.noreply.github.com> | 2022-04-26 16:48:36 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-26 15:48:36 -0700 |
| commit | 2f8a1bfcb663adea7bea935ef1dcb8a2f82d46cb (patch) | |
| tree | f5cd483c48f0c2b4b97089c9648e4ae990d92bcc /src | |
| parent | 626513f90aca28597857768ff5fd45acd1dd9b59 (diff) | |
Actor decomp (#183)
* Actor decomp
Diffstat (limited to 'src')
| -rw-r--r-- | src/audio/external.c | 3 | ||||
| -rw-r--r-- | src/code_80027D00.c | 44 | ||||
| -rw-r--r-- | src/code_800393C0.c | 72 | ||||
| -rw-r--r-- | src/code_80040E50.c | 1 | ||||
| -rw-r--r-- | src/code_80057C60.c | 202 | ||||
| -rw-r--r-- | src/code_80071F00.c | 10 | ||||
| -rw-r--r-- | src/code_8008C1D0.c | 8 | ||||
| -rw-r--r-- | src/code_80280000.c | 14 | ||||
| -rw-r--r-- | src/code_80281610.c | 12 | ||||
| -rw-r--r-- | src/code_80281780.c | 2 | ||||
| -rw-r--r-- | src/code_80281780.h | 2 | ||||
| -rw-r--r-- | src/code_80281C40.c | 6 | ||||
| -rw-r--r-- | src/code_80281FA0.c | 16 | ||||
| -rw-r--r-- | src/code_8028DF00.c | 2 | ||||
| -rw-r--r-- | src/code_80296A50.c | 2663 | ||||
| -rw-r--r-- | src/code_802A3730.c | 80 | ||||
| -rw-r--r-- | src/code_802B0210.c | 193 | ||||
| -rw-r--r-- | src/main.c | 14 | ||||
| -rw-r--r-- | src/math_util.c | 60 | ||||
| -rw-r--r-- | src/memory.c | 37 |
20 files changed, 1395 insertions, 2046 deletions
diff --git a/src/audio/external.c b/src/audio/external.c index ec11461f5..a10446013 100644 --- a/src/audio/external.c +++ b/src/audio/external.c @@ -5242,7 +5242,8 @@ extern ? D_800EA1C8; extern ? D_800EA1D4; extern ? D_800EA1DC; -void func_800C98B8(s32 arg0, ? arg1, s32 arg2) { +// Precursor to play_sound +void func_800C98B8(Vec3f arg0, Vec3f arg1, u32 arg2) { s32 temp_t0; void *temp_v0; s32 phi_s0; diff --git a/src/code_80027D00.c b/src/code_80027D00.c index 659918666..10525b42b 100644 --- a/src/code_80027D00.c +++ b/src/code_80027D00.c @@ -932,9 +932,9 @@ void func_8002934C(Player *player, s32 arg1, s8 arg2, s8 arg3) { } else { temp_v0 = phi_a3->unk244; if ((temp_v0 >= 0) && (temp_v0 < 0x101)) { - phi_f0 = player->rotY - player->posY; + phi_f0 = player->rotY - player->pos[1]; } else { - phi_f0 = player->posY - player->rotY; + phi_f0 = player->pos[1] - player->rotY; } sp24 = phi_a3; phi_a3->unkD4 = func_802B7C40(phi_f0 / phi_f2, 0x4000000) * 0.5; @@ -1124,9 +1124,9 @@ void func_80029B4C(Player *player, f32 arg1, f32 arg2, f32 arg3) { sp80 = player->boundingBoxCorners[0].cornerX; sp84 = player->boundingBoxCorners[0].cornerY; sp88 = player->boundingBoxCorners[0].cornerZ; - player->boundingBoxCorners[0].cornerX = sp8C + player->posX; - player->boundingBoxCorners[0].cornerY = sp90 + player->posY; - player->boundingBoxCorners[0].cornerZ = sp94 + player->posZ; + player->boundingBoxCorners[0].cornerX = sp8C + player->pos[0]; + player->boundingBoxCorners[0].cornerY = sp90 + player->pos[1]; + player->boundingBoxCorners[0].cornerZ = sp94 + player->pos[2]; func_802AFA34(player, player->boundingBoxCorners, sp80, sp84, sp88); temp_f14 = -sp48; temp_f2_2 = (f64) temp_f14; @@ -1140,9 +1140,9 @@ void func_80029B4C(Player *player, f32 arg1, f32 arg2, f32 arg3) { sp80 = player->boundingBoxCorners[1].cornerX; sp84 = player->boundingBoxCorners[1].cornerY; sp88 = player->boundingBoxCorners[1].cornerZ; - player->boundingBoxCorners[1].cornerX = sp8C + player->posX; - player->boundingBoxCorners[1].cornerY = sp90 + player->posY; - player->boundingBoxCorners[1].cornerZ = sp94 + player->posZ; + player->boundingBoxCorners[1].cornerX = sp8C + player->pos[0]; + player->boundingBoxCorners[1].cornerY = sp90 + player->pos[1]; + player->boundingBoxCorners[1].cornerZ = sp94 + player->pos[2]; func_802AFA34(player, &player->boundingBoxCorners[1], sp80, sp84, sp88); temp_a0_3 = &sp8C; temp_f12 = sp34 + 4.0f; @@ -1154,9 +1154,9 @@ void func_80029B4C(Player *player, f32 arg1, f32 arg2, f32 arg3) { sp80 = player->boundingBoxCorners[2].cornerX; sp84 = player->boundingBoxCorners[2].cornerY; sp88 = player->boundingBoxCorners[2].cornerZ; - player->boundingBoxCorners[2].cornerX = sp8C + player->posX; - player->boundingBoxCorners[2].cornerY = sp90 + player->posY; - player->boundingBoxCorners[2].cornerZ = sp94 + player->posZ; + player->boundingBoxCorners[2].cornerX = sp8C + player->pos[0]; + player->boundingBoxCorners[2].cornerY = sp90 + player->pos[1]; + player->boundingBoxCorners[2].cornerZ = sp94 + player->pos[2]; func_802AFA34(player, &player->boundingBoxCorners[2], sp80, sp84, sp88); temp_a0_4 = &sp8C; sp8C = (f32) (sp28 + 2.6); @@ -1166,9 +1166,9 @@ void func_80029B4C(Player *player, f32 arg1, f32 arg2, f32 arg3) { sp80 = player->boundingBoxCorners[3].cornerX; sp84 = player->boundingBoxCorners[3].cornerY; sp88 = player->boundingBoxCorners[3].cornerZ; - player->boundingBoxCorners[3].cornerX = sp8C + player->posX; - player->boundingBoxCorners[3].cornerY = sp90 + player->posY; - player->boundingBoxCorners[3].cornerZ = sp94 + player->posZ; + player->boundingBoxCorners[3].cornerX = sp8C + player->pos[0]; + player->boundingBoxCorners[3].cornerY = sp90 + player->pos[1]; + player->boundingBoxCorners[3].cornerZ = sp94 + player->pos[2]; func_802AFA34(player, &player->boundingBoxCorners[3], sp80, sp84, sp88); if ((player->unk_0BC & 8) == 0) { move_f32_towards(&player->unk_230, (player->boundingBoxCorners[0].cornerGroundY + player->boundingBoxCorners[2].cornerGroundY) / 2.0f, 0.5f); @@ -1619,7 +1619,7 @@ void func_8002AB70(Player *player) { move_f32_towards(&player->unk_DAC, 1.0f, 0.07f); } } else { - if (player->unk_124 >= 50.0f) { + if (player->unk_110.unk44 >= 50.0f) { player->unk_DAC = 2.0f; } move_f32_towards(&player->unk_100, gKartGravityTable[player->characterId], 0.02f); @@ -3207,10 +3207,10 @@ void func_8002D268(Player *player, s32 arg1, s8 arg2, s8 arg3) { if ((temp_v0_5 & 0x10) == 0x10) { player->unk_044 = temp_v0_5 & 0xFFEF; } - temp_f0_7 = player->posX; + temp_f0_7 = player->pos[0]; spF0 = temp_f0_7; - temp_f2_7 = player->posZ; - temp_f12_6 = player->posY; + temp_f2_7 = player->pos[2]; + temp_f12_6 = player->pos[1]; spE8 = temp_f2_7; player->rotX = temp_f0_7; player->rotZ = temp_f2_7; @@ -3353,7 +3353,7 @@ void func_8002D268(Player *player, s32 arg1, s8 arg2, s8 arg3) { player->posZ = spF4; } temp_v0_17 = player->unk_000; - player->posY = spF8; + player->pos[1] = spF8; if (((temp_v0_17 & 0x4000) != 0) && ((temp_v0_17 & 0x1000) == 0)) { func_8002BB9C(player, &spFC, &spF4, arg2, arg3, &sp98); } @@ -3404,9 +3404,9 @@ void func_8002E4C4(Player *player) { player->kartHopJerk = 0.0f; player->kartHopAcceleration = 0.0f; player->kartHopVelocity = 0.0f; - player->posY = func_802AE1C0(player->posX, D_80164510[player_index] + 10.0f, player->posZ) + player->unk_070; - if (((player->posY - D_80164510[player_index]) > 1200.0f) || ((player->posY - D_80164510[player_index]) < -1200.0f)) { - player->posY = player->rotY; + player->pos[1] = func_802AE1C0(player->pos[0], D_80164510[player_index] + 10.0f, player->pos[2]) + player->unk_070; + if (((player->pos[1] - D_80164510[player_index]) > 1200.0f) || ((player->pos[1] - D_80164510[player_index]) < -1200.0f)) { + player->pos[1] = player->rotY; } player->unk_038 = 0.0f; } diff --git a/src/code_800393C0.c b/src/code_800393C0.c index 9b8cd60f5..6f83a2718 100644 --- a/src/code_800393C0.c +++ b/src/code_800393C0.c @@ -49,10 +49,10 @@ void spawn_player(Player *player, s8 playerIndex, f32 arg2, f32 arg3, f32 arg4, break; } - player->posX = arg2; + player->pos[0] = arg2; ret = func_802AE1C0(arg2, arg4 + 50.0f, arg3) + player->unk_070; - player->posZ = arg3; - player->posY = ret; + player->pos[2] = arg3; + player->pos[1] = ret; player->rotX = arg2; player->rotY = ret; @@ -251,12 +251,12 @@ void spawn_player(Player *player, s8 playerIndex, f32 arg2, f32 arg3, f32 arg4, player->boundingBoxCorners[BACK_LEFT_TYRE].unk_14 = 0; player->boundingBoxCorners[BACK_RIGHT_TYRE].unk_14 = 0; - player->unk_110 = 0; - player->unk_112 = 0; - player->unk_114 = 0; - player->unk_116 = 0; - player->unk_118 = 0; - player->unk_11A = 0; + player->unk_110.unk30 = 0; + player->unk_110.unk32 = 0; + player->unk_110.unk34 = 0; + player->unk_110.unk36 = 0; + player->unk_110.unk38 = 0; + player->unk_110.unk3A = 0; player->boundingBoxCorners[FRONT_LEFT_TYRE].cornerX = 0.0f; player->boundingBoxCorners[FRONT_LEFT_TYRE].cornerY = 0.0f; @@ -279,18 +279,18 @@ void spawn_player(Player *player, s8 playerIndex, f32 arg2, f32 arg3, f32 arg4, player->boundingBoxCorners[BACK_LEFT_TYRE].cornerGroundY = 0.0f; player->boundingBoxCorners[BACK_RIGHT_TYRE].cornerGroundY = 0.0f; - player->unk_11C = 0.0f; - player->unk_120 = 0.0f; - player->unk_124 = 0.0f; - player->unk_128 = 0.0f; - player->unk_12C = 0.0f; - player->unk_130 = 0.0f; - player->unk_134 = 0.0f; - player->unk_138 = 0.0f; - player->unk_13C = 0.0f; - player->unk_140 = 0.0f; - player->unk_144 = 0.0f; - player->unk_148 = 0.0f; + player->unk_110.unk3C = 0.0f; + player->unk_110.unk40 = 0.0f; + player->unk_110.unk44 = 0.0f; + player->unk_110.unk48[0] = 0.0f; + player->unk_110.unk48[1] = 0.0f; + player->unk_110.unk48[2] = 0.0f; + player->unk_110.unk54[0] = 0.0f; + player->unk_110.unk54[1] = 0.0f; + player->unk_110.unk54[2] = 0.0f; + player->unk_110.unk60[0] = 0.0f; + player->unk_110.unk60[1] = 0.0f; + player->unk_110.unk60[2] = 0.0f; D_80165300[playerIndex] = 0; D_8018CE10[playerIndex].unk_04 = 0.0f; @@ -1115,17 +1115,17 @@ void func_8003D080(void) { switch (gModeSelection) { case GRAND_PRIX: func_8001C4D0(gPlayerOne->unk_0A4, gPlayerOne->unk_0A8, gPlayerOne->unk_0AC, gPlayerOne->unk_0BC, 1, 0); - func_8001C4D0(gPlayerTwo->posX, gPlayerTwo->posY, gPlayerTwo->posZ, gPlayerTwo->unk_02E, 1, 1); + func_8001C4D0(gPlayerTwo->pos[0], gPlayerTwo->pos[1], gPlayerTwo->pos[2], gPlayerTwo->unk_02E, 1, 1); break; case BATTLE: func_8001C4D0(gPlayerOne->unk_0A4, gPlayerOne->unk_0A8, gPlayerOne->unk_0AC, gPlayerOne->unk_0BC, 9, 0); - func_8001C4D0(gPlayerTwo->posX, gPlayerTwo->posY, gPlayerTwo->posZ, gPlayerTwo->unk_02E, 9, 1); + func_8001C4D0(gPlayerTwo->pos[0], gPlayerTwo->pos[1], gPlayerTwo->pos[2], gPlayerTwo->unk_02E, 9, 1); break; default: func_8001C4D0(gPlayerOne->unk_0A4, gPlayerOne->unk_0A8, gPlayerOne->unk_0AC, gPlayerOne->unk_0BC, 1, 0); - func_8001C4D0(gPlayerTwo->posX, gPlayerTwo->posY, gPlayerTwo->posZ, gPlayerTwo->unk_02E, 1, 1); + func_8001C4D0(gPlayerTwo->pos[0], gPlayerTwo->pos[1], gPlayerTwo->pos[2], gPlayerTwo->unk_02E, 1, 1); break; } break; @@ -1134,22 +1134,22 @@ void func_8003D080(void) { if (gModeSelection == BATTLE) { ptr = &gPlayerThree; func_8001C4D0(gPlayerOne->unk_0A4, gPlayerOne->unk_0A8, gPlayerOne->unk_0AC, gPlayerOne->unk_0BC, 9, 0); - func_8001C4D0(gPlayerTwo->posX, gPlayerTwo->posY, gPlayerTwo->posZ, gPlayerTwo->unk_02E, 9, 1); + func_8001C4D0(gPlayerTwo->pos[0], gPlayerTwo->pos[1], gPlayerTwo->pos[2], gPlayerTwo->unk_02E, 9, 1); ptr++; - func_8001C4D0(ptr->posX, ptr->posY, ptr->posZ, ptr->unk_02E, 9, 2); + func_8001C4D0(ptr->pos[0], ptr->pos[1], ptr->pos[2], ptr->unk_02E, 9, 2); ptr++; if (gPlayerCountSelection1 == 4) { - func_8001C4D0(ptr->posX, ptr->posY, ptr->posZ, ptr->unk_02E, 9, 3); + func_8001C4D0(ptr->pos[0], ptr->pos[1], ptr->pos[2], ptr->unk_02E, 9, 3); } } else { ptr = &gPlayerThree; func_8001C4D0(gPlayerOne->unk_0A4, gPlayerOne->unk_0A8, gPlayerOne->unk_0AC, gPlayerOne->unk_0BC, 1, 0); - func_8001C4D0(gPlayerTwo->posX, gPlayerTwo->posY, gPlayerTwo->posZ, gPlayerTwo->unk_02E, 1, 1); + func_8001C4D0(gPlayerTwo->pos[0], gPlayerTwo->pos[1], gPlayerTwo->pos[2], gPlayerTwo->unk_02E, 1, 1); ptr++; - func_8001C4D0(ptr->posX, ptr->posY, ptr->posZ, ptr->unk_02E, 1, 2); + func_8001C4D0(ptr->pos[0], ptr->pos[1], ptr->pos[2], ptr->unk_02E, 1, 2); ptr++; if (gPlayerCountSelection1 == 4) { - func_8001C4D0(ptr->posX, ptr->posY, ptr->posZ, ptr->unk_02E, 1, 3); + func_8001C4D0(ptr->pos[0], ptr->pos[1], ptr->pos[2], ptr->unk_02E, 1, 3); } } break; @@ -1163,17 +1163,17 @@ void func_8003D080(void) { case 1: case 2: func_8001C4D0(gPlayerOne->unk_0A4, gPlayerOne->unk_0A8, gPlayerOne->unk_0AC, gPlayerOne->unk_0BC, 3, 0); - func_8001C4D0(gPlayerTwo->posX, gPlayerTwo->posY, gPlayerTwo->posZ, gPlayerTwo->unk_02E, 3, 1); + func_8001C4D0(gPlayerTwo->pos[0], gPlayerTwo->pos[1], gPlayerTwo->pos[2], gPlayerTwo->unk_02E, 3, 1); break; case 3: ptr = &gPlayerThree; func_8001C4D0(gPlayerOne->unk_0A4, gPlayerOne->unk_0A8, gPlayerOne->unk_0AC, gPlayerOne->unk_0BC, 3, 0); - func_8001C4D0(gPlayerTwo->posX, gPlayerTwo->posY, gPlayerTwo->posZ, gPlayerTwo->unk_02E, 3, 1); + func_8001C4D0(gPlayerTwo->pos[0], gPlayerTwo->pos[1], gPlayerTwo->pos[2], gPlayerTwo->unk_02E, 3, 1); ptr++; - func_8001C4D0(ptr->posX, ptr->posY, ptr->posZ, ptr->unk_02E, 3, 2); + func_8001C4D0(ptr->pos[0], ptr->pos[1], ptr->pos[2], ptr->unk_02E, 3, 2); ptr++; - func_8001C4D0(ptr->posX, ptr->posY, ptr->posZ, ptr->unk_02E, 3, 3); + func_8001C4D0(ptr->pos[0], ptr->pos[1], ptr->pos[2], ptr->unk_02E, 3, 3); break; } } @@ -1242,8 +1242,8 @@ void func_8003DB5C(void) { Player *player = gPlayerOne; s32 i; - func_8001C4D0(player->posX, player->posY, player->posZ, player->unk_02E, 3, 0); - func_8001C4D0(player->posX, player->posY, player->posZ, player->unk_02E, 3, 1); + func_8001C4D0(player->pos[0], player->pos[1], player->pos[2], player->unk_02E, 3, 0); + func_8001C4D0(player->pos[0], player->pos[1], player->pos[2], player->unk_02E, 3, 1); for (i = 0; i < 8; i++, player++) { func_80027A20(player, i, 1, 0); diff --git a/src/code_80040E50.c b/src/code_80040E50.c index 361dfd7ba..45ed71625 100644 --- a/src/code_80040E50.c +++ b/src/code_80040E50.c @@ -192,7 +192,6 @@ UNUSED s32 s32_step_up_towards_alternate(s32 *value, s32 target, s32 *step) { } UNUSED s32 s32_step_down_towards_alternate(s32 *value, s32 target, s32 *step) { - s32 temp_t7; s32 targetReached = 0; if (target < *value) { diff --git a/src/code_80057C60.c b/src/code_80057C60.c index 311330e92..570e950ed 100644 --- a/src/code_80057C60.c +++ b/src/code_80057C60.c @@ -919,9 +919,9 @@ void func_80059820(s32 playerId) { D_8018CF14 = &camera1[playerId]; temp_v1 = D_8018CF1C; temp_v0 = &D_8018CA70[playerId]; - temp_v0->posXInt = (s32) temp_v1->posX; - temp_v0->posYInt = (s32) temp_v1->posY; - temp_v0->posZInt = (s32) temp_v1->posZ; + temp_v0->posXInt = (s32) temp_v1->pos[0]; + temp_v0->posYInt = (s32) temp_v1->pos[1]; + temp_v0->posZInt = (s32) temp_v1->pos[2]; } #else GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80059820.s") @@ -3184,9 +3184,9 @@ void func_8005D6C0(Player* arg0) { } void func_8005D794(Player* arg0, UnkPlayerStruct258* arg1, f32 arg2, f32 arg3, f32 arg4, s8 arg5, s8 arg6) { - arg1->unk_008 = arg4; - arg1->unk_000 = arg2; - arg1->unk_004 = arg3; + arg1->unk_000[2] = arg4; + arg1->unk_000[0] = arg2; + arg1->unk_000[1] = arg3; arg1->unk_020 = -arg0->unk_02E; arg1->unk_014 = arg5; arg1->unk_010 = arg6; @@ -4144,15 +4144,15 @@ void func_8005F90C(Player *player, s16 arg1, s32 arg2, s32 arg3) { phi_t1 = 0; if ((player->unk_0BC & 0x80) == 0x80) { phi_v0 = (s32) player->boundingBoxCorners[2].surfaceType; - phi_f12 = player->posZ; - phi_f0 = player->posX; - phi_f2 = player->posY - player->unk_070; + phi_f12 = player->pos[2]; + phi_f0 = player->pos[0]; + phi_f2 = player->pos[1] - player->unk_070; phi_t1 = 1; } else { phi_v0 = (s32) player->boundingBoxCorners[3].surfaceType; - phi_f12 = player->posZ; - phi_f0 = player->posX; - phi_f2 = player->posY - player->unk_070; + phi_f12 = player->pos[2]; + phi_f0 = player->pos[0]; + phi_f2 = player->pos[1] - player->unk_070; } switch (phi_v0) { case 2: @@ -4655,9 +4655,9 @@ void func_80060F50(Player* arg0, s16 arg1, UNUSED s8 arg2, s8 arg3) { func_8005D800(&arg0->unk_258[arg1], 0xFFFFFF, 0xFF); } - arg0->unk_258[arg1].unk_008 = (coss(arg0->unk_258[arg1].unk_020) * D_800EE5A8) + arg0->posZ; - arg0->unk_258[arg1].unk_000 = (sins(arg0->unk_258[arg1].unk_020) * D_800EE5B0) + arg0->posX; - arg0->unk_258[arg1].unk_004 = D_801652A0[arg3]; + arg0->unk_258[arg1].unk_000[2] = arg0->pos[2] + (coss(arg0->unk_258[arg1].unk_020) * D_800EE5A8); + arg0->unk_258[arg1].unk_000[0] = arg0->pos[0] + (sins(arg0->unk_258[arg1].unk_020) * D_800EE5B0); + arg0->unk_258[arg1].unk_000[1] = D_801652A0[arg3]; arg0->unk_0DE &= ~0x0008; } @@ -4677,9 +4677,9 @@ void func_80061130(Player* arg0, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { func_8005D7D8(&arg0->unk_258[arg1], 7, 0.6f); func_8005D800(&arg0->unk_258[arg1], 0xFFFFFF, 0xD0); - arg0->unk_258[arg1].unk_008 = (coss(arg0->unk_258[arg1].unk_020) * 6.0f) + arg0->posZ; - arg0->unk_258[arg1].unk_000 = (sins(arg0->unk_258[arg1].unk_020) * 6.0f) + arg0->posX; - arg0->unk_258[arg1].unk_004 = arg0->posY - 5.0f; + arg0->unk_258[arg1].unk_000[2] = arg0->pos[2] +(coss(arg0->unk_258[arg1].unk_020) * 6.0f); + arg0->unk_258[arg1].unk_000[0] = arg0->pos[0] + (sins(arg0->unk_258[arg1].unk_020) * 6.0f); + arg0->unk_258[arg1].unk_000[1] = arg0->pos[1] - 5.0f; arg0->unk_258[arg1].unk_040 = 0; arg0->unk_258[arg1].unk_024 = 0.0f; } @@ -5108,7 +5108,7 @@ void func_80061EF4(void *arg0, s16 arg1, s32 arg2, ? arg3) { GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80061EF4.s") #endif -void func_800621BC(Player *arg0, s16 arg1, s32 arg2, UNUSED s8 arg3) { +void func_800621BC(Player* arg0, s16 arg1, s32 arg2, UNUSED s8 arg3) { s32 temp_v1; s32 phi_t0; s32 phi_t1; @@ -5121,7 +5121,7 @@ void func_800621BC(Player *arg0, s16 arg1, s32 arg2, UNUSED s8 arg3) { if (temp_v1 == 1) { phi_t1 = 1; phi_t0 = 0; - phi_f2 = arg0->posY; + phi_f2 = arg0->pos[1]; } if (temp_v1 == 0) { @@ -5129,7 +5129,7 @@ void func_800621BC(Player *arg0, s16 arg1, s32 arg2, UNUSED s8 arg3) { if (1) { phi_t0 = 0; } - phi_f2 = arg0->posY; + phi_f2 = arg0->pos[1]; } if (phi_t0 == 0) { @@ -5145,8 +5145,8 @@ void func_800621BC(Player *arg0, s16 arg1, s32 arg2, UNUSED s8 arg3) { arg0->unk_258[30 + arg1].unk_020 -= 2184; } - arg0->unk_258[30 + arg1].unk_008 = (coss((arg0->unk_258[30 + arg1].unk_020 - arg0->unk_02E) - arg0->unk_0C0) * 5.0f) + arg0->posZ; - arg0->unk_258[30 + arg1].unk_000 = (sins((arg0->unk_258[30 + arg1].unk_020 - arg0->unk_02E) - arg0->unk_0C0) * 5.0f) + arg0->posX; + arg0->unk_258[30 + arg1].unk_000[2] = arg0->pos[2] + (coss((arg0->unk_258[30 + arg1].unk_020 - arg0->unk_02E) - arg0->unk_0C0) * 5.0f); + arg0->unk_258[30 + arg1].unk_000[0] = arg0->pos[0] + (sins((arg0->unk_258[30 + arg1].unk_020 - arg0->unk_02E) - arg0->unk_0C0) * 5.0f); return; } @@ -5163,17 +5163,17 @@ void func_800621BC(Player *arg0, s16 arg1, s32 arg2, UNUSED s8 arg3) { } new_var = new_var2; - new_var->unk_258[30 + arg1].unk_008 = (coss((new_var->unk_258[30 + arg1].unk_020 - new_var->unk_02E) - new_var->unk_0C0) * 5.0f) + new_var->posZ; - new_var->unk_258[30 + arg1].unk_000 = (sins((new_var->unk_258[30 + arg1].unk_020 - new_var->unk_02E) - new_var->unk_0C0) * 5.0f) + new_var->posX; + new_var->unk_258[30 + arg1].unk_000[2] = new_var->pos[2] + (coss((new_var->unk_258[30 + arg1].unk_020 - new_var->unk_02E) - new_var->unk_0C0) * 5.0f); + new_var->unk_258[30 + arg1].unk_000[0] = new_var->pos[0] + (sins((new_var->unk_258[30 + arg1].unk_020 - new_var->unk_02E) - new_var->unk_0C0) * 5.0f); } } } void func_80062484(Player* arg0, UnkPlayerStruct258* arg1, s32 arg2) { arg1->unk_01C = 1; - arg1->unk_004 = arg0->unk_074 + 1.0f; - arg1->unk_008 = arg0->posZ; - arg1->unk_000 = arg0->posX; + arg1->unk_000[1] = arg0->unk_074 + 1.0f; + arg1->unk_000[2] = arg0->pos[2]; + arg1->unk_000[0] = arg0->pos[0]; arg1->unk_020 = (arg2 * 0x1998) - arg0->unk_02E; arg1->unk_012 = 4; arg1->unk_01E = 0; @@ -5401,7 +5401,7 @@ void func_800629BC(Player* arg0, UNUSED s8 arg1, UNUSED s8 arg2, s8 arg3) { arg0->unk_258[20 + arg3].unk_012 = 6; arg0->unk_258[20 + arg3].unk_01E = 0; arg0->unk_258[20 + arg3].unk_00C = D_800EE604; - arg0->unk_258[20 + arg3].unk_004 = 0.0f; + arg0->unk_258[20 + arg3].unk_000[1] = 0.0f; } void func_80062A18(Player* arg0, s8 arg1, UNUSED s8 arg2, s8 arg3) { @@ -5411,9 +5411,9 @@ void func_80062A18(Player* arg0, s8 arg1, UNUSED s8 arg2, s8 arg3) { arg0->unk_258[20 + arg3].unk_01E = 1; arg0->unk_258[20 + arg3].unk_020 = 0; arg0->unk_0B6 &= ~0x0080; - arg0->unk_258[20 + arg3].unk_008 = arg0->posZ; - arg0->unk_258[20 + arg3].unk_000 = arg0->posX; - arg0->unk_258[20 + arg3].unk_004 = (arg0->posY + 4.0f); + arg0->unk_258[20 + arg3].unk_000[2] = arg0->pos[2]; + arg0->unk_258[20 + arg3].unk_000[0] = arg0->pos[0]; + arg0->unk_258[20 + arg3].unk_000[1] = (arg0->pos[1] + 4.0f); } void func_80062AA8(Player* arg0, UNUSED s8 arg1, UNUSED s8 arg2, s8 arg3) { @@ -5421,7 +5421,7 @@ void func_80062AA8(Player* arg0, UNUSED s8 arg1, UNUSED s8 arg2, s8 arg3) { arg0->unk_258[20 + arg3].unk_012 = 5; arg0->unk_258[20 + arg3].unk_00C = D_800EE60C; arg0->unk_258[20 + arg3].unk_01E = 0; - arg0->unk_258[20 + arg3].unk_004 = (arg0->posY + arg0->unk_070) - 2.5; + arg0->unk_258[20 + arg3].unk_000[1] = (arg0->pos[1] + arg0->unk_070) - 2.5; } void func_80062B18(f32 *arg0, f32 *arg1, f32 *arg2, f32 arg3, f32 arg4, f32 arg5, u16 arg6, u16 arg7) { @@ -5552,15 +5552,15 @@ void func_80062F98(Player* arg0, s16 arg1, s8 arg2, UNUSED s8 arg3) { temp_f0 = arg0->unk_258[10 + arg1].unk_018 / 10.0f; ++arg0->unk_258[10 + arg1].unk_01E; - arg0->unk_258[10 + arg1].unk_004 += temp_f0; + arg0->unk_258[10 + arg1].unk_000[1] += temp_f0; if ((arg0->unk_0CA & 1) == 1) { - arg0->unk_258[10 + arg1].unk_004 += (temp_f0 + D_800EE648); - if ((arg0->unk_258[10 + arg1].unk_01E == 0x10) || ((D_801652A0[arg2] - arg0->unk_258[10 + arg1].unk_004) < 3.0f)) { + arg0->unk_258[10 + arg1].unk_000[1] += (temp_f0 + D_800EE648); + if ((arg0->unk_258[10 + arg1].unk_01E == 0x10) || ((D_801652A0[arg2] - arg0->unk_258[10 + arg1].unk_000[1]) < 3.0f)) { arg0->unk_258[10 + arg1].unk_01C = 0; arg0->unk_258[10 + arg1].unk_01E = 0; arg0->unk_258[10 + arg1].unk_012 = 0; } - } else if ((arg0->unk_258[10 + arg1].unk_01E == 0xA) || ((D_801652A0[arg2] - arg0->unk_258[10 + arg1].unk_004) < 3.0f)) { + } else if ((arg0->unk_258[10 + arg1].unk_01E == 0xA) || ((D_801652A0[arg2] - arg0->unk_258[10 + arg1].unk_000[1]) < 3.0f)) { arg0->unk_258[10 + arg1].unk_01C = 0; arg0->unk_258[10 + arg1].unk_01E = 0; arg0->unk_258[10 + arg1].unk_012 = 0; @@ -5569,9 +5569,9 @@ void func_80062F98(Player* arg0, s16 arg1, s8 arg2, UNUSED s8 arg3) { void func_800630C0(Player* arg0, s16 arg1, s8 arg2, UNUSED s8 arg3) { ++arg0->unk_258[arg1].unk_01E; - arg0->unk_258[arg1].unk_008 = coss(arg0->unk_258[arg1].unk_020) * D_800EE650 + arg0->posZ; - arg0->unk_258[arg1].unk_000 = sins(arg0->unk_258[arg1].unk_020) * D_800EE658 + arg0->posX; - arg0->unk_258[arg1].unk_004 = D_801652A0[arg2]; + arg0->unk_258[arg1].unk_000[2] = arg0->pos[2] + coss(arg0->unk_258[arg1].unk_020) * D_800EE650; + arg0->unk_258[arg1].unk_000[0] = arg0->pos[0] + sins(arg0->unk_258[arg1].unk_020) * D_800EE658; + arg0->unk_258[arg1].unk_000[1] = D_801652A0[arg2]; if (arg0->unk_258[arg1].unk_01E == 15) { arg0->unk_258[arg1].unk_01C = 0; arg0->unk_258[arg1].unk_01E = 0; @@ -5611,9 +5611,9 @@ void func_80063268(Player* arg0, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { } arg0->unk_258[arg1].unk_024 += 0.25; - arg0->unk_258[arg1].unk_008 = (coss((arg0->unk_258[arg1].unk_020 + arg0->unk_258[arg1].unk_040)) * 5.5) + arg0->posZ; - arg0->unk_258[arg1].unk_000 = (sins((arg0->unk_258[arg1].unk_020 + arg0->unk_258[arg1].unk_040)) * 5.5) + arg0->posX; - arg0->unk_258[arg1].unk_004 = (arg0->unk_258[arg1].unk_024 + (arg0->posY - 5.0f)); + arg0->unk_258[arg1].unk_000[2] = arg0->pos[2] + (coss((arg0->unk_258[arg1].unk_020 + arg0->unk_258[arg1].unk_040)) * 5.5); + arg0->unk_258[arg1].unk_000[0] = arg0->pos[0] + (sins((arg0->unk_258[arg1].unk_020 + arg0->unk_258[arg1].unk_040)) * 5.5); + arg0->unk_258[arg1].unk_000[1] = ((arg0->pos[1] - 5.0f) + arg0->unk_258[arg1].unk_024); ++arg0->unk_258[arg1].unk_01E; arg0->unk_258[arg1].unk_00C += D_800EE660; arg0->unk_258[arg1].unk_03E -= 5; @@ -5631,15 +5631,15 @@ void func_80063268(Player* arg0, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { void func_80063408(Player* arg0, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { if (arg0->unk_258[10 + arg1].unk_010 == 1) { - arg0->unk_258[10 + arg1].unk_008 = arg0->boundingBoxCorners[2].cornerZ + (arg0->unk_258[10 + arg1].unk_01E * -7) * coss(arg0->unk_258[10 + arg1].unk_020); - arg0->unk_258[10 + arg1].unk_000 = arg0->boundingBoxCorners[2].cornerX + (arg0->unk_258[10 + arg1].unk_01E * -7) * sins(arg0->unk_258[10 + arg1].unk_020); + arg0->unk_258[10 + arg1].unk_000[2] = arg0->boundingBoxCorners[2].cornerZ + (arg0->unk_258[10 + arg1].unk_01E * -7) * coss(arg0->unk_258[10 + arg1].unk_020); + arg0->unk_258[10 + arg1].unk_000[0] = arg0->boundingBoxCorners[2].cornerX + (arg0->unk_258[10 + arg1].unk_01E * -7) * sins(arg0->unk_258[10 + arg1].unk_020); } else { - arg0->unk_258[10 + arg1].unk_008 = arg0->boundingBoxCorners[3].cornerZ + (arg0->unk_258[10 + arg1].unk_01E * -7) * coss(arg0->unk_258[10 + arg1].unk_020); - arg0->unk_258[10 + arg1].unk_000 = arg0->boundingBoxCorners[3].cornerX + (arg0->unk_258[10 + arg1].unk_01E * -7) * sins(arg0->unk_258[10 + arg1].unk_020); + arg0->unk_258[10 + arg1].unk_000[2] = arg0->boundingBoxCorners[3].cornerZ + (arg0->unk_258[10 + arg1].unk_01E * -7) * coss(arg0->unk_258[10 + arg1].unk_020); + arg0->unk_258[10 + arg1].unk_000[0] = arg0->boundingBoxCorners[3].cornerX + (arg0->unk_258[10 + arg1].unk_01E * -7) * sins(arg0->unk_258[10 + arg1].unk_020); } ++arg0->unk_258[10 + arg1].unk_01E; - arg0->unk_258[10 + arg1].unk_004 += 1.0f; + arg0->unk_258[10 + arg1].unk_000[1] += 1.0f; if (((arg0->unk_0BC & 0x80) != 0) || ((arg0->unk_0BC & 0x40) != 0)) { arg0->unk_258[10 + arg1].unk_01C = 0; @@ -5670,23 +5670,23 @@ void func_800635D4(Player* arg0, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { if (arg0->unk_258[10 + arg1].unk_010 == 1) { if ((arg0->unk_0BC * 2) < 0) { func_80062B18(&sp44, &sp40, &sp3C, -2.0f, 0.0f, (-arg0->unk_258[10 + arg1].unk_01E * (arg0->unk_094 / 18.0f) * 216.0f) / 16, -arg0->unk_258[10 + arg1].unk_020, 2 * -arg0->unk_206); - arg0->unk_258[10 + arg1].unk_000 = arg0->boundingBoxCorners[2].cornerX + sp44; - arg0->unk_258[10 + arg1].unk_008 = arg0->boundingBoxCorners[2].cornerZ + sp3C; + arg0->unk_258[10 + arg1].unk_000[0] = arg0->boundingBoxCorners[2].cornerX + sp44; + arg0->unk_258[10 + arg1].unk_000[2] = arg0->boundingBoxCorners[2].cornerZ + sp3C; } else { - arg0->unk_258[10 + arg1].unk_008 = arg0->boundingBoxCorners[2].cornerZ + ((-arg0->unk_258[10 + arg1].unk_01E * (arg0->unk_094 / 18.0f) * 216.0f) / 16) * coss(arg0->unk_258[10 + arg1].unk_020); - arg0->unk_258[10 + arg1].unk_000 = arg0->boundingBoxCorners[2].cornerX + ((-arg0->unk_258[10 + arg1].unk_01E * (arg0->unk_094 / 18.0f) * 216.0f) / 16) * sins(arg0->unk_258[10 + arg1].unk_020); + arg0->unk_258[10 + arg1].unk_000[2] = arg0->boundingBoxCorners[2].cornerZ + ((-arg0->unk_258[10 + arg1].unk_01E * (arg0->unk_094 / 18.0f) * 216.0f) / 16) * coss(arg0->unk_258[10 + arg1].unk_020); + arg0->unk_258[10 + arg1].unk_000[0] = arg0->boundingBoxCorners[2].cornerX + ((-arg0->unk_258[10 + arg1].unk_01E * (arg0->unk_094 / 18.0f) * 216.0f) / 16) * sins(arg0->unk_258[10 + arg1].unk_020); } } else if ((arg0->unk_0BC * 2) < 0) { func_80062B18(&sp44, &sp40, &sp3C, 2.0f, 0.0f, (-arg0->unk_258[10 + arg1].unk_01E * (arg0->unk_094 / 18.0f) * 216.0f) / 16, - arg0->unk_258[10 + arg1].unk_020, 2 * -arg0->unk_206); - arg0->unk_258[10 + arg1].unk_000 = arg0->boundingBoxCorners[3].cornerX + sp44; - arg0->unk_258[10 + arg1].unk_008 = arg0->boundingBoxCorners[3].cornerZ + sp3C; + arg0->unk_258[10 + arg1].unk_000[0] = arg0->boundingBoxCorners[3].cornerX + sp44; + arg0->unk_258[10 + arg1].unk_000[2] = arg0->boundingBoxCorners[3].cornerZ + sp3C; } else { - arg0->unk_258[10 + arg1].unk_008 = arg0->boundingBoxCorners[3].cornerZ + ((-arg0->unk_258[10 + arg1].unk_01E * (arg0->unk_094 / 18.0f) * 216.0f) / 16) * coss(arg0->unk_258[10 + arg1].unk_020); - arg0->unk_258[10 + arg1].unk_000 = arg0->boundingBoxCorners[3].cornerX + ((-arg0->unk_258[10 + arg1].unk_01E * (arg0->unk_094 / 18.0f) * 216.0f) / 16) * sins(arg0->unk_258[10 + arg1].unk_020); + arg0->unk_258[10 + arg1].unk_000[2] = arg0->boundingBoxCorners[3].cornerZ + ((-arg0->unk_258[10 + arg1].unk_01E * (arg0->unk_094 / 18.0f) * 216.0f) / 16) * coss(arg0->unk_258[10 + arg1].unk_020); + arg0->unk_258[10 + arg1].unk_000[0] = arg0->boundingBoxCorners[3].cornerX + ((-arg0->unk_258[10 + arg1].unk_01E * (arg0->unk_094 / 18.0f) * 216.0f) / 16) * sins(arg0->unk_258[10 + arg1].unk_020); } ++arg0->unk_258[10 + arg1].unk_01E; - arg0->unk_258[10 + arg1].unk_004 += D_800EE670; + arg0->unk_258[10 + arg1].unk_000[1] += D_800EE670; if (((arg0->unk_0BC & 0x80) != 0) || ((arg0->unk_0BC & 0x40) != 0)) { arg0->unk_258[10 + arg1].unk_01C = 0; arg0->unk_258[10 + arg1].unk_01E = 0; @@ -5718,14 +5718,14 @@ void func_800635D4(Player* arg0, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { void func_800639DC(Player* arg0, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { if (arg0->unk_258[10 + arg1].unk_010 == 1) { - arg0->unk_258[10 + arg1].unk_008 = arg0->boundingBoxCorners[2].cornerZ + (D_800EE680 * arg0->unk_258[10 + arg1].unk_01E) * coss(arg0->unk_258[10 + arg1].unk_020); - arg0->unk_258[10 + arg1].unk_000 = arg0->boundingBoxCorners[2].cornerX + (D_800EE684 * arg0->unk_258[10 + arg1].unk_01E) * sins(arg0->unk_258[10 + arg1].unk_020); + arg0->unk_258[10 + arg1].unk_000[2] = arg0->boundingBoxCorners[2].cornerZ + (D_800EE680 * arg0->unk_258[10 + arg1].unk_01E) * coss(arg0->unk_258[10 + arg1].unk_020); + arg0->unk_258[10 + arg1].unk_000[0] = arg0->boundingBoxCorners[2].cornerX + (D_800EE684 * arg0->unk_258[10 + arg1].unk_01E) * sins(arg0->unk_258[10 + arg1].unk_020); } else { - arg0->unk_258[10 + arg1].unk_008 = arg0->boundingBoxCorners[3].cornerZ + (D_800EE688 * arg0->unk_258[10 + arg1].unk_01E) * coss(arg0->unk_258[10 + arg1].unk_020); - arg0->unk_258[10 + arg1].unk_000 = arg0->boundingBoxCorners[3].cornerX + (D_800EE68C * arg0->unk_258[10 + arg1].unk_01E) * sins(arg0->unk_258[10 + arg1].unk_020); + arg0->unk_258[10 + arg1].unk_000[2] = arg0->boundingBoxCorners[3].cornerZ + (D_800EE688 * arg0->unk_258[10 + arg1].unk_01E) * coss(arg0->unk_258[10 + arg1].unk_020); + arg0->unk_258[10 + arg1].unk_000[0] = arg0->boundingBoxCorners[3].cornerX + (D_800EE68C * arg0->unk_258[10 + arg1].unk_01E) * sins(arg0->unk_258[10 + arg1].unk_020); } ++arg0->unk_258[10 + arg1].unk_01E; - arg0->unk_258[10 + arg1].unk_004 += D_800EE690; + arg0->unk_258[10 + arg1].unk_000[1] += D_800EE690; if (arg0->unk_258[10 + arg1].unk_01E == 8) { arg0->unk_258[10 + arg1].unk_01C = 0; arg0->unk_258[10 + arg1].unk_01E = 0; @@ -5753,15 +5753,15 @@ void func_800639DC(Player* arg0, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { void func_80063BD4(Player* arg0, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { if (arg0->unk_258[10 + arg1].unk_010 == 1) { - arg0->unk_258[10 + arg1].unk_008 = arg0->boundingBoxCorners[2].cornerZ + (-2 * arg0->unk_258[10 + arg1].unk_01E * coss(arg0->unk_258[10 + arg1].unk_020)); - arg0->unk_258[10 + arg1].unk_000 = arg0->boundingBoxCorners[2].cornerX + (-2 * arg0->unk_258[10 + arg1].unk_01E * sins(arg0->unk_258[10 + arg1].unk_020)); + arg0->unk_258[10 + arg1].unk_000[2] = arg0->boundingBoxCorners[2].cornerZ + (-2 * arg0->unk_258[10 + arg1].unk_01E * coss(arg0->unk_258[10 + arg1].unk_020)); + arg0->unk_258[10 + arg1].unk_000[0] = arg0->boundingBoxCorners[2].cornerX + (-2 * arg0->unk_258[10 + arg1].unk_01E * sins(arg0->unk_258[10 + arg1].unk_020)); } else { - arg0->unk_258[10 + arg1].unk_008 = arg0->boundingBoxCorners[3].cornerZ + (-2 * arg0->unk_258[10 + arg1].unk_01E * coss(arg0->unk_258[10 + arg1].unk_020)); - arg0->unk_258[10 + arg1].unk_000 = arg0->boundingBoxCorners[3].cornerX + (-2 * arg0->unk_258[10 + arg1].unk_01E * sins(arg0->unk_258[10 + arg1].unk_020)); + arg0->unk_258[10 + arg1].unk_000[2] = arg0->boundingBoxCorners[3].cornerZ + (-2 * arg0->unk_258[10 + arg1].unk_01E * coss(arg0->unk_258[10 + arg1].unk_020)); + arg0->unk_258[10 + arg1].unk_000[0] = arg0->boundingBoxCorners[3].cornerX + (-2 * arg0->unk_258[10 + arg1].unk_01E * sins(arg0->unk_258[10 + arg1].unk_020)); } ++arg0->unk_258[10 + arg1].unk_01E; - arg0->unk_258[10 + arg1].unk_004 += D_800EE6A0; + arg0->unk_258[10 + arg1].unk_000[1] += D_800EE6A0; if (arg0->unk_258[10 + arg1].unk_01E == 8) { arg0->unk_258[10 + arg1].unk_01C = 0; arg0->unk_258[10 + arg1].unk_01E = 0; @@ -5774,11 +5774,11 @@ void func_80063BD4(Player* arg0, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { void func_80063D58(Player* arg0, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { if (arg0->unk_258[10 + arg1].unk_010 == 1) { - arg0->unk_258[10 + arg1].unk_008 = arg0->boundingBoxCorners[2].cornerZ + ((-arg0->unk_258[10 + arg1].unk_01E * (arg0->unk_094 / 18.0f) * 216.0f) / 20.0f) * coss(arg0->unk_258[10 + arg1].unk_020); - arg0->unk_258[10 + arg1].unk_000 = arg0->boundingBoxCorners[2].cornerX + ((-arg0->unk_258[10 + arg1].unk_01E * (arg0->unk_094 / 18.0f) * 216.0f) / 20.0f) * sins(arg0->unk_258[10 + arg1].unk_020); + arg0->unk_258[10 + arg1].unk_000[2] = arg0->boundingBoxCorners[2].cornerZ + ((-arg0->unk_258[10 + arg1].unk_01E * (arg0->unk_094 / 18.0f) * 216.0f) / 20.0f) * coss(arg0->unk_258[10 + arg1].unk_020); + arg0->unk_258[10 + arg1].unk_000[0] = arg0->boundingBoxCorners[2].cornerX + ((-arg0->unk_258[10 + arg1].unk_01E * (arg0->unk_094 / 18.0f) * 216.0f) / 20.0f) * sins(arg0->unk_258[10 + arg1].unk_020); } else { - arg0->unk_258[10 + arg1].unk_008 = arg0->boundingBoxCorners[3].cornerZ + ((-arg0->unk_258[10 + arg1].unk_01E * (arg0->unk_094 / 18.0f) * 216.0f) / 20.0f) * coss(arg0->unk_258[10 + arg1].unk_020); - arg0->unk_258[10 + arg1].unk_000 = arg0->boundingBoxCorners[3].cornerX + ((-arg0->unk_258[10 + arg1].unk_01E * (arg0->unk_094 / 18.0f) * 216.0f) / 20.0f) * sins(arg0->unk_258[10 + arg1].unk_020); + arg0->unk_258[10 + arg1].unk_000[2] = arg0->boundingBoxCorners[3].cornerZ + ((-arg0->unk_258[10 + arg1].unk_01E * (arg0->unk_094 / 18.0f) * 216.0f) / 20.0f) * coss(arg0->unk_258[10 + arg1].unk_020); + arg0->unk_258[10 + arg1].unk_000[0] = arg0->boundingBoxCorners[3].cornerX + ((-arg0->unk_258[10 + arg1].unk_01E * (arg0->unk_094 / 18.0f) * 216.0f) / 20.0f) * sins(arg0->unk_258[10 + arg1].unk_020); } ++arg0->unk_258[10 + arg1].unk_01E; @@ -5791,9 +5791,9 @@ void func_80063D58(Player* arg0, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { arg0->unk_258[10 + arg1].unk_00C += D_800EE6B0; if (arg0->unk_258[10 + arg1].unk_01E >= 4) { arg0->unk_258[10 + arg1].unk_03E -= 18; - arg0->unk_258[10 + arg1].unk_004 -= D_800EE6B8; + arg0->unk_258[10 + arg1].unk_000[1] -= D_800EE6B8; } else { - arg0->unk_258[10 + arg1].unk_004 += D_800EE6C0; + arg0->unk_258[10 + arg1].unk_000[1] += D_800EE6C0; } if (arg0->unk_258[10 + arg1].unk_03E <= 0) { @@ -5840,17 +5840,17 @@ void func_80064184(Player* arg0, s16 arg1, s8 arg2, UNUSED s8 arg3) { f32 sp40; f32 sp3C; - sp40 = D_801652A0[arg2] - arg0->posY - 3.0f; + sp40 = D_801652A0[arg2] - arg0->pos[1] - 3.0f; if (((arg0->unk_0DE & 1) != 0) && (gCurrentCourseId != COURSE_KOOPA_BEACH)) { - sp40 = D_801652A0[arg2] - arg0->posY + D_800EE6C8; + sp40 = D_801652A0[arg2] - arg0->pos[1] + D_800EE6C8; } func_80062B18(&sp44, &sp40, &sp3C, 0.0f, sp40, -4.0f + ((-arg0->unk_258[arg1].unk_01E * (arg0->unk_094 / 18.0f) * 216.0f) / 10.0f), -arg0->unk_258[arg1].unk_020, 2 * -arg0->unk_206); - arg0->unk_258[arg1].unk_000 = arg0->posX + sp44; - arg0->unk_258[arg1].unk_008 = arg0->posZ + sp3C; - arg0->unk_258[arg1].unk_004 = arg0->posY + sp40; + arg0->unk_258[arg1].unk_000[0] = arg0->pos[0] + sp44; + arg0->unk_258[arg1].unk_000[2] = arg0->pos[2] + sp3C; + arg0->unk_258[arg1].unk_000[1] = arg0->pos[1] + sp40; ++arg0->unk_258[arg1].unk_01E; - if ((arg0->unk_258[arg1].unk_01E == 12) || (D_801652A0[arg2] <= (arg0->posY - arg0->unk_070))) { + if ((arg0->unk_258[arg1].unk_01E == 12) || (D_801652A0[arg2] <= (arg0->pos[1] - arg0->unk_070))) { arg0->unk_258[arg1].unk_01C = 0; arg0->unk_258[arg1].unk_01E = 0; arg0->unk_258[arg1].unk_012 = 0; @@ -5868,9 +5868,9 @@ void func_80064184(Player* arg0, s16 arg1, s8 arg2, UNUSED s8 arg3) { } void func_800643A8(Player* arg0, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { - arg0->unk_258[10 + arg1].unk_008 = (D_800EE6D8 * arg0->unk_258[10 + arg1].unk_01E * coss(arg0->unk_258[10 + arg1].unk_020) + arg0->posZ); - arg0->unk_258[10 + arg1].unk_000 = (D_800EE6E0 * arg0->unk_258[10 + arg1].unk_01E * sins(arg0->unk_258[10 + arg1].unk_020) + arg0->posX); - arg0->unk_258[10 + arg1].unk_004 = arg0->unk_258[10 + arg1].unk_004 + 0.5; + arg0->unk_258[10 + arg1].unk_000[2] = arg0->pos[2] + (D_800EE6D8 * arg0->unk_258[10 + arg1].unk_01E * coss(arg0->unk_258[10 + arg1].unk_020)); + arg0->unk_258[10 + arg1].unk_000[0] = arg0->pos[0] + (D_800EE6E0 * arg0->unk_258[10 + arg1].unk_01E * sins(arg0->unk_258[10 + arg1].unk_020)); + arg0->unk_258[10 + arg1].unk_000[1] = arg0->unk_258[10 + arg1].unk_000[1] + 0.5; ++arg0->unk_258[10 + arg1].unk_01E; if (arg0->unk_258[10 + arg1].unk_01E == 10) { @@ -5984,9 +5984,9 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80064664.s") void func_800647C8(Player* arg0, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { ++arg0->unk_258[30 + arg1].unk_01E; - arg0->unk_258[30 + arg1].unk_008 = ((D_800EE710 * (arg0->unk_258[30 + arg1].unk_01E)) * coss(arg0->unk_258[30 + arg1].unk_020)) + arg0->posZ; - arg0->unk_258[30 + arg1].unk_000 = ((D_800EE718 * (arg0->unk_258[30 + arg1].unk_01E)) * sins(arg0->unk_258[30 + arg1].unk_020) + arg0->posX); - arg0->unk_258[30 + arg1].unk_004 = (arg0->unk_074 + 2.0f); + arg0->unk_258[30 + arg1].unk_000[2] = arg0->pos[2] + ((D_800EE710 * (arg0->unk_258[30 + arg1].unk_01E)) * coss(arg0->unk_258[30 + arg1].unk_020)); + arg0->unk_258[30 + arg1].unk_000[0] = arg0->pos[0] + ((D_800EE718 * (arg0->unk_258[30 + arg1].unk_01E)) * sins(arg0->unk_258[30 + arg1].unk_020)); + arg0->unk_258[30 + arg1].unk_000[1] = (arg0->unk_074 + 2.0f); if (arg0->unk_258[30 + arg1].unk_01E == 14) { arg0->unk_258[30 + arg1].unk_01C = 0; @@ -6003,7 +6003,7 @@ void func_800647C8(Player* arg0, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { void func_800648E4(Player* arg0, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { ++arg0->unk_258[30 + arg1].unk_01E; arg0->unk_258[30 + arg1].unk_00C -= D_800EE720; - arg0->unk_258[30 + arg1].unk_004 += D_800EE728; + arg0->unk_258[30 + arg1].unk_000[1] += D_800EE728; arg0->unk_258[30 + arg1].unk_03E -= 12; if (arg0->unk_258[30 + arg1].unk_03E <= 0) { @@ -6019,7 +6019,7 @@ void func_800648E4(Player* arg0, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { void func_80064988(Player* arg0, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { ++arg0->unk_258[30 + arg1].unk_01E; - arg0->unk_258[30 + arg1].unk_004 -= D_800EE730; + arg0->unk_258[30 + arg1].unk_000[1] -= D_800EE730; if (arg0->unk_258[30 + arg1].unk_01E == 10) { arg0->unk_258[30 + arg1].unk_01C = 0; @@ -6032,9 +6032,9 @@ void func_800649F4(Player* arg0, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { f32 temp; temp = arg0->unk_258[30 + arg1].unk_018; - arg0->unk_258[30 + arg1].unk_008 = ((-temp * arg0->unk_258[30 + arg1].unk_01E) * (coss(arg0->unk_258[30 + arg1].unk_020) ) + arg0->unk_21C); - arg0->unk_258[30 + arg1].unk_000 = ((-temp * arg0->unk_258[30 + arg1].unk_01E) * (sins(arg0->unk_258[30 + arg1].unk_020)) + arg0->unk_218); - arg0->unk_258[30 + arg1].unk_004 = (arg0->unk_258[30 + arg1].unk_014 + arg0->posY); + arg0->unk_258[30 + arg1].unk_000[2] = arg0->unk_21C + (((-temp) * arg0->unk_258[30 + arg1].unk_01E) * coss(arg0->unk_258[30 + arg1].unk_020)); + arg0->unk_258[30 + arg1].unk_000[0] = arg0->unk_218 + (((-temp) * arg0->unk_258[30 + arg1].unk_01E) * sins(arg0->unk_258[30 + arg1].unk_020)); + arg0->unk_258[30 + arg1].unk_000[1] = arg0->pos[1] + arg0->unk_258[30 + arg1].unk_014; arg0->unk_258[30 + arg1].unk_00C += D_800EE738; ++arg0->unk_258[30 + arg1].unk_01E; @@ -6056,9 +6056,9 @@ void func_80064B30(Player* arg0, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { f32 temp; temp = arg0->unk_258[30 + arg1].unk_018 * D_800EE740; - arg0->unk_258[30 + arg1].unk_008 = ((-temp * arg0->unk_258[30 + arg1].unk_01E) * (coss(arg0->unk_258[30 + arg1].unk_020)) + arg0->posZ); - arg0->unk_258[30 + arg1].unk_000 = ((-temp * arg0->unk_258[30 + arg1].unk_01E) * (sins(arg0->unk_258[30 + arg1].unk_020)) + arg0->posX); - arg0->unk_258[30 + arg1].unk_004 += D_800EE748; + arg0->unk_258[30 + arg1].unk_000[2] = (arg0->pos[2] + (-temp * arg0->unk_258[30 + arg1].unk_01E) * (coss(arg0->unk_258[30 + arg1].unk_020))); + arg0->unk_258[30 + arg1].unk_000[0] = (arg0->pos[0] + (-temp * arg0->unk_258[30 + arg1].unk_01E) * (sins(arg0->unk_258[30 + arg1].unk_020))); + arg0->unk_258[30 + arg1].unk_000[1] += D_800EE748; ++arg0->unk_258[30 + arg1].unk_01E; if (arg0->unk_258[30 + arg1].unk_01E == 10) { @@ -6084,9 +6084,9 @@ void func_80064C74(Player* arg0, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { arg0->unk_258[30 + arg1].unk_020 -= 2184; } - arg0->unk_258[30 + arg1].unk_008 = (coss(arg0->unk_258[30 + arg1].unk_020 - arg0->unk_02E - arg0->unk_0C0) * 5.0f) + arg0->posZ; - arg0->unk_258[30 + arg1].unk_000 = (sins(arg0->unk_258[30 + arg1].unk_020 - arg0->unk_02E - arg0->unk_0C0) * 5.0f) + arg0->posX; - arg0->unk_258[30 + arg1].unk_004 = arg0->posY - 1.0f; + arg0->unk_258[30 + arg1].unk_000[2] = arg0->pos[2] + (coss(arg0->unk_258[30 + arg1].unk_020 - arg0->unk_02E - arg0->unk_0C0) * 5.0f); + arg0->unk_258[30 + arg1].unk_000[0] = arg0->pos[0] + (sins(arg0->unk_258[30 + arg1].unk_020 - arg0->unk_02E - arg0->unk_0C0) * 5.0f); + arg0->unk_258[30 + arg1].unk_000[1] = arg0->pos[1] - 1.0f; arg0->unk_258[30 + arg1].unk_00C += D_800EE750; ++arg0->unk_258[30 + arg1].unk_01E; @@ -6105,7 +6105,7 @@ void func_80064C74(Player* arg0, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { void func_80064DEC(Player* arg0, UNUSED s16 arg1, UNUSED s8 arg2, s8 arg3) { - arg0->unk_258[20 + arg3].unk_004 = arg0->posY; + arg0->unk_258[20 + arg3].unk_000[1] = arg0->pos[1]; ++arg0->unk_258[20 + arg3].unk_01E; if (arg0->unk_258[20 + arg3].unk_01E == 9) { @@ -6157,7 +6157,7 @@ void func_80064F88(Player* arg0, UNUSED s16 arg1, UNUSED s8 arg2, s8 arg3) { void func_80065030(Player* arg0, UNUSED s16 arg1, UNUSED s8 arg2, s8 arg3) { ++arg0->unk_258[20 + arg3].unk_01E; - arg0->unk_258[20 + arg3].unk_004 += D_800EE788; + arg0->unk_258[20 + arg3].unk_000[1] += D_800EE788; arg0->unk_258[20 + arg3].unk_00C += D_800EE790; if (arg0->unk_258[20 + arg3].unk_00C >= (f64) 1.5) { arg0->unk_258[20 + arg3].unk_00C = 1.5f; @@ -6172,9 +6172,9 @@ void func_80065030(Player* arg0, UNUSED s16 arg1, UNUSED s8 arg2, s8 arg3) { } void func_800650FC(Player* arg0, UNUSED s16 arg1, UNUSED s8 arg2, s8 arg3) { - arg0->unk_258[20 + arg3].unk_008 = (f32) arg0->posZ; - arg0->unk_258[20 + arg3].unk_000 = (f32) arg0->posX; - arg0->unk_258[20 + arg3].unk_004 = (f32) (arg0->posY + 4.0f); + arg0->unk_258[20 + arg3].unk_000[2] = (f32) arg0->pos[2]; + arg0->unk_258[20 + arg3].unk_000[0] = (f32) arg0->pos[0]; + arg0->unk_258[20 + arg3].unk_000[1] = (f32) (arg0->pos[1] + 4.0f); if ((arg0->unk_0BC & 0x80) == 0x80) { arg0->unk_258[20 + arg3].unk_020 += 4732; } else { diff --git a/src/code_80071F00.c b/src/code_80071F00.c index 01cbc5ce7..050fcc578 100644 --- a/src/code_80071F00.c +++ b/src/code_80071F00.c @@ -4143,27 +4143,27 @@ void func_80078C70(u32 arg0) { case 0: /* switch 1 */ sp1C = 0; sp18 = camera1; - D_8018D200 = D_80150130 + 40.0f; + D_8018D200 = D_80150130[0] + 40.0f; break; case 1: /* switch 1 */ sp1C = 0; sp18 = camera1; - D_8018D200 = D_80150130 + 40.0f; + D_8018D200 = D_80150130[0] + 40.0f; break; case 2: /* switch 1 */ sp18 = camera2; sp1C = D_8018D1F0; - D_8018D200 = D_80150134 + 40.0f; + D_8018D200 = D_80150130[1] + 40.0f; break; case 3: /* switch 1 */ sp1C = 0; sp18 = camera1; - D_8018D200 = D_80150130 + 40.0f; + D_8018D200 = D_80150130[0] + 40.0f; break; case 4: /* switch 1 */ sp18 = camera2; sp1C = D_8018D1F0; - D_8018D200 = D_80150134 + 40.0f; + D_8018D200 = D_80150130[1] + 40.0f; break; } temp_v0 = D_8018D200; diff --git a/src/code_8008C1D0.c b/src/code_8008C1D0.c index f7b7964cc..16f976896 100644 --- a/src/code_8008C1D0.c +++ b/src/code_8008C1D0.c @@ -854,7 +854,7 @@ void func_8008DC08(Player* player, s8 arg1) { player->unk_0C0 = 0; player->unk_08C = 0.0f; player->unk_09C = 0.0f; - if ((player->unk_124 >= 600.0f) || ((player->unk_0BC & 0x1000) != 0)) { D_8018D990[arg1] = 3; } // placed block on same line to match + if ((player->unk_110.unk44 >= 600.0f) || ((player->unk_0BC & 0x1000) != 0)) { D_8018D990[arg1] = 3; } // placed block on same line to match switch (D_8018D990[arg1]) { case 0: @@ -888,7 +888,7 @@ void func_8008DC08(Player* player, s8 arg1) { break; case 1: player->unk_DC4 = 4.5f; - player->posY += D_800EF570; + player->pos[1] += D_800EF570; ++player->unk_238; if ((player->unk_046 & 0x80) != 0) { @@ -920,12 +920,12 @@ void func_8008DC08(Player* player, s8 arg1) { player->unk_238 = 0; } - if (player->unk_124 >= 600.0f) { + if (player->unk_110.unk44 >= 600.0f) { D_8018D990[arg1] = 3; } player->unk_DC4 = 4.5f; - player->posY -= D_800EF580; + player->pos[1] -= D_800EF580; if ((player->unk_0BC & 8) != 8) { D_8018D990[arg1] = 3; diff --git a/src/code_80280000.c b/src/code_80280000.c index dcbe591bb..6636bece6 100644 --- a/src/code_80280000.c +++ b/src/code_80280000.c @@ -11,8 +11,8 @@ extern Gfx *gDisplayListHead; extern Camera cameras[];//, *camera1, *camera2, *camera3, *camera4; -extern f32 D_80150130, D_80150148, D_8015014C, D_80150150; - +extern f32 D_80150148, D_8015014C, D_80150150; +extern f32 D_80150130[4]; extern s16 gCreditsCourseId; extern u16 D_80150112; extern u16 D_80164AF0; @@ -52,7 +52,7 @@ void func_80280038(void) { func_802A3E3C(); func_80057FC4(0); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[1], &sp44[37], D_80150130, D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPool[1], &sp44[37], D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); gDPHalf1(gDisplayListHead++, sp44[37]); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->unk, camera->unk1, camera->unk2, camera->angleX, camera->angleY, camera->angleZ); @@ -103,9 +103,9 @@ void func_802802AC(void) { temp_f12 = camera->unk - camera->pos[0]; temp = camera->unk1 - camera->pos[1]; temp_f14 = camera->unk2 - camera->pos[2]; - camera->rotX2 = func_802B7830(temp_f12, temp_f14); - camera->rotX = func_802B7830(sqrtf((temp_f12 * temp_f12) + (temp_f14 * temp_f14)), temp); - camera->rotY = 0; + camera->rotX[1] = func_802B7830(temp_f12, temp_f14); + camera->rotX[0] = func_802B7830(sqrtf((temp_f12 * temp_f12) + (temp_f14 * temp_f14)), temp); + camera->rotX[2] = 0; if (D_802874A0 != 0) { D_800DC5E4++; } else { @@ -126,7 +126,7 @@ void func_80280420(void) { func_802A4D18(); func_802A74BC(); camera->unk30 = 60.0f; - D_80150130 = 60.0f; + D_80150130[0] = 60.0f; D_800DC5EC->screenWidth = 320; D_800DC5EC->screenHeight = 240; D_800DC5EC->screenStartX = 160; diff --git a/src/code_80281610.c b/src/code_80281610.c index 980eb0a53..7ccd7d6aa 100644 --- a/src/code_80281610.c +++ b/src/code_80281610.c @@ -18,14 +18,14 @@ void func_80281610(void) { temp_f12 = camera->unk - camera->pos[0]; temp = camera->unk1 - camera->pos[1]; temp_f14 = camera->unk2 - camera->pos[2]; - camera->rotX2 = func_802B7830(temp_f12, temp_f14); - camera->rotX = func_802B7830(sqrtf((temp_f12 * temp_f12) + (temp_f14 * temp_f14)), temp); - camera->rotY = 0; + camera->rotX[1] = func_802B7830(temp_f12, temp_f14); + camera->rotX[0] = func_802B7830(sqrtf((temp_f12 * temp_f12) + (temp_f14 * temp_f14)), temp); + camera->rotX[2] = 0; } // guPerspective params -extern f32 D_80150130, D_80150148, D_8015014C, D_80150150; - +extern f32 D_80150148, D_8015014C, D_80150150; +extern f32 D_80150130[]; // rodata extern const f32 D_80286B90, D_80286B94, D_80286B98, D_80286B9C, D_80286BA0; @@ -39,7 +39,7 @@ void func_802816B8(void) { cameras[0].angleX = 0.0f; cameras[0].angleY = 1.0f; cameras[0].angleZ = 0.0f; - D_80150130 = 40.0f; + D_80150130[0] = 40.0f; D_80150148 = D_80286B9C; D_80150150 = 3.0f; D_8015014C = D_80286BA0; diff --git a/src/code_80281780.c b/src/code_80281780.c index 0c1e2fe56..f79e43bc4 100644 --- a/src/code_80281780.c +++ b/src/code_80281780.c @@ -85,7 +85,7 @@ void load_ending_sequence_royalraceway(void) { func_802A4D18(); func_802A74BC(); camera->unk30 = 60.0f; - D_80150130 = 60.0f; + D_80150130[0] = 60.0f; D_800DC5EC->screenWidth = 320; D_800DC5EC->screenHeight = 240; D_800DC5EC->screenStartX = 160; diff --git a/src/code_80281780.h b/src/code_80281780.h index 6e1946b76..04a7f5652 100644 --- a/src/code_80281780.h +++ b/src/code_80281780.h @@ -33,7 +33,7 @@ extern struct UnkStruct_800DC5EC *D_800DC5EC; extern s32 gMenuSelectionFromEndingSequence; //D_80287550; extern s32 D_80287554; extern f32 D_801647A4; -extern f32 D_80150130; +extern f32 D_80150130[]; extern s32 gPrevLoadedAddress; extern s32 D_8015F734; diff --git a/src/code_80281C40.c b/src/code_80281C40.c index b14f2781c..efae661e2 100644 --- a/src/code_80281C40.c +++ b/src/code_80281C40.c @@ -24,9 +24,9 @@ extern Gfx D_00284EE0[]; extern Camera cameras[]; -extern f32 D_80150130, D_80150148, D_8015014C, D_80150150; - +extern f32 D_80150148, D_8015014C, D_80150150; +extern f32 D_80150130[]; void func_80281C40(void) { s32 i; @@ -64,7 +64,7 @@ void func_80281D00(void) { } func_8028150C(); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective((Mtx*) &gGfxPool->mtxPool[1], &sp64[39], D_80150130, D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective((Mtx*) &gGfxPool->mtxPool[1], &sp64[39], D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); gDPHalf1(gDisplayListHead++, sp64[39]); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt((Mtx*) &gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->unk, camera->unk1, camera->unk2, camera->angleX, camera->angleY, camera->angleZ); diff --git a/src/code_80281FA0.c b/src/code_80281FA0.c index cb8e2f35a..38e4278a7 100644 --- a/src/code_80281FA0.c +++ b/src/code_80281FA0.c @@ -1070,7 +1070,7 @@ void func_80283EA0(s32 arg0) { } void func_80283ED0(Vec3f arg0) { - func_80282008(arg0, &gPlayerTwo->posX); + func_80282008(arg0, &gPlayerTwo->pos[0]); } #ifdef MIPS_TO_C @@ -1078,9 +1078,9 @@ void func_80283ED0(Vec3f arg0) { ? func_802821A0(f32, f32, ?); // extern void func_80283EF8(s32 arg0) { - func_802821A0(gPlayerTwo->posX, 0.12f); - func_802821A0((bitwise f32) (arg0 + 4), gPlayerTwo->posY, 0x3DF5C28F); - func_802821A0((bitwise f32) (arg0 + 8), gPlayerTwo->posZ, 0x3DF5C28F); + func_802821A0(gPlayerTwo->pos[0], 0.12f); + func_802821A0((bitwise f32) (arg0 + 4), gPlayerTwo->pos[1], 0x3DF5C28F); + func_802821A0((bitwise f32) (arg0 + 8), gPlayerTwo->pos[2], 0x3DF5C28F); } #else GLOBAL_ASM("asm/non_matchings/code_80281FA0/func_80283EF8.s") @@ -1095,7 +1095,7 @@ void func_80283F6C(s32 arg0) { } void func_80283FCC(Vec3f arg0) { - func_80282008(arg0, &gPlayerThree->posX); + func_80282008(arg0, &gPlayerThree->pos[0]); } #ifdef MIPS_TO_C @@ -1219,9 +1219,9 @@ void func_80284308(void *arg0) { func_80282D90(arg0, &D_802858E0, &D_802858F8, 0); temp_v0 = *(sp30 + (D_802874F5 * 4)); //player = gPlayerOne; - temp_f0 = temp_v0->unk14 - player->posX; - temp_f12 = temp_v0->unk1C - player->posZ; - temp_f2 = temp_v0->unk18 - player->posY; + temp_f0 = temp_v0->unk14 - player->pos[0]; + temp_f12 = temp_v0->unk1C - player->pos[2]; + temp_f2 = temp_v0->unk18 - player->pos[1]; arg0->unkC = arg0->unkC + temp_f0; arg0->unk0 = arg0->unk0 + temp_f0; arg0->unk14 = arg0->unk14 + temp_f12; diff --git a/src/code_8028DF00.c b/src/code_8028DF00.c index d2f4abb33..75bc388e9 100644 --- a/src/code_8028DF00.c +++ b/src/code_8028DF00.c @@ -588,7 +588,7 @@ void func_8028EDA8(void) { } f32 func_8028EE8C(s32 arg0) { - f32 temp_v0 = gPlayers[arg0].posZ; + f32 temp_v0 = gPlayers[arg0].pos[2]; f32 temp_v1 = gPlayers[arg0].rotZ; f32 temp_f14 = D_8015F8D8 - temp_v0; f32 temp_f16 = temp_v1 - D_8015F8D8; diff --git a/src/code_80296A50.c b/src/code_80296A50.c index 6e1261ead..a2423dc6a 100644 --- a/src/code_80296A50.c +++ b/src/code_80296A50.c @@ -3,10 +3,33 @@ #include <PR/os.h> #include "types.h" #include <common_structs.h> -#include "actor_types.h" +#include <actor_types.h> #include <defines.h> +#include <PR/gbi.h> + +f32 func_802B80D0(Vec3f, Vec3f, u16, f32, f32, f32); // extern +void func_800C98B8(Vec3f, Vec3f, u32); // extern +void func_8029794C(Vec3f, Vec3s, f32); +s32 func_802B4FF8(Mat4, s32); + +void func_802B52BC(Vec3s, s16, s16, s16); +void load_giant_egg(Vec3f, f32, f32, f32); +s16 func_8029EC88(Vec3f, Vec3s, Vec3f, s16); +extern struct Actor *D_802BA05C; + +extern Player gPlayers[]; +extern Player *gPlayerOne; +extern struct Controller gControllers[]; + +extern s32 gActiveScreenMode; extern Camera *camera1; +extern struct Actor D_8015F9B8[]; +extern Gfx *gDisplayListHead; +extern s32 gModeSelection; +extern s16 gCurrentCourseId; +extern f32 D_80150130[]; +extern u16 D_801637B8[]; #ifdef MIPS_TO_C //generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 @@ -417,10 +440,10 @@ extern ? D_8015F8D0; extern s32 D_801625EC; extern s32 D_801625F0; extern s32 D_801625F4; -extern void *gDisplayListHead; + static u16 D_800DC5BC; /* type too large by 2; unable to generate initializer */ -void func_80297340(void *arg0) { +void func_80297340(Camera *arg0) { ? sp38; s16 sp36; void *temp_v0; @@ -472,11 +495,12 @@ void func_80297340(void *arg0) { GLOBAL_ASM("asm/non_matchings/code_actors/func_80297340.s") #endif -void func_802976D8(struct UnkStruct_802976D8 *arg0) { - arg0->unk0 = 0x4000; - arg0->unk2 = 0; - arg0->unk4 = 0; +void func_802976D8(Vec3s arg0) { + arg0[0] = 0x4000; + arg0[1] = 0; + arg0[2] = 0; } + #ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 ? func_802976D8(void *); // extern @@ -504,11 +528,11 @@ GLOBAL_ASM("asm/non_matchings/code_actors/func_802976EC.s") f32 func_802ABE30(f32, f32, f32, u16); // extern -void func_80297760(struct bigboi *arg0, struct bigboi *arg1) { - arg1->unk_000 = arg0->unk_018; - arg1->unk_004 = arg0->unk_01C; - arg1->unk_008 = arg0->unk_020; - arg1->unk_004 = func_802ABE30(arg1->unk_000, arg1->unk_004, arg1->unk_008, arg0->unk_03A); +void func_80297760(struct Actor *arg0, Vec3f arg1) { + arg1[0] = arg0->unk18[0]; + arg1[1] = arg0->unk18[1]; + arg1[2] = arg0->unk18[2]; + arg1[1] = func_802ABE30(arg1[0], arg1[1], arg1[2], arg0->unk30.unk3A); } void func_802977B0(Player *arg0) { @@ -567,62 +591,58 @@ void func_80297818(void) { GLOBAL_ASM("asm/non_matchings/code_actors/func_80297818.s") #endif -#ifdef MIPS_TO_C +//#ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_802B4FF8(? *, ?); // extern -? func_802B5F00(? *, s32); // extern -? func_802B5F74(? *, void *, ?, void *); // extern -extern ? D_0D007B20; -extern void *gDisplayListHead; - -void func_8029794C(void *arg0, ? arg1, s32 arg2) { - ? sp20; - void *temp_a1; - void *temp_a3; - void *temp_v1; - - temp_a3 = arg0; - temp_a1 = temp_a3; - arg0->unk4 = arg0->unk4 + 2.0f; - arg0 = temp_a3; - func_802B5F74(&sp20, temp_a1, arg1, temp_a3); - func_802B5F00(&sp20, arg2); - if (func_802B4FF8(&sp20, 0) != 0) { - temp_v1 = gDisplayListHead; - gDisplayListHead = temp_v1 + 8; - temp_v1->unk0 = 0x6000000; - temp_v1->unk4 = &D_0D007B20; - arg0->unk4 = arg0->unk4 - 2.0f; +//s32 func_802B4FF8(? *, ?); // extern +//? func_802B5F00(? *, s32); // extern +//? func_802B5F74(? *, void *, ?, void *); // extern +void func_802B5F74(Mat4, Vec3f, Vec3s); +void func_802B5F00(Mat4, f32); +extern s8 D_0D007B20[]; +// +// void func_8029794C(Vec3f, Vec3f, f32); +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; } } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/func_8029794C.s") -#endif +//#else +//GLOBAL_ASM("asm/non_matchings/code_actors/func_8029794C.s") +//#endif -#ifdef MIPS_TO_C +//#ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_802976EC(void *, ? *, void *); // extern -? func_80297760(void *, ? *); // extern -? func_8029794C(? *, ? *, ?); // extern +//? func_802976EC(void *, ? *, void *); // extern +//? func_80297760(void *, ? *); // extern +//? func_8029794C(? *, ? *, ?); // extern -void func_802979F8(void *arg0, ? arg1) { - ? sp24; - ? sp1C; - void *temp_a0; - void *temp_a2; +void func_802976EC(UnkActorInner*, Vec3s); - temp_a2 = arg0; - temp_a0 = arg0 + 0x30; - if (arg0->unk34 != 0) { - arg0 = temp_a2; - func_802976EC(temp_a0, &sp1C, temp_a2); - func_80297760(arg0, &sp24); - func_8029794C(&sp24, &sp1C, 0x3EE66666); +void func_802979F8(struct Actor *arg0, f32 arg1) { + Vec3f sp24; + Vec3s sp1C; + //void *temp_a0; + //void *temp_a2; + + //temp_a2 = arg0; + //temp_a0 = arg0 + 0x30; + if (arg0->unk30.unk34 != 0) { + + func_802976EC(&arg0->unk30, sp1C); // arg0 + 0x30 + func_80297760(arg0, sp24); + func_8029794C(sp24, sp1C, 0.45f); } } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/func_802979F8.s") -#endif +//#else +//GLOBAL_ASM("asm/non_matchings/code_actors/func_802979F8.s") +//#endif #ifdef MIPS_TO_C //generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 @@ -881,13 +901,14 @@ block_18: GLOBAL_ASM("asm/non_matchings/code_actors/update_obj_kiwano_fruit.s") #endif -void update_obj_paddle_wheel(struct choochoo *arg0) { +void update_obj_paddle_wheel(struct Actor *arg0) { arg0->unk6 += 0x38E; } -extern void func_800C9D80(f32 *arg0, f32 *arg1, s32 arg2); // extern +extern void func_800C9D80(Vec3f *arg0, Vec3f *arg1, u32 arg2); // extern -void update_obj_train_engine(struct choochooTrain *arg0) { +// wheels +void update_obj_train_engine(struct Actor *arg0) { arg0->unk6 -= 0x666; if (arg0->unk8 != 0.0f) { @@ -896,70 +917,62 @@ void update_obj_train_engine(struct choochooTrain *arg0) { } } -void update_obj_train_car1(struct choochoo *arg0) { +// wheels +void update_obj_train_car1(struct Actor *arg0) { arg0->unk6 -= 0x4FA; } -void update_obj_train_car2(struct choochoo *arg0) { +// wheels +void update_obj_train_car2(struct Actor *arg0) { arg0->unk6 -= 0x666; } -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void update_obj_piranha_plant(void *arg0) { - s16 temp_v0; +void update_obj_piranha_plant(void *data) { + struct piranha_plant *arg0 = (struct piranha_plant *) data; + s16 temp_v0 = arg0->unk2; - temp_v0 = arg0->unk2; if ((temp_v0 & 0x800) == 0) { if ((temp_v0 & 0x400) != 0) { - arg0->unk1C = arg0->unk1C + 4.0f; + arg0->unk1C += 4.0f; if (arg0->unk1C > 800.0f) { - arg0->unk2 = arg0->unk2 | 0x800; - return; - } - // Duplicate return node #21. Try simplifying control flow for better match - return; - } - if (arg0->unk4 == 1) { - arg0->unk24 = arg0->unk24 + 1; - if (arg0->unk24 >= 0x3D) { - arg0->unk24 = 6; + arg0->unk2 |= 0x800; } } else { - arg0->unk24 = 0; - } - if (arg0->unk6 == 1) { - arg0->unk26 = arg0->unk26 + 1; - if (arg0->unk26 >= 0x3D) { - arg0->unk26 = 6; + if (arg0->unk4 == 1) { + arg0->unk24++; + if (arg0->unk24 > 60) { + arg0->unk24 = 6; + } + } else { + arg0->unk24 = 0; } - } else { - arg0->unk26 = 0; - } - if (arg0->unk8 == 1) { - arg0->unk28 = arg0->unk28 + 1; - if (arg0->unk28 >= 0x3D) { - arg0->unk28 = 6; + if (arg0->unk6 == 1) { + arg0->unk26++; + if (arg0->unk26 > 60) { + arg0->unk26 = 6; + } + } else { + arg0->unk26 = 0; } - } else { - arg0->unk28 = 0; - } - if (arg0->unkA == 1) { - arg0->unk2A = arg0->unk2A + 1; - if (arg0->unk2A >= 0x3D) { - arg0->unk2A = 6; - return; + if (arg0->unk8 == 1) { + arg0->unk28++; + if (arg0->unk28 > 60) { + arg0->unk28 = 6; + } + } else { + arg0->unk28 = 0; + } + if (arg0->unkA == 1) { + arg0->unk2A++; + if (arg0->unk2A > 60) { + arg0->unk2A = 6; + } + } else { + arg0->unk2A = 0; } - // Duplicate return node #21. Try simplifying control flow for better match - return; } - arg0->unk2A = 0; - // Duplicate return node #21. Try simplifying control flow for better match } } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/update_obj_piranha_plant.s") -#endif #ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 @@ -969,7 +982,7 @@ extern ? D_06006990; extern f32 D_802B9624; extern f32 D_802B9628; extern s32 D_802BA058; -extern void *gDisplayListHead; + void func_80298328(void *arg0, void *arg1, void *arg2) { s16 sp36; @@ -1416,7 +1429,7 @@ extern ? D_802B87E0; extern f32 D_802B9650; extern f32 D_802B9654; extern f32 gCourseDirection; -extern s32 *gDisplayListHead; + extern ? gSegmentTable; void func_80298D7C(void *arg0, ? *arg1, ? arg2) { @@ -1559,7 +1572,7 @@ extern ? D_06006A68; extern ? D_0D004C68; extern f32 D_802B9658; extern f32 D_802B965C; -extern void *gDisplayListHead; + void func_80299144(void *arg0, void *arg1, void *arg2) { s16 sp4A; @@ -1634,7 +1647,7 @@ extern ? D_06015B48; extern ? D_0D004C68; extern f32 D_802B9660; extern f32 D_802B9664; -extern void *gDisplayListHead; + void func_8029930C(void *arg0, void *arg1, void *arg2) { s16 sp4A; @@ -1709,7 +1722,7 @@ extern ? D_0600D4A0; extern ? D_0D004C68; extern f32 D_802B9668; extern f32 D_802B966C; -extern void *gDisplayListHead; + void func_802994D4(void *arg0, void *arg1, void *arg2) { s16 sp4A; @@ -1783,7 +1796,7 @@ f32 func_802B80D0(void *, u16, ?, f32, f32); // extern extern ? D_06013F20; extern ? D_0D004C68; extern f32 D_802B9670; -extern void *gDisplayListHead; + void func_8029969C(void *arg0, void *arg1, void *arg2) { s16 sp4A; @@ -1858,7 +1871,7 @@ extern ? D_0600FC70; extern ? D_0D004C68; extern f32 D_802B9674; extern f32 D_802B9678; -extern void *gDisplayListHead; + void func_80299864(void *arg0, void *arg1, void *arg2) { s16 sp4A; @@ -1933,7 +1946,7 @@ extern ? D_0600D578; extern ? D_0D004C68; extern f32 D_802B967C; extern f32 D_802B9680; -extern void *gDisplayListHead; + void func_80299A2C(void *arg0, void *arg1, void *arg2) { s16 sp4A; @@ -2008,7 +2021,7 @@ extern ? D_060090C8; extern ? D_0D004C68; extern f32 D_802B9684; extern f32 D_802B9688; -extern void *gDisplayListHead; + void func_80299BF4(void *arg0, void *arg1, void *arg2) { s16 sp4A; @@ -2082,7 +2095,7 @@ f32 func_802B80D0(void *, u16, ?, f32, f32); // extern extern ? D_060075A0; extern f32 D_802B968C; extern f32 D_802B9690; -extern void *gDisplayListHead; + void func_80299DBC(void *arg0, void *arg1, void *arg2) { s16 sp32; @@ -2126,7 +2139,7 @@ f32 func_802B80D0(void *, u16, ?, f32, f32); // extern extern ? D_06008528; extern f32 D_802B9694; extern f32 D_802B9698; -extern void *gDisplayListHead; + void func_80299EDC(void *arg0, void *arg1, void *arg2) { s16 sp32; @@ -2170,7 +2183,7 @@ f32 func_802B80D0(void *, u16, ?, f32, f32); // extern extern ? D_06008628; extern f32 D_802B969C; extern f32 D_802B96A0; -extern void *gDisplayListHead; + void func_80299FFC(void *arg0, void *arg1, void *arg2) { s16 sp32; @@ -2214,7 +2227,7 @@ f32 func_802B80D0(void *, u16, ?, f32, f32); // extern extern ? D_06008728; extern f32 D_802B96A4; extern f32 D_802B96A8; -extern void *gDisplayListHead; + void func_8029A11C(void *arg0, void *arg1, void *arg2) { s16 sp32; @@ -2254,7 +2267,7 @@ GLOBAL_ASM("asm/non_matchings/code_actors/func_8029A11C.s") //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 s32 func_802B4FF8(void *, ?); // extern extern ? D_06013BB8; -extern void *gDisplayListHead; + void func_8029A23C(s32 arg0, void *arg1, void *arg2) { void *temp_v0; @@ -2325,7 +2338,7 @@ extern f32 D_802B96AC; extern f32 D_802B96B0; extern s32 D_802BA050; extern s32 D_802BA054; -extern void *gDisplayListHead; + void func_8029A3AC(void *arg0, void *arg1, void *arg2) { u16 sp7C; @@ -2428,7 +2441,7 @@ GLOBAL_ASM("asm/non_matchings/code_actors/func_8029A3AC.s") //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 ? func_8029A3AC(); // extern extern ? D_0D004E38; -extern void *gDisplayListHead; + void func_8029A690(void) { void *temp_v0; @@ -2472,7 +2485,7 @@ GLOBAL_ASM("asm/non_matchings/code_actors/func_8029A690.s") //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 ? func_8029A3AC(); // extern extern ? D_802BA060; -extern void *gDisplayListHead; + void func_8029A75C(void) { void *temp_v0; @@ -2516,7 +2529,7 @@ GLOBAL_ASM("asm/non_matchings/code_actors/func_8029A75C.s") //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 ? func_8029A3AC(); // extern extern ? D_0D005038; -extern void *gDisplayListHead; + void func_8029A828(void) { void *temp_v0; @@ -2566,7 +2579,7 @@ f32 func_802B80D0(s32, u16, ?, f32, f32); // extern extern ? D_0D004B48; extern ? D_0D004BD8; extern f32 D_802B96B4; -extern void *gDisplayListHead; + void func_8029A8F4(void *arg0, ? arg1, void *arg2) { s16 sp80; @@ -2624,59 +2637,45 @@ void func_8029A8F4(void *arg0, ? arg1, void *arg2) { GLOBAL_ASM("asm/non_matchings/code_actors/func_8029A8F4.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void update_obj_wario_stadium_sign(void *arg0) { - arg0->unk12 = arg0->unk12 + 0xB6; +void update_obj_wario_stadium_sign(struct Actor *arg0) { + arg0->unk10[1] += 0xB6; } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/update_obj_wario_stadium_sign.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_800C98B8(void *, void *, ?, void *); // extern -extern ? D_801637B8; - -void update_obj_railroad_crossing(void *arg0) { - if (*(&D_801637B8 + (arg0->unk6 * 2)) != 0) { - arg0->unk4 = arg0->unk4 + 1; - if (arg0->unk4 >= 0x29) { +/** + * If train close activate bell sound according to timing + **/ +void update_obj_railroad_crossing(struct Actor *arg0) { + // If train close? + if (D_801637B8[arg0->unk6] != 0) { + // Timer++ + arg0->unk4++; + // Reset timer + if (arg0->unk4 > 40) { arg0->unk4 = 1; } - if ((arg0->unk4 == 1) || (arg0->unk4 == 0x14)) { - func_800C98B8(arg0 + 0x18, arg0 + 0x24, 0x19017016, arg0); + // Play Bell sound when timer hits 20 or 1. + if ((arg0->unk4 == 1) || (arg0->unk4 == 20)) { + func_800C98B8(arg0->unk18, arg0->unk24, 0x19017016); } } } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/update_obj_railroad_crossing.s") -#endif - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void update_obj_mario_raceway_sign(void *arg0) { - s16 temp_v0; - temp_v0 = arg0->unk2; - if ((temp_v0 & 0x800) == 0) { - if ((temp_v0 & 0x400) != 0) { - arg0->unk1C = arg0->unk1C + 4.0f; - if (arg0->unk1C > 800.0f) { - arg0->unk2 = arg0->unk2 | 0x800; - arg0->unk12 = arg0->unk12 + 0x71C; - return; +void update_obj_mario_raceway_sign(struct Actor *arg0) { + if ((arg0->unk2 & 0x800) == 0) { + if ((arg0->unk2 & 0x400) != 0) { + arg0->unk18[1] += 4.0f; + if (arg0->unk18[1] > 800.0f) { + arg0->unk2 |= 0x800; + arg0->unk10[1] += 1820; } - // Duplicate return node #5. Try simplifying control flow for better match - return; + } else { + arg0->unk10[1] += 182; } - arg0->unk12 = arg0->unk12 + 0xB6; - // Duplicate return node #5. Try simplifying control flow for better match } } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/update_obj_mario_raceway_sign.s") -#endif + +// UNUSED +GLOBAL_ASM("asm/non_matchings/code_actors/func_8029ABD4.s") #ifdef MIPS_TO_C //generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 @@ -2790,7 +2789,7 @@ extern ? D_0600FC28; extern ? D_800DC628; extern ? D_800DC630; extern f32 D_802B96DC; -extern void *gDisplayListHead; + void func_8029AE1C(void *arg0, void *arg1, ? arg2, s32 arg3) { ? sp120; @@ -2884,7 +2883,7 @@ extern f32 D_802B96E0; extern f32 D_802B96E4; extern f32 D_802B96E8; extern f32 D_802B96EC; -extern s32 *gDisplayListHead; + extern ? toads_turnpike_dl_0; extern ? toads_turnpike_dl_1; extern ? toads_turnpike_dl_2; @@ -3001,7 +3000,7 @@ extern f32 D_802B96F0; extern f32 D_802B96F4; extern f32 D_802B96F8; extern f32 D_802B96FC; -extern s32 *gDisplayListHead; + extern ? toads_turnpike_dl_3; extern ? toads_turnpike_dl_4; extern ? toads_turnpike_dl_5; @@ -3068,158 +3067,89 @@ block_11: GLOBAL_ASM("asm/non_matchings/code_actors/func_8029B2E4.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_802B4FF8(? *, ?); // extern -? func_802B5F00(? *, ?); // extern -? func_802B5F74(? *, s32, s32); // extern -f32 func_802B80D0(s32, u16, ?, f32, f32); // extern extern f32 D_802B9700; extern f32 D_802B9704; extern f32 D_802B9708; extern f32 D_802B970C; -extern s32 *gDisplayListHead; -extern ? toads_turnpike_dl_10; -extern ? toads_turnpike_dl_11; -extern ? toads_turnpike_dl_9; -void func_8029B4E0(void *arg0, s32 arg1) { - ? spC8; - f32 sp44; - s32 sp24; - f32 temp_f0; - f32 temp_f2; - s32 *temp_v0; - s32 *temp_v0_2; - s32 *temp_v0_3; - s32 *temp_v0_4; - s32 *temp_v0_5; - s32 *temp_v0_6; - s32 *temp_v0_7; - s32 temp_a1; - s32 *phi_v0; +s32 func_802B4FF8(Mat4, s32); +extern s8 toads_turnpike_dl_10[]; +extern s8 toads_turnpike_dl_11[]; +extern s8 toads_turnpike_dl_9[]; - temp_a1 = arg1 + 0x18; - sp24 = temp_a1; - temp_f0 = func_802B80D0(temp_a1, arg0->unk26, 0x451C4000, (&D_80150130)[(arg0 - camera1) / 0xB8], D_802B9700); - temp_f2 = temp_f0; - if (!(temp_f0 < 0.0f) && (temp_v0 = gDisplayListHead, gDisplayListHead = temp_v0 + 8, temp_v0->unk4 = -1, temp_v0->unk0 = 0xBB000001, temp_v0_2 = gDisplayListHead, gDisplayListHead = temp_v0_2 + 8, temp_v0_2->unk4 = 0x20000, temp_v0_2->unk0 = 0xB6000000, sp44 = temp_f2, func_802B5F74(&spC8, temp_a1, arg1 + 0x10), func_802B5F00(&spC8, 0x3DCCCCCD), (func_802B4FF8(&spC8, 0) != 0))) { - if (gActiveScreenMode == 0) { - if (temp_f2 < D_802B9704) { - temp_v0_3 = gDisplayListHead; - gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = &toads_turnpike_dl_9; - temp_v0_3->unk0 = 0x6000000; - return; - } - if (temp_f2 < D_802B9708) { - temp_v0_4 = gDisplayListHead; - gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = &toads_turnpike_dl_10; - phi_v0 = temp_v0_4; - goto block_11; +void func_8029B4E0(Camera *arg0, struct Actor *arg1) { + s32 pad[6]; + Mat4 spC8; + s32 pad2[32]; + f32 temp_f0 = func_802B80D0(arg0->pos,arg1->unk18, arg0->rotX[1], 2500.0f, D_80150130[arg0 - camera1], D_802B9700); + + if (!(temp_f0 < 0.0f)) { + + gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); + gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); + + + func_802B5F74(spC8, arg1->unk18, arg1->unk10); + func_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); } - temp_v0_5 = gDisplayListHead; - gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = &toads_turnpike_dl_11; - temp_v0_5->unk0 = 0x6000000; - return; } - if (temp_f2 < D_802B970C) { - temp_v0_6 = gDisplayListHead; - gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = &toads_turnpike_dl_10; - temp_v0_6->unk0 = 0x6000000; - return; - } - temp_v0_7 = gDisplayListHead; - gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = &toads_turnpike_dl_11; - phi_v0 = temp_v0_7; -block_11: - *phi_v0 = 0x6000000; - // Duplicate return node #12. Try simplifying control flow for better match } } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/func_8029B4E0.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_802B4FF8(? *, ?); // extern -? func_802B5F74(? *, s32, s32); // extern -f32 func_802B80D0(s32, u16, ?, f32, f32); // extern extern f32 D_802B9710; extern f32 D_802B9714; extern f32 D_802B9718; extern f32 D_802B971C; -extern s32 *gDisplayListHead; -extern ? toads_turnpike_dl_6; -extern ? toads_turnpike_dl_7; -extern ? toads_turnpike_dl_8; -void func_8029B6EC(void *arg0, s32 arg1) { - ? spC8; - f32 sp44; - s32 sp24; - f32 temp_f0; - f32 temp_f2; - s32 *temp_v0; - s32 *temp_v0_2; - s32 *temp_v0_3; - s32 *temp_v0_4; - s32 *temp_v0_5; - s32 *temp_v0_6; - s32 *temp_v0_7; - s32 temp_a1; - s32 *phi_v0; +extern Gfx toads_turnpike_dl_6[]; +extern Gfx toads_turnpike_dl_7[]; +extern Gfx toads_turnpike_dl_8[]; - temp_a1 = arg1 + 0x18; - sp24 = temp_a1; - temp_f0 = func_802B80D0(temp_a1, arg0->unk26, 0x451C4000, (&D_80150130)[(arg0 - camera1) / 0xB8], D_802B9710); - temp_f2 = temp_f0; - if (!(temp_f0 < 0.0f) && (temp_v0 = gDisplayListHead, gDisplayListHead = temp_v0 + 8, temp_v0->unk4 = -1, temp_v0->unk0 = 0xBB000001, temp_v0_2 = gDisplayListHead, gDisplayListHead = temp_v0_2 + 8, temp_v0_2->unk4 = 0x20000, temp_v0_2->unk0 = 0xB6000000, sp44 = temp_f2, func_802B5F74(&spC8, temp_a1, arg1 + 0x10), (func_802B4FF8(&spC8, 0) != 0))) { - if (gActiveScreenMode == 0) { - if (temp_f2 < D_802B9714) { - temp_v0_3 = gDisplayListHead; - gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = &toads_turnpike_dl_6; - temp_v0_3->unk0 = 0x6000000; - return; - } - if (temp_f2 < D_802B9718) { - temp_v0_4 = gDisplayListHead; - gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = &toads_turnpike_dl_7; - phi_v0 = temp_v0_4; - goto block_11; - } - temp_v0_5 = gDisplayListHead; - gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = &toads_turnpike_dl_8; - temp_v0_5->unk0 = 0x6000000; - return; - } - if (temp_f2 < D_802B971C) { - temp_v0_6 = gDisplayListHead; - gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = &toads_turnpike_dl_7; - temp_v0_6->unk0 = 0x6000000; - return; +void func_8029B6EC(Camera *arg0, struct Actor* arg1) { + s32 pad[6]; + Mat4 spC8; + s32 pad2[32]; + f32 temp_f0 = func_802B80D0(arg0->pos, arg1->unk18, arg0->rotX[1], 2500.0f, D_80150130[arg0 - camera1], D_802B9710); + + if (!(temp_f0 < 0.0f)) { + + gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); + gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); + + func_802B5F74(spC8, arg1->unk18, arg1->unk10); + 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); + } } - temp_v0_7 = gDisplayListHead; - gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = &toads_turnpike_dl_8; - phi_v0 = temp_v0_7; -block_11: - *phi_v0 = 0x6000000; - // Duplicate return node #12. Try simplifying control flow for better match } } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/func_8029B6EC.s") -#endif #ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 @@ -3243,7 +3173,7 @@ extern f32 D_802B9720; extern f32 D_802B9724; extern f32 D_802B9728; extern f32 D_802B972C; -extern void *gDisplayListHead; + void func_8029B8E8(void *arg0, void *arg1) { ? sp160; @@ -3475,7 +3405,7 @@ extern f32 D_802B9730; extern f32 D_802B9734; extern f32 D_802B9738; extern f32 D_802B973C; -extern void *gDisplayListHead; + void func_8029BFB0(void *arg0, void *arg1) { ? sp100; @@ -3630,7 +3560,7 @@ extern f32 D_802B9740; extern f32 D_802B9744; extern f32 D_802B9748; extern f32 D_802B974C; -extern void *gDisplayListHead; + void func_8029C3CC(void *arg0, void *arg1) { ? sp128; @@ -3853,7 +3783,7 @@ extern ? D_06006F88; extern ? D_06006FE0; extern f32 D_802B9750; extern f32 D_802B9754; -extern void *gDisplayListHead; + void func_8029CA90(void *arg0, void *arg1) { s16 sp9C; @@ -4102,11 +4032,12 @@ GLOBAL_ASM("asm/non_matchings/code_actors/place_falling_rocks.s") #ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_800C98B8(void *, void *, ?); // extern -? func_8029CF0C(? *, void *); // extern -? func_802AC114(f32, f32 *, f32, void *, ?); // extern -? func_802ADDC8(f32, f32, void *, ?, f32, f32, f32); // extern -extern ? D_06007230; +//? func_800C98B8(void *, void *, ?); // extern +void func_8029CF0C(s8, struct Actor*); // extern +void func_802ADDC8(UnkActorInner, f32, f32, f32, f32); +//? func_802AC114(f32, f32 *, f32, void *, ?); // extern +//? func_802ADDC8(f32, f32, void *, ?, f32, f32, f32); // extern +extern s8 D_06007230[]; extern f32 D_802B9758; extern f64 D_802B9760; extern f32 D_802B9768; @@ -4114,8 +4045,9 @@ extern f32 D_802B976C; extern f32 D_802B9770; extern f32 D_802B9774; extern f32 D_802B9778; +extern f32 D_8015F8E4; -void update_obj_falling_rocks(void *arg0) { +void update_obj_falling_rocks(struct Actor *arg0) { f32 sp4C; f32 sp48; f32 sp44; @@ -4126,38 +4058,36 @@ void update_obj_falling_rocks(void *arg0) { 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; void *temp_s1; void *temp_s1_2; void *temp_s1_3; f32 phi_f12; - temp_v0 = arg0->unk4; - if (temp_v0 != 0) { - arg0->unk4 = temp_v0 - 1; + //temp_v0 = arg0->unk4; + if (arg0->unk4 != 0) { + arg0->unk4--; return; } - if (arg0->unk1C < D_8015F8E4) { + if (arg0->unk18[1] < D_8015F8E4) { func_8029CF0C(&D_06007230, arg0); } - temp_f14 = D_802B9758; - arg0->unk10 = arg0->unk10 + ((arg0->unk2C * temp_f14) / 20.0f); - arg0->unk14 = arg0->unk14 + ((arg0->unk24 * temp_f14) / 20.0f); - arg0->unk28 = arg0->unk28 - D_802B9760; - if (arg0->unk28 < -2.0f) { - arg0->unk28 = -2.0f; - } - arg0->unk18 = arg0->unk18 + arg0->unk24; - arg0->unk1C = arg0->unk1C + arg0->unk28; - arg0->unk20 = arg0->unk20 + arg0->unk2C; - sp3C = arg0->unk28; - func_802ADDC8(arg0->unk24, temp_f14, arg0 + 0x30, 0x41200000, arg0->unk18, arg0->unk1C, arg0->unk20); - temp_f2 = arg0->unk44; + //temp_f14 = D_802B9758; + arg0->unk10[0] += ((arg0->unk24[2] * D_802B9758) / 20.0f); + arg0->unk10[2] += ((arg0->unk24[0] * D_802B9758) / 20.0f); + arg0->unk24[1] -= D_802B9760; + if (arg0->unk24[1] < -2.0f) { + arg0->unk24[1] = -2.0f; + } + arg0->unk18[0] += arg0->unk24[0]; + arg0->unk18[1] += arg0->unk24[1]; + arg0->unk18[2] += arg0->unk24[2]; + sp3C = arg0->unk24[1]; + func_802ADDC8(&arg0->unk30, 10.0f, arg0->unk18[0], arg0->unk18[1], arg0->unk18[2]); + temp_f2 = arg0->unk30.unkC; //unk44; phi_f12 = 0.0f; if (temp_f2 < 0.0f) { temp_s1 = arg0 + 0x24; @@ -4165,11 +4095,11 @@ void update_obj_falling_rocks(void *arg0) { sp48 = -arg0->unk64; sp4C = -arg0->unk68; temp_f0 = arg0->unk44; - arg0->unk18 = arg0->unk18 + (sp44 * temp_f0); - arg0->unk1C = arg0->unk1C + (sp48 * temp_f0); - arg0->unk20 = arg0->unk20 + (sp4C * temp_f0); + arg0->unk18[0] = arg0->unk18[0] + (sp44 * temp_f0); + arg0->unk18[1] = arg0->unk18[1] + (sp48 * temp_f0); + arg0->unk18[2] = arg0->unk18[2] + (sp4C * temp_f0); func_802AC114(0.0f, &sp44, temp_f2, temp_s1, 0x40000000); - arg0->unk28 = D_802B9768 * sp3C; + arg0->unk24[1] = D_802B9768 * sp3C; func_800C98B8(arg0 + 0x18, temp_s1, 0x1900800F); } temp_f2_2 = arg0->unk3C; @@ -4177,44 +4107,44 @@ void update_obj_falling_rocks(void *arg0) { if (temp_f2_2 < 0.0f) { sp48 = -arg0->unk4C; if (sp48 == 0.0f) { - arg0->unk28 = arg0->unk28 * D_802B976C; + arg0->unk24[1] *= D_802B976C; return; } temp_f4 = -arg0->unk48; - temp_s1_2 = arg0 + 0x24; + temp_s1_2 = arg0->unk24[0]; sp44 = temp_f4; sp4C = -arg0->unk50; temp_f0_2 = arg0->unk3C; - arg0->unk18 = arg0->unk18 + (temp_f4 * temp_f0_2); - arg0->unk1C = arg0->unk1C + (sp48 * temp_f0_2); - arg0->unk20 = arg0->unk20 + (sp4C * temp_f0_2); + arg0->unk18[0] += (temp_f4 * temp_f0_2); + arg0->unk18[1] += (sp48 * temp_f0_2); + arg0->unk18[2] += (sp4C * temp_f0_2); sp30 = arg0 + 0x18; sp34 = D_802B9770 * sp3C; func_802AC114(0.0f, &sp44, temp_f2_2, temp_s1_2, 0x40000000); - arg0->unk28 = sp34; + arg0->unk24[1] = sp34; func_800C98B8(sp30, temp_s1_2, 0x1900800F); - goto block_12; + //goto block_12; } -block_12: +//block_12: temp_f2_3 = arg0->unk40; if (temp_f2_3 < phi_f12) { sp48 = -arg0->unk58; if (phi_f12 == sp48) { - arg0->unk28 = arg0->unk28 * D_802B9774; + arg0->unk24[1] *= D_802B9774; return; } - temp_s1_3 = arg0 + 0x24; + temp_s1_3 = arg0->unk24[0]; temp_f10 = -arg0->unk54; sp44 = temp_f10; sp4C = -arg0->unk5C; temp_f0_3 = arg0->unk40; - arg0->unk18 = arg0->unk18 + (temp_f10 * temp_f0_3); - arg0->unk1C = arg0->unk1C + (sp48 * temp_f0_3); - arg0->unk20 = arg0->unk20 + (sp4C * temp_f0_3); - sp30 = arg0 + 0x18; - sp3C = arg0->unk28; + arg0->unk18[0] += (temp_f10 * temp_f0_3); + arg0->unk18[1] += (sp48 * temp_f0_3); + arg0->unk18[2] += (sp4C * temp_f0_3); + sp30 = arg0->unk18[0]; + sp3C = arg0->unk24[1]; func_802AC114(phi_f12, &sp44, temp_f2_3, temp_s1_3, 0x40000000); - arg0->unk28 = D_802B9778 * sp3C; + arg0->unk24[1] = D_802B9778 * sp3C; func_800C98B8(sp30, temp_s1_3, 0x1900800F); // Duplicate return node #16. Try simplifying control flow for better match } @@ -4443,43 +4373,22 @@ GLOBAL_ASM("asm/non_matchings/code_actors/func_8029D9F8.s") #ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 extern s16 D_80150110; -extern ? D_8015F9B8; -extern ? D_80162578; - +//extern ? D_8015F9B8; +extern s32 D_80162578; +extern struct Actor D_8015F9B8[112]; void func_8029DAB8(void) { - ? *temp_v1; - ? *phi_v1; - + struct Actor *temp_v1; + s32 i; D_80150110 = 0; - phi_v1 = &D_8015F9B8; - do { - temp_v1 = phi_v1 + 0x1C0; - temp_v1->unk-14E = 0; - temp_v1->unk-150 = 0; - temp_v1->unk-14C = 0; - temp_v1->unk-14A = 0; - temp_v1->unk-148 = 0.0f; - temp_v1->unk-144 = 0.0f; - temp_v1->unk-DE = 0; - temp_v1->unk-E0 = 0; - temp_v1->unk-DC = 0; - temp_v1->unk-DA = 0; - temp_v1->unk-D8 = 0.0f; - temp_v1->unk-D4 = 0.0f; - temp_v1->unk-6E = 0; - temp_v1->unk-70 = 0; - temp_v1->unk-6C = 0; - temp_v1->unk-6A = 0; - temp_v1->unk-68 = 0.0f; - temp_v1->unk-64 = 0.0f; - temp_v1->unk-1BE = 0; - temp_v1->unk-1C0 = 0; - temp_v1->unk-1BC = 0; - temp_v1->unk-1BA = 0; - temp_v1->unk-1B8 = 0.0f; - temp_v1->unk-1B4 = 0.0f; - phi_v1 = temp_v1; - } while (temp_v1 != &D_80162578); + for (i = 0; i < 100; i++) { + temp_v1 = &D_8015F9B8[i]; + temp_v1->unk2 = 0; + temp_v1->unk0 = 0; + temp_v1->unk4 = 0; + temp_v1->unk6 = 0; + temp_v1->unk8 = 0.0f; + temp_v1->unkC = 0.0f; + } } #else GLOBAL_ASM("asm/non_matchings/code_actors/func_8029DAB8.s") @@ -5125,17 +5034,16 @@ GLOBAL_ASM("asm/non_matchings/code_actors/func_8029EC88.s") #ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8029EC88(s32, s32 *, s32 *, s32); // extern -void func_802B52BC(s32 *, s32, s32, s32); // extern -void load_giant_egg(s32 *, s32, s32, s32); // extern +//void func_8029EC88(s32, s32 *, s32 *, s32); // extern +//void func_802B52BC(s32 *, s32, s32, s32); // extern -void func_8029ED38(s32 *arg0, s32 arg1) { +void func_8029ED38(Vec3f arg0, Vec3s arg1) { //? sp24; //? sp1C; - load_giant_egg(&arg0, 0, 0, 0); - func_802B52BC(&arg1, 0, 0, 0); - func_8029EC88(arg0, &arg1, &arg0, arg1); + load_giant_egg(arg0, 0, 0, 0); + func_802B52BC(arg1, 0, 0, 0); + func_8029EC88(arg0, arg1, arg0, arg1); } #else GLOBAL_ASM("asm/non_matchings/code_actors/func_8029ED38.s") @@ -5347,14 +5255,14 @@ s32 func_8029F408(Player *arg0, Player *arg1) { f32 temp_f2; f32 temp_f2_2; - temp_f2 = arg1->posY - arg0->posX; + temp_f2 = arg1->posY - arg0->pos[0]; if ((temp_f2 < 0.0f) && (temp_f2 < -60.0f)) { return 0; } if (temp_f2 > 60.0f) { return 0; } - temp_f0 = arg1->rotX - arg0->posZ; + temp_f0 = arg1->rotX - arg0->pos[2]; if ((temp_f0 < 0.0f) && (temp_f0 < -60.0f)) { return 0; } @@ -5583,39 +5491,35 @@ block_36: GLOBAL_ASM("asm/non_matchings/code_actors/func_8029F69C.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 extern f32 D_802B98AC; -? func_8029FB80(void *arg0, void *arg1) { +s32 func_8029FB80(Player *arg0, struct Actor *arg1) { f32 temp_f0; - f32 temp_f12; f32 temp_f12_2; f32 temp_f14; f32 temp_f16; f32 temp_f2; - temp_f0 = arg0->unk70 + arg1->unkC; - temp_f2 = arg1->unk18 - arg0->unk14; + temp_f0 = arg0->unk_070 + arg1->unkC; + temp_f2 = arg1->unk18[0] - arg0->pos[0]; if (temp_f0 < temp_f2) { return 0; } - temp_f12 = -temp_f0; - if (temp_f2 < temp_f12) { + if (temp_f2 < -temp_f0) { return 0; } - temp_f14 = arg1->unk1C - arg0->unk18; + temp_f14 = arg1->unk18[1] - arg0->pos[1]; if (temp_f0 < temp_f14) { return 0; } - if (temp_f14 < temp_f12) { + if (temp_f14 < -temp_f0) { return 0; } - temp_f16 = arg1->unk20 - arg0->unk1C; + temp_f16 = arg1->unk18[2] - arg0->pos[2]; if (temp_f0 < temp_f16) { return 0; } - if (temp_f16 < temp_f12) { + if (temp_f16 < -temp_f0) { return 0; } temp_f12_2 = (temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16); @@ -5627,43 +5531,36 @@ extern f32 D_802B98AC; } return 1; } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/func_8029FB80.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 extern f32 D_802B98B0; -? func_8029FCA4(void *arg0, void *arg1) { +s32 func_8029FCA4(struct Actor *arg0, struct Actor *arg1) { f32 temp_f0; - f32 temp_f12; f32 temp_f12_2; f32 temp_f14; f32 temp_f16; f32 temp_f2; temp_f0 = arg0->unkC + arg1->unkC; - temp_f2 = arg0->unk18 - arg1->unk18; + temp_f2 = arg0->unk18[0] - arg1->unk18[0]; if (temp_f0 < temp_f2) { return 0; } - temp_f12 = -temp_f0; - if (temp_f2 < temp_f12) { + if (temp_f2 < -temp_f0) { return 0; } - temp_f14 = arg0->unk1C - arg1->unk1C; + temp_f14 = arg0->unk18[1] - arg1->unk18[1]; if (temp_f0 < temp_f14) { return 0; } - if (temp_f14 < temp_f12) { + if (temp_f14 < -temp_f0) { return 0; } - temp_f16 = arg0->unk20 - arg1->unk20; + temp_f16 = arg0->unk18[2] - arg1->unk18[2]; if (temp_f0 < temp_f16) { return 0; } - if (temp_f16 < temp_f12) { + if (temp_f16 < -temp_f0) { return 0; } temp_f12_2 = (temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16); @@ -5675,9 +5572,6 @@ extern f32 D_802B98B0; } return 1; } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/func_8029FCA4.s") -#endif #ifdef MIPS_TO_C //generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 @@ -5834,127 +5728,97 @@ block_18: GLOBAL_ASM("asm/non_matchings/code_actors/func_8029FDC8.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_800C98B8(void *, void *, ?, void *); // extern -void func_802A00E8(void *arg0, void *arg1) { - s16 temp_v0; - s16 temp_v0_2; - s16 temp_v0_3; - s16 temp_v0_4; - s16 temp_v0_5; - s16 temp_v0_6; +void func_802A00E8(struct Actor *arg0, struct Actor *arg1) { - temp_v0 = arg0->unk0; - if (temp_v0 != 7) { - if (temp_v0 != 8) { - if (temp_v0 != 0xD) { - if (temp_v0 != 0x2A) { - goto block_15; - } - if (arg0->unk6 == 0) { - arg0->unk2 = arg0->unk2 | 0x200; - func_800C98B8(arg0 + 0x18, arg0 + 0x24, 0x19019053, arg0); - return; - } - goto block_15; + + switch(arg0->unk0) { + case 7: + if ((arg0->unk6 == 0) || (arg0->unk6 == 4)) { + arg0->unk2 |= 0x200; + func_800C98B8(arg0->unk18, arg0->unk24, 0x19019053); + return; } + break; + case 8: + if ((arg0->unk6 == 0) || (arg0->unk6 == 6)) { + arg0->unk2 |= 0x200; + func_800C98B8(arg0->unk18, arg0->unk24, 0x19019053); + return; + } + break; + case 42: + if (arg0->unk6 == 0) { + arg0->unk2 |= 0x200; + func_800C98B8(arg0->unk18, arg0->unk24, 0x19019053); + return; + } + break; + case 13: if (arg0->unk6 == 0) { arg0->unk2 = arg0->unk2 | 0x200; - func_800C98B8(arg0 + 0x18, arg0 + 0x24, 0x19019053, arg0); + func_800C98B8(arg0->unk18, arg0->unk24, 0x19019053); return; } - goto block_15; - } - temp_v0_2 = arg0->unk6; - if ((temp_v0_2 == 0) || (temp_v0_2 == 6)) { - arg0->unk2 = arg0->unk2 | 0x200; - func_800C98B8(arg0 + 0x18, arg0 + 0x24, 0x19019053, arg0); - return; - } - goto block_15; + break; } - temp_v0_3 = arg0->unk6; - if ((temp_v0_3 == 0) || (temp_v0_3 == 4)) { - arg0->unk2 = arg0->unk2 | 0x200; - func_800C98B8(arg0 + 0x18, arg0 + 0x24, 0x19019053, arg0); + + switch(arg1->unk0) { + case 7: + if ((arg1->unk6 == 0) || (arg1->unk6 == 4)) { + arg1->unk2 |= 0x200; + func_800C98B8(arg1->unk18, arg1->unk24, 0x19019053); return; - } -block_15: - temp_v0_4 = arg1->unk0; - if (temp_v0_4 != 7) { - if (temp_v0_4 != 8) { - if (temp_v0_4 != 0xD) { - if (temp_v0_4 != 0x2A) { - goto block_30; - } - if (arg1->unk6 == 0) { - arg1->unk2 = arg1->unk2 | 0x200; - func_800C98B8(arg1 + 0x18, arg1 + 0x24, 0x19019053, arg0); - return; - } - goto block_30; } + break; + case 8: + if ((arg1->unk6 == 0) || (arg1->unk6 == 6)) { + arg1->unk2 = arg1->unk2 | 0x200; + func_800C98B8(arg1->unk18, arg1->unk24, 0x19019053); + return; + } + break; + case 42: if (arg1->unk6 == 0) { arg1->unk2 = arg1->unk2 | 0x200; - func_800C98B8(arg1 + 0x18, arg1 + 0x24, 0x19019053, arg0); + func_800C98B8(arg1->unk18, arg1->unk24, 0x19019053); return; } - goto block_30; - } - temp_v0_5 = arg1->unk6; - if ((temp_v0_5 == 0) || (temp_v0_5 == 6)) { - arg1->unk2 = arg1->unk2 | 0x200; - func_800C98B8(arg1 + 0x18, arg1 + 0x24, 0x19019053, arg0); - return; - } - goto block_30; - } - temp_v0_6 = arg1->unk6; - if ((temp_v0_6 == 0) || (temp_v0_6 == 4)) { - arg1->unk2 = arg1->unk2 | 0x200; - func_800C98B8(arg1 + 0x18, arg1 + 0x24, 0x19019053, arg0); - return; + break; + case 13: + if (arg1->unk6 == 0) { + arg1->unk2 = arg1->unk2 | 0x200; + func_800C98B8(arg1->unk18, arg1->unk24, 0x19019053); + return; + } + break; + } -block_30: - arg0->unk2 = arg0->unk2 | 0x100; - func_800C98B8(arg0 + 0x18, arg0 + 0x24, 0x19018010, arg0); -} -#else -GLOBAL_ASM("asm/non_matchings/code_actors/func_802A00E8.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_800C98B8(void *, void *, ?); // extern -s32 func_8029FCA4(); // extern -? func_8029FDC8(void *); // extern -? func_802A00E8(void *, void *); // extern + arg0->unk2 |= 0x100; + func_800C98B8(arg0->unk18, arg0->unk24, 0x19018010); +} -void func_802A0350(void *arg0, void *arg1) { - s16 temp_v0; - s32 phi_v1; +s32 func_8029FCA4(struct Actor*, struct Actor*); // extern +void func_8029FDC8(struct Actor*); - if (func_8029FCA4() == 1) { - temp_v0 = arg0->unk0; - phi_v1 = 0x2A; - if ((temp_v0 == 0x2A) && (arg1->unk0 == 0x2A)) { +void func_802A0350(struct Actor *arg0, struct Actor *arg1) { + if (func_8029FCA4(arg0, arg1) == 1) { + if ((arg0->unk0 == 42) && (arg1->unk0 == 42)) { func_8029FDC8(arg0); func_8029FDC8(arg1); - arg0->unk2 = arg0->unk2 | 0x100; - func_800C98B8(arg0 + 0x18, arg0 + 0x24, 0x19018010); + arg0->unk2 |= 256; + func_800C98B8(arg0->unk18, arg0->unk24, 0x19018010); return; } - if (temp_v0 == 0x2A) { + if (arg0->unk0 == 42) { if (arg0->unk6 == 0) { func_8029FDC8(arg0); } - phi_v1 = 0x2A; } else { func_8029FDC8(arg0); } - if (phi_v1 == arg1->unk0) { + if (arg1->unk0 == 42) { if (arg1->unk6 == 0) { func_8029FDC8(arg1); } @@ -5962,12 +5826,11 @@ void func_802A0350(void *arg0, void *arg1) { func_8029FDC8(arg1); } func_802A00E8(arg0, arg1); - // Duplicate return node #14. Try simplifying control flow for better match } } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/func_802A0350.s") -#endif +//#else +//GLOBAL_ASM("asm/non_matchings/code_actors/func_802A0350.s") +//#endif #ifdef MIPS_TO_C //generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 @@ -6216,393 +6079,271 @@ block_89: GLOBAL_ASM("asm/non_matchings/code_actors/func_802A0450.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_802977E4(? *); // extern -? func_802A0450(? *, void *); // extern -extern ? D_800FD850; -extern ? D_8015F9B8; -extern ? gPlayers; +extern Player gPlayers[]; void func_802A0D54(void) { - ? *temp_s1; - s16 temp_v0; - s32 temp_s0; - void *temp_a1; - ? *phi_s1; - s32 phi_s0; + struct Actor *temp_a1; + s32 i, j; + Player *phi_s1; - phi_s1 = &gPlayers; - do { - if (((phi_s1->unk0 & 0x8000) != 0) && ((phi_s1->unkBC & 0x4000000) == 0)) { + 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); - phi_s0 = 0; - do { - if ((phi_s1->unkBC & 0x4000000) == 0) { - temp_a1 = &D_8015F9B8 + (phi_s0 * 0x70); - temp_v0 = temp_a1->unk2; - if (((temp_v0 & 0x8000) != 0) && ((temp_v0 & 0x4000) != 0)) { - func_802A0450(phi_s1, temp_a1); + for (j = 0; j < 100; j++) { + temp_a1 = &D_8015F9B8[j]; + + if ((phi_s1->unk_0BC & 0x4000000) == 0) { + // temp_v0 = temp_a1->unk2; + if (((temp_a1->unk2 & 0x8000) != 0) && ((temp_a1->unk2 & 0x4000) != 0)) { + func_802A0450(phi_s1, temp_a1); + } } - } - temp_s0 = phi_s0 + 1; - phi_s0 = temp_s0; - } while (temp_s0 != 0x64); + } } - temp_s1 = phi_s1 + 0xDD8; - phi_s1 = temp_s1; - } while (temp_s1 != &D_800FD850); + } } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/func_802A0D54.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_802A0350(void *, void *); // extern extern u16 D_8015F900; -extern ? D_8015F9B8; +void func_802A0350(struct Actor*, struct Actor*); void func_802A0E44(void) { - s32 sp44; - s16 temp_v0; - s16 temp_v0_2; - s16 temp_v0_3; - s16 temp_v0_4; - s16 temp_v0_5; - s32 temp_s1; - s32 temp_s1_2; - u16 temp_v1; - void *temp_a1; - void *phi_s0; - u16 phi_v1; - s32 phi_s1; + struct Actor *phi_s0; + struct Actor *temp_a1; + s32 i, j; + s32 pad; - temp_v1 = D_8015F900; - phi_v1 = temp_v1; - if (temp_v1 < 0x63) { - phi_s0 = (temp_v1 * 0x70) + &D_8015F9B8; - do { - temp_v0 = phi_s0->unk2; - if ((temp_v0 & 0x8000) == 0) { - sp44 = phi_v1 + 1; - } else if ((temp_v0 & 0x4000) == 0) { - sp44 = phi_v1 + 1; - } else { - temp_v0_2 = phi_s0->unk0; - temp_s1 = phi_v1 + 1; - phi_s1 = temp_s1; - if ((temp_v0_2 != 6) && (temp_v0_2 != 7) && (temp_v0_2 != 8) && (temp_v0_2 != 0xD) && (temp_v0_2 != 0x2A)) { - sp44 = phi_v1 + 1; - } else { - sp44 = temp_s1; - if (temp_s1 < 0x64) { - do { - temp_v0_3 = phi_s0->unk2; - if (((temp_v0_3 & 0x8000) != 0) && ((temp_v0_3 & 0x4000) != 0)) { - temp_a1 = &D_8015F9B8 + (phi_s1 * 0x70); - temp_v0_4 = temp_a1->unk2; - if (((temp_v0_4 & 0x8000) != 0) && ((temp_v0_4 & 0x4000) != 0)) { - temp_v0_5 = temp_a1->unk0; - if (temp_v0_5 != 6) { - if (temp_v0_5 != 7) { - if (temp_v0_5 != 8) { - if ((temp_v0_5 != 0xD) && (temp_v0_5 != 0x2A)) { - - } else { - func_802A0350(phi_s0, temp_a1); - } - } else if ((phi_s0->unk0 != 8) || (phi_s0->unk14 != temp_a1->unk14)) { - func_802A0350(phi_s0, temp_a1); - } - } else if ((phi_s0->unk0 != 7) || (phi_s0->unk14 != temp_a1->unk14)) { - func_802A0350(phi_s0, temp_a1); - } - } else if (phi_s0->unk0 != 6) { - func_802A0350(phi_s0, temp_a1); - } - } + for (i = D_8015F900; i < 99; i++) { + phi_s0 = &D_8015F9B8[i]; + + if ((phi_s0->unk2 & 0x8000) == 0) { continue; } + if ((phi_s0->unk2 & 0x4000) == 0) { continue; } + + switch(phi_s0->unk0) { + case 6: + case 7: + case 8: + case 42: + case 13: + + for (j = i + 1; j < 100; j++) { + temp_a1 = &D_8015F9B8[j]; + + if ((phi_s0->unk2 & 0x8000) == 0) {continue;} + if ((phi_s0->unk2 & 0x4000) == 0) {continue;} + + if ((temp_a1->unk2 & 0x8000) == 0) { continue; } + if ((temp_a1->unk2 & 0x4000) == 0) { continue; } + + switch(temp_a1->unk0) { + case 6: + if (phi_s0->unk0 == 6) { continue; } + func_802A0350(phi_s0, temp_a1); + break; + case 7: + if (phi_s0->unk0 == 7) { + if (phi_s0->unk10[2] == temp_a1->unk10[2]) { continue; } } - temp_s1_2 = phi_s1 + 1; - phi_s1 = temp_s1_2; - } while (temp_s1_2 != 0x64); + func_802A0350(phi_s0, temp_a1); + + break; + case 8: + if (phi_s0->unk0 == 8) { + if (phi_s0->unk10[2] == temp_a1->unk10[2]) { continue; } + } + func_802A0350(phi_s0, temp_a1); + break; + case 42: + case 13: + func_802A0350(phi_s0, temp_a1); + break; } } - } - phi_s0 += 0x70; - phi_v1 = sp44; - } while (sp44 < 0x63); + + break; + } } } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/func_802A0E44.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -f32 func_802ABEAC(void *, void *, void *); // extern -extern ? D_8015F9B8; +f32 func_802ABEAC(UnkActorInner*, Vec3f); extern f32 D_802B99CC; -void func_802A1064(void *arg0) { - f32 temp_f6; - void *temp_a1; - void *temp_a2; +void func_802A1064(struct Actor *arg0) { + if (arg0 - &D_8015F9B8[0] > 100u) { return; } + if ((arg0->unk2 & 0x8000) == 0) { return; } - temp_a2 = arg0; - if ((((arg0 - &D_8015F9B8) / 0x70) < 0x65) && ((arg0->unk2 & 0x8000) != 0)) { - temp_a1 = temp_a2 + 0x18; - if (arg0->unk0 == 0xD) { - arg0->unk6 = 1; - arg0 = temp_a2; - temp_f6 = func_802ABEAC(arg0 + 0x30, temp_a1, temp_a2) + D_802B99CC; - arg0->unk4 = 0x64; - arg0->unk28 = temp_f6; - } + if (arg0->unk0 == 13) { + arg0->unk6 = 1; + arg0->unk24[1] = func_802ABEAC(&arg0->unk30, arg0->unk18) + D_802B99CC; + arg0->unk4 = 100; } } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/func_802A1064.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_800C9060(s32, ?); // extern -? func_8029E854(void *); // extern -? func_802A1064(void *, u16); // extern -? func_802ADDC8(f32, f32, void *, f32, f32, f32, f32); // extern -? func_802B4E30(void *); // extern extern f32 D_802B99D0; extern f32 D_802B99D4; -extern ? gControllers; -extern ? gPlayers; - -void update_obj_fake_item_box(void *arg0) { - u32 sp74; - f32 sp48; - f32 sp44; - f32 sp40; - void *sp2C; - f32 temp_f0; - f32 temp_f12; +void func_802ADDC8(UnkActorInner*, f32, f32, f32, f32); +void func_802B4E30(struct Actor*); +void update_obj_fake_item_box(struct Actor *arg0) { + u32 temp_v1 = arg0->unk24[0]; + Player *temp_v0_4 = &gPlayers[temp_v1]; + struct Controller *temp_v1_3; + + s32 pad[7]; + f32 temp_f2_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_v0; - s16 temp_v0_2; - s16 temp_v0_3; - s16 temp_v1_2; - u16 temp_a1; - u32 temp_v1; - void *temp_v0_4; - void *temp_v1_3; + s32 pad2[3]; - temp_v1 = arg0->unk24; - temp_v0 = arg0->unk6; - if (temp_v0 != 0) { - if (temp_v0 != 1) { - if (temp_v0 != 2) { - func_8029E854(arg0); - // Duplicate return node #26. Try simplifying control flow for better match - return; + switch(arg0->unk6) { + case 0: + arg0->unkC = arg0->unk8 * 5.5f; + arg0->unk10[0] -= 0xB6; + arg0->unk10[1] += 0x16C; + arg0->unk10[2] -= 0xB6; + + temp_f14 = temp_v0_4->pos[0] - arg0->unk18[0]; + temp_f16 = temp_v0_4->pos[1] - arg0->unk18[1]; + temp_f18 = temp_v0_4->pos[2] - arg0->unk18[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; + arg0->unk18[0] = temp_v0_4->pos[0] - temp_f14; + arg0->unk18[1] = (temp_v0_4->pos[1] - temp_f16) - 1.0f; + arg0->unk18[2] = temp_v0_4->pos[2] - temp_f18; + func_802ADDC8(&arg0->unk30, arg0->unkC, arg0->unk18[0], arg0->unk18[1], arg0->unk18[2]); + func_802B4E30(arg0); + 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(arg0); + temp_v0_4->unk_00C &= 0xFFFBFFFF; + func_800C9060(((temp_v0_4 - gPlayerOne)) & 0xFF, 0x19008012); + } } - temp_v0_2 = arg0->unk4; - if ((temp_v0_2 >= 0x14) || (temp_v0_2 < 0)) { - func_8029E854(arg0); - return; + break; + case 1: + if (arg0->unk8 < 1.0f) { + arg0->unk8 += D_802B99D0; + } else if (arg0->unk8 >= 1.0f) { + arg0->unk8 = 1.0f; } - arg0->unk4 = temp_v0_2 + 1; - arg0->unk10 = arg0->unk10 + 0x444; - arg0->unk12 = arg0->unk12 - 0x2D8; - arg0->unk14 = arg0->unk14 + 0x16C; - return; - } - temp_f0 = arg0->unk8; - if (temp_f0 < 1.0f) { - arg0->unk8 = temp_f0 + D_802B99D0; - goto block_11; - } - if (temp_f0 >= 1.0f) { - arg0->unk8 = 1.0f; -block_11: - } - temp_f2 = arg0->unk1C; - temp_f12 = arg0->unk28; - arg0->unkC = arg0->unk8 * 5.5f; - if (temp_f12 <= temp_f2) { - arg0->unk1C = temp_f12; - } else { - arg0->unk1C = temp_f2 + D_802B99D4; - } - temp_v1_2 = arg0->unk2; - if ((temp_v1_2 & 0x1000) != 0) { - temp_v0_3 = arg0->unk4; - if ((temp_v0_3 <= 0) || (temp_v0_3 >= 0x12D)) { - arg0->unk2 = temp_v1_2 & 0xEFFF; - arg0->unk4 = 0; + + arg0->unkC = arg0->unk8 * 5.5f; + if (arg0->unk24[1] <= arg0->unk18[1]) { + arg0->unk18[1] = arg0->unk24[1]; } else { - arg0->unk4 = temp_v0_3 - 1; + arg0->unk18[1] += D_802B99D4; } - } - arg0->unk10 = arg0->unk10 - 0xB6; - arg0->unk12 = arg0->unk12 + 0x16C; - arg0->unk14 = arg0->unk14 - 0xB6; - return; - } - arg0->unkC = arg0->unk8 * 5.5f; - arg0->unk10 = arg0->unk10 - 0xB6; - arg0->unk12 = arg0->unk12 + 0x16C; - arg0->unk14 = arg0->unk14 - 0xB6; - temp_v0_4 = (temp_v1 * 0xDD8) + &gPlayers; - temp_f14 = temp_v0_4->unk14 - arg0->unk18; - temp_f16 = temp_v0_4->unk18 - arg0->unk1C; - sp48 = temp_f14; - temp_f18 = temp_v0_4->unk1C - arg0->unk20; - sp44 = temp_f16; - sp74 = temp_v1; - sp40 = temp_f18; - sp2C = temp_v0_4; - temp_f2_2 = sqrtf((temp_f14 * temp_f14) + (temp_f16 * temp_f16) + (temp_f18 * temp_f18)) / 10.0f; - temp_f14_2 = temp_f14 / temp_f2_2; - temp_f16_2 = temp_f16 / temp_f2_2; - arg0->unk18 = temp_v0_4->unk14 - temp_f14_2; - arg0->unk1C = (temp_v0_4->unk18 - temp_f16_2) - 1.0f; - arg0->unk20 = temp_v0_4->unk1C - (temp_f18 / temp_f2_2); - func_802ADDC8(1.0f, temp_f14_2, arg0 + 0x30, arg0->unkC, arg0->unk18, arg0->unk1C, arg0->unk20); - func_802B4E30(arg0); - temp_v1_3 = (sp74 * 0x10) + &gControllers; - if (((temp_v0_4->unk0 & 0x4000) != 0) && (temp_a1 = temp_v1_3->unk8, ((temp_a1 & 0x2000) != 0))) { - temp_v1_3->unk8 = temp_a1 & 0xDFFF; - sp2C = temp_v0_4; - func_802A1064(arg0, temp_a1); - temp_v0_4->unkC = temp_v0_4->unkC & 0xFFFBFFFF; - func_800C9060(((temp_v0_4 - gPlayerOne) / 0xDD8) & 0xFF, 0x19008012); + if ((arg0->unk2 & 0x1000) != 0) { + if ((arg0->unk4 <= 0) || (arg0->unk4 >= 0x12D)) { + arg0->unk2 &= 0xEFFF; + arg0->unk4 = 0; + } else { + arg0->unk4--; + } + } + arg0->unk10[0] -= 0xB6; + arg0->unk10[1] += 0x16C; + arg0->unk10[2] -= 0xB6; + break; + + case 2: + if ((arg0->unk4 >= 0x14) || (arg0->unk4 < 0)) { + func_8029E854(arg0); + } else { + arg0->unk4++; + arg0->unk10[0] += 0x444; + arg0->unk10[1] -= 0x2D8; + arg0->unk10[2] += 0x16C; + } + break; + default: + func_8029E854(arg0); + break; } } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/update_obj_fake_item_box.s") -#endif - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_8029EC88(f32 *, ? *, ? *, ?); // extern -? func_802B52BC(? *, ?, ?, ?); // extern -? load_giant_egg(? *, ?, ?, ?); // extern -extern ? D_8015F9B8; -extern void *D_802BA05C; void func_802A14BC(f32 arg0, f32 arg1, f32 arg2) { - f32 sp3C; - f32 sp38; - f32 sp34; - ? sp28; - ? sp20; - f32 *temp_a0; + Vec3f sp34; + Vec3f sp28; + Vec3s sp20; + s16 temp_a0; if (gModeSelection != TIME_TRIALS) { - func_802B52BC(&sp20, 0, 0, 0); - load_giant_egg(&sp28, 0, 0, 0); - temp_a0 = &sp34; - sp34 = arg0; - sp38 = arg1; - sp3C = arg2; - D_802BA05C = (func_8029EC88(temp_a0, &sp20, &sp28, 0x2B) * 0x70) + &D_8015F9B8; + func_802B52BC(sp20, 0, 0, 0); + load_giant_egg(sp28, 0, 0, 0); + sp34[0] = arg0; + sp34[1] = arg1; + sp34[2] = arg2; + temp_a0 = func_8029EC88(sp34, sp20, sp28, 43); + D_802BA05C = &D_8015F9B8[temp_a0]; } } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/func_802A14BC.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void update_obj_item_box_hot_air_balloon(void *arg0) { - s16 temp_v0; - s16 temp_v0_2; +void update_obj_item_box_hot_air_balloon(struct Actor *arg0) { + switch(arg0->unk6) { + case 5: + arg0->unk10[0] += 0xB6; + arg0->unk10[1] -= 0x16C; + arg0->unk10[2] += 0xB6; + break; + case 3: + if (arg0->unk4 == 0x14) { + arg0->unk6 = 5; + arg0->unk2 = -0x4000; + return; + } + arg0->unk4++; + arg0->unk10[0] += 0x444; + arg0->unk10[1] -= 0x2D8; + arg0->unk10[2] += 0x16C; + break; - temp_v0 = arg0->unk6; - if (temp_v0 != 3) { - if (temp_v0 == 5) { - arg0->unk10 = arg0->unk10 + 0xB6; - arg0->unk12 = arg0->unk12 - 0x16C; - arg0->unk14 = arg0->unk14 + 0xB6; - return; - } - // Duplicate return node #6. Try simplifying control flow for better match - return; - } - temp_v0_2 = arg0->unk4; - if (temp_v0_2 == 0x14) { - arg0->unk6 = 5; - arg0->unk2 = -0x4000; - return; } - arg0->unk4 = temp_v0_2 + 1; - arg0->unk10 = arg0->unk10 + 0x444; - arg0->unk12 = arg0->unk12 - 0x2D8; - arg0->unk14 = arg0->unk14 + 0x16C; } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/update_obj_item_box_hot_air_balloon.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 extern f32 D_802B99D8; extern f32 D_802B99DC; -void update_obj_item_box(void *arg0) { - f32 temp_f0; - f32 temp_f12; - f32 temp_f2; - s16 temp_v0; - s16 temp_v0_2; - - temp_v0 = arg0->unk6; - if (temp_v0 != 0) { - if (temp_v0 != 1) { - if (temp_v0 != 2) { - if (temp_v0 != 3) { - return; - } - temp_v0_2 = arg0->unk4; - if (temp_v0_2 == 0x14) { - arg0->unk6 = 0; - arg0->unk2 = -0x4000; - arg0->unk1C = arg0->unk8 - 20.0f; - return; - } - arg0->unk4 = temp_v0_2 + 1; - arg0->unk10 = arg0->unk10 + 0x444; - arg0->unk12 = arg0->unk12 - 0x2D8; - arg0->unk14 = arg0->unk14 + 0x16C; - return; +void update_obj_item_box(struct Actor *arg0) { + switch (arg0->unk6) { + case 0: + arg0->unk6 = 1; + break; + case 1: + if ((arg0->unk18[1] - arg0->unk24[0]) < D_802B99D8) { + arg0->unk18[1] += D_802B99DC; + } else { + arg0->unk18[1] = arg0->unk24[0] + D_802B99D8; + arg0->unk6 = 2; + arg0->unk2 = 0xC000; } - arg0->unk10 = arg0->unk10 + 0xB6; - arg0->unk12 = arg0->unk12 - 0x16C; - arg0->unk14 = arg0->unk14 + 0xB6; - return; - } - temp_f0 = arg0->unk1C; - temp_f2 = arg0->unk24; - temp_f12 = D_802B99D8; - if ((temp_f0 - temp_f2) < temp_f12) { - arg0->unk1C = temp_f0 + D_802B99DC; - return; - } - arg0->unk6 = 2; - arg0->unk2 = -0x4000; - arg0->unk1C = temp_f2 + temp_f12; - return; + break; + case 2: + arg0->unk10[0] += 0xB6; + arg0->unk10[1] -= 0x16C; + arg0->unk10[2] += 0xB6; + break; + case 3: + if (arg0->unk4 == 20) { + arg0->unk6 = 0; + arg0->unk18[1] = arg0->unk8 - 20.0f; + arg0->unk2 = 0xC000; + } else { + arg0->unk4++; + arg0->unk10[0] += 0x444; + arg0->unk10[1] -= 0x2D8; + arg0->unk10[2] += 0x16C; + } + break; } - arg0->unk6 = 1; } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/update_obj_item_box.s") -#endif #ifdef MIPS_TO_C /* @@ -6630,7 +6371,7 @@ extern f32 D_802B99F0; extern f32 D_802B99F4; extern f32 D_802B99F8; extern f32 D_802B99FC; -extern void *gDisplayListHead; + void func_802A171C(void *arg0, void *arg1) { s16 sp184; @@ -6883,20 +6624,20 @@ GLOBAL_ASM("asm/non_matchings/code_actors/func_802A171C.s") #ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_802B4FF8(f32 *, ?); // extern -? func_802B5450(f32 *, f32 *, f32 *, f32 *); // extern -? func_802B5F00(f32, f32 *, f32); // extern -? func_802B5F74(f32 *, f32 *, s16 *, void *); // extern -f32 func_802B80D0(f32 *, u16, ?, f32, f32); // extern -extern ? 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; +//s32 func_802B4FF8(f32 *, ?); // extern +//? func_802B5450(f32 *, f32 *, f32 *, f32 *); // extern +//? func_802B5F00(f32, f32 *, f32); // extern +//? func_802B5F74(f32 *, f32 *, s16 *, void *); // extern +//f32 func_802B80D0(f32 *, u16, ?, f32, f32); // extern +extern s8 D_0D002EE8[]; +extern s8 D_0D003008[]; +extern s8 D_0D003090[]; +extern s8 D_0D0030F8[]; +extern s8 D_0D003128[]; +extern s8 D_0D003158[]; +extern s8 D_0D003188[]; +extern s8 D_0D0031B8[]; +extern s8 D_0D0031E8[]; extern f32 D_802B9A00; extern f32 D_802B9A04; extern f32 D_802B9A08; @@ -6907,7 +6648,7 @@ extern f32 D_802B9A18; extern f32 D_802B9A1C; extern f32 D_802B9A20; extern f32 D_802B9A24; -extern void *gDisplayListHead; + void func_802A1EA0(void *arg0, void *arg1) { f32 sp17C; @@ -6940,34 +6681,7 @@ void func_802A1EA0(void *arg0, void *arg1) { s16 *temp_a2; s16 temp_a0; s16 temp_v1; - void *temp_v0; - void *temp_v0_10; - void *temp_v0_11; - void *temp_v0_12; - void *temp_v0_13; - void *temp_v0_14; - void *temp_v0_15; - void *temp_v0_16; - void *temp_v0_17; - void *temp_v0_18; - void *temp_v0_19; - void *temp_v0_20; - void *temp_v0_21; - void *temp_v0_22; - void *temp_v0_23; - void *temp_v0_24; - void *temp_v0_25; - void *temp_v0_26; - void *temp_v0_27; - void *temp_v0_28; - void *temp_v0_2; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - void *temp_v0_6; - void *temp_v0_7; - void *temp_v0_8; - void *temp_v0_9; + s16 phi_a0; s16 phi_a0_2; void *phi_t1; @@ -6988,18 +6702,13 @@ void func_802A1EA0(void *arg0, void *arg1) { sp170 = arg1->unk20; func_802B5F74(&sp118, &sp168, &sp160); if (func_802B4FF8(&sp118, 0) != 0) { - temp_v0 = gDisplayListHead; - gDisplayListHead = temp_v0 + 8; - temp_v0->unk0 = 0x6000000; - temp_v0->unk4 = &D_0D002EE8; + + gSPDisplayList(gDisplayListHead++, D_0D002EE8); sp162 = arg1->unk12 * 2; sp16C = arg1->unk1C; func_802B5F74(&sp118, &sp168, &sp160, arg1); if (func_802B4FF8(&sp118, 0) != 0) { - temp_v0_2 = gDisplayListHead; - gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk4 = &D_0D003008; - temp_v0_2->unk0 = 0x6000000; + gSPDisplayList(gDisplayListHead++, D_0D003008); phi_a0 = arg1->unk6; goto block_7; } @@ -7011,10 +6720,7 @@ block_7: if (phi_a0 == 5) { func_802B5F74(&sp118, sp38, arg1 + 0x10); if (func_802B4FF8(&sp118, 0) != 0) { - temp_v0_3 = gDisplayListHead; - gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = &D_0D003008; - temp_v0_3->unk0 = 0x6000000; + gSPDisplayList(gDisplayListHead++, D_0D003008); phi_a0_2 = arg1->unk6; phi_t1 = arg1; goto block_10; @@ -7025,68 +6731,35 @@ block_10: if (phi_a0_2 != 3) { func_802B5F74(&sp118, sp38, temp_a2); if (func_802B4FF8(&sp118, 0) != 0) { - temp_v0_4 = gDisplayListHead; - gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x20000; - temp_v0_4->unk0 = 0xB6000000; - temp_v0_5 = gDisplayListHead; - gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk0 = 0xFC121824; - temp_v0_5->unk4 = 0xFF33FFFF; + + gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); + gDPSetCombineLERP(gDisplayListHead++, TEXEL0, SHADE, SHADE, 1, TEXEL0, PRIMITIVE, LOD_FRACTION, 0, 0, 0, TEXEL1, 0, 0, 0, SHADE, 0); temp_v1 = arg1->unk12; if ((temp_v1 < 0xAA1) && (temp_v1 > 0)) { - temp_v0_6 = gDisplayListHead; - gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk0 = 0xB900031D; - temp_v0_6->unk4 = 0x552078; + gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); } else if ((temp_v1 >= 0x6AA5) && (temp_v1 < 0x754E)) { - temp_v0_7 = gDisplayListHead; - gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk0 = 0xB900031D; - temp_v0_7->unk4 = 0x552078; + gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); } else if ((temp_v1 >= 0x38E1) && (temp_v1 < 0x438A)) { - temp_v0_8 = gDisplayListHead; - gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk0 = 0xB900031D; - temp_v0_8->unk4 = 0x552078; + gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); } else if ((temp_v1 >= 0xC711) && (temp_v1 < 0xD1BA)) { - temp_v0_9 = gDisplayListHead; - gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk0 = 0xB900031D; - temp_v0_9->unk4 = 0x552078; + gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); } else { - temp_v0_10 = gDisplayListHead; - gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk4 = 0; - temp_v0_10->unk0 = 0xC0000000; - temp_v0_11 = gDisplayListHead; - gDisplayListHead = temp_v0_11 + 8; + gDPNoOp(gDisplayListHead++); + gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2); +/* + temp_v0_11->unk4 = 0x504B50; temp_v0_11->unk0 = 0xB900031D; + */ } - temp_v0_12 = gDisplayListHead; - gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk4 = 0x200; - temp_v0_12->unk0 = 0xB7000000; - temp_v0_13 = gDisplayListHead; - gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk0 = 0x6000000; - temp_v0_13->unk4 = &D_0D003090; + gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); + gSPDisplayList(gDisplayListHead++, D_0D003090); goto block_42; } } else { - temp_v0_14 = gDisplayListHead; - gDisplayListHead = temp_v0_14 + 8; - temp_v0_14->unk4 = 0x20000; - temp_v0_14->unk0 = 0xB6000000; - temp_v0_15 = gDisplayListHead; - gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk4 = 0x2000; - temp_v0_15->unk0 = 0xB6000000; - temp_v0_16 = gDisplayListHead; - gDisplayListHead = temp_v0_16 + 8; - temp_v0_16->unk4 = 0; - temp_v0_16->unk0 = 0xC0000000; + gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); + gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); + gDPNoOp(gDisplayListHead++); sp15C = phi_t1->unk4; func_802B5F74(&sp118, sp38, temp_a2); if (sp15C < 10.0f) { @@ -7096,15 +6769,14 @@ block_10: } func_802B5F00(sp15C, &sp118, phi_f0); if ((arg1->unk4 & 1) != 0) { - temp_v0_17 = gDisplayListHead; - gDisplayListHead = temp_v0_17 + 8; - temp_v0_17->unk4 = 0x552078; - temp_v0_17->unk0 = 0xB900031D; + gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); + + } else { - temp_v0_18 = gDisplayListHead; - gDisplayListHead = temp_v0_18 + 8; - temp_v0_18->unk4 = 0x4045D8; - temp_v0_18->unk0 = 0xB900031D; + gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2); + + //temp_v0_18->unk4 = 0x4045D8; + //temp_v0_18->unk0 = 0xB900031D; } sp174 = 0.0f; temp_f2 = 2.0f * sp15C; @@ -7113,10 +6785,7 @@ block_10: sp38 = (bitwise f32 *) temp_f2; func_802B5450(&sp118, &spD8, &sp174); if (func_802B4FF8(&spD8, 0) != 0) { - temp_v0_19 = gDisplayListHead; - gDisplayListHead = temp_v0_19 + 8; - temp_v0_19->unk0 = 0x6000000; - temp_v0_19->unk4 = &D_0D003158; + gSPDisplayList(gDisplayListHead++, D_0D003158); temp_f2_2 = D_802B9A10 * sp15C; temp_f12 = 0.5f * sp15C; sp174 = temp_f2_2; @@ -7126,10 +6795,7 @@ block_10: sp30 = temp_f12; func_802B5450((bitwise f32 *) temp_f12, &sp118, &spD8, &sp174); if (func_802B4FF8(&spD8, 0) != 0) { - temp_v0_20 = gDisplayListHead; - gDisplayListHead = temp_v0_20 + 8; - temp_v0_20->unk0 = 0x6000000; - temp_v0_20->unk4 = &D_0D0031B8; + gSPDisplayList(gDisplayListHead++, D_0D0031B8); temp_f0_2 = -0.5f * sp15C; temp_a2_2 = &sp174; sp174 = sp34; @@ -7138,20 +6804,11 @@ block_10: sp2C = temp_f0_2; func_802B5450(&sp118, &spD8, temp_a2_2); if (func_802B4FF8(&spD8, 0) != 0) { - temp_v0_21 = gDisplayListHead; - gDisplayListHead = temp_v0_21 + 8; - temp_v0_21->unk4 = &D_0D003128; - temp_v0_21->unk0 = 0x6000000; + gSPDisplayList(gDisplayListHead++, D_0D003128); if ((arg1->unk4 & 1) == 0) { - temp_v0_22 = gDisplayListHead; - gDisplayListHead = temp_v0_22 + 8; - temp_v0_22->unk4 = 0x552078; - temp_v0_22->unk0 = 0xB900031D; + gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); } else { - temp_v0_23 = gDisplayListHead; - gDisplayListHead = temp_v0_23 + 8; - temp_v0_23->unk4 = 0x4045D8; - temp_v0_23->unk0 = 0xB900031D; + gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_XLU_INTER, G_RM_NOOP2); } temp_a2_3 = &sp174; sp174 = 0.0f; @@ -7159,10 +6816,7 @@ block_10: sp17C = -1.0f * sp15C; func_802B5450(&sp118, &spD8, temp_a2_3); if (func_802B4FF8(&spD8, 0) != 0) { - temp_v0_24 = gDisplayListHead; - gDisplayListHead = temp_v0_24 + 8; - temp_v0_24->unk4 = &D_0D0031E8; - temp_v0_24->unk0 = 0x6000000; + gSPDisplayList(gDisplayListHead++, D_0D0031E8); temp_f0_3 = D_802B9A20 * sp15C; temp_a2_4 = &sp174; sp17C = sp2C; @@ -7171,29 +6825,17 @@ block_10: sp178 = D_802B9A24 * sp15C; func_802B5450(&sp118, &spD8, temp_a2_4); if (func_802B4FF8(&spD8, 0) != 0) { - temp_v0_25 = gDisplayListHead; - gDisplayListHead = temp_v0_25 + 8; - temp_v0_25->unk4 = &D_0D003188; - temp_v0_25->unk0 = 0x6000000; + gSPDisplayList(gDisplayListHead++, D_0D003188); temp_a2_5 = &sp174; sp174 = sp34; sp178 = (bitwise f32) sp38; sp17C = sp30; func_802B5450(&sp118, &spD8, temp_a2_5); if (func_802B4FF8(&spD8, 0) != 0) { - temp_v0_26 = gDisplayListHead; - gDisplayListHead = temp_v0_26 + 8; - temp_v0_26->unk4 = &D_0D0030F8; - temp_v0_26->unk0 = 0x6000000; - temp_v0_27 = gDisplayListHead; - gDisplayListHead = temp_v0_27 + 8; - temp_v0_27->unk4 = 0x2000; - temp_v0_27->unk0 = 0xB7000000; + gSPDisplayList(gDisplayListHead++, D_0D0030F8); + gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK); + gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); block_42: - temp_v0_28 = gDisplayListHead; - gDisplayListHead = temp_v0_28 + 8; - temp_v0_28->unk4 = -1; - temp_v0_28->unk0 = 0xBB000001; } } } @@ -7209,694 +6851,433 @@ block_42: GLOBAL_ASM("asm/non_matchings/code_actors/func_802A1EA0.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_802B4FF8(? *, ?); // extern -? func_802B5F74(? *, s32, s32); // extern -f32 func_802B80D0(s32, u16, ?, f32, f32); // extern -extern ? D_0600CA60; +extern s8 D_0600CA60[]; extern f32 D_802B9A28; -extern void *gDisplayListHead; -void func_802A269C(void *arg0, s32 arg1) { - ? sp38; - s32 sp24; - s32 temp_a1; - void *temp_v0; - void *temp_v0_2; - void *temp_v0_3; +void func_802A269C(Camera *arg0, struct Actor *arg1) { + Mat4 sp38; + f32 unk = func_802B80D0(arg0->pos, arg1->unk18, arg0->rotX[1], 0, D_80150130[arg0 - camera1], D_802B9A28); - temp_a1 = arg1 + 0x18; - sp24 = temp_a1; - if (!(func_802B80D0(temp_a1, arg0->unk26, 0, (&D_80150130)[(arg0 - camera1) / 0xB8], D_802B9A28) < 0.0f)) { - temp_v0 = gDisplayListHead; - gDisplayListHead = temp_v0 + 8; - temp_v0->unk4 = 0x200; - temp_v0->unk0 = 0xB7000000; - temp_v0_2 = gDisplayListHead; - gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk4 = 0x20000; - temp_v0_2->unk0 = 0xB6000000; - func_802B5F74(&sp38, temp_a1, arg1 + 0x10); - if (func_802B4FF8(&sp38, 0) != 0) { - temp_v0_3 = gDisplayListHead; - gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0x6000000; - temp_v0_3->unk4 = &D_0600CA60; + if (!(unk < 0.0f)) { + gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); + gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); + + func_802B5F74(sp38, arg1->unk18, arg1->unk10); + if (func_802B4FF8(sp38, 0) != 0) { + + gSPDisplayList(gDisplayListHead++, D_0600CA60); } } } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/func_802A269C.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_802976D8(s16 *); // extern -? func_8029794C(f32 *, s16 *, ?); // extern -s32 func_802B4FF8(? *, ?); // extern -? func_802B5F74(? *, s32, s16 *); // extern -f32 func_802B80D0(s32, u16, ?, f32, f32); // extern -extern ? D_06016D70; -extern ? D_06017FA8; +extern s8 D_06016D70[]; +extern s8 D_06017FA8[]; extern f32 D_802B9A2C; -extern f32 D_802B9A30; -extern void *gDisplayListHead; +extern s32 D_800DC50C; -void func_802A27A0(void *arg0, ? *arg1, void *arg2, u16 arg3) { - ? sp60; - s16 sp5C; - s16 sp5A; - s16 sp58; - f32 sp54; - f32 sp50; - f32 sp4C; - s32 sp30; +void func_802A27A0(Camera *arg0, Mat4 arg1, struct Actor *arg2, u16 arg3) { + Mat4 sp60; + Vec3s sp5C; + Vec3f sp54; f32 temp_f0; - void *temp_v0; - void *temp_v0_2; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - f32 phi_f2; if (D_800DC50C != CREDITS_SEQUENCE) { - temp_f0 = func_802B80D0(arg2 + 0x18, arg0->unk26, 0x43480000, (&D_80150130)[(arg0 - camera1) / 0xB8], D_802B9A2C); - phi_f2 = temp_f0; + temp_f0 = func_802B80D0(arg0->pos, arg2->unk18, arg0->rotX[1], 200.0f, D_80150130[arg0 - camera1], D_802B9A2C); if (temp_f0 < 0.0f) { return; } - goto block_4; - } - arg3 = 0xF; - phi_f2 = 0.0f; -block_4: - temp_v0 = gDisplayListHead; - gDisplayListHead = temp_v0 + 8; - temp_v0->unk4 = 0x200; - temp_v0->unk0 = 0xB7000000; - if ((arg3 >= 0xD) && (arg3 < 0x14)) { - sp30 = arg2 + 0x18; - if (phi_f2 < D_802B9A30) { - sp4C = arg2->unk18; - sp50 = 3.0f; - sp54 = arg2->unk20; - func_802976D8(&sp58); - func_8029794C(&sp4C, &sp58, 0x41200000); + } else { + arg3 = 15; + temp_f0 = 0.0f; + } + + gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); + if ((arg3 > 12) && (arg3 < 20)) { + if (temp_f0 < 640000.0f) { + sp54[0] = arg2->unk18[0]; + sp54[1] = 3.0f; + sp54[2] = arg2->unk18[2]; + func_802976D8(sp5C); + func_8029794C(sp54, sp5C, 10.0f); } - sp58 = 0; - sp5C = 0; - sp5A = arg2->unk12; - func_802B5F74(&sp60, sp30, &sp58); - if (func_802B4FF8(&sp60, 0) != 0) { - temp_v0_2 = gDisplayListHead; - gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk4 = 0x20000; - temp_v0_2->unk0 = 0xB7000000; - temp_v0_3 = gDisplayListHead; - gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0x6000000; - temp_v0_3->unk4 = &D_06016D70; - return; + sp5C[0] = 0; + sp5C[1] = arg2->unk10[1]; + sp5C[2] = 0; + func_802B5F74(sp60, arg2->unk18, sp5C); + if (func_802B4FF8(sp60, 0) == 0) { return; } + + gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING); + gSPDisplayList(gDisplayListHead++, D_06016D70); + } else { + + arg1[3][0] = arg2->unk18[0]; + arg1[3][1] = arg2->unk18[1]; + arg1[3][2] = arg2->unk18[2]; + + if (func_802B4FF8(arg1, 0) != 0) { + gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); + gSPDisplayList(gDisplayListHead++, D_06017FA8); } - // Duplicate return node #12. Try simplifying control flow for better match - return; - } - arg1->unk30 = arg2->unk18; - arg1->unk34 = arg2->unk1C; - arg1->unk38 = arg2->unk20; - if (func_802B4FF8(arg1, 0) != 0) { - temp_v0_4 = gDisplayListHead; - gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x20000; - temp_v0_4->unk0 = 0xB6000000; - temp_v0_5 = gDisplayListHead; - gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk0 = 0x6000000; - temp_v0_5->unk4 = &D_06017FA8; } } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/func_802A27A0.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_802B4FF8(? *, ?); // extern -? func_802B5F74(? *, void *, void *); // extern -f32 func_802B80D0(void *, u16, ?, f32, f32); // extern -extern ? D_06009330; -extern f32 D_802B9A34; -extern void *gDisplayListHead; +extern s8 D_06009330[]; -void func_802A29BC(void *arg0, ? arg1, void *arg2) { - ? sp40; - void *sp28; - void *temp_a1; - void *temp_v0; - void *temp_v0_2; - void *temp_v0_3; - temp_a1 = arg2 + 0x18; - if ((arg2->unk2 & 0x800) == 0) { - sp28 = temp_a1; - if (!(func_802B80D0(temp_a1, arg0->unk26, 0, (&D_80150130)[(arg0 - camera1) / 0xB8], D_802B9A34) < 0.0f)) { - temp_v0 = gDisplayListHead; - gDisplayListHead = temp_v0 + 8; - temp_v0->unk4 = 0x200; - temp_v0->unk0 = 0xB7000000; - temp_v0_2 = gDisplayListHead; - gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk4 = 0x20000; - temp_v0_2->unk0 = 0xB6000000; - func_802B5F74(&sp40, temp_a1, arg2 + 0x10); +void func_802A29BC(Camera *arg0, Mat4 arg1, struct Actor *arg2) { + Mat4 sp40; + f32 unk; + s16 temp = arg2->unk2; + + if (temp & 0x800) { return; } + unk = func_802B80D0(arg0->pos, arg2->unk18, arg0->rotX[1], 0, D_80150130[arg0 - camera1], 16000000.0f); + if (!(unk < 0.0f)) { + gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); + gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); + func_802B5F74(&sp40, arg2->unk18, arg2->unk10); if (func_802B4FF8(&sp40, 0) != 0) { - temp_v0_3 = gDisplayListHead; - gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0x6000000; - temp_v0_3->unk4 = &D_06009330; + gSPDisplayList(gDisplayListHead++, D_06009330); } } - } } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/func_802A29BC.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_802B4FF8(? *, ?); // extern -? func_802B5F74(? *, s32, s32); // extern -f32 func_802B80D0(s32, u16, ?, f32, f32); // extern -extern ? D_06010AE8; -extern ? D_06010C10; -extern ? D_06010D38; -extern ? D_801637B8; -extern ? D_802B8864; -extern f32 D_802B9A38; -extern void *gDisplayListHead; - -void func_802A2AD0(void *arg0, void *arg1) { - ? sp80; - ? sp40; - s32 sp20; - s32 temp_a1; - void *temp_v0; - void *temp_v0_2; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - void *temp_v0_6; +s32 D_802B8850[] = {0, 0, 0}; +s16 D_802B885C[] = {0, 0, 0}; +//s16 filla; - sp80.unk0 = D_802B8864.unk0; - sp80.unk4 = D_802B8864.unk4; - temp_a1 = arg1 + 0x18; - sp20 = temp_a1; - if (!(func_802B80D0(temp_a1, arg0->unk26, 0, (&D_80150130)[(arg0 - camera1) / 0xB8], D_802B9A38) < 0.0f)) { - func_802B5F74(&sp40, temp_a1, arg1 + 0x10); - if (func_802B4FF8(&sp40, 0) != 0) { - temp_v0 = gDisplayListHead; - gDisplayListHead = temp_v0 + 8; - temp_v0->unk4 = 0x20000; - temp_v0->unk0 = 0xB7000000; - temp_v0_2 = gDisplayListHead; - gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk4 = 0x2000; - temp_v0_2->unk0 = 0xB6000000; - if (*(&D_801637B8 + (arg1->unk6 * 2)) != 0) { - if (arg1->unk4 < 0x14) { - temp_v0_3 = gDisplayListHead; - gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = &D_06010AE8; - temp_v0_3->unk0 = 0x6000000; +extern s8 D_06010AE8[]; +extern s8 D_06010C10[]; +extern s8 D_06010D38[]; +extern s8 D_802B8864[]; + + +void func_802A2AD0(Camera *arg0, struct Actor *arg1) { + Vec3s sp80 = {0, 0, 0}; + Mat4 sp40; + f32 unk = func_802B80D0(arg0->pos, arg1->unk18, arg0->rotX[1], 0.0f, D_80150130[arg0 - camera1], 4000000.0f); + + if (unk < 0.0f) { return; } + func_802B5F74(sp40, arg1->unk18, arg1->unk10); + if (func_802B4FF8(sp40, 0) == 0) { return; } + + gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING); + gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK); + + if (D_801637B8[arg1->unk6]) { + + if (arg1->unk4 < 20) { + gSPDisplayList(gDisplayListHead++, D_06010AE8); } else { - temp_v0_4 = gDisplayListHead; - gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = &D_06010C10; - temp_v0_4->unk0 = 0x6000000; + gSPDisplayList(gDisplayListHead++, D_06010C10); } } else { - temp_v0_5 = gDisplayListHead; - gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk0 = 0x6000000; - temp_v0_5->unk4 = &D_06010D38; + gSPDisplayList(gDisplayListHead++, D_06010D38); } - temp_v0_6 = gDisplayListHead; - gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0x2000; - temp_v0_6->unk0 = 0xB7000000; - } - } + gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK); + } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/func_802A2AD0.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_8029794C(void *, void *, ?); // extern -s32 func_802B4FF8(? *, ?); // extern -? func_802B5F74(? *, void *, ? *); // extern -f32 func_802B80D0(void *, u16, ?, f32, f32); // extern -extern ? D_060185F8; -extern ? D_060186B8; -extern ? D_06018948; -extern ? D_06018A08; -extern ? D_06018C98; -extern ? D_06018D58; -extern ? D_802B886C; -extern f32 D_802B9A3C; -extern f32 D_802B9A40; -extern s32 *gDisplayListHead; - -void func_802A2C78(void *arg0, ? arg1, void *arg2) { - ? spA8; - ? sp68; - s16 sp62; - void *sp20; +extern s8 D_060185F8[]; +extern s8 D_060186B8[]; +extern s8 D_06018948[]; +extern s8 D_06018A08[]; +extern s8 D_06018C98[]; +extern s8 D_06018D58[]; + +void func_802A2C78(Camera *arg0, Mat4 arg1, struct Actor *arg2) { + Vec3s spA8 = {0, 0, 0}; + Mat4 sp68; f32 temp_f0; - s16 temp_a2; - s16 temp_v0; - s32 *temp_v0_10; - s32 *temp_v0_11; - s32 *temp_v0_12; - s32 *temp_v0_13; - s32 *temp_v0_14; - s32 *temp_v0_15; - s32 *temp_v0_2; - s32 *temp_v0_3; - s32 *temp_v0_4; - s32 *temp_v0_5; - s32 *temp_v0_6; - s32 *temp_v0_7; - s32 *temp_v0_8; - s32 *temp_v0_9; - void *temp_a1; - s32 *phi_v0; + s16 temp_v0 = arg2->unk2; - spA8.unk0 = D_802B886C.unk0; - spA8.unk4 = D_802B886C.unk4; - temp_v0 = arg2->unk2; - temp_a1 = arg2 + 0x18; - if (((temp_v0 & 0x800) == 0) && (sp20 = temp_a1, sp62 = temp_v0, temp_f0 = func_802B80D0(temp_a1, arg0->unk26, 0, (&D_80150130)[(arg0 - camera1) / 0xB8], D_802B9A3C), !(temp_f0 < 0.0f))) { - if (((temp_v0 & 0x400) == 0) && (temp_f0 < D_802B9A40)) { - func_8029794C(sp20, arg2 + 0x10, 0x40000000); + if ((temp_v0 & 0x800)) { + return; + } + + temp_f0 = func_802B80D0(arg0->pos, arg2->unk18, arg0->rotX[1], 0.0f, D_80150130[arg0 - camera1], 4000000.0f); + + if (!(temp_f0 < 0.0f)) { + if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) { + func_8029794C(arg2->unk18, arg2->unk10, 2.0f); } - func_802B5F74(&sp68, sp20, &spA8); - if (func_802B4FF8(&sp68, 0) != 0) { - temp_v0_2 = gDisplayListHead; - gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk4 = 0; - temp_v0_2->unk0 = 0xBA000E02; - temp_v0_3 = gDisplayListHead; - gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = 0x20000; - temp_v0_3->unk0 = 0xB7000000; - temp_a2 = arg2->unk4; - if (temp_a2 != 0) { - if (temp_a2 != 1) { - if (temp_a2 != 2) { - return; - } - temp_v0_4 = gDisplayListHead; - gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = &D_06018D58; - temp_v0_4->unk0 = 0x6000000; - temp_v0_5 = gDisplayListHead; - gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0x2000; - temp_v0_5->unk0 = 0xB6000000; - temp_v0_6 = gDisplayListHead; - gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = &D_06018C98; - temp_v0_6->unk0 = 0x6000000; - temp_v0_7 = gDisplayListHead; - gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0x2000; - phi_v0 = temp_v0_7; - goto block_13; - } - temp_v0_8 = gDisplayListHead; - gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = &D_06018A08; - temp_v0_8->unk0 = 0x6000000; - temp_v0_9 = gDisplayListHead; - gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk4 = 0x2000; - temp_v0_9->unk0 = 0xB6000000; - temp_v0_10 = gDisplayListHead; - gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk4 = &D_06018948; - temp_v0_10->unk0 = 0x6000000; - temp_v0_11 = gDisplayListHead; - gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk4 = 0x2000; - phi_v0 = temp_v0_11; - goto block_13; + func_802B5F74(sp68, arg2->unk18, spA8); + if (func_802B4FF8(sp68, 0) != 0) { + + gDPSetTextureLUT(gDisplayListHead++, G_TT_NONE); + gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING); + + switch(arg2->unk4) { + 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; + } - temp_v0_12 = gDisplayListHead; - gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk4 = &D_060186B8; - temp_v0_12->unk0 = 0x6000000; - temp_v0_13 = gDisplayListHead; - gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk4 = 0x2000; - temp_v0_13->unk0 = 0xB6000000; - temp_v0_14 = gDisplayListHead; - gDisplayListHead = temp_v0_14 + 8; - temp_v0_14->unk4 = &D_060185F8; - temp_v0_14->unk0 = 0x6000000; - temp_v0_15 = gDisplayListHead; - gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk4 = 0x2000; - phi_v0 = temp_v0_15; -block_13: - *phi_v0 = 0xB7000000; - // Duplicate return node #14. Try simplifying control flow for better match - return; } - // Duplicate return node #14. Try simplifying control flow for better match } } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/func_802A2C78.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_802A171C(s32, ? *); // extern -? func_802A1EA0(s32, ? *); // extern +void func_802A171C(Camera*, struct Actor*); // extern +void func_802A1EA0(Camera*, struct Actor*); // extern extern s32 D_8015F8DC; -extern ? D_8015F9B8; -extern ? D_80162578; -void func_802A2F34(void *arg0) { - ? *temp_s0; - s16 temp_v0; - s32 temp_s1; - ? *phi_s0; - - temp_s1 = arg0->unk4; +void func_802A2F34(struct UnkStruct_800DC5EC *arg0) { + Camera *temp_s1 = arg0->camera; + struct Actor *phi_s0; + s32 i; D_8015F8DC = 0; - phi_s0 = &D_8015F9B8; - do { - if (phi_s0->unk2 != 0) { - temp_v0 = phi_s0->unk0; - if (temp_v0 != 0xC) { - if (temp_v0 != 0xD) { - if (temp_v0 != 0x2B) { - } else { - func_802A1EA0(temp_s1, phi_s0); - } - } else { - func_802A171C(temp_s1, phi_s0); - } - } else { + for (i = 0; i < 100; i++) { + phi_s0 = &D_8015F9B8[i]; + + if (phi_s0->unk2 == 0) { + continue; + } + + switch(phi_s0->unk0) { + case 13: + func_802A171C(temp_s1, phi_s0); + break; + case 12: func_802A1EA0(temp_s1, phi_s0); - } + break; + case 43: + func_802A1EA0(temp_s1, phi_s0); + break; } - temp_s0 = phi_s0 + 0x70; - phi_s0 = temp_s0; - } while (temp_s0 != &D_80162578); + } } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/func_802A2F34.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 -? func_80297340(f32, f32, void *); /* extern */ -? func_80297A50(void *, ? *, ? *); /* extern */ -? func_80298328(void *, ? *, ? *); /* extern */ -? func_802986B4(void *, ? *, ? *); /* extern */ -? func_80298D7C(void *, ? *, ? *); /* extern */ -? func_80299144(void *, ? *, ? *); /* extern */ -? func_8029930C(void *, ? *, ? *); /* extern */ -? func_802994D4(void *, ? *, ? *); /* extern */ -? func_8029969C(void *, ? *, ? *); /* extern */ -? func_80299864(void *, ? *, ? *); /* extern */ -? func_80299A2C(void *, ? *, ? *); /* extern */ -? func_80299BF4(void *, ? *, ? *); /* extern */ -? func_80299DBC(void *, ? *, ? *); /* extern */ -? func_80299EDC(void *, ? *, ? *); /* extern */ -? func_80299FFC(void *, ? *, ? *); /* extern */ -? func_8029A11C(void *, ? *, ? *); /* extern */ -? func_8029A23C(void *, ? *, ? *); /* extern */ -? func_8029A690(void *, ? *, ? *); /* extern */ -? func_8029A75C(void *, ? *, ? *); /* extern */ -? func_8029A828(void *, ? *, ? *); /* extern */ -? func_8029A8F4(void *, ? *, ? *); /* extern */ -? func_8029AC18(void *, ? *, ? *); /* extern */ -? func_8029AE1C(void *, ? *, ? *, u16); /* extern */ -? func_8029B06C(void *, ? *); /* extern */ -? func_8029B2E4(void *, ? *); /* extern */ -? func_8029B4E0(void *, ? *); /* extern */ -? func_8029B6EC(void *, ? *); /* extern */ -? func_8029B8E8(void *, ? *); /* extern */ -? func_8029BFB0(void *, ? *); /* extern */ -? func_8029C3CC(void *, ? *); /* extern */ -? func_8029CA90(void *, ? *); /* extern */ -? func_802A269C(void *, ? *); /* extern */ -? func_802A27A0(void *, ? *, ? *, u16); /* extern */ -? func_802A29BC(void *, ? *, ? *); /* extern */ -? func_802A2AD0(void *, ? *); /* extern */ -? func_802A2C78(void *, ? *, ? *); /* extern */ f32 sins(s32); /* extern */ f32 coss(s32); /* extern */ -extern ? D_801502C0; +void func_802986B4(Camera*, Mat4, struct Actor*); +void func_80298D7C(Camera*, Mat4, struct Actor*); + + +void func_802A27A0(Camera*, Mat4, struct Actor*, u16); +void func_8029AE1C(Camera*, Mat4, struct Actor*, u16); + +extern Mat4 D_801502C0; extern s32 D_8015F8E0; -extern ? D_8015F9B8; -extern ? D_80162578; -extern void *gDisplayListHead; -extern s32 gModeSelection; -static ? D_800DC628; /* unable to generate initializer */ -static ? D_800DC630; /* unable to generate initializer */ -static ? D_802B8874; /* unable to generate initializer */ -static s16 gCurrentCourseId; /* type too large by 2; unable to generate initializer */ - -void func_802A3008(void *arg0) { - s16 sp92; - ? *sp58; - ? sp4C; - f32 sp48; - ? *temp_s0; - f32 temp_f0; - s16 temp_t4; - s16 temp_v0_6; - void *temp_s1; - void *temp_v0; - void *temp_v0_2; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - ? *phi_s0; - - temp_s1 = arg0->unk4; - sp92 = arg0->unk38; - sp4C.unk0 = D_802B8874.unk0; - sp4C.unk4 = D_802B8874.unk4; - sp4C.unk8 = D_802B8874.unk8; - sp48 = sins((temp_s1->unk26 - 0x8000) & 0xFFFF); - temp_f0 = coss((temp_s1->unk26 - 0x8000) & 0xFFFF); - temp_v0 = gDisplayListHead; - D_801502C0.unk0 = temp_f0; - D_801502C0.unk8 = -sp48; - D_801502C0.unk28 = temp_f0; - gDisplayListHead = temp_v0 + 8; - D_801502C0.unk10 = 0.0f; - D_801502C0.unk4 = 0.0f; - D_801502C0.unk24 = 0.0f; - D_801502C0.unk18 = 0.0f; - D_801502C0.unkC = 0.0f; - D_801502C0.unk1C = 0.0f; - D_801502C0.unk2C = 0.0f; - D_801502C0.unk20 = sp48; - D_801502C0.unk14 = 1.0f; - D_801502C0.unk3C = 1.0f; - temp_v0->unk4 = 0x20000; - temp_v0->unk0 = 0xB6000000; - temp_v0_2 = gDisplayListHead; - gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0xBC000002; - temp_v0_2->unk4 = 0x80000040; - temp_v0_3 = gDisplayListHead; - gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0x3860010; - temp_v0_3->unk4 = &D_800DC630; - temp_v0_4 = gDisplayListHead; - gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk0 = 0x3880010; - temp_v0_4->unk4 = &D_800DC628; - temp_v0_5 = gDisplayListHead; - gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = -1; - temp_v0_5->unk0 = 0xBB000001; + +void func_80299144(Camera *, Mat4, struct Actor*); /* extern */ +void func_8029930C(Camera *, Mat4, struct Actor*); /* extern */ +void func_802994D4(Camera *, Mat4, struct Actor*); /* extern */ +void func_8029969C(Camera *, Mat4, struct Actor*); /* extern */ +void func_80299864(Camera *, Mat4, struct Actor*); /* extern */ +void func_80299A2C(Camera *, Mat4, struct Actor*); /* extern */ +void func_80299BF4(Camera *, Mat4, struct Actor*); /* extern */ +void func_80299DBC(Camera *, Mat4, struct Actor*); /* extern */ +void func_80299EDC(Camera *, Mat4, struct Actor*); /* extern */ +void func_80299FFC(Camera *, Mat4, struct Actor*); /* extern */ +void func_8029A11C(Camera *, Mat4, struct Actor*); /* extern */ +void func_8029A690(Camera *, Mat4, struct Actor*); /* extern */ +void func_8029A23C(Camera *, Mat4, struct Actor*); /* extern */ +void func_8029A75C(Camera *, Mat4, struct Actor*); /* extern */ +void func_8029A828(Camera *, Mat4, struct Actor*); /* extern */ +void func_8029A8F4(Camera *, Mat4, struct Actor*); /* extern */ +void func_80298328(Camera *, Mat4, struct Actor*); +void func_8029AC18(Camera *, Mat4, struct Actor*); /* extern */ +void func_8029AE1C(Camera *, Mat4, struct Actor*, u16); /* extern */ +void func_8029B06C(Camera *, struct Actor*); /* extern */ +void func_8029B2E4(Camera *, struct Actor*); /* extern */ +void func_8029B6EC(Camera *, struct Actor*); /* extern */ +void func_8029B4E0(Camera *, struct Actor*); /* extern */ +void func_8029B8E8(Camera *, struct Actor*); /* extern */ +void func_8029BFB0(Camera *, struct Actor*); /* extern */ +void func_8029C3CC(Camera *, struct Actor*); /* extern */ +void func_8029CA90(Camera *, struct Actor*); /* extern */ +void func_80297A50(Camera *, Mat4, struct Actor*); +void func_802A269C(Camera *, struct Actor*); /* extern */ +void func_802A27A0(Camera *, Mat4, struct Actor*, u16); /* extern */ +void func_802A29BC(Camera *, Mat4, struct Actor*); /* extern */ +void func_802A2AD0(Camera *, struct Actor*); /* extern */ +void func_802A2C78(Camera *, Mat4, struct Actor*); /* extern */ + +extern Lights1 D_800DC610[]; + +extern void func_80297340(Camera*); +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) & 0xFFFF); // unk26; + f32 temp_f0 = coss((temp_s1->rotX[1] - 0x8000) & 0xFFFF); + + + 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(sp48, 1.0f, temp_s1); + func_80297340(temp_s1); } D_8015F8E0 = 0; - phi_s0 = &D_8015F9B8; - do { - sp58 = phi_s0; - if (phi_s0->unk2 != 0) { - temp_t4 = phi_s0->unk0; - switch (temp_t4) { - 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 5: - func_8029CA90(temp_s1, phi_s0); - break; - case 45: - func_8029A23C(temp_s1, &D_801502C0, phi_s0); - break; - case 6: - func_8029A8F4(temp_s1, &D_801502C0, phi_s0); - break; - case 7: - func_8029A690(temp_s1, &D_801502C0, phi_s0); - break; - case 8: - func_8029A75C(temp_s1, &D_801502C0, phi_s0); - break; - case 42: - func_8029A828(temp_s1, &D_801502C0, phi_s0); - break; - case 10: - func_80298328(temp_s1, &D_801502C0, phi_s0); - break; - case 15: - func_8029B8E8(temp_s1, phi_s0); - break; - case 16: - func_8029BFB0(temp_s1, phi_s0); - break; - case 17: - func_8029C3CC(temp_s1, 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 23: - func_802A29BC(temp_s1, &D_801502C0, phi_s0); - break; - case 35: - func_802A269C(temp_s1, phi_s0); - break; - case 25: - func_802A2C78(temp_s1, &D_801502C0, phi_s0); - break; - case 38: - 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 9: - func_802A27A0(temp_s1, &D_801502C0, phi_s0, sp92); - break; - } - } - temp_s0 = phi_s0 + 0x70; - phi_s0 = temp_s0; - } while (temp_s0 != &D_80162578); - temp_v0_6 = gCurrentCourseId; - if (temp_v0_6 != 9) { - if (temp_v0_6 != 0x12) { - return; + + for (i = 0; i < 100; i++) { + phi_s0 = &D_8015F9B8[i]; + + if (phi_s0->unk2 == 0) { + continue; } - func_80298D7C(temp_s1, &D_801502C0, sp58); - return; + switch (phi_s0->unk0) { + 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 5: + func_8029CA90(temp_s1, phi_s0); + break; + case 45: + func_8029A23C(temp_s1, D_801502C0, phi_s0); + break; + case 6: + func_8029A8F4(temp_s1, D_801502C0, phi_s0); + break; + case 7: + func_8029A690(temp_s1, D_801502C0, phi_s0); + break; + case 8: + func_8029A75C(temp_s1, D_801502C0, phi_s0); + break; + case 42: + func_8029A828(temp_s1, D_801502C0, phi_s0); + break; + case 10: + func_80298328(temp_s1, D_801502C0, phi_s0); + break; + case 15: + func_8029B8E8(temp_s1, phi_s0); + break; + case 16: + func_8029BFB0(temp_s1, phi_s0); + break; + case 17: + func_8029C3CC(temp_s1, 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 23: + func_802A29BC(temp_s1, D_801502C0, phi_s0); + break; + case 35: + func_802A269C(temp_s1, phi_s0); + break; + case 25: + func_802A2C78(temp_s1, D_801502C0, phi_s0); + break; + case 38: + 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 9: + 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; } - func_802986B4(temp_s1, &D_801502C0, sp58); } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/func_802A3008.s") -#endif - -#ifdef MIPS_TO_C -//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 -? func_802A0E44(); /* extern */ -? func_802B30EC(); /* extern */ -? update_obj_banana(? *); /* extern */ -? update_obj_banana_bunch(? *); /* extern */ -? update_obj_fake_item_box(? *); /* extern */ -? update_obj_falling_rocks(? *); /* extern */ -? update_obj_green_shell(? *); /* extern */ -? update_obj_item_box(? *); /* extern */ -? update_obj_item_box_hot_air_balloon(? *); /* extern */ -? update_obj_kiwano_fruit(? *); /* extern */ -? update_obj_mario_raceway_sign(? *); /* extern */ -? update_obj_paddle_wheel(? *); /* extern */ -? update_obj_piranha_plant(? *); /* extern */ -? update_obj_railroad_crossing(? *); /* extern */ -? update_obj_red_blue_shell(? *); /* extern */ -? update_obj_train_car1(? *); /* extern */ -? update_obj_train_car2(? *); /* extern */ -? update_obj_train_engine(? *); /* extern */ -? update_obj_trees_cacti_shrubs(? *); /* extern */ -? update_obj_triple_shell(? *, ?); /* extern */ -? update_obj_wario_stadium_sign(? *); /* extern */ -? update_obj_yoshi_valley_egg(? *); /* extern */ -extern ? D_8015F9B8; -extern ? D_80162578; void update_simple_objects(void) { - ? *temp_s0; - s16 temp_t7; - ? *phi_s0; + struct Actor *phi_s0; + s32 i; + for (i = 0; i < 100; i++) { - phi_s0 = &D_8015F9B8; - do { - if (phi_s0->unk2 != 0) { - temp_t7 = phi_s0->unk0; - switch (temp_t7) { + phi_s0 = &D_8015F9B8[i]; + if (phi_s0->unk2 == 0) { + continue; + } + + switch (phi_s0->unk0) { case 5: update_obj_falling_rocks(phi_s0); break; @@ -7977,12 +7358,10 @@ void update_simple_objects(void) { break; } } - temp_s0 = phi_s0 + 0x70; - phi_s0 = temp_s0; - } while (temp_s0 != &D_80162578); func_802A0E44(); func_802B30EC(); } -#else -GLOBAL_ASM("asm/non_matchings/code_actors/update_simple_objects.s") -#endif + +//#else +//GLOBAL_ASM("asm/non_matchings/code_actors/update_simple_objects.s") +//#endif diff --git a/src/code_802A3730.c b/src/code_802A3730.c index b131d62d1..e6191b514 100644 --- a/src/code_802A3730.c +++ b/src/code_802A3730.c @@ -754,31 +754,31 @@ void func_802A4D18(void) { GLOBAL_ASM("asm/non_matchings/code_802A3730/func_802A4D18.s") #endif -extern f32 D_80150134; -extern f32 D_80150138; -extern f32 D_8015013C; +//extern f32 D_80150134; +//extern f32 D_80150138; +//extern f32 D_8015013C; -extern f32 D_80150130; +extern f32 D_80150130[]; void func_802A4EF4(void) { switch(gActiveScreenMode) { case 0: - func_8001F394(gPlayerOne, &D_80150130); + func_8001F394(gPlayerOne, &D_80150130[0]); break; case 2: - func_8001F394(gPlayerOne, &D_80150130); - func_8001F394(gPlayerTwo, &D_80150134); + func_8001F394(gPlayerOne, &D_80150130[0]); + func_8001F394(gPlayerTwo, &D_80150130[1]); break; case 1: - func_8001F394(gPlayerOne, &D_80150130); - func_8001F394(gPlayerTwo, &D_80150134); + func_8001F394(gPlayerOne, &D_80150130[0]); + func_8001F394(gPlayerTwo, &D_80150130[1]); break; case 3: - func_8001F394(gPlayerOne, &D_80150130); - func_8001F394(gPlayerTwo, &D_80150134); - func_8001F394(gPlayerThree, &D_80150138); - func_8001F394(gPlayerFour, &D_8015013C); + func_8001F394(gPlayerOne, &D_80150130[0]); + func_8001F394(gPlayerTwo, &D_80150130[1]); + func_8001F394(gPlayerThree, &D_80150130[2]); + func_8001F394(gPlayerFour, &D_80150130[3]); break; } } @@ -796,9 +796,9 @@ void func_802A5004(void) { func_802A39E0(D_800DC5F0); if (D_800DC5B4 != 0) { - func_802A4A0C(&D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150134); + func_802A4A0C(&D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[1]); func_80057FC4(2); - func_802A487C(&D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150134); + func_802A487C(&D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[1]); func_80093A30(2); } } @@ -813,9 +813,9 @@ void func_802A50EC(void) { func_802A39E0(D_800DC5EC); if (D_800DC5B4 != 0) { - func_802A4A0C(&D_802B8890, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130); + func_802A4A0C(&D_802B8890, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[0]); func_80057FC4(1); - func_802A487C(&D_802B8890, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130); + func_802A487C(&D_802B8890, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[0]); func_80093A30(1); } } @@ -830,9 +830,9 @@ void func_802A51D4(void) { gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CLIPPING); if (D_800DC5B4 != 0) { - func_802A4A0C(&D_802B8890, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130); + func_802A4A0C(&D_802B8890, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[0]); func_80057FC4(3); - func_802A487C(&D_802B8890, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130); + func_802A487C(&D_802B8890, D_800DC5EC, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[0]); func_80093A30(3); } } @@ -847,9 +847,9 @@ void func_802A52BC(void) { gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CLIPPING); if (D_800DC5B4 != 0) { - func_802A4A0C(&D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150134); + func_802A4A0C(&D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[1]); func_80057FC4(4); - func_802A487C(&D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150134); + func_802A487C(&D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[1]); func_80093A30(4); } } @@ -866,11 +866,11 @@ void func_802A53A4(void) { func_802A3CB0(); func_802A41D4(); if (D_800DC5B4 != 0) { - func_802A4A0C(&D_802B8890, D_800DC5EC, 0x140, 0xF0, &D_80150130); + func_802A4A0C(&D_802B8890, D_800DC5EC, 0x140, 0xF0, &D_80150130[0]); if (D_800DC50C != CREDITS_SEQUENCE) { func_80057FC4(0); } - func_802A487C(&D_802B8890, D_800DC5EC, 0x140, 0xF0, &D_80150130); + func_802A487C(&D_802B8890, D_800DC5EC, 0x140, 0xF0, &D_80150130[0]); func_80093A30(0); } } @@ -885,9 +885,9 @@ void func_802A54A8(void) { gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CLIPPING); if (D_800DC5B4 != 0) { - func_802A4A0C(&D_802B8890, D_800DC5EC, 0x140, 0xF0, &D_80150130); + func_802A4A0C(&D_802B8890, D_800DC5EC, 0x140, 0xF0, &D_80150130[0]); func_80057FC4(8); - func_802A487C(&D_802B8890, D_800DC5EC, 0x140, 0xF0, &D_80150130); + func_802A487C(&D_802B8890, D_800DC5EC, 0x140, 0xF0, &D_80150130[0]); func_80093A30(8); } } @@ -902,9 +902,9 @@ void func_802A5590(void) { gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CLIPPING); if (D_800DC5B4 != 0) { - func_802A4A0C(&D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150134); + func_802A4A0C(&D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[1]); func_80057FC4(9); - func_802A487C(&D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150134); + func_802A487C(&D_802B8910, D_800DC5F0, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[1]); func_80093A30(9); } } @@ -919,9 +919,9 @@ void func_802A5678(void) { gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CLIPPING); if (D_800DC5B4 != 0) { - func_802A4A0C(&D_802B8990, D_800DC5F4, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150138); + func_802A4A0C(&D_802B8990, D_800DC5F4, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[2]); func_80057FC4(10); - func_802A487C(&D_802B8990, D_800DC5F4, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150138); + func_802A487C(&D_802B8990, D_800DC5F4, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[2]); func_80093A30(10); } } @@ -955,9 +955,9 @@ void func_802A5760(void) { func_802A39E0(D_800DC5F8); if (D_800DC5B4 != 0) { - func_802A4A0C(&D_802B8A10, D_800DC5F8, SCREEN_WIDTH, SCREEN_HEIGHT, &D_8015013C); + func_802A4A0C(&D_802B8A10, D_800DC5F8, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[3]); func_80057FC4(11); - func_802A487C(&D_802B8A10, D_800DC5F8, SCREEN_WIDTH, SCREEN_HEIGHT, &D_8015013C); + func_802A487C(&D_802B8A10, D_800DC5F8, SCREEN_WIDTH, SCREEN_HEIGHT, &D_80150130[3]); func_80093A30(11); } } @@ -983,7 +983,7 @@ void func_802A59A4(void) { gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH); gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); - guPerspective(&gGfxPool->mtxPool[1], &spAA[23], D_80150130, D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPool[1], &spAA[23], D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); gDPHalf1(gDisplayListHead++, spAA[23]); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); @@ -1033,7 +1033,7 @@ void func_802A5CB4(void) { gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[1], &sp9A[17], D_80150130, D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPool[1], &sp9A[17], D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); gDPHalf1(gDisplayListHead++, sp9A[17]); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->unk, camera->unk1, camera->unk2, camera->angleX, camera->angleY, camera->angleZ); @@ -1082,7 +1082,7 @@ void func_802A5FAC(void) { func_802A3730(D_800DC5F0); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[2], &sp9A[17], D_80150134, D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPool[2], &sp9A[17], D_80150130[1], D_80150148, D_80150150, D_8015014C, 1.0f); gDPHalf1(gDisplayListHead++, sp9A[17]); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[2]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt(&gGfxPool->mtxPool[8], camera->pos[0], camera->pos[1], camera->pos[2], camera->unk, camera->unk1, camera->unk2, camera->angleX, camera->angleY, camera->angleZ); @@ -1130,7 +1130,7 @@ void func_802A62A4(void) { func_802A3E3C(); func_802A3730(D_800DC5EC); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[1], &sp9A[17], D_80150130, D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPool[1], &sp9A[17], D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); gDPHalf1(gDisplayListHead++, sp9A[17]); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->unk, camera->unk1, camera->unk2, camera->angleX, camera->angleY, camera->angleZ); @@ -1178,7 +1178,7 @@ void func_802A65B8(void) { func_802A3E3C(); func_802A3730(D_800DC5F0); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[2], &sp9A[17], D_80150134, D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPool[2], &sp9A[17], D_80150130[1], D_80150148, D_80150150, D_8015014C, 1.0f); gDPHalf1(gDisplayListHead++, sp9A[17]); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[2]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt(&gGfxPool->mtxPool[8], camera->pos[0], camera->pos[1], camera->pos[2], camera->unk, camera->unk1, camera->unk2, camera->angleX, camera->angleY, camera->angleZ); @@ -1224,7 +1224,7 @@ void func_802A68CC(void) { func_802A3730(D_800DC5EC); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[1], &sp9A[17], D_80150130, D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPool[1], &sp9A[17], D_80150130[0], D_80150148, D_80150150, D_8015014C, 1.0f); gDPHalf1(gDisplayListHead++, sp9A[17]); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt(&gGfxPool->mtxPool[7], camera->pos[0], camera->pos[1], camera->pos[2], camera->unk, camera->unk1, camera->unk2, camera->angleX, camera->angleY, camera->angleZ); @@ -1270,7 +1270,7 @@ void func_802A6BB0(void) { func_802A3730(D_800DC5F0); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[2], &sp9A[17], D_80150134, D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPool[2], &sp9A[17], D_80150130[1], D_80150148, D_80150150, D_8015014C, 1.0f); gDPHalf1(gDisplayListHead++, sp9A[17]); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[2]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); @@ -1315,7 +1315,7 @@ void func_802A6E94(void) { func_802A3E3C(); func_802A3730(D_800DC5F4); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[3], &sp9A[17], D_80150138, D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPool[3], &sp9A[17], D_80150130[2], D_80150148, D_80150150, D_8015014C, 1.0f); gDPHalf1(gDisplayListHead++, sp9A[17]); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[3]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt(&gGfxPool->mtxPool[9], camera->pos[0], camera->pos[1], camera->pos[2], camera->unk, camera->unk1, camera->unk2, camera->angleX, camera->angleY, camera->angleZ); @@ -1370,7 +1370,7 @@ void func_802A7178(void) { func_802A3730(D_800DC5F8); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPool[4], &sp92[17], D_8015013C, D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPool[4], &sp92[17], D_80150130[3], D_80150148, D_80150150, D_8015014C, 1.0f); gDPHalf1(gDisplayListHead++, sp92[17]); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[4]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt(&gGfxPool->mtxPool[10], camera->pos[0], camera->pos[1], camera->pos[2], camera->unk, camera->unk1, camera->unk2, camera->angleX, camera->angleY, camera->angleZ); diff --git a/src/code_802B0210.c b/src/code_802B0210.c index 651fcd8d1..5b7721ffd 100644 --- a/src/code_802B0210.c +++ b/src/code_802B0210.c @@ -1,78 +1,61 @@ #include <ultra64.h> #include <macros.h> #include <defines.h> - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? vec3f_copy(void *, void *, void *, void *); // extern - -void func_802B0210(void *arg0, void *arg1) { - void *temp_a0; - void *temp_a2; - void *temp_a3; - - temp_a3 = arg0; - temp_a2 = arg1; - arg1->unk0 = arg0->unk0; - arg1->unk2 = arg0->unk2; - arg1->unk4 = arg0->unk4; - arg1->unk6 = arg0->unk6; - arg1->unk8 = arg0->unk8; - arg1->unkA = arg0->unkA; - arg1->unkC = arg0->unkC; - arg1->unk10 = arg0->unk10; - temp_a0 = arg1 + 0x18; - arg1->unk14 = arg0->unk14; - arg0 = temp_a3; - arg1 = temp_a2; - vec3f_copy(temp_a0, temp_a3 + 0x18, temp_a2, temp_a3); - vec3f_copy(arg1 + 0x24, arg0 + 0x24, arg1, arg0); - vec3f_copy(arg1 + 0x30, arg0 + 0x30, arg1, arg0); +#include <actor_types.h> + +void *vec3f_copy(Vec3f, Vec3f); // extern + +void func_802B0210(UnkActorInner *arg0, UnkActorInner *arg1) { + arg1->unk30 = arg0->unk30; + arg1->unk32 = arg0->unk32; + arg1->unk34 = arg0->unk34; + arg1->unk36 = arg0->unk36; + arg1->unk38 = arg0->unk38; + arg1->unk3A = arg0->unk3A; + arg1->unk3C = arg0->unk3C; + arg1->unk40 = arg0->unk40; + + arg1->unk44 = arg0->unk44; + vec3f_copy(arg1->unk48, arg0->unk48); + vec3f_copy(arg1->unk54, arg0->unk54); + vec3f_copy(arg1->unk60, arg0->unk60); } -#else -GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B0210.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_8015F9B8; +extern struct Actor D_8015F9B8[]; -void func_802B02B4(void *arg0, s32 arg1) { +void func_802B02B4(struct Actor *arg0, s32 arg1) { s32 temp_f6; - void *temp_v0; + struct Actor *temp_v0 = &D_8015F9B8[arg0->unk4]; + + temp_v0->unk4--; + + switch((s16)arg0->unk8) { + case 0: + temp_v0->unk24[0] = -1.0f; + break; + case 1: + temp_v0->unk24[1] = -1.0f; + break; + case 2: + temp_v0->unk24[2] = -1.0f; + break; - temp_v0 = (arg0->unk4 * 0x70) + &D_8015F9B8; - temp_v0->unk4 = temp_v0->unk4 - 1; - temp_f6 = arg0->unk8; - if (temp_f6 != 0) { - if (temp_f6 != 1) { - if (temp_f6 != 2) { - } else { - temp_v0->unk2C = -1.0f; - } - } else { - temp_v0->unk28 = -1.0f; - } - } else { - temp_v0->unk24 = -1.0f; } - arg0->unk2 = -0x8000; - arg0->unk12 = 0; - arg0->unk4 = 0x3C; - arg0->unk28 = 3.0f; - if (arg1 != 7) { - if (arg1 != 8) { - return; - } - arg0->unk6 = 7; - return; + arg0->unk2 = 0x8000; // bitflag + arg0->unk10[1] = 0; + arg0->unk24[1] = 3.0f; + arg0->unk4 = 60; + + switch(arg1) { + case 7: + arg0->unk6 = 5; + break; + case 8: + arg0->unk6 = 7; + break; } - arg0->unk6 = 5; } -#else -GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B02B4.s") -#endif #ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 @@ -1130,10 +1113,10 @@ void update_obj_banana(void *arg0) { temp_t9 = arg0->unk6; switch (temp_t9) { case 0: - temp_f2 = gPlayers[temp_t6].posX - arg0->unk18; - temp_f14 = gPlayers[temp_t6].posY - arg0->unk1C; + temp_f2 = gPlayers[temp_t6].pos[0] - arg0->unk18; + temp_f14 = gPlayers[temp_t6].pos[1] - arg0->unk1C; sp48 = temp_f2; - temp_f16 = gPlayers[temp_t6].posZ - arg0->unk20; + temp_f16 = gPlayers[temp_t6].pos[2] - arg0->unk20; sp44 = temp_f14; sp88 = &gPlayers[temp_t6]; sp40 = temp_f16; @@ -1141,13 +1124,13 @@ void update_obj_banana(void *arg0) { phi_f14 = (bitwise void *) temp_f14; if (temp_f12 == 0.0f) { temp_f0 = D_802B9EE0; - arg0->unk18 = gPlayers[temp_t6].posX + temp_f0; - arg0->unk1C = gPlayers[temp_t6].posY + temp_f0; + arg0->unk18 = gPlayers[temp_t6].pos[0] + temp_f0; + arg0->unk1C = gPlayers[temp_t6].pos[1] + temp_f0; phi_f6 = gPlayers[temp_t6].posZ + temp_f0; } else { temp_f14_2 = temp_f14 / temp_f12; - arg0->unk18 = gPlayers[temp_t6].posX - (temp_f2 / temp_f12); - arg0->unk1C = (gPlayers[temp_t6].posY - temp_f14_2) - 2.0f; + arg0->unk18 = gPlayers[temp_t6].pos[0] - (temp_f2 / temp_f12); + arg0->unk1C = (gPlayers[temp_t6].pos[1] - temp_f14_2) - 2.0f; phi_f6 = gPlayers[temp_t6].posZ - (temp_f16 / temp_f12); phi_f14 = (bitwise void *) temp_f14_2; } @@ -1239,9 +1222,9 @@ void update_obj_banana(void *arg0) { sp70 = -5.0f; sp88 = &gPlayers[temp_t6]; func_802B64C4(&sp68, gPlayers[temp_t6].unk_02E + gPlayers[temp_t6].unk_0C0); - temp_f18 = sp68 + gPlayers[temp_t6].posX; - temp_f0_7 = sp6C + gPlayers[temp_t6].posY; - temp_f10 = sp70 + gPlayers[temp_t6].posZ; + temp_f18 = sp68 + gPlayers[temp_t6].pos[0]; + temp_f0_7 = sp6C + gPlayers[temp_t6].pos[1]; + temp_f10 = sp70 + gPlayers[temp_t6].pos[2]; sp34 = temp_f10; temp_f2_4 = temp_f18 - arg0->unk18; sp3C = temp_f18; @@ -1254,9 +1237,9 @@ void update_obj_banana(void *arg0) { temp_f0_8 = sqrtf((temp_f2_4 * temp_f2_4) + (temp_f14_3 * temp_f14_3) + (temp_f16_2 * temp_f16_2), temp_f14_3); if (temp_f0_8 == 0.0f) { temp_f0_9 = D_802B9EE8; - arg0->unk18 = gPlayers[temp_t6].posX + temp_f0_9; - arg0->unk1C = gPlayers[temp_t6].posY + temp_f0_9; - arg0->unk20 = gPlayers[temp_t6].posZ + temp_f0_9; + arg0->unk18 = gPlayers[temp_t6].pos[0] + temp_f0_9; + arg0->unk1C = gPlayers[temp_t6].pos[1] + temp_f0_9; + arg0->unk20 = gPlayers[temp_t6].pos[2] + temp_f0_9; } else { arg0->unk18 = sp68 + (temp_f18 - (temp_f2_4 / temp_f0_8)); arg0->unk1C = (sp38 - (temp_f14_3 / temp_f0_8)) - 2.0f; @@ -1355,9 +1338,9 @@ void func_802B2914(void *arg0, Player *player, s16 arg2) { temp_a0 = &sp4C; temp_a1 = &sp58; temp_a2 = &sp60; - sp4C += player->posX; - sp50 += player->posY; - sp54 += player->posZ; + sp4C += player->pos[0]; + sp50 += player->pos[1]; + sp54 += player->pos[2]; sp60 = player->unk_034; sp64 = player->unk_038; sp58 = 0; @@ -1368,10 +1351,10 @@ void func_802B2914(void *arg0, Player *player, s16 arg2) { temp_t6 = temp_v0; if (temp_v0 >= 0) { temp_lo = temp_t6 * 0x70; - sp4C = player->posX; - sp50 = player->posY; + sp4C = player->pos[0]; + sp50 = player->pos[1]; temp_s0 = &D_8015F9B8 + temp_lo; - sp54 = player->posZ; + sp54 = player->pos[2]; sp6E = temp_t6; func_802AD950(temp_s0 + 0x30, temp_s0->unkC + 1.0f, temp_s0->unk18, temp_s0->unk1C, temp_s0->unk20, sp4C, sp50, sp54); func_802B4E30(temp_s0); @@ -1724,7 +1707,7 @@ GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B30EC.s") ? func_802B64C4(f32 *, s16); /* extern */ extern ? D_8015F9B8; -void update_obj_green_shell(void *arg0) { +void update_obj_green_shell(struct Actor *arg0) { f32 sp80; f32 sp7C; f32 sp78; @@ -1767,15 +1750,15 @@ void update_obj_green_shell(void *arg0) { arg0->unk10 = arg0->unk10 + 0x71C; switch (temp_t3) { case 0: - temp_s1 = &gPlayers[arg0->unk14]; + temp_s1 = &gPlayers[arg0->unk10[2]]; func_802B0210(&temp_s1->unk_110, arg0 + 0x30); sp6C = 0.0f; sp70 = temp_s1->unk_070; sp74 = -(temp_s1->unk_070 + arg0->unkC + 2.0f); func_802B63B8(&sp6C, temp_s1->unk_174); - arg0->unk18 = sp6C + temp_s1->posX; + arg0->unk18 = sp6C + temp_s1->pos[0]; temp_f14 = temp_s1->posY - sp70; - arg0->unk20 = sp74 + temp_s1->posZ; + arg0->unk20 = sp74 + temp_s1->pos[2]; sp54 = temp_f14; temp_f0_2 = func_802ABE30(arg0->unk18, temp_f14, arg0->unk20, temp_s1->unk_11A); temp_f2_2 = temp_f14 - temp_f0_2; @@ -2521,32 +2504,20 @@ block_16: GLOBAL_ASM("asm/non_matchings/code_802B0210/update_obj_red_blue_shell.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_802B4E30(void *arg0) { - f32 temp_f0; - f32 temp_f0_2; - f32 temp_f0_3; - - temp_f0 = arg0->unk44; - if ((temp_f0 < 0.0f) && (arg0->unk34 == 1)) { - arg0->unk18 = arg0->unk18 - (arg0->unk60 * temp_f0); - arg0->unk1C = arg0->unk1C - (arg0->unk64 * temp_f0); - arg0->unk20 = arg0->unk20 - (arg0->unk68 * temp_f0); +void func_802B4E30(struct Actor *arg0) { + if ((arg0->unk30.unk44 < 0.0f) && (arg0->unk30.unk34 == 1)) { + arg0->unk18[0] -= (arg0->unk30.unk60[0] * arg0->unk30.unk44); + arg0->unk18[1] -= (arg0->unk30.unk60[1] * arg0->unk30.unk44); + arg0->unk18[2] -= (arg0->unk30.unk60[2] * arg0->unk30.unk44); } - temp_f0_2 = arg0->unk3C; - if ((temp_f0_2 < 0.0f) && (arg0->unk30 == 1)) { - arg0->unk18 = arg0->unk18 - (arg0->unk48 * temp_f0_2); - arg0->unk1C = arg0->unk1C - (arg0->unk4C * temp_f0_2); - arg0->unk20 = arg0->unk20 - (arg0->unk50 * temp_f0_2); + if ((arg0->unk30.unk3C < 0.0f) && (arg0->unk30.unk30 == 1)) { + arg0->unk18[0] -= (arg0->unk30.unk48[0] * arg0->unk30.unk3C); + arg0->unk18[1] -= (arg0->unk30.unk48[1] * arg0->unk30.unk3C); + arg0->unk18[2] -= (arg0->unk30.unk48[2] * arg0->unk30.unk3C); } - temp_f0_3 = arg0->unk40; - if ((temp_f0_3 < 0.0f) && (arg0->unk32 == 1)) { - arg0->unk18 = arg0->unk18 - (arg0->unk54 * temp_f0_3); - arg0->unk1C = arg0->unk1C - (arg0->unk58 * temp_f0_3); - arg0->unk20 = arg0->unk20 - (arg0->unk5C * temp_f0_3); + if ((arg0->unk30.unk40 < 0.0f) && (arg0->unk30.unk32 == 1)) { + arg0->unk18[0] -= (arg0->unk30.unk54[0] * arg0->unk30.unk40); + arg0->unk18[1] -= (arg0->unk30.unk54[1] * arg0->unk30.unk40); + arg0->unk18[2] -= (arg0->unk30.unk54[2] * arg0->unk30.unk40); } } -#else -GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B4E30.s") -#endif diff --git a/src/main.c b/src/main.c index 05dd6b1a3..bd01d6b5d 100644 --- a/src/main.c +++ b/src/main.c @@ -118,10 +118,10 @@ s32 D_80150120; s32 gMenuSelectionFromQuit; UNUSED s32 D_80150128; UNUSED s32 D_8015012C; -s32 D_80150130; -s32 D_80150134; -s32 D_80150138; -s32 D_8015013C; +f32 D_80150130[4]; +//f32 D_80150134; +//f32 D_80150138; +//f32 D_8015013C; UNUSED s32 D_80150140; UNUSED s32 D_80150144; f32 D_80150148; @@ -139,7 +139,9 @@ uintptr_t gPhysicalFramebuffers[3]; u32 D_801502B4; UNUSED u32 D_801502B8; UNUSED u32 D_801502BC; -s32 D_801502C0[2064]; +Mat4 D_801502C0; + +s32 padding[2048]; u16 D_80152300[4]; u16 D_80152308; @@ -640,7 +642,7 @@ void func_8000142C(void) { D_800DC514 = 0; } - temp_v0 = camera1->rotX2; + temp_v0 = camera1->rotX[1]; D_801625E8 = D_800DC5EC->pathCounter; if (temp_v0 < 0x2000) { func_80057A50(40, 100, "SOUTH ", D_801625E8); diff --git a/src/math_util.c b/src/math_util.c index 8bdea2ee6..edc7d5e35 100644 --- a/src/math_util.c +++ b/src/math_util.c @@ -38,34 +38,34 @@ s32 func_802B4FF8(Mat4 arg0, s32 arg1) { } func_802B75F8(&gGfxPool->mtxPool[D_80150112 + 0x32B], arg0); switch (arg1) { /* irregular */ - case 0: - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80150112 + 0x32B]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - D_80150112 += 1; - break; - case 1: - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80150112 + 0x32B]), G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - D_80150112 += 1; - break; - case 3: - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80150112 + 0x32B]), G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); - D_80150112 += 1; - break; - case 2: - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80150112 + 0x32B]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); - D_80150112 += 1; - break; + case 0: + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80150112 + 0x32B]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + D_80150112 += 1; + break; + case 1: + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80150112 + 0x32B]), G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + D_80150112 += 1; + break; + case 3: + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80150112 + 0x32B]), G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); + D_80150112 += 1; + break; + case 2: + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80150112 + 0x32B]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); + D_80150112 += 1; + break; } return 1; } -f32 func_802B51E8(struct UnkStruct_802B51E8 *arg0, struct UnkStruct_802B51E8 *arg1) { +f32 func_802B51E8(Vec3f arg0, Vec3f arg1) { f32 temp_f12; f32 temp_f14; f32 temp_f2; - temp_f2 = arg1->unk0 - arg0->unk0; - temp_f12 = arg1->unk4 - arg0->unk4; - temp_f14 = arg1->unk8 - arg0->unk8; + temp_f2 = arg1[0] - arg0[0]; + temp_f12 = arg1[1] - arg0[1]; + temp_f14 = arg1[2] - arg0[2]; return (temp_f2 * temp_f2) + (temp_f12 * temp_f12) + temp_f14 + temp_f14; } @@ -87,16 +87,16 @@ u32 func_802B5258(Vec3f arg0, Vec3s arg1) { return func_802B7830(temp_v1, temp_v2); } -void load_giant_egg(struct UnkStruct_802B51E8 *arg0, f32 arg1, f32 arg2, f32 arg3) { - arg0->unk0 = arg1; - arg0->unk4 = arg2; - arg0->unk8 = arg3; +void load_giant_egg(Vec3f arg0, f32 arg1, f32 arg2, f32 arg3) { + arg0[0] = arg1; + arg0[1] = arg2; + arg0[2] = arg3; } -void func_802B52BC(struct UnkStruct_802B52BC *arg0, s16 arg1, s16 arg2, s16 arg3) { - arg0->unk0 = arg1; - arg0->unk2 = arg2; - arg0->unk4 = arg3; +void func_802B52BC(Vec3s arg0, s16 arg1, s16 arg2, s16 arg3) { + arg0[0] = arg1; + arg0[1] = arg2; + arg0[2] = arg3; } // These functions have bogus return values. @@ -707,7 +707,7 @@ void func_802B5F00(Mat4 arg0, f32 arg1) { f32 sins(u16); /* extern */ f32 coss(u16); /* extern */ -void func_802B5F74(void *arg0, void *arg1, void *arg2) { +void func_802B5F74(Mat4 arg0, Vec3f arg1, Vec3s arg2) { f32 sp3C; f32 sp34; f32 sp30; @@ -1810,7 +1810,7 @@ s32 func_802B5224(f32, f32, u16); /* extern */ u16 func_802B7CA8(f32, f32); /* extern */ s32 func_802B8058(s32, s32, u16, u16); /* extern */ -f32 func_802B80D0(void *arg0, void *arg1, u16 arg2, f32 arg3, f32 arg4, f32 arg5) { +f32 func_802B80D0(Vec3f arg0, Vec3f arg1, u16 arg2, f32 arg3, f32 arg4, f32 arg5) { u16 sp5E; u16 sp5A; s32 sp28; diff --git a/src/memory.c b/src/memory.c index 96b174178..c10ad0cca 100644 --- a/src/memory.c +++ b/src/memory.c @@ -10,6 +10,7 @@ #include "main.h" #include "memory.h" #include "variables.h" +#include <actor_types.h> //#include "segment_symbols.h" //#include "segments.h" @@ -2478,25 +2479,21 @@ f32 func_802ABE30(f32 arg0, f32 arg1, f32 arg2, u16 arg3) { return ((tile->height * arg0) + (tile->rotation * arg2) + tile->height2) / -tile->gravity; } -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -f32 func_802ABE30(f32, f32, s32, u16); // extern +f32 func_802ABE30(f32, f32, f32, u16); // extern + -f32 func_802ABEAC(void *arg0, void *arg1) { - if (arg0->unk4 == 1) { - return func_802ABE30(arg1->unk0, arg1->unk4, arg1->unk8, arg0->unkA); +f32 func_802ABEAC(UnkActorInner *arg0, Vec3f arg1) { + if (arg0->unk34 == 1) { + return func_802ABE30(arg1[0], arg1[1], arg1[2], arg0->unk3A); } - if (arg0->unk0 == 1) { - return func_802ABE30(arg1->unk0, arg1->unk4, arg1->unk8, arg0->unk6); + if (arg0->unk30 == 1) { + return func_802ABE30(arg1[0], arg1[1], arg1[2], arg0->unk36); } - if (arg0->unk2 == 1) { - return func_802ABE30(arg1->unk0, arg1->unk4, arg1->unk8, arg0->unk8); + if (arg0->unk32 == 1) { + return func_802ABE30(arg1[0], arg1[1], arg1[2], arg0->unk38); } - return arg1->unk4; + return arg1[1]; } -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802ABEAC.s") -#endif #ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 @@ -4500,7 +4497,7 @@ s32 func_802AFA34(Player *player, kartBoundingBoxCorner *corner, f32 cornerX, f3 } if (func_802AD278(&spF8, temp_f20, temp_f22, temp_f24, temp_f26, (s32) corner->surfaceMapIndex, cornerX, cornerY, cornerZ) == 1) { temp_f0 = func_802ABE30(temp_f22, temp_f24, temp_f26, corner->surfaceMapIndex); - temp_f2 = player->posY; + temp_f2 = player->pos[1]; if (!(temp_f2 < temp_f0) && !((2.0f * temp_f20) < (temp_f2 - temp_f0))) { corner->cornerGroundY = temp_f0; func_802AF9F0(temp_f0, &sp11C, sp108, corner); @@ -4512,7 +4509,7 @@ s32 func_802AFA34(Player *player, kartBoundingBoxCorner *corner, f32 cornerX, f3 } if (func_802AC760(&spF8, temp_f20, temp_f22, temp_f24, temp_f26, (s32) corner->surfaceMapIndex, cornerX, cornerY, cornerZ) == 1) { temp_f0_2 = func_802ABE30(temp_f22, temp_f24, temp_f26, corner->surfaceMapIndex); - temp_f2_2 = player->posY; + temp_f2_2 = player->pos[1]; if (!(temp_f2_2 < temp_f0_2) && !((2.0f * temp_f20) < (temp_f2_2 - temp_f0_2))) { corner->cornerGroundY = temp_f0_2; func_802AF9F0(temp_f0_2, &sp128, sp10C, corner); @@ -4524,7 +4521,7 @@ s32 func_802AFA34(Player *player, kartBoundingBoxCorner *corner, f32 cornerX, f3 } if (func_802ACBA4(&spF8, temp_f20, temp_f22, temp_f24, temp_f26, (s32) corner->surfaceMapIndex, cornerX, cornerY, cornerZ) == 1) { temp_f0_3 = func_802ABE30(temp_f22, temp_f24, temp_f26, corner->surfaceMapIndex); - temp_f2_3 = player->posY; + temp_f2_3 = player->pos[1]; if (!(temp_f2_3 < temp_f0_3) && !((2.0f * temp_f20) < (temp_f2_3 - temp_f0_3))) { corner->cornerGroundY = temp_f0_3; func_802AF9F0(temp_f0_3, &sp110, sp104, corner); @@ -4570,7 +4567,7 @@ loop_34: if ((temp_v1_3 & 0x4000) != 0) { if ((corner->surfaceMapIndex != temp_s0) && (func_802AC760(phi_s7, temp_f20, temp_f22, temp_f24, temp_f26, (s32) temp_s0, cornerX, cornerY, cornerZ) == 1)) { temp_f0_4 = func_802ABE30(temp_f22, temp_f24, temp_f26, temp_s0 & 0xFFFF); - temp_f2_4 = player->posY; + temp_f2_4 = player->pos[1]; if (!(temp_f2_4 < temp_f0_4) && !((phi_f30 * temp_f20) < (temp_f2_4 - temp_f0_4))) { spD4 = temp_f0_4; func_802AF9F0(temp_f0_4, &sp128, sp10C, corner); @@ -4591,7 +4588,7 @@ loop_34: if ((temp_v1_3 & 0x8000) != 0) { if ((temp_v0_4->gravity != 0.0f) && (corner->surfaceMapIndex != temp_s0) && (func_802AD278(phi_s7, temp_f20, temp_f22, temp_f24, temp_f26, (s32) temp_s0, cornerX, cornerY, cornerZ) == 1)) { temp_f0_5 = func_802ABE30(temp_f22, temp_f24, temp_f26, temp_s0 & 0xFFFF); - temp_f2_5 = player->posY; + temp_f2_5 = player->pos[1]; if (!(temp_f2_5 < temp_f0_5) && !((phi_f30 * temp_f20) < (temp_f2_5 - temp_f0_5))) { corner->cornerGroundY = temp_f0_5; func_802AF9F0(temp_f0_5, &sp11C, sp108, corner); @@ -4606,7 +4603,7 @@ loop_34: } if ((temp_v0_4->gravity != 0.0f) && (corner->surfaceMapIndex != temp_s0) && (func_802ACBA4(phi_s7, temp_f20, temp_f22, temp_f24, temp_f26, (s32) temp_s0, cornerX, cornerY, cornerZ) == 1)) { temp_f0_6 = func_802ABE30(temp_f22, temp_f24, temp_f26, temp_s0 & 0xFFFF); - temp_f2_6 = player->posY; + temp_f2_6 = player->pos[1]; if (!(temp_f2_6 < temp_f0_6) && !((phi_f30 * temp_f20) < (temp_f2_6 - temp_f0_6))) { corner->cornerGroundY = temp_f0_6; func_802AF9F0(temp_f0_6, &sp110, sp104, corner); |
