diff options
| author | Tyler McGavran <tyler.taggerung@gmail.com> | 2022-10-20 00:00:45 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-19 22:00:45 -0600 |
| commit | 1483ddaa0343c1614159c8a4e915d9f027abb8bc (patch) | |
| tree | 35583efcc403b0cc9e73b597d999f8538ba6e61f /src | |
| parent | cc4b5bfcd2864e22933ea20dfc3891eed52eb1fe (diff) | |
Matches and m2c refreshing for code_80057C60 (#266)
* Matches and m2c refreshing for code_80057C60
* Convert some Vtx's into a Mtx
Based on the usage of D_0D008E98, it seems like it should be a
Mtx. So this commit changes some Vtx's into a Mtx
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/code_80057C60.c | 9173 | ||||
| -rw-r--r-- | src/code_80057C60.h | 25 | ||||
| -rw-r--r-- | src/common_textures.h | 3 | ||||
| -rw-r--r-- | src/common_textures.inc.c | 41 | ||||
| -rw-r--r-- | src/skybox_and_splitscreen.c | 1 | ||||
| -rw-r--r-- | src/skybox_and_splitscreen.h | 1 |
6 files changed, 4099 insertions, 5145 deletions
diff --git a/src/code_80057C60.c b/src/code_80057C60.c index 5d0600dd0..fac29f79e 100644 --- a/src/code_80057C60.c +++ b/src/code_80057C60.c @@ -7,13 +7,15 @@ #include <defines.h> #include "math_util.h" #include "math_util_2.h" -#include "code_800431B0.h" #include "code_80005FD0.h" +#include "code_8001F980.h" +#include "code_800431B0.h" #include "code_80057C60.h" #include "code_80071F00.h" #include "code_80086E70.h" #include "code_8008C1D0.h" #include "skybox_and_splitscreen.h" +#include "common_textures.h" // UI Code? void func_80057C60(void) { @@ -665,19 +667,14 @@ void func_80059358(void) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 792017ad9d422c2467bd42686f383a5c41f41c75 -void func_8004CB60(s16, s16, ? *); /* extern */ -void func_8004E638(?); /* extern */ -void func_8004FA78(?); /* extern */ -void func_8004FC78(s16, s16, s8); /* extern */ -extern ? D_0D00A958; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b extern s8 D_801657B0; void func_80059360(void) { if (D_801657B0 == 0) { func_8004FA78(0); if (D_8018CA70->lapCount != 3) { - func_8004CB60(D_8018CA70->lapX, D_8018CA70->lapY, &D_0D00A958); + func_8004CB60((s32) D_8018CA70->lapX, (s32) D_8018CA70->lapY, (s32) D_0D00A958); func_8004FC78((s16) (D_8018CA70->lapX + 0xC), (s16) (D_8018CA70->lapY - 4), D_8018CA70->alsoLapCount); func_8004E638(0); } @@ -692,21 +689,15 @@ void func_800593F0(void) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8004CB60(s16, s16, ? *); // extern -void func_8004E638(?); // extern -void func_8004FA78(?); // extern -void func_8004FC78(s16, s16, s8); // extern -extern ? D_0D00A958; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b extern s8 D_801657B0; -extern struct_8018CA70_entry D_8018CA70; void func_800593F8(void) { if (D_801657B0 == 0) { func_8004FA78(1); - if (D_8018CA70.unkF5 != 3) { - func_8004CB60(D_8018CA70.unkDE, D_8018CA70.unkE4, &D_0D00A958); - func_8004FC78(D_8018CA70.unkDE + 0xC, D_8018CA70.unkE4 - 4, D_8018CA70.unkF6); + if (D_8018CA70->unkF5 != 3) { + func_8004CB60((s32) D_8018CA70->unkDE, (s32) D_8018CA70->unkE4, (s32) D_0D00A958); + func_8004FC78((s16) (D_8018CA70->unkDE + 0xC), (s16) (D_8018CA70->unkE4 - 4), D_8018CA70->unkF6); func_8004E638(1); } } @@ -744,15 +735,7 @@ void func_80059530(void) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 792017ad9d422c2467bd42686f383a5c41f41c75 -void func_80047910(s16, s16, ?, ?, ? *, ? *, ? *, s32, s32, s32, s32); /* extern */ -void func_8004CB60(s16, s16, ? *); /* extern */ -void func_8004E6C4(s32); /* extern */ -void func_8004FC78(s16, s16, s8); /* extern */ -extern Vtx D_0D005AE0; -extern ? D_0D00A958; -extern s8 D_0D01B4D8; -extern s8 D_0D01D6D8; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b extern s32 D_80165608; extern s8 D_801657E4; extern s8 D_801657F8; @@ -763,17 +746,17 @@ void func_80059560(s32 playerId) { struct_8018CA70_entry *temp_v0; struct_8018CA70_entry *temp_v0_2; - if (gModeSelection != BATTLE) { + if (gModeSelection != 3) { if ((D_801657F8 != 0) && (D_8018D188 != 0)) { temp_v0 = &D_8018CA70[playerId]; sp3C = temp_v0; - func_8004CB60(temp_v0->lapX, temp_v0->lapY, &D_0D00A958); + func_8004CB60((s32) temp_v0->lapX, (s32) temp_v0->lapY, (s32) D_0D00A958); func_8004FC78((s16) (temp_v0->lapX - 0xC), (s16) (temp_v0->lapY + 4), temp_v0->alsoLapCount); } if (D_801657E4 == 2) { temp_v0_2 = &D_8018CA70[playerId]; if ((temp_v0_2->unk_74 != 0) && (D_80165608 != 0)) { - func_80047910(temp_v0_2->unk_6C, temp_v0_2->unk_6E, 0, 0x3F800000, &D_0D01B4D8, &D_0D01D6D8, &D_0D005AE0, 0x20, 0x20, 0x20, 0x20); + func_80047910((s32) temp_v0_2->unk_6C, (s32) temp_v0_2->unk_6E, 0U, 1.0f, (s32) D_0D01B4D8, (s32) D_0D01D6D8, D_0D005AE0, 0x00000020, 0x00000020, 0x00000020, 0x00000020); } } } @@ -873,47 +856,45 @@ void func_8005994C(void) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 792017ad9d422c2467bd42686f383a5c41f41c75 +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b extern s8 D_80165890; void func_8005995C(void) { - s32 temp_v1; + Player *temp_v0; + Player *var_v0; + s32 var_v1; struct_8018CA70_entry *temp_a0; struct_8018CA70_entry *temp_a0_2; - void *temp_v0; - Player *phi_v0; - s32 phi_v1; - phi_v0 = gPlayerOne; - phi_v1 = 0; + var_v0 = gPlayerOne; + var_v1 = 0; do { - if ((D_80165890 != 0) && ((phi_v0->unk_000 & 0x100) != 0)) { - phi_v0->unk_010 = 0xC; - D_8018CA70[phi_v1].unk_75 = 2; + if ((D_80165890 != 0) && (var_v0->unk_000 & 0x100)) { + var_v0->unk_010 = 0x000C; + D_8018CA70[var_v1].unk_75 = 2; } - if (((phi_v0->unk_000 & 0x100) != 0) && (phi_v0->unk_010 == 0)) { - temp_a0 = &D_8018CA70[phi_v1]; + if ((var_v0->unk_000 & 0x100) && (var_v0->unk_010 == 0)) { + temp_a0 = &D_8018CA70[var_v1]; if (temp_a0->unk_75 != 0) { - phi_v0->unk_010 = 0xC; - temp_a0->unk_75 += -1; + var_v0->unk_010 = 0x000C; + temp_a0->unk_75 -= 1; } } - temp_v0 = phi_v0 + 0xDD8; - if ((D_80165890 != 0) && ((temp_v0->unk0 & 0x100) != 0)) { - temp_v0->unk10 = 0xC; - D_8018CA70[phi_v1].unkF9 = 2; + temp_v0 = var_v0 + 0xDD8; + if ((D_80165890 != 0) && (temp_v0->unk_000 & 0x100)) { + temp_v0->unk_010 = 0x000C; + D_8018CA70[var_v1].unkF9 = 2; } - if (((temp_v0->unk0 & 0x100) != 0) && (temp_v0->unk10 == 0)) { - temp_a0_2 = &D_8018CA70[phi_v1]; + if ((temp_v0->unk_000 & 0x100) && (temp_v0->unk_010 == 0)) { + temp_a0_2 = &D_8018CA70[var_v1]; if (temp_a0_2->unkF9 != 0) { - temp_v0->unk10 = 0xC; + temp_v0->unk_010 = 0x000C; temp_a0_2->unkF9 = (s8) (temp_a0_2->unkF9 - 1); } } - temp_v1 = phi_v1 + 2; - phi_v0 = temp_v0 + 0xDD8; - phi_v1 = temp_v1; - } while (temp_v1 != 4); + var_v1 += 2; + var_v0 = temp_v0 + 0xDD8; + } while (var_v1 != 4); D_80165890 = 0; } #else @@ -928,68 +909,57 @@ void func_80059A88(s32 arg0) { } } -#ifdef NON_MATCHING -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -//void func_80059820(?); // extern -//void func_8005995C(); // extern -//void func_80059A88(?); // extern -//void func_8005A71C(); // extern -//void func_800892E0(s32); // extern -s32 func_8008A890(Camera*); // extern -//void func_8008C1D8(? *); // extern -extern u16 D_800DC5FC; +#ifdef MIPS_TO_C +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b extern s32 D_80165678; -extern s16 D_8018CF68[]; +extern s32 gGamestate; extern s32 gRaceFrameCounter; -extern Camera *camera1; -// unused? void func_80059AC8(void) { - //s32 temp_s0; - UNUSED s32 temp_v0; - s16 *phi_s2; - s32 phi_s0; + s16 *var_s2; + s32 temp_v0; + s32 var_s0; + s32 var_s1; if (D_800DC5FC == 0) { func_8008C1D8(&D_80165678); - gRaceFrameCounter++; - phi_s2 = (s16*) &D_8018CF68; - phi_s0 = 0; - //phi_s1 = 0; - for (phi_s0 = 0; phi_s0 != 8; phi_s0++) { - *phi_s2 = func_8008A890(phi_s0 + camera1); - func_800892E0(phi_s0); - //temp_s0 = phi_s0 + 1; - //phi_s1 += 0xB8; - phi_s2 += 2; - phi_s0++; - } //while (phi_s0 != 8); - - switch (gScreenModeSelection) { - case SCREEN_MODE_1P: - if (gGamestate != 9) { - func_80059A88(0); - if (gModeSelection == TIME_TRIALS) { - func_8005995C(); - } - } else { - func_80059820(0); - } - break; - case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: - func_80059A88(0); - func_80059A88(1); - break; - case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: - func_80059A88(0); - func_80059A88(1); - break; - case SCREEN_MODE_3P_4P_SPLITSCREEN: + gRaceFrameCounter += 1; + var_s2 = D_8018CF68; + var_s0 = 0; + var_s1 = 0; + do { + *var_s2 = func_8008A890(var_s1 + camera1); + func_800892E0(var_s0); + var_s0 += 1; + var_s1 += 0xB8; + var_s2 += 2; + } while (var_s0 != 8); + temp_v0 = gScreenModeSelection; + switch (temp_v0) { /* irregular */ + case SCREEN_MODE_1P: + if (gGamestate != 9) { func_80059A88(0); - func_80059A88(1); - func_80059A88(2); - func_80059A88(3); - break; + if (gModeSelection == TIME_TRIALS) { + func_8005995C(); + } + } else { + func_80059820(0); + } + break; + case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: + func_80059A88(0); + func_80059A88(1); + break; + case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: + func_80059A88(0); + func_80059A88(1); + break; + case SCREEN_MODE_3P_4P_SPLITSCREEN: + func_80059A88(0); + func_80059A88(1); + func_80059A88(2); + func_80059A88(3); + break; } func_8005A71C(); } @@ -999,44 +969,46 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80059AC8.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 -void func_8005A3C0(); /* extern */ -extern s16 gGPCurrentRacePlayerIdByRank; -extern s32 gPlayerPositions; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b extern ? D_801643D8; -extern s16 D_8018CF90; +extern ? D_8018CF90; extern ? D_8018CF98; +extern ? gGPCurrentRaceRanks; void func_80059C50(void) { - ? *temp_v0_2; - ? *temp_v1; - u32 temp_v0; - s16 *phi_a0; - s16 *phi_v0; - ? *phi_v0_2; - ? *phi_v1; + ? *var_v0; + ? *var_v1; + s16 *var_a0; + s32 *var_v0_2; + s32 temp_lo; + s32 temp_t0; + s32 temp_t1; + s32 temp_t2; + s32 temp_t9; func_8005A3C0(); - phi_a0 = &gGPCurrentRacePlayerIdByRank; - phi_v0 = gGPCurrentRaceRanks; + var_v0 = &gGPCurrentRaceRanks; + var_a0 = gGPCurrentRacePlayerIdByRank; do { - temp_v0 = phi_v0 + 2; - temp_v0->unk-2 = gPlayerOne[*phi_a0].characterId; - phi_a0 += 2; - phi_v0 = temp_v0; - } while (temp_v0 < &D_8018CF90); - phi_v0_2 = &gPlayerPositions; - phi_v1 = &D_8018CF98; + var_v0 += 2; + temp_lo = *var_a0 * 0xDD8; + var_a0 += 2; + var_v0->unk-2 = (u16) (temp_lo + gPlayerOne)->unk254; + } while ((u32) var_v0 < (u32) &D_8018CF90); + var_v0_2 = gPlayerPositions; + var_v1 = &D_8018CF98; do { - temp_v0_2 = phi_v0_2 + 0x10; - temp_v1 = phi_v1 + 8; - temp_v1->unk-6 = phi_v0_2->unk4; - temp_v1->unk-4 = phi_v0_2->unk8; - temp_v1->unk-2 = phi_v0_2->unkC; - temp_v1->unk-8 = phi_v0_2->unk0; - phi_v0_2 = temp_v0_2; - phi_v1 = temp_v1; - } while (temp_v0_2 != &D_801643D8); + temp_t0 = var_v0_2->unk4; + temp_t1 = var_v0_2->unk8; + temp_t2 = var_v0_2->unkC; + temp_t9 = var_v0_2->unk0; + var_v0_2 += 0x10; + var_v1 += 8; + var_v1->unk-6 = (s16) temp_t0; + var_v1->unk-4 = (s16) temp_t1; + var_v1->unk-2 = (s16) temp_t2; + var_v1->unk-8 = (s16) temp_t9; + } while (var_v0_2 != &D_801643D8); } #else GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80059C50.s") @@ -1172,82 +1144,70 @@ void func_8005A070(void) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 u16_step_up_towards(s32, ?, ?); // extern -s32 u16_step_down_towards(s32, ?, ?); // extern -s32 f32_step_towards(void *, ?, ?, s32); // extern -s32 func_80087D24(s32, ?, ?, ?); // extern -extern f32 D_800EE1E0; -extern struct_80165C18_entry D_80165C18; -extern s32 D_8018CE24; -extern s32 gLapCountByPlayerId; - -void func_8005A14C(s32 arg0) { +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +extern ? D_8018CE24; + +void func_8005A14C(s32 playerId) { s32 sp2C; s32 sp28; Player *sp24; Player *temp_t0; s32 temp_a3; + struct_80165C18_entry *temp_s0; + struct_80165C18_entry *temp_s0_2; u16 temp_v1; - void *temp_s0; - void *temp_s0_2; - void *phi_s0; - - temp_t0 = &gPlayerOne[arg0]; - sp28 = *(&gLapCountByPlayerId + (arg0 * 4)); - temp_a3 = *(&D_8018CE24 + (arg0 << 5)); - if ((temp_t0->unk_000 & 0x8000) != 0) { - if ((temp_t0->unk_0BC & 0x204C0) != 0) { - temp_s0 = (temp_a3 * 0xE0) + &D_80165C18; - temp_s0->unkC2 = temp_s0->unkC2 + 0x1000; - phi_s0 = temp_s0; - goto block_5; - } - temp_s0_2 = (temp_a3 * 0xE0) + &D_80165C18; - temp_v1 = temp_s0_2->unkC2; - phi_s0 = temp_s0_2; - phi_s0 = temp_s0_2; - if (temp_v1 != 0) { - temp_s0_2->unkC2 = temp_v1 + 0x1000; -block_5: - } - if ((temp_t0->unk_0BC * 2) < 0) { + + temp_t0 = &gPlayerOne[playerId]; + sp28 = gLapCountByPlayerId[playerId]; + temp_a3 = *(&D_8018CE24 + (playerId << 5)); + if (temp_t0->unk_000 & 0x8000) { + if (temp_t0->unk_0BC & 0x204C0) { + temp_s0 = &D_80165C18[temp_a3]; + temp_s0->unk_0BE[2] += 0x1000; + } else { + temp_s0_2 = &D_80165C18[temp_a3]; + temp_v1 = temp_s0_2->unk_0BE[2]; + if (temp_v1 != 0) { + temp_s0_2->unk_0BE[2] = temp_v1 + 0x1000; + } + } + if (temp_t0->unk_0BC & 0x40000000) { sp2C = temp_a3; sp24 = temp_t0; - f32_step_towards(phi_s0, 0x3E99999A, 0x3CA3D70A, temp_a3); + f32_step_towards(&D_80165C18[temp_a3].unk_000, 0.3f, 0.02f); } else { sp2C = temp_a3; sp24 = temp_t0; - f32_step_towards(phi_s0, 0x3F19999A, 0x3CA3D70A, temp_a3); + f32_step_towards(&D_80165C18[temp_a3].unk_000, 0.6f, 0.02f); } - if (sp24->unk_0BC & 0x4000000) { + if (sp24->unk_0BC & 0x04000000) { sp24 = sp24; - u16_step_up_towards(phi_s0 + 0xBE, 0xC00, 0x100); + u16_step_up_towards(&D_80165C18[temp_a3].unk_000 + 0xBE, 0x0C00U, 0x0100U); } else { sp24 = sp24; - u16_step_down_towards(phi_s0 + 0xBE, 0, 0x100); + u16_step_down_towards(&D_80165C18[temp_a3].unk_000 + 0xBE, 0, 0x00000100); } - if ((sp24->unk_0BC & 0x3000000) != 0) { + if (sp24->unk_0BC & 0x03000000) { sp24 = sp24; - func_80087D24(sp2C, 0x40C00000, 0x3FC00000, 0); + func_80087D24(sp2C, 6.0f, 1.5f, 0.0f); } else { sp24 = sp24; - f32_step_towards(phi_s0 + 0x2C, 0, 0x3F800000); + f32_step_towards(&D_80165C18[temp_a3].unk_000 + 0x2C, 0.0f, 1.0f); } - if (((sp24->unk_000 & 0x100) != 0) || (sp24->unk_0BC & 0x80000000)) { - phi_s0->unkA0 = 0x50; + if ((sp24->unk_000 & 0x100) || (sp24->unk_0BC & 0x80000000)) { + D_80165C18[temp_a3].unk_000.unkA0 = 0x0050; } else { - phi_s0->unkA0 = 0xFF; + D_80165C18[temp_a3].unk_000.unkA0 = 0x00FF; } if (sp28 >= 3) { - phi_s0->unkC2 = 0; - phi_s0->unkC0 = 0; - phi_s0->unkBE = 0; - phi_s0->unk30 = 0.0f; - phi_s0->unk2C = 0.0f; - phi_s0->unk28 = 0.0f; - phi_s0->unkA0 = 0xFF; - phi_s0->unk0 = D_800EE1E0; + D_80165C18[temp_a3].unk_000.unkC2 = 0; + D_80165C18[temp_a3].unk_000.unkC0 = 0; + D_80165C18[temp_a3].unk_000.unkBE = 0; + D_80165C18[temp_a3].unk_000.unk30 = 0.0f; + D_80165C18[temp_a3].unk_000.unk2C = 0.0f; + D_80165C18[temp_a3].unk_000.unk28 = 0.0f; + D_80165C18[temp_a3].unk_000.unkA0 = 0x00FF; + D_80165C18[temp_a3].unk_000 = 0.6f; } } } @@ -1263,79 +1223,79 @@ void func_8005A380(void) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 -void func_8006F824(?, s8, s32); /* extern */ -extern s32 gGamestate; -extern u16 D_800DC51C; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_8006F824(?, s8, s32); /* extern */ extern s8 D_801657E4; extern s8 D_801657E6; -extern s8 D_801657E8; extern s8 D_801657F0; extern s8 D_801657F8; -extern s8 D_80165800; +extern ? D_80165800; extern s32 D_8018D204; +extern void *gControllerFour; +extern void *gControllerOne; +extern void *gControllerThree; +extern void *gControllerTwo; +extern s32 gGamestate; -void func_8005A3C0(s32 arg2) { +void func_8005A3C0(s32 arg0, s32 arg1, s32 arg2) { s32 temp_v0; s32 temp_v0_2; - s8 phi_a1; - s32 phi_a2; + s32 var_a2; + s8 var_a1; + var_a2 = arg2; temp_v0 = gGamestate; - phi_a1 = 0; - phi_a2 = arg2; - phi_a1 = 0; + var_a1 = 0; if ((temp_v0 != 5) && (temp_v0 != 9) && (D_8018D204 == 0)) { temp_v0_2 = gPlayerCountSelection1; - if (temp_v0_2 != 1) { + if (temp_v0_2 != (s32) 1) { if (temp_v0_2 != 2) { - if (temp_v0_2 != 3) { - if (temp_v0_2 != 4) { - phi_a2 = 3; - } else if (((gControllerOne->buttonPressed & 1) != 0) || ((gControllerTwo->buttonPressed & 1) != 0) || ((gControllerThree->buttonPressed & 1) != 0) || (phi_a2 = 3, ((gControllerFour->buttonPressed & 1) != 0))) { + var_a2 = 3; + switch (temp_v0_2) { /* irregular */ + case 3: + if ((gControllerOne->unk6 & 1) || (gControllerTwo->unk6 & 1) || (gControllerThree->unk6 & 1)) { + if (gModeSelection != 3) { + D_801657F0 = (D_801657F0 + 1) & 1; + } + var_a1 = 1; + D_801657E4 = (D_801657E4 + 1) & 1; + } + break; + case 4: + if ((gControllerOne->unk6 & 1) || (gControllerTwo->unk6 & 1) || (gControllerThree->unk6 & 1) || (gControllerFour->unk6 & 1)) { D_801657E4 = (D_801657E4 + 1) & 1; D_801657F8 = (D_801657F8 + 1) & 1; - D_80165800.unk0 = (D_80165800.unk0 + 1) & 1; - phi_a1 = 1; - phi_a2 = 3; - if (gModeSelection != BATTLE) { + D_80165800.unk0 = (s8) ((D_80165800.unk0 + 1) & 1); + var_a1 = 1; + if (gModeSelection != 3) { D_801657F0 = (D_801657F0 + 1) & 1; - phi_a1 = 1; - phi_a2 = 3; } } - } else if (((gControllerOne->buttonPressed & 1) != 0) || ((gControllerTwo->buttonPressed & 1) != 0) || (phi_a2 = 3, ((gControllerThree->buttonPressed & 1) != 0))) { - if (gModeSelection != BATTLE) { - D_801657F0 = (D_801657F0 + 1) & 1; - } - D_801657E4 = (D_801657E4 + 1) & 1; - phi_a1 = 1; - phi_a2 = 3; + break; } } else { - phi_a2 = 3; - if (gModeSelection != BATTLE) { - if ((gControllerOne->buttonPressed & 1) != 0) { - D_80165800.unk0 = (D_80165800.unk0 + 1) & 1; - phi_a1 = 1; + var_a2 = 3; + if (gModeSelection != 3) { + if (gControllerOne->unk6 & 1) { + var_a1 = 1; + D_80165800.unk0 = (s8) ((D_80165800.unk0 + 1) & 1); } - if ((gControllerTwo->buttonPressed & 1) != 0) { - D_80165800.unk1 = (D_80165800.unk1 + 1) & 1; - phi_a1 = 1; + if (gControllerTwo->unk6 & 1) { + var_a1 = 1; + D_80165800.unk1 = (s8) ((D_80165800.unk1 + 1) & 1); } if ((D_80165800.unk0 != 0) && (D_80165800.unk1 != 0)) { D_801657F0 = 0; } else { D_801657F0 = 1; } - phi_a2 = 3; if (D_800DC51C != 0) { D_801657F0 = 0; - phi_a2 = 3; } } } - } else if ((gControllerOne->buttonPressed & 1) != 0) { + } else if (gControllerOne->unk6 & 1) { + var_a1 = 1; D_801657E4 += 1; if (D_801657E4 >= 3) { D_801657E4 = 0; @@ -1344,21 +1304,20 @@ void func_8005A3C0(s32 arg2) { D_801657E8 = 0; D_801657E6 = 0; D_801657F0 = 1; - phi_a1 = 1; } else if (D_801657E4 == 1) { D_801657E8 = 0; D_801657E6 = 1; D_801657F0 = 0; - phi_a1 = 1; + var_a1 = 1; } else { D_801657E8 = 1; D_801657E6 = 0; D_801657F0 = 0; - phi_a1 = 1; + var_a1 = 1; } } - if (phi_a1 != 0) { - func_8006F824(1, phi_a1, phi_a2); + if (var_a1 != 0) { + func_8006F824(1, var_a1, var_a2); } } } @@ -1373,38 +1332,37 @@ void func_8005A71C(void) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 -void func_80074EE8(); /* extern */ -void func_80075838(); /* extern */ -void func_80075CA8(); /* extern */ -void func_80076B84(); /* extern */ -void func_80076F2C(); /* extern */ -void func_80077C9C(); /* extern */ -void func_80078838(); /* extern */ -void func_8007C2F8(?); /* extern */ -void func_8007C340(); /* extern */ -void func_8007DB44(); /* extern */ -void func_8007E1AC(); /* extern */ -void func_8007E4C4(); /* extern */ -void func_80081208(); /* extern */ -void func_800821FC(); /* extern */ -void func_80082870(); /* extern */ -void func_80082E5C(); /* extern */ -void func_80083080(); /* extern */ -void func_800834B8(); /* extern */ -void func_80083D60(); /* extern */ -void func_800842C8(); /* extern */ -void func_80085214(); /* extern */ -void func_800857C0(); /* extern */ -void func_80085AA8(); /* extern */ -void func_800861E0(); /* extern */ -u16 gCurrentCourseId; /* unable to generate initializer */ +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_80074EE8(); /* extern */ +? func_80075838(); /* extern */ +? func_80075CA8(); /* extern */ +? func_80076B84(); /* extern */ +? func_80076F2C(); /* extern */ +? func_80077C9C(); /* extern */ +? func_80078838(); /* extern */ +? func_8007DB44(); /* extern */ +? func_8007E1AC(); /* extern */ +? func_8007E4C4(); /* extern */ +? func_800821FC(); /* extern */ +? func_80082870(); /* extern */ +? func_80082E5C(); /* extern */ +? func_80083080(); /* extern */ +? func_800834B8(); /* extern */ +? func_80083D60(); /* extern */ +? func_800842C8(); /* extern */ +? func_80085214(); /* extern */ +? func_800857C0(); /* extern */ +? func_80085AA8(); /* extern */ +? func_800861E0(); /* extern */ +extern s8 D_80165898; +extern s32 gGamestate; +s16 gCurrentCourseId; /* unable to generate initializer */ void func_8005A74C(void) { s8 temp_v0; u16 temp_t6; - temp_t6 = gCurrentCourseId; + temp_t6 = (u16) gCurrentCourseId; switch (temp_t6) { case 2: func_80081208(); @@ -1548,22 +1506,21 @@ void func_8005AB20(void) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 792017ad9d422c2467bd42686f383a5c41f41c75 -s32 s16_step_towards(? *, ?, ?); /* extern */ +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b extern s16 D_8016579E; extern u8 D_801657E7; -extern ? D_8018CAAE; -extern ? D_8018CAB0; +extern s16 D_8018CAAE; +extern s16 D_8018CAB0; extern s16 D_8018CAB8; -extern ? D_8018CABE; -extern ? D_8018CAC0; -extern ? D_8018CAC2; -extern ? D_8018CACA; -extern ? D_8018CACC; -extern ? D_8018CACE; +extern s16 D_8018CABE; +extern s16 D_8018CAC0; +extern s16 D_8018CAC2; +extern s16 D_8018CACA; +extern s16 D_8018CACC; +extern s16 D_8018CACE; extern f32 D_8018CFEC; extern f32 D_8018CFF4; -static u16 D_800E55B0[0]; /* unable to generate initializer; const */ +static u16 D_800E55B0[0]; /* unable to generate initializer */ void func_8005AB60(void) { s32 temp_v0_2; @@ -1581,45 +1538,45 @@ void func_8005AB60(void) { temp_t6 = (u8) D_8018CA70->unk_78; switch (temp_t6) { /* switch 1 */ case 1: /* switch 1 */ - s16_step_towards(&D_8018CAAE, 0x106, 0x10); - if (s16_step_towards(&D_8018CAB0, 0xB6, 0x10) != 0) { + s16_step_towards(&D_8018CAAE, 0x0106, 0x0010); + if (s16_step_towards(&D_8018CAB0, 0x00B6, 0x0010) != 0) { D_8018CA70->unk_79 = 1; D_8018CA70->unk_78 = (u8) D_8018CA70->unk_78 + 1; } break; case 2: /* switch 1 */ - s16_step_towards(&D_8018CAAE, 0x116, 4); - if (s16_step_towards(&D_8018CAB0, 0xC6, 4) != 0) { + s16_step_towards(&D_8018CAAE, 0x0116, 4); + if (s16_step_towards(&D_8018CAB0, 0x00C6, 4) != 0) { D_8018CA70->unk_78 = (u8) D_8018CA70->unk_78 + 1; } break; case 3: /* switch 1 */ - s16_step_towards(&D_8018CAAE, 0x106, 4); - if (s16_step_towards(&D_8018CAB0, 0xB6, 4) != 0) { + s16_step_towards(&D_8018CAAE, 0x0106, 4); + if (s16_step_towards(&D_8018CAB0, 0x00B6, 4) != 0) { D_8018CA70->unk_78 = (u8) D_8018CA70->unk_78 + 1; } break; case 4: /* switch 1 */ - s16_step_towards(&D_8018CAAE, 0x10E, 4); - if (s16_step_towards(&D_8018CAB0, 0xBE, 4) != 0) { + s16_step_towards(&D_8018CAAE, 0x010E, 4); + if (s16_step_towards(&D_8018CAB0, 0x00BE, 4) != 0) { D_8018CA70->unk_78 = (u8) D_8018CA70->unk_78 + 1; } break; case 5: /* switch 1 */ - s16_step_towards(&D_8018CAAE, 0x106, 4); - if (s16_step_towards(&D_8018CAB0, 0xB6, 4) != 0) { + s16_step_towards(&D_8018CAAE, 0x0106, 4); + if (s16_step_towards(&D_8018CAB0, 0x00B6, 4) != 0) { D_8018CA70->unk_78 = (u8) D_8018CA70->unk_78 + 1; } break; case 6: /* switch 1 */ - s16_step_towards(&D_8018CAAE, 0x10A, 2); - if (s16_step_towards(&D_8018CAB0, 0xBA, 2) != 0) { + s16_step_towards(&D_8018CAAE, 0x010A, 2); + if (s16_step_towards(&D_8018CAB0, 0x00BA, 2) != 0) { D_8018CA70->unk_78 = (u8) D_8018CA70->unk_78 + 1; } break; case 7: /* switch 1 */ - s16_step_towards(&D_8018CAAE, 0x106, 2); - if (s16_step_towards(&D_8018CAB0, 0xB6, 2) != 0) { + s16_step_towards(&D_8018CAAE, 0x0106, 2); + if (s16_step_towards(&D_8018CAB0, 0x00B6, 2) != 0) { D_8018CA70->unk_78 = (u8) D_8018CA70->unk_78 + 1; } break; @@ -1640,81 +1597,81 @@ void func_8005AB60(void) { D_8016579E = D_800E55B0[temp_v0_2] + 0xDD00; } } - temp_t8 = D_8018CA70->unk80; + temp_t8 = (u8) D_8018CA70->unk_80; switch (temp_t8) { /* switch 2 */ case 1: /* switch 2 */ - if (s16_step_towards(&D_8018CAB8, 0x40, 8) != 0) { - D_8018CA70->unk80 = (u8) (D_8018CA70->unk80 + 1); + if (s16_step_towards(&D_8018CAB8, 0x0040, 8) != 0) { + D_8018CA70->unk_80 = (u8) D_8018CA70->unk_80 + 1; } break; case 2: /* switch 2 */ - if (s16_step_towards(&D_8018CAB8, 0x38, 8) != 0) { - D_8018CA70->unk80 = (u8) (D_8018CA70->unk80 + 1); + if (s16_step_towards(&D_8018CAB8, 0x0038, 8) != 0) { + D_8018CA70->unk_80 = (u8) D_8018CA70->unk_80 + 1; } break; case 3: /* switch 2 */ - if (s16_step_towards(&D_8018CAB8, 0x40, 8) != 0) { - D_8018CA70->unk80 = (u8) (D_8018CA70->unk80 + 1); + if (s16_step_towards(&D_8018CAB8, 0x0040, 8) != 0) { + D_8018CA70->unk_80 = (u8) D_8018CA70->unk_80 + 1; } break; case 4: /* switch 2 */ - if (s16_step_towards(&D_8018CAB8, 0x38, 8) != 0) { - D_8018CA70->unk80 = (u8) (D_8018CA70->unk80 + 1); + if (s16_step_towards(&D_8018CAB8, 0x0038, 8) != 0) { + D_8018CA70->unk_80 = (u8) D_8018CA70->unk_80 + 1; } break; case 5: /* switch 2 */ - if (s16_step_towards(&D_8018CAB8, 0x40, 8) != 0) { - D_8018CA70->unk80 = (u8) (D_8018CA70->unk80 + 1); + if (s16_step_towards(&D_8018CAB8, 0x0040, 8) != 0) { + D_8018CA70->unk_80 = (u8) D_8018CA70->unk_80 + 1; } break; case 6: /* switch 2 */ - if (s16_step_towards(&D_8018CAB8, 0x38, 4) != 0) { - D_8018CA70->unk80 = (u8) (D_8018CA70->unk80 + 1); + if (s16_step_towards(&D_8018CAB8, 0x0038, 4) != 0) { + D_8018CA70->unk_80 = (u8) D_8018CA70->unk_80 + 1; } break; case 7: /* switch 2 */ - if (s16_step_towards(&D_8018CAB8, 0x40, 4) != 0) { - D_8018CA70->unk80 = (u8) (D_8018CA70->unk80 + 1); + if (s16_step_towards(&D_8018CAB8, 0x0040, 4) != 0) { + D_8018CA70->unk_80 = (u8) D_8018CA70->unk_80 + 1; } break; case 8: /* switch 2 */ - D_8018CA70->unk80 = 0U; + D_8018CA70->unk_80 = 0; break; } temp_t3_2 = (u8) D_8018CA70->unk_7A; switch (temp_t3_2) { /* switch 3 */ case 1: /* switch 3 */ - if (s16_step_towards(&D_8018CABE, 0xE4, 0x10) != 0) { + if (s16_step_towards(&D_8018CABE, 0x00E4, 0x0010) != 0) { D_8018CA70->unk_7A = (u8) D_8018CA70->unk_7A + 1; } break; case 2: /* switch 3 */ - if (s16_step_towards(&D_8018CABE, 0xF4, 4) != 0) { + if (s16_step_towards(&D_8018CABE, 0x00F4, 4) != 0) { D_8018CA70->unk_7A = (u8) D_8018CA70->unk_7A + 1; } break; case 3: /* switch 3 */ - if (s16_step_towards(&D_8018CABE, 0xE4, 4) != 0) { + if (s16_step_towards(&D_8018CABE, 0x00E4, 4) != 0) { D_8018CA70->unk_7A = (u8) D_8018CA70->unk_7A + 1; } break; case 4: /* switch 3 */ - if (s16_step_towards(&D_8018CABE, 0xEC, 4) != 0) { + if (s16_step_towards(&D_8018CABE, 0x00EC, 4) != 0) { D_8018CA70->unk_7A = (u8) D_8018CA70->unk_7A + 1; } break; case 5: /* switch 3 */ - if (s16_step_towards(&D_8018CABE, 0xE4, 4) != 0) { + if (s16_step_towards(&D_8018CABE, 0x00E4, 4) != 0) { D_8018CA70->unk_7A = (u8) D_8018CA70->unk_7A + 1; } break; case 6: /* switch 3 */ - if (s16_step_towards(&D_8018CABE, 0xE8, 2) != 0) { + if (s16_step_towards(&D_8018CABE, 0x00E8, 2) != 0) { D_8018CA70->unk_7A = (u8) D_8018CA70->unk_7A + 1; } break; case 7: /* switch 3 */ - if (s16_step_towards(&D_8018CABE, 0xE4, 2) != 0) { + if (s16_step_towards(&D_8018CABE, 0x00E4, 2) != 0) { D_8018CA70->unk_7A = (u8) D_8018CA70->unk_7A + 1; } break; @@ -1725,37 +1682,37 @@ void func_8005AB60(void) { temp_t8_2 = (u8) D_8018CA70->unk_7D; switch (temp_t8_2) { /* switch 4 */ case 1: /* switch 4 */ - if (s16_step_towards(&D_8018CACA, 0x53, 0x10) != 0) { + if (s16_step_towards(&D_8018CACA, 0x0053, 0x0010) != 0) { D_8018CA70->unk_7D = (u8) D_8018CA70->unk_7D + 1; } break; case 2: /* switch 4 */ - if (s16_step_towards(&D_8018CACA, 0x43, 4) != 0) { + if (s16_step_towards(&D_8018CACA, 0x0043, 4) != 0) { D_8018CA70->unk_7D = (u8) D_8018CA70->unk_7D + 1; } break; case 3: /* switch 4 */ - if (s16_step_towards(&D_8018CACA, 0x53, 4) != 0) { + if (s16_step_towards(&D_8018CACA, 0x0053, 4) != 0) { D_8018CA70->unk_7D = (u8) D_8018CA70->unk_7D + 1; } break; case 4: /* switch 4 */ - if (s16_step_towards(&D_8018CACA, 0x4B, 4) != 0) { + if (s16_step_towards(&D_8018CACA, 0x004B, 4) != 0) { D_8018CA70->unk_7D = (u8) D_8018CA70->unk_7D + 1; } break; case 5: /* switch 4 */ - if (s16_step_towards(&D_8018CACA, 0x53, 4) != 0) { + if (s16_step_towards(&D_8018CACA, 0x0053, 4) != 0) { D_8018CA70->unk_7D = (u8) D_8018CA70->unk_7D + 1; } break; case 6: /* switch 4 */ - if (s16_step_towards(&D_8018CACA, 0x4F, 2) != 0) { + if (s16_step_towards(&D_8018CACA, 0x004F, 2) != 0) { D_8018CA70->unk_7D = (u8) D_8018CA70->unk_7D + 1; } break; case 7: /* switch 4 */ - if (s16_step_towards(&D_8018CACA, 0x53, 2) != 0) { + if (s16_step_towards(&D_8018CACA, 0x0053, 2) != 0) { D_8018CA70->unk_7D = (u8) D_8018CA70->unk_7D + 1; } break; @@ -1768,37 +1725,37 @@ void func_8005AB60(void) { temp_t7 = (u8) D_8018CA70->unk_7B; switch (temp_t7) { /* switch 5 */ case 1: /* switch 5 */ - if (s16_step_towards(&D_8018CAC0, 0xE4, 0x10) != 0) { + if (s16_step_towards(&D_8018CAC0, 0x00E4, 0x0010) != 0) { D_8018CA70->unk_7B = (u8) D_8018CA70->unk_7B + 1; } break; case 2: /* switch 5 */ - if (s16_step_towards(&D_8018CAC0, 0xF4, 4) != 0) { + if (s16_step_towards(&D_8018CAC0, 0x00F4, 4) != 0) { D_8018CA70->unk_7B = (u8) D_8018CA70->unk_7B + 1; } break; case 3: /* switch 5 */ - if (s16_step_towards(&D_8018CAC0, 0xE4, 4) != 0) { + if (s16_step_towards(&D_8018CAC0, 0x00E4, 4) != 0) { D_8018CA70->unk_7B = (u8) D_8018CA70->unk_7B + 1; } break; case 4: /* switch 5 */ - if (s16_step_towards(&D_8018CAC0, 0xEC, 4) != 0) { + if (s16_step_towards(&D_8018CAC0, 0x00EC, 4) != 0) { D_8018CA70->unk_7B = (u8) D_8018CA70->unk_7B + 1; } break; case 5: /* switch 5 */ - if (s16_step_towards(&D_8018CAC0, 0xE4, 4) != 0) { + if (s16_step_towards(&D_8018CAC0, 0x00E4, 4) != 0) { D_8018CA70->unk_7B = (u8) D_8018CA70->unk_7B + 1; } break; case 6: /* switch 5 */ - if (s16_step_towards(&D_8018CAC0, 0xE8, 2) != 0) { + if (s16_step_towards(&D_8018CAC0, 0x00E8, 2) != 0) { D_8018CA70->unk_7B = (u8) D_8018CA70->unk_7B + 1; } break; case 7: /* switch 5 */ - if (s16_step_towards(&D_8018CAC0, 0xE4, 2) != 0) { + if (s16_step_towards(&D_8018CAC0, 0x00E4, 2) != 0) { D_8018CA70->unk_7B = (u8) D_8018CA70->unk_7B + 1; } break; @@ -1809,37 +1766,37 @@ void func_8005AB60(void) { temp_t2 = (u8) D_8018CA70->unk_7E; switch (temp_t2) { /* switch 6 */ case 1: /* switch 6 */ - if (s16_step_towards(&D_8018CACC, 0x53, 0x10) != 0) { + if (s16_step_towards(&D_8018CACC, 0x0053, 0x0010) != 0) { D_8018CA70->unk_7E = (u8) D_8018CA70->unk_7E + 1; } break; case 2: /* switch 6 */ - if (s16_step_towards(&D_8018CACC, 0x43, 4) != 0) { + if (s16_step_towards(&D_8018CACC, 0x0043, 4) != 0) { D_8018CA70->unk_7E = (u8) D_8018CA70->unk_7E + 1; } break; case 3: /* switch 6 */ - if (s16_step_towards(&D_8018CACC, 0x53, 4) != 0) { + if (s16_step_towards(&D_8018CACC, 0x0053, 4) != 0) { D_8018CA70->unk_7E = (u8) D_8018CA70->unk_7E + 1; } break; case 4: /* switch 6 */ - if (s16_step_towards(&D_8018CACC, 0x4B, 4) != 0) { + if (s16_step_towards(&D_8018CACC, 0x004B, 4) != 0) { D_8018CA70->unk_7E = (u8) D_8018CA70->unk_7E + 1; } break; case 5: /* switch 6 */ - if (s16_step_towards(&D_8018CACC, 0x53, 4) != 0) { + if (s16_step_towards(&D_8018CACC, 0x0053, 4) != 0) { D_8018CA70->unk_7E = (u8) D_8018CA70->unk_7E + 1; } break; case 6: /* switch 6 */ - if (s16_step_towards(&D_8018CACC, 0x4F, 2) != 0) { + if (s16_step_towards(&D_8018CACC, 0x004F, 2) != 0) { D_8018CA70->unk_7E = (u8) D_8018CA70->unk_7E + 1; } break; case 7: /* switch 6 */ - if (s16_step_towards(&D_8018CACC, 0x53, 2) != 0) { + if (s16_step_towards(&D_8018CACC, 0x0053, 2) != 0) { D_8018CA70->unk_7E = (u8) D_8018CA70->unk_7E + 1; } break; @@ -1850,37 +1807,37 @@ void func_8005AB60(void) { temp_t7_2 = (u8) D_8018CA70->unk_7C; switch (temp_t7_2) { /* switch 7 */ case 1: /* switch 7 */ - if (s16_step_towards(&D_8018CAC2, 0xE4, 0x10) != 0) { + if (s16_step_towards(&D_8018CAC2, 0x00E4, 0x0010) != 0) { D_8018CA70->unk_7C = (u8) D_8018CA70->unk_7C + 1; } break; case 2: /* switch 7 */ - if (s16_step_towards(&D_8018CAC2, 0xF4, 4) != 0) { + if (s16_step_towards(&D_8018CAC2, 0x00F4, 4) != 0) { D_8018CA70->unk_7C = (u8) D_8018CA70->unk_7C + 1; } break; case 3: /* switch 7 */ - if (s16_step_towards(&D_8018CAC2, 0xE4, 4) != 0) { + if (s16_step_towards(&D_8018CAC2, 0x00E4, 4) != 0) { D_8018CA70->unk_7C = (u8) D_8018CA70->unk_7C + 1; } break; case 4: /* switch 7 */ - if (s16_step_towards(&D_8018CAC2, 0xEC, 4) != 0) { + if (s16_step_towards(&D_8018CAC2, 0x00EC, 4) != 0) { D_8018CA70->unk_7C = (u8) D_8018CA70->unk_7C + 1; } break; case 5: /* switch 7 */ - if (s16_step_towards(&D_8018CAC2, 0xE4, 4) != 0) { + if (s16_step_towards(&D_8018CAC2, 0x00E4, 4) != 0) { D_8018CA70->unk_7C = (u8) D_8018CA70->unk_7C + 1; } break; case 6: /* switch 7 */ - if (s16_step_towards(&D_8018CAC2, 0xE8, 2) != 0) { + if (s16_step_towards(&D_8018CAC2, 0x00E8, 2) != 0) { D_8018CA70->unk_7C = (u8) D_8018CA70->unk_7C + 1; } break; case 7: /* switch 7 */ - if (s16_step_towards(&D_8018CAC2, 0xE4, 2) != 0) { + if (s16_step_towards(&D_8018CAC2, 0x00E4, 2) != 0) { D_8018CA70->unk_7C = (u8) D_8018CA70->unk_7C + 1; } break; @@ -1891,44 +1848,44 @@ void func_8005AB60(void) { temp_t2_2 = (u8) D_8018CA70->unk_7F; switch (temp_t2_2) { /* switch 8 */ case 1: /* switch 8 */ - if (s16_step_towards(&D_8018CACE, 0x53, 0x10) != 0) { + if (s16_step_towards(&D_8018CACE, 0x0053, 0x0010) != 0) { D_8018CA70->unk_7F = (u8) D_8018CA70->unk_7F + 1; return; } default: /* switch 8 */ return; case 2: /* switch 8 */ - if (s16_step_towards(&D_8018CACE, 0x43, 4) != 0) { + if (s16_step_towards(&D_8018CACE, 0x0043, 4) != 0) { D_8018CA70->unk_7F = (u8) D_8018CA70->unk_7F + 1; return; } break; case 3: /* switch 8 */ - if (s16_step_towards(&D_8018CACE, 0x53, 4) != 0) { + if (s16_step_towards(&D_8018CACE, 0x0053, 4) != 0) { D_8018CA70->unk_7F = (u8) D_8018CA70->unk_7F + 1; return; } break; case 4: /* switch 8 */ - if (s16_step_towards(&D_8018CACE, 0x4B, 4) != 0) { + if (s16_step_towards(&D_8018CACE, 0x004B, 4) != 0) { D_8018CA70->unk_7F = (u8) D_8018CA70->unk_7F + 1; return; } break; case 5: /* switch 8 */ - if (s16_step_towards(&D_8018CACE, 0x53, 4) != 0) { + if (s16_step_towards(&D_8018CACE, 0x0053, 4) != 0) { D_8018CA70->unk_7F = (u8) D_8018CA70->unk_7F + 1; return; } break; case 6: /* switch 8 */ - if (s16_step_towards(&D_8018CACE, 0x4F, 2) != 0) { + if (s16_step_towards(&D_8018CACE, 0x004F, 2) != 0) { D_8018CA70->unk_7F = (u8) D_8018CA70->unk_7F + 1; return; } break; case 7: /* switch 8 */ - if (s16_step_towards(&D_8018CACE, 0x53, 2) != 0) { + if (s16_step_towards(&D_8018CACE, 0x0053, 2) != 0) { D_8018CA70->unk_7F = (u8) D_8018CA70->unk_7F + 1; return; } @@ -1943,67 +1900,57 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8005AB60.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 792017ad9d422c2467bd42686f383a5c41f41c75 -s32 s16_step_towards(? *, ?, ?); /* extern */ -s32 f32_step_towards(f32 *, f32, f32); /* extern */ -extern ? D_8018CAC0; -extern ? D_8018CAC2; -extern ? D_8018CAC4; -extern ? D_8018CAC6; -extern f32 D_8018D028; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +extern s16 D_8018CAC0; +extern s16 D_8018CAC2; +extern s16 D_8018CAC4; +extern s16 D_8018CAC6; +extern ? D_8018D028; extern f32 D_8018D050; -extern s16 D_8018D070; +extern ? D_8018D070; extern ? D_8018D078; -extern f32 D_8018D0C8; +extern ? D_8018D0C8; void func_8005B7A0(void) { - f32 *temp_s1; f32 *temp_s2; f32 *temp_s3; f32 *temp_s4; + f32 *var_s1; f32 temp_f0; - f32 *phi_s1; - s32 phi_s0; - - s16_step_towards(&D_8018CAC0, 0xE4, 0x10); - s16_step_towards(&D_8018CAC2, 0xE4, 0x10); - s16_step_towards(&D_8018CAC4, 0xE4, 0x10); - s16_step_towards(&D_8018CAC6, 0xE4, 0x10); - phi_s1 = &D_8018D050; - phi_s0 = 0; + s32 var_s0; + + s16_step_towards(&D_8018CAC0, 0x00E4, 0x0010); + s16_step_towards(&D_8018CAC2, 0x00E4, 0x0010); + s16_step_towards(&D_8018CAC4, 0x00E4, 0x0010); + s16_step_towards(&D_8018CAC6, 0x00E4, 0x0010); + var_s1 = &D_8018D050; + var_s0 = 0; do { - temp_s2 = &D_8018D028 + phi_s0; - temp_s3 = &D_8018D0C8 + phi_s0; - temp_s4 = &D_8018D078 + phi_s0; - if (*phi_s1 >= 0.0f) { + temp_s2 = &D_8018D028 + var_s0; + temp_s3 = &D_8018D0C8 + var_s0; + temp_s4 = &D_8018D078 + var_s0; + if (*var_s1 >= 0.0f) { f32_step_towards(temp_s2, *temp_s3, *temp_s4); temp_f0 = *temp_s2; if (temp_f0 == *temp_s3) { *temp_s4 = 0.0f; } if ((f64) temp_f0 <= -32.0) { - *phi_s1 = -32.0f; + *var_s1 = -32.0f; } } - temp_s1 = phi_s1 + 4; - phi_s1 = temp_s1; - phi_s0 += 4; - } while (temp_s1 != &D_8018D070); + var_s1 += 4; + var_s0 += 4; + } while (var_s1 != &D_8018D070); } #else GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8005B7A0.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 792017ad9d422c2467bd42686f383a5c41f41c75 -s32 f32_step_towards(f32 *, f32, ?32); /* extern */ -void func_8005AA4C(); /* extern */ -void func_8005AA6C(?); /* extern */ -void func_8005AA80(); /* extern */ -void func_8005AA94(?); /* extern */ -void func_8005AAF0(); /* extern */ -void func_8005AB60(); /* extern */ -void func_8005B7A0(); /* extern */ +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_8005AB60(); /* extern */ +? func_8005B7A0(); /* extern */ extern s8 D_801657E2; extern f32 D_8018D028; extern f32 D_8018D02C; @@ -2021,8 +1968,8 @@ extern f32 D_8018D060; extern f32 D_8018D064; extern f32 D_8018D068; extern f32 D_8018D06C; -extern s16 D_8018D070; -extern ?32 D_8018D078; +extern ? D_8018D070; +extern f32 D_8018D078; extern f32 D_8018D07C; extern f32 D_8018D080; extern f32 D_8018D084; @@ -2030,7 +1977,7 @@ extern f32 D_8018D088; extern f32 D_8018D08C; extern f32 D_8018D090; extern f32 D_8018D094; -extern s16 D_8018D098; +extern ? D_8018D098; extern f32 D_8018D0C8; extern f32 D_8018D0CC; extern f32 D_8018D0D0; @@ -2042,32 +1989,27 @@ extern f32 D_8018D0E4; extern s32 D_8018D1CC; void func_8005B914(void) { - ?32 *sp20; + f32 *sp20; f32 *sp1C; f32 *sp18; - ?32 *temp_v0_3; - f32 *temp_v0_2; - f32 *temp_v1; - s32 temp_v0; - f32 *phi_v0; - ?32 *phi_v0_2; - s32 phi_v0_3; - s32 phi_v0_4; - ?32 *phi_v0_5; - f32 *phi_v1; - f32 *phi_a0; - - temp_v0 = D_8018D1CC; - phi_v0_3 = temp_v0; - switch (temp_v0) { /* irregular */ + f32 *var_a0; + f32 *var_v0_2; + f32 *var_v0_3; + f32 *var_v0_4; + f32 *var_v1; + s32 temp_cond; + s32 var_v0; + + var_v0 = D_8018D1CC; + switch (var_v0) { /* irregular */ case 0x1: func_8005AAF0(); block_76: - phi_v0_3 = D_8018D1CC; + var_v0 = D_8018D1CC; break; case 0x2: - if (gModeSelection == TIME_TRIALS) { - D_8018CA70->unk80 = 1; + if (gModeSelection == 1) { + D_8018CA70->unk_80 = 1; } D_8018CA70->unk_78 = 1; D_8018CA70->unk_7A = 1; @@ -2092,7 +2034,7 @@ block_76: func_8005AA80(); goto block_76; case 0x14: - D_8018D078 = 0x41800000; + D_8018D078 = 16.0f; func_8005AA4C(); goto block_76; case 0x15: @@ -2117,7 +2059,7 @@ block_76: func_8005AA4C(); goto block_76; case 0x1B: - func_8005AA94(0xA); + func_8005AA94(0x0000000A); goto block_76; case 0x1C: func_8005AA80(); @@ -2126,10 +2068,10 @@ block_76: func_8005AA4C(); goto block_76; case 0x65: - func_8005AA94(0x3A); + func_8005AA94(0x0000003A); goto block_76; case 0x66: - D_8018D078 = 0xC1000000; + D_8018D078 = -8.0f; D_8018D0C8 = -32.0f; func_8005AA4C(); goto block_76; @@ -2158,22 +2100,21 @@ block_76: func_8005AA4C(); goto block_76; case 0x6D: - func_8005AA94(0xA); + func_8005AA94(0x0000000A); goto block_76; case 0x6E: - phi_v0 = &D_8018D050; + var_v0_2 = &D_8018D050; do { - temp_v0_2 = phi_v0 + 0x10; - temp_v0_2->unk-10 = -32.0f; - temp_v0_2->unk-C = -32.0f; - temp_v0_2->unk-8 = -32.0f; - temp_v0_2->unk-4 = -32.0f; - phi_v0 = temp_v0_2; - } while (temp_v0_2 != &D_8018D070); + var_v0_2 += 0x10; + var_v0_2->unk-10 = -32.0f; + var_v0_2->unk-C = -32.0f; + var_v0_2->unk-8 = -32.0f; + var_v0_2->unk-4 = -32.0f; + } while (var_v0_2 != &D_8018D070); D_8018D028 = 360.0f; D_8018D050 = 110.0f; D_8018D0C8 = 44.0f; - D_8018D078 = 0xC1800000; + D_8018D078 = -16.0f; D_801657E2 = 1; func_8005AA4C(); goto block_76; @@ -2248,35 +2189,34 @@ block_76: func_8005AA4C(); goto block_76; case 0x7D: - func_8005AA94(0xA); + func_8005AA94(0x0000000A); goto block_76; case 0x7E: - phi_v0_2 = &D_8018D078; + var_v0_3 = &D_8018D078; do { - temp_v0_3 = phi_v0_2 + 0x10; - temp_v0_3->unk-C = 0.0f; - temp_v0_3->unk-8 = 0.0f; - temp_v0_3->unk-4 = 0.0f; - temp_v0_3->unk-10 = 0.0f; - phi_v0_2 = temp_v0_3; - } while (temp_v0_3 != &D_8018D098); + var_v0_3 += 0x10; + var_v0_3->unk-C = 0.0f; + var_v0_3->unk-8 = 0.0f; + var_v0_3->unk-4 = 0.0f; + var_v0_3->unk-10 = 0.0f; + } while (var_v0_3 != &D_8018D098); func_8005AA4C(); goto block_76; case 0x7F: - func_8005AA94(0x82); + func_8005AA94(0x00000082); goto block_76; case 0x80: if (*gPlayerPositions < 4) { - func_8005AA6C(0x8C); + func_8005AA6C(0x0000008C); } else { - func_8005AA6C(0x82); + func_8005AA6C(0x00000082); } goto block_76; case 0x82: func_8005AA80(); goto block_76; case 0x8C: - D_8018D078 = 0xC1800000; + D_8018D078 = -16.0f; D_8018D0C8 = -32.0f; func_8005AA4C(); goto block_76; @@ -2337,39 +2277,38 @@ block_76: func_8005AA4C(); goto block_76; case 0x9B: - func_8005AA94(0x14); + func_8005AA94(0x00000014); goto block_76; case 0x9C: func_8005AA80(); goto block_76; } - phi_v0_4 = phi_v0_3; - if (phi_v0_3 < 0x64) { + if (var_v0 < 0x64) { func_8005AB60(); goto block_81; } - if (phi_v0_3 < 0xC8) { + if (var_v0 < 0xC8) { func_8005B7A0(); block_81: - phi_v0_4 = D_8018D1CC; + var_v0 = D_8018D1CC; } - if ((phi_v0_4 != 0) && (phi_v0_4 >= 0x14) && (phi_v0_4 < 0x1E)) { - phi_v0_5 = &D_8018D078; - phi_v1 = &D_8018D0C8; - phi_a0 = &D_8018D028; + if ((var_v0 != 0) && (var_v0 >= 0x14) && (var_v0 < 0x1E)) { + var_v1 = &D_8018D0C8; + var_a0 = &D_8018D028; + var_v0_4 = &D_8018D078; do { - sp20 = phi_v0_5; - sp18 = phi_v1; - sp1C = phi_a0; - f32_step_towards(phi_a0, *phi_v1, *phi_v0_5); - temp_v1 = phi_v1 + 4; - phi_v1 = temp_v1; - phi_a0 += 4; - if (*phi_a0 == *phi_v1) { - *phi_v0_5 = 0; + sp20 = var_v0_4; + sp18 = var_v1; + sp1C = var_a0; + f32_step_towards(var_a0, *var_v1, *var_v0_4); + temp_cond = *var_a0 == *var_v1; + var_v1 += 4; + var_a0 += 4; + if (temp_cond) { + *var_v0_4 = 0.0f; } - phi_v0_5 += 4; - } while (temp_v1 != &D_8018D0D8); + var_v0_4 += 4; + } while (var_v1 != &D_8018D0D8); } } #else @@ -2377,27 +2316,26 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8005B914.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_800E55A0; -extern f64 D_800EE4A8; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b extern s16 D_8016579E; extern u8 D_801657E7; extern u8 D_8018CAE9; extern f32 D_8018CFE4; +static u16 D_800E55A0[0]; /* unable to generate initializer */ void func_8005C360(f32 arg0) { f64 temp_f0; + s32 var_v0; u8 temp_t7; - s32 phi_v0; if (D_8018CAE9 == 0) { - temp_f0 = arg0; + temp_f0 = (f64) arg0; if (temp_f0 < 10.0) { - phi_v0 = ((128.0f * arg0) + 0xDD00) & 0xFFFF; + var_v0 = ((u32) (128.0f * arg0) + 0xDD00) & 0xFFFF; } else if (temp_f0 < 20.0) { - phi_v0 = (((temp_f0 - 10.0) * 256.0) + 0xE200) & 0xFFFF; + var_v0 = ((u32) ((temp_f0 - 10.0) * 256.0) + 0xE200) & 0xFFFF; } else { - phi_v0 = (((temp_f0 - 20.0) * D_800EE4A8) + 0xEC00) & 0xFFFF; + var_v0 = ((u32) ((temp_f0 - 20.0) * 268.8) + 0xEC00) & 0xFFFF; } if (arg0 == D_8018CFE4) { if (arg0 > 5.0f) { @@ -2411,7 +2349,7 @@ block_10: D_801657E7 = 0; } } - D_8016579E = *(&D_800E55A0 + (D_801657E7 * 2)) + phi_v0; + D_8016579E = D_800E55A0[D_801657E7] + var_v0; D_8018CFE4 = arg0; } } @@ -2485,9 +2423,9 @@ void func_8005C6B4(s8 arg0, s16* arg1, s16* arg2, s16* arg3) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8005C674(s8, s16 *, s16 *, s16 *); // extern -void func_8005C980(); // extern +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_8005C674(s8, s16 *, s16 *, s16 *); /* extern */ +? func_8005C980(); /* extern */ extern s32 D_80165590; extern s32 D_80165594; extern s32 D_80165598; @@ -2517,66 +2455,56 @@ void func_8005C728(void) { s16 sp26; s16 sp24; s16 sp22; - s32 temp_t2; - s32 temp_t3; - s32 temp_t4; s32 temp_t5; - s32 temp_t5_2; s32 temp_t7; s32 temp_t8; - s32 temp_t9; temp_t7 = D_8018D400 + 1; temp_t8 = temp_t7 & 0x3F; - temp_t9 = temp_t7 & 0x1F; - temp_t2 = temp_t7 & 0xF; - temp_t3 = temp_t7 & 7; - temp_t4 = temp_t7 & 3; - temp_t5 = temp_t7 & 1; D_8018D400 = temp_t7; D_8018D40C = temp_t8; - D_8018D410 = temp_t9; - D_80165590 = temp_t2; - D_80165594 = temp_t3; - D_80165598 = temp_t4; - D_8016559C = temp_t5; + D_8018D410 = temp_t7 & 0x1F; + D_80165590 = temp_t7 & 0xF; + D_80165594 = temp_t7 & 7; + D_80165598 = temp_t7 & 3; + D_8016559C = temp_t7 & 1; if (temp_t8 == 0) { - D_801655A4 = D_801655A4 + 1; - D_801655D8 = D_801655D8 ^ 1; + D_801655A4 += 1; + D_801655D8 ^= 1; } if (D_8018D410 == 0) { - D_801655AC = D_801655AC + 1; - D_801655E8 = D_801655E8 ^ 1; + D_801655AC += 1; + D_801655E8 ^= 1; } if (D_80165590 == 0) { - D_801655B4 = D_801655B4 + 1; - D_801655F8 = D_801655F8 ^ 1; + D_801655B4 += 1; + D_801655F8 ^= 1; } if (D_80165594 == 0) { - D_801655BC = D_801655BC + 1; - D_80165608 = D_80165608 ^ 1; + D_801655BC += 1; + D_80165608 ^= 1; } if (D_80165598 == 0) { - D_801655C4 = D_801655C4 + 1; - D_80165618 = D_80165618 ^ 1; + D_801655C4 += 1; + D_80165618 ^= 1; } if (D_8016559C == 0) { - D_801655CC = D_801655CC + 1; - D_80165628 = D_80165628 ^ 1; + D_801655CC += 1; + D_80165628 ^= 1; } - temp_t5_2 = D_8018D2AC - 1; - D_8018D2AC = temp_t5_2; - if (temp_t5_2 < 0) { + temp_t5 = D_8018D2AC - 1; + D_8018D2AC = temp_t5; + if (temp_t5 < 0) { D_8018D2AC = 0; } - D_801658A8 = D_801658A8 + 1; + D_801658A8 += 1; if (D_801658A8 >= 7) { D_801658A8 = 0; } func_8005C674(D_801658A8, &sp26, &sp24, &sp22); - D_801656C0 = sp26 / 2; - D_801656D0 = sp24 / 2; - D_801656E0 = sp22 / 2; + D_801656C0 = (s16) (sp26 / 2); + D_801656D0 = (s16) (sp24 / 2); + D_801656E0 = (s16) (sp22 / 2); func_8005C980(); } #else @@ -2584,14 +2512,18 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8005C728.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 -extern s16 gGPCurrentRacePlayerIdByRank; -extern s32 gPlayerPositions; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +struct _struct_D_800E55D0_0x3 { + /* 0x0 */ u8 unk0; /* inferred */ + /* 0x1 */ u8 unk1; /* inferred */ + /* 0x2 */ u8 unk2; /* inferred */ +}; /* size = 0x3 */ + extern s32 D_80165590; extern s16 D_80165794; extern ? D_8018CF28; extern ? D_8018CF50; -extern s16 D_8018CF60; +extern ? D_8018CF60; extern ? D_8018CF98; extern s32 D_8018D314; extern s32 D_8018D3E4; @@ -2599,84 +2531,95 @@ extern s32 D_8018D3E8; extern s32 D_8018D3EC; extern s32 D_8018D3F4; extern s32 D_8018D3F8; -static ? D_800E55D0; /* unable to generate initializer; const */ +extern ? gGPCurrentRaceRanks; +static struct _struct_D_800E55D0_0x3 D_800E55D0[0xD] = { + { 0x64, 0x64, 0x64 }, + { 0x96, 0x96, 0x73 }, + { 0xC8, 0xC8, 0x82 }, + { 0xFF, 0xFF, 0x96 }, + { 0xC8, 0xC8, 0x82 }, + { 0x96, 0x96, 0x73 }, + { 0, 0, 0 }, + { 1, 2, 3 }, + { 2, 1, 0 }, + { 4, 5, 6 }, + { 5, 4, 0 }, + { 7, 8, 9 }, + { 8, 7, 0 }, +}; void func_8005C980(void) { - ? *temp_t0; + ? *var_t0; Player *temp_a3; + s16 *var_a0_2; s16 temp_a2; s16 temp_a2_2; s16 temp_a2_3; - s16 temp_v0_2; + s16 temp_v0; + s32 *var_a0; s32 temp_a1; s32 temp_t4; s32 temp_t6; - s32 temp_v0; - s32 temp_v0_3; + s32 temp_v0_2; s32 temp_v1; - void *temp_v1_2; - s32 *phi_a0; - s32 phi_v0; - ? *phi_a0_2; - ? *phi_t0; - s32 phi_v1; + s32 var_v0; + s32 var_v1; + struct _struct_D_800E55D0_0x3 *temp_v1_2; temp_a3 = gPlayerOne; temp_a1 = D_80165590; - phi_a0 = &gPlayerPositions; - phi_v0 = 0; + var_a0 = gPlayerPositions; + var_v0 = 0; do { - temp_v1 = *phi_a0; + temp_v1 = *var_a0; if (temp_a1 == 0) { - *(&D_8018CF98 + (phi_v0 * 2)) = temp_v1; + *(&D_8018CF98 + (var_v0 * 2)) = (s16) temp_v1; } *(&D_8018CF28 + (temp_v1 * 4)) = &temp_a3[sp0]; if (sp0 == 0) { - D_80165794 = temp_v1; - } - temp_v0 = phi_v0 + 1; - phi_a0 += 4; - phi_v0 = temp_v0; - } while (temp_v0 < 8); - phi_a0_2 = &gGPCurrentRacePlayerIdByRank; - phi_t0 = &D_8018CF50; - phi_v1 = 0; + D_80165794 = (s16) temp_v1; + } + var_v0 += 1; + var_a0 += 4; + } while (var_v0 < 8); + var_t0 = &D_8018CF50; + var_a0_2 = gGPCurrentRacePlayerIdByRank; + var_v1 = 0; do { - temp_v0_2 = phi_a0_2->unk0; - phi_t0->unk0 = temp_v0_2; + temp_v0 = var_a0_2->unk0; + var_t0->unk0 = temp_v0; if (temp_a1 == 0) { - *(gGPCurrentRaceRanks + phi_v1) = temp_a3[temp_v0_2].characterId; + *(&gGPCurrentRaceRanks + var_v1) = temp_a3[temp_v0].characterId; } - temp_a2 = phi_a0_2->unk2; - phi_t0->unk2 = temp_a2; + temp_a2 = var_a0_2->unk2; + var_t0->unk2 = temp_a2; if (temp_a1 == 0) { - (gGPCurrentRaceRanks + phi_v1)->unk2 = temp_a3[temp_a2].characterId; + (&gGPCurrentRaceRanks + var_v1)->unk2 = (u16) temp_a3[temp_a2].characterId; } - temp_a2_2 = phi_a0_2->unk4; - phi_t0->unk4 = temp_a2_2; + temp_a2_2 = var_a0_2->unk4; + var_t0->unk4 = temp_a2_2; if (temp_a1 == 0) { - (gGPCurrentRaceRanks + phi_v1)->unk4 = temp_a3[temp_a2_2].characterId; + (&gGPCurrentRaceRanks + var_v1)->unk4 = (u16) temp_a3[temp_a2_2].characterId; } - temp_a2_3 = phi_a0_2->unk6; - phi_t0->unk6 = temp_a2_3; - phi_a0_2 += 8; + temp_a2_3 = var_a0_2->unk6; + var_a0_2 += 8; + var_t0->unk6 = temp_a2_3; if (temp_a1 == 0) { - (gGPCurrentRaceRanks + phi_v1)->unk6 = temp_a3[temp_a2_3].characterId; + (&gGPCurrentRaceRanks + var_v1)->unk6 = (u16) temp_a3[temp_a2_3].characterId; } - temp_t0 = phi_t0 + 8; - phi_t0 = temp_t0; - phi_v1 += 8; - } while (temp_t0 != &D_8018CF60); + var_t0 += 8; + var_v1 += 8; + } while (var_t0 != &D_8018CF60); temp_t4 = D_8018D314 - 1; D_8018D314 = temp_t4; if (temp_t4 <= 0) { - temp_v0_3 = D_8018D3F8; - temp_v1_2 = (temp_v0_3 * 3) + &D_800E55D0; + temp_v0_2 = D_8018D3F8; + temp_v1_2 = &D_800E55D0[temp_v0_2]; D_8018D314 = D_8018D3F4; - D_8018D3E4 = temp_v1_2->unk0; - temp_t6 = temp_v0_3 + 1; - D_8018D3E8 = temp_v1_2->unk1; - D_8018D3EC = temp_v1_2->unk2; + D_8018D3E4 = (s32) temp_v1_2->unk0; + temp_t6 = temp_v0_2 + 1; + D_8018D3E8 = (s32) temp_v1_2->unk1; + D_8018D3EC = (s32) temp_v1_2->unk2; D_8018D3F8 = temp_t6; if (temp_t6 == 6) { D_8018D3F8 = 0; @@ -2688,25 +2631,18 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8005C980.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 792017ad9d422c2467bd42686f383a5c41f41c75 -s32 s16_step_towards(s16 *, ?, ?, s32); /* extern */ -s32 f32_step_towards(f32 *, ?, ?, s32); /* extern */ -void func_80079054(s32); /* extern */ -void func_80079084(s32); /* extern */ -void func_800790B4(s32); /* extern */ -void func_800C9060(s32, ?); /* extern */ -void func_800C90F4(?, s32, s8, s32); /* extern */ +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b extern s32 D_80165594; extern u32 D_80165638; extern u32 D_80165648; extern ? D_80165654; -extern s32 D_80165658; +extern ? D_80165658; extern s8 D_801657E3; extern s8 D_801657E4; extern s8 D_801657E5; extern s8 D_801657E6; extern s8 D_801657F0; -extern s8 D_80165800; +extern ? D_80165800; extern s32 D_8016587C; extern s8 D_80165898; extern s32 D_8018D114; @@ -2715,13 +2651,10 @@ extern s32 D_8018D1FC; extern s32 D_8018D204; extern s32 D_8018D20C; extern s32 D_8018D320; -extern s8 D_8018EDF3; -extern s32 gScreenModeSelection; s16 gCurrentCourseId; /* unable to generate initializer */ void func_8005CB60(s32 playerId, s32 arg1) { s8 *sp20; - s32 temp_a3; s32 temp_f18; s32 temp_v0_3; s32 temp_v0_5; @@ -2731,25 +2664,15 @@ void func_8005CB60(s32 playerId, s32 arg1) { s8 temp_a0; s8 temp_v0_4; struct_8018CA70_entry *temp_s0; - u16 temp_a1; u32 temp_a0_2; u32 temp_v0_2; void *temp_v0; - s8 *phi_v1; - s8 phi_a2; - s32 phi_t1; - s32 phi_a3; temp_s0 = &D_8018CA70[playerId]; - temp_a3 = playerId; - phi_a3 = temp_a3; - phi_a3 = temp_a3; - if ((s32) temp_s0->lapCount < D_8018D320) { + if (temp_s0->lapCount < D_8018D320) { temp_v1 = &temp_s0->alsoLapCount; temp_s0->someTimer = (u32) (s32) (gCourseTimer * 100.0f); - phi_v1 = temp_v1; - phi_t1 = 3; - if ((s32) *temp_v1 < arg1) { + if (*temp_v1 < arg1) { temp_f18 = (s32) (gTimePlayerLastTouchedFinishLine[playerId] * 100.0f); temp_s0->timeLastTouchedFinishLine = (u32) temp_f18; (temp_s0 + (*temp_v1 * 4))->unk14 = temp_f18; @@ -2757,16 +2680,15 @@ void func_8005CB60(s32 playerId, s32 arg1) { if (temp_a0 == 0) { (temp_s0 + (temp_a0 * 4))->unk20 = (u32) temp_s0->timeLastTouchedFinishLine; } else { - temp_v0 = &D_8018CA70[temp_a3] + (temp_a0 * 4); + temp_v0 = &D_8018CA70[playerId] + (temp_a0 * 4); temp_v0->unk20 = (s32) (temp_v0->unk14 - temp_v0->unk10); } - temp_s0->blinkTimer = 0x3C; + temp_s0->blinkTimer = 0x003C; temp_s0->someTimer1 = (temp_s0 + (*temp_v1 * 4))->unk20; if (arg1 == 3) { temp_s0->someTimer = (temp_s0 + (*temp_v1 * 4))->unk14; } - phi_a2 = 1; - if (gModeSelection == TIME_TRIALS) { + if (gModeSelection == (s32) 1) { temp_v0_2 = D_80165638; temp_a0_2 = temp_s0->someTimer1; if (temp_v0_2 >= temp_a0_2) { @@ -2774,110 +2696,101 @@ void func_8005CB60(s32 playerId, s32 arg1) { D_80165658.unk4 = 0; D_80165658.unk0 = 0; } - temp_a1 = gPlayerOne[playerId].characterId; - playerId = temp_a3; sp20 = temp_v1; - func_800C90F4(0, (temp_a1 * 0x10) + 0x2900800D, 1, temp_a3); + func_800C90F4(0U, (gPlayerOne[playerId].characterId * 0x10) + 0x2900800D); D_80165638 = temp_s0->someTimer1; *(&D_80165654 + (arg1 * 4)) = 1; D_801657E3 = 1; - phi_a3 = playerId; } - phi_v1 = &temp_s0->alsoLapCount; - phi_a2 = 1; - phi_t1 = 3; if ((arg1 == 3) && ((u32) temp_s0->someTimer < (u32) D_80165648)) { D_801657E5 = 1; } } - *phi_v1 += 1; + *temp_v1 += 1; temp_v0_3 = D_8018D320; - if (temp_v0_3 == *phi_v1) { - *phi_v1 = temp_v0_3 - 1; + if (temp_v0_3 == *temp_v1) { + *temp_v1 = temp_v0_3 - 1; } temp_v1_2 = &temp_s0->lapCount; *temp_v1_2 += 1; temp_v0_4 = *temp_v1_2; - if (temp_v0_4 != 0) { - if (temp_v0_4 != phi_a2) { - if (temp_v0_4 != 2) { - if (temp_v0_4 != phi_t1) { - - } else { - temp_v0_5 = D_8018D114; - if ((temp_v0_5 == 0) || (phi_a2 == temp_v0_5)) { - D_801657E4 = 0; - D_801657E6 = 0; - D_801657F0 = 0; - D_801657E8 = phi_a2; - D_80165800.unk0 = phi_a2; - D_80165800.unk1 = phi_a2; - D_8018D204 = (s32) phi_a2; - } - temp_s0->raceCompleteBool = phi_a2; - if (temp_v0_5 == 2) { - *(&D_80165800 + phi_a3) = 0; - } - if (gCurrentCourseId == 4) { - temp_s0->unk81 = 1; - } - temp_s0->lap1CompletionTimeX = 0x140; - temp_s0->lap2CompletionTimeX = 0x1E0; - temp_s0->lap3CompletionTimeX = 0x280; - temp_s0->totalTimeX = 0x320; - D_8016587C = (s32) phi_a2; - if (D_8018D20C == 0) { - func_80079054(phi_a3); - D_8018D20C = 1; - if (D_8018EDF3 == 1) { - D_8018D1CC = 0x64; - } - } - } - } else { - func_800790B4(phi_a3); - } - } else { - playerId = phi_a3; - func_80079084(phi_a3); - func_800C9060(playerId & 0xFF, 0x1900F015); - if ((gCurrentCourseId == 8) && (D_80165898 == 0) && (gModeSelection != TIME_TRIALS)) { - D_80165898 = 1; + switch (temp_v0_4) { /* switch 1; irregular */ + case 0: /* switch 1 */ + break; + case 1: /* switch 1 */ + func_80079084(playerId); + func_800C9060(playerId & 0xFF, 0x1900F015U); + if ((gCurrentCourseId == 8) && (D_80165898 == 0) && (gModeSelection != (s32) 1)) { + D_80165898 = 1; + } + break; + case 2: /* switch 1 */ + func_800790B4(playerId); + break; + case 3: /* switch 1 */ + temp_v0_5 = D_8018D114; + if ((temp_v0_5 == 0) || (temp_v0_5 == (s32) 1)) { + D_801657E4 = 0; + D_801657E6 = 0; + D_801657F0 = 0; + D_801657E8 = 1; + D_80165800.unk0 = 1; + D_80165800.unk1 = 1; + D_8018D204 = (s32) 1; + } + temp_s0->raceCompleteBool = 1; + if (temp_v0_5 == 2) { + *(&D_80165800 + playerId) = 0; + } + if (gCurrentCourseId == 4) { + temp_s0->unk_81 = 1; + } + temp_s0->lap1CompletionTimeX = 0x0140; + temp_s0->lap2CompletionTimeX = 0x01E0; + temp_s0->lap3CompletionTimeX = 0x0280; + temp_s0->totalTimeX = 0x0320; + D_8016587C = (s32) 1; + if (D_8018D20C == 0) { + func_80079054(playerId); + D_8018D20C = 1; + if (D_8018EDF3 == (s8) 1) { + D_8018D1CC = 0x00000064; } } + break; } } } else { - playerId = temp_a3; - f32_step_towards(&temp_s0->rankScaling, 0x3F800000, 0x3E000000, temp_a3); - switch (gScreenModeSelection) { /* irregular */ - case SCREEN_MODE_1P: - s16_step_towards(&temp_s0->slideRankX, 0x1C, 7, playerId); + f32_step_towards(&temp_s0->rankScaling, 1.0f, 0.125f); + temp_v0_6 = gScreenModeSelection; + switch (temp_v0_6) { /* irregular */ + case 0: + s16_step_towards(&temp_s0->slideRankX, 0x001C, 7); if (D_8018D1FC != 0) { - s16_step_towards(&temp_s0->slideRankY, -0x28, 1); + s16_step_towards(&temp_s0->slideRankY, -0x0028, 1); } else { - s16_step_towards(&temp_s0->slideRankY, -0x10, 4); + s16_step_towards(&temp_s0->slideRankY, -0x0010, 4); } break; - case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: - s16_step_towards(&temp_s0->slideRankX, 0x1C, 7, playerId); - s16_step_towards(&temp_s0->slideRankY, -0x10, 4); + case 2: + s16_step_towards(&temp_s0->slideRankX, 0x001C, 7); + s16_step_towards(&temp_s0->slideRankY, -0x0010, 4); break; - case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: - s16_step_towards(&temp_s0->slideRankX, 0x1C, 7, playerId); - s16_step_towards(&temp_s0->slideRankY, -0x10, 4); - s16_step_towards(&temp_s0->lap1CompletionTimeX, 0xE4, 0x10); - s16_step_towards(&temp_s0->lap2CompletionTimeX, 0xE4, 0x10); - s16_step_towards(&temp_s0->lap3CompletionTimeX, 0xE4, 0x10); - s16_step_towards(&temp_s0->totalTimeX, 0xE4, 0x10); + case 1: + s16_step_towards(&temp_s0->slideRankX, 0x001C, 7); + s16_step_towards(&temp_s0->slideRankY, -0x0010, 4); + s16_step_towards(&temp_s0->lap1CompletionTimeX, 0x00E4, 0x0010); + s16_step_towards(&temp_s0->lap2CompletionTimeX, 0x00E4, 0x0010); + s16_step_towards(&temp_s0->lap3CompletionTimeX, 0x00E4, 0x0010); + s16_step_towards(&temp_s0->totalTimeX, 0x00E4, 0x0010); break; - case SCREEN_MODE_3P_4P_SPLITSCREEN: + case 3: if ((playerId & 1) == 1) { - s16_step_towards(&temp_s0->slideRankX, -8, 2, playerId); + s16_step_towards(&temp_s0->slideRankX, -8, 2); } else { - s16_step_towards(&temp_s0->slideRankX, 8, 2, playerId); + s16_step_towards(&temp_s0->slideRankX, 8, 2); } - s16_step_towards(&temp_s0->slideRankY, -0x10, 4); + s16_step_towards(&temp_s0->slideRankY, -0x0010, 4); break; } } @@ -2890,7 +2803,7 @@ void func_8005CB60(s32 playerId, s32 arg1) { temp_s0->blinkState += 1; temp_s0->blinkState &= 1; } - temp_s0->blinkTimer += -1; + temp_s0->blinkTimer -= 1; if (temp_s0->blinkTimer == 0) { temp_s0->blinkState = 0; } @@ -2932,34 +2845,31 @@ void func_8005D18C(void) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 792017ad9d422c2467bd42686f383a5c41f41c75 +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b extern ? D_80163DE8; extern ? D_80164034; -extern u16 gNearestWaypointByPlayerId; void func_8005D1F4(s32 playerId) { - ? *temp_a2; + ? *var_a2; s32 temp_a1; struct_8018CA70_entry *temp_v1; u16 temp_a0; - ? *phi_a2; - if (gModeSelection == VERSUS) { + if (gModeSelection == 2) { temp_v1 = &D_8018CA70[playerId]; temp_v1->unk_74 = 0; - phi_a2 = &D_80163DE8; + var_a2 = &D_80163DE8; loop_2: - temp_a0 = phi_a2->unk44; + temp_a0 = var_a2->unk44; if ((temp_a0 != 4) && (temp_a0 != 0)) { - temp_a1 = phi_a2->unk42 - *(&gNearestWaypointByPlayerId + (playerId * 2)); + temp_a1 = var_a2->unk42 - gNearestWaypointByPlayerId[playerId]; if ((temp_a1 >= -5) && (temp_a1 < 0x1F)) { temp_v1->unk_74 = 1; return; } } - temp_a2 = phi_a2 + 0x54; - phi_a2 = temp_a2; - if (temp_a2 == &D_80164034) { + var_a2 += 0x54; + if (var_a2 == &D_80164034) { } else { goto loop_2; @@ -3158,7 +3068,7 @@ void func_8005D82C(UnkPlayerStruct258* arg0, s32 arg1, s16 arg2) { arg0->unk_03E = arg2; } -void func_8005D898(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { +void func_8005D898(Player* player, s16 arg1, UNUSED s32 arg2, UNUSED s8 arg3, UNUSED s8 arg4) { s32 temp_lo; if (player->unk_0C0 >= 0) { @@ -3193,24 +3103,13 @@ void func_8005D898(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { } } -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8005D898(s16, s8, s32); // extern - -void func_8005DA30(s32 arg0, s16 arg1, s32 arg2, s8 arg3, s8 arg4) { - void *temp_v0; - - if ((arg1 == 0) && ((temp_v0 = arg0 + (arg2 * 0x48), ((temp_v0->unk546 < 3) == 0)) || (temp_v0->unk544 == 0))) { - func_8005D898(arg1, arg3, arg4); - return; - } - if ((arg0 + (arg2 * 0x48))->unk546 >= 3) { - func_8005D898(arg1, arg3, arg4); +void func_8005DA30(Player *player, s16 arg1, s32 arg2, s8 arg3, s8 arg4) { + if ((arg1 == 0) && ((player->unk_258[10 + arg2].unk_01E >= 3) || (player->unk_258[10 + arg2].unk_01C == 0))) { + func_8005D898(player, arg1, arg2, arg3, arg4); + } else if (player->unk_258[10 + arg2].unk_01E >= 3) { + func_8005D898(player, arg1, arg2, arg3, arg4); } } -#else -GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8005DA30.s") -#endif UNUSED void func_8005DAD0(void) { @@ -3223,14 +3122,8 @@ void func_8005DAD8(UnkPlayerStruct258* arg0, s16 arg1, s16 arg2, s16 arg3) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 792017ad9d422c2467bd42686f383a5c41f41c75 -void func_8005D794(f32, f32, Player *, void *, f32, f32, f32, s32, s32); /* extern */ -void func_8005D7D8(void *, ?, ?); /* extern */ -void func_8005D800(void *, ?, ?); /* extern */ -void func_8005D82C(void *, ?, ?); /* extern */ -void func_8005DAD8(void *, ?, ?, ?); /* extern */ -s16 random_int(u16); /* extern */ -static u16 D_800E483E; /* unable to generate initializer; const */ +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +static u16 D_800E483E; /* unable to generate initializer */ s16 gCurrentCourseId; /* unable to generate initializer */ void func_8005DAF4(Player *player, s32 arg1, s8 arg2, s32 arg3) { @@ -3239,48 +3132,40 @@ void func_8005DAF4(Player *player, s32 arg1, s8 arg2, s32 arg3) { f32 sp40; f32 sp3C; f32 sp38; + UnkPlayerStruct258 *temp_s0; + UnkPlayerStruct258 *temp_s0_10; + UnkPlayerStruct258 *temp_s0_11; + UnkPlayerStruct258 *temp_s0_12; + UnkPlayerStruct258 *temp_s0_13; + UnkPlayerStruct258 *temp_s0_14; + UnkPlayerStruct258 *temp_s0_15; + UnkPlayerStruct258 *temp_s0_16; + UnkPlayerStruct258 *temp_s0_2; + UnkPlayerStruct258 *temp_s0_3; + UnkPlayerStruct258 *temp_s0_4; + UnkPlayerStruct258 *temp_s0_5; + UnkPlayerStruct258 *temp_s0_6; + UnkPlayerStruct258 *temp_s0_7; + UnkPlayerStruct258 *temp_s0_8; + UnkPlayerStruct258 *temp_s0_9; f32 temp_f0; f32 temp_f0_2; - s16 temp_v0; + f32 var_f12; + f32 var_f14; + f32 var_f2; s16 temp_v1; s16 temp_v1_2; s32 temp_lo; s32 temp_lo_2; s32 temp_v1_3; s32 temp_v1_4; - void *temp_s0; - void *temp_s0_10; - void *temp_s0_11; - void *temp_s0_12; - void *temp_s0_13; - void *temp_s0_14; - void *temp_s0_15; - void *temp_s0_16; - void *temp_s0_2; - void *temp_s0_3; - void *temp_s0_4; - void *temp_s0_5; - void *temp_s0_6; - void *temp_s0_7; - void *temp_s0_8; - void *temp_s0_9; + s32 var_t1; + s32 var_t3; + u16 temp_v0; + u16 var_v0; void *temp_s2; - void *temp_s2_10; - void *temp_s2_11; - void *temp_s2_12; - void *temp_s2_13; - void *temp_s2_14; - void *temp_s2_15; - void *temp_s2_16; - void *temp_s2_17; void *temp_s2_2; void *temp_s2_3; - void *temp_s2_4; - void *temp_s2_5; - void *temp_s2_6; - void *temp_s2_7; - void *temp_s2_8; - void *temp_s2_9; void *temp_v0_2; void *temp_v0_3; void *temp_v0_4; @@ -3289,298 +3174,244 @@ void func_8005DAF4(Player *player, s32 arg1, s8 arg2, s32 arg3) { void *temp_v0_7; void *temp_v0_8; void *temp_v0_9; - s32 phi_t1; - f32 phi_f12; - f32 phi_f14; - f32 phi_f2; - s32 phi_t3; - s16 phi_v1; - s16 phi_v1_2; - s16 phi_v1_3; - s16 phi_v1_4; - s16 phi_v1_5; - s16 phi_v1_6; - s16 phi_v1_7; - s16 phi_v1_8; - s16 phi_v1_9; - s16 phi_v1_10; - s16 phi_t0; - s16 phi_v0; - void *phi_s2; - - sp48 = 0xFF; + void *var_s2; + + sp48 = 0x000000FF; temp_v0 = random_int(D_800E483E); - phi_t0 = (s16) arg1; - phi_t1 = 0xFF; + var_t1 = 0x000000FF; if ((temp_v0 == 0) || (temp_v0 == 4)) { + var_t1 = (s32) player->boundingBoxCorners[2].surfaceType; sp44 = 1; sp3C = player->boundingBoxCorners[2].cornerGroundY + 2.0f; sp40 = player->boundingBoxCorners[2].cornerPos[0]; sp38 = player->boundingBoxCorners[2].cornerPos[2]; - phi_t1 = (s32) player->boundingBoxCorners[2].surfaceType; } - phi_f12 = sp3C; - phi_f14 = sp38; - phi_f2 = sp40; - phi_t3 = sp44; + var_t3 = sp44; + var_f2 = sp40; + var_f12 = sp3C; + var_f14 = sp38; if ((temp_v0 == 2) || (temp_v0 == 6)) { - phi_t1 = (s32) player->boundingBoxCorners[3].surfaceType; - phi_f12 = player->boundingBoxCorners[3].cornerGroundY + 2.0f; - phi_f14 = player->boundingBoxCorners[3].cornerPos[2]; - phi_f2 = player->boundingBoxCorners[3].cornerPos[0]; - phi_t3 = 0; + var_f2 = player->boundingBoxCorners[3].cornerPos[0]; + var_f14 = player->boundingBoxCorners[3].cornerPos[2]; + var_t3 = 0; + var_t1 = (s32) player->boundingBoxCorners[3].surfaceType; + var_f12 = player->boundingBoxCorners[3].cornerGroundY + 2.0f; } - switch (phi_t1) { + switch (var_t1) { case 2: - if (((s16) arg1 == 0) && ((temp_v0_2 = player + (arg2 * 0x48), ((s32) temp_v0_2->unk546 > 0)) || (temp_v0_2->unk544 == 0))) { + if (((s16) arg1 == 0) && ((temp_v0_2 = player + (arg2 * 0x48), (temp_v0_2->unk546 > 0)) || (temp_v0_2->unk544 == 0))) { if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) { - temp_s2 = player + ((s16) arg1 * 0x48); - temp_s0 = temp_s2 + 0x528; - func_8005D794(phi_f12, phi_f14, player, temp_s0, phi_f2, phi_f12, phi_f14, phi_t1, phi_t3); - func_8005D7D8(temp_s0, 2, 0x3EEB851F); + var_s2 = player + ((s16) arg1 * 0x48); + temp_s0 = var_s2 + 0x528; + func_8005D794(player, temp_s0, var_f2, var_f12, var_f14, (s8) var_t1, (s8) var_t3); + func_8005D7D8(temp_s0, 2, 0.46f); temp_v1 = gCurrentCourseId; - phi_v1 = temp_v1; - phi_s2 = temp_s2; if ((temp_v1 == 1) || (temp_v1 == 7)) { - func_8005DAD8(temp_s0, 1, 0, 0x80); - phi_v1 = gCurrentCourseId; + func_8005DAD8(temp_s0, 1, 0, 0x0080); } - phi_v1_2 = phi_v1; - if (phi_v1 == 0xB) { - func_8005DAD8(temp_s0, 7, 0, 0x80); - phi_v1_2 = gCurrentCourseId; + if (gCurrentCourseId == 0x000B) { + func_8005DAD8(temp_s0, 7, 0, 0x0080); } - phi_v1_3 = phi_v1_2; - if (phi_v1_2 == 9) { - func_8005DAD8(temp_s0, 8, 0, 0x80); - phi_v1_3 = gCurrentCourseId; + if (gCurrentCourseId == 9) { + func_8005DAD8(temp_s0, 8, 0, 0x0080); } - phi_v1_4 = phi_v1_3; - if (phi_v1_3 == 0xE) { - func_8005DAD8(temp_s0, 9, 0, 0x80); - phi_v1_4 = gCurrentCourseId; + if (gCurrentCourseId == 0x000E) { + func_8005DAD8(temp_s0, 9, 0, 0x0080); } - phi_v1_5 = phi_v1_4; - if (phi_v1_4 == 4) { - func_8005DAD8(temp_s0, 0xA, 0, 0x80); - phi_v1_5 = gCurrentCourseId; + if (gCurrentCourseId == 4) { + func_8005DAD8(temp_s0, 0x000A, 0, 0x0080); } - if (phi_v1_5 == 0x12) { - func_8005DAD8(temp_s0, 0xB, 0, 0x80); + if (gCurrentCourseId == 0x0012) { + func_8005DAD8(temp_s0, 0x000B, 0, 0x0080); } - phi_v0 = random_int(0x10U); + var_v0 = random_int(0x0010U); goto block_105; } - } else if (((s32) (player + (arg2 * 0x48))->unk546 > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { - temp_s2_2 = player + ((s16) arg1 * 0x48); - temp_s0_2 = temp_s2_2 + 0x528; - func_8005D794(phi_f12, phi_f14, player, temp_s0_2, phi_f2, phi_f12, phi_f14, phi_t1, phi_t3); - func_8005D7D8(temp_s0_2, 2, 0x3EEB851F); + } else if (((player + (arg2 * 0x48))->unk546 > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { + var_s2 = player + ((s16) arg1 * 0x48); + temp_s0_2 = var_s2 + 0x528; + func_8005D794(player, temp_s0_2, var_f2, var_f12, var_f14, (s8) var_t1, (s8) var_t3); + func_8005D7D8(temp_s0_2, 2, 0.46f); temp_v1_2 = gCurrentCourseId; - phi_v1_6 = temp_v1_2; - phi_s2 = temp_s2_2; if ((temp_v1_2 == 1) || (temp_v1_2 == 7)) { - func_8005DAD8(temp_s0_2, 1, 0, 0x80); - phi_v1_6 = gCurrentCourseId; + func_8005DAD8(temp_s0_2, 1, 0, 0x0080); } - phi_v1_7 = phi_v1_6; - if (phi_v1_6 == 0xB) { - func_8005DAD8(temp_s0_2, 7, 0, 0x80); - phi_v1_7 = gCurrentCourseId; + if (gCurrentCourseId == 0x000B) { + func_8005DAD8(temp_s0_2, 7, 0, 0x0080); } - phi_v1_8 = phi_v1_7; - if (phi_v1_7 == 9) { - func_8005DAD8(temp_s0_2, 8, 0, 0x80); - phi_v1_8 = gCurrentCourseId; + if (gCurrentCourseId == 9) { + func_8005DAD8(temp_s0_2, 8, 0, 0x0080); } - phi_v1_9 = phi_v1_8; - if (phi_v1_8 == 0xE) { - func_8005DAD8(temp_s0_2, 9, 0, 0x80); - phi_v1_9 = gCurrentCourseId; + if (gCurrentCourseId == 0x000E) { + func_8005DAD8(temp_s0_2, 9, 0, 0x0080); } - phi_v1_10 = phi_v1_9; - if (phi_v1_9 == 4) { - func_8005DAD8(temp_s0_2, 0xA, 0, 0x80); - phi_v1_10 = gCurrentCourseId; + if (gCurrentCourseId == 4) { + func_8005DAD8(temp_s0_2, 0x000A, 0, 0x0080); } - if (phi_v1_10 == 0x12) { - func_8005DAD8(temp_s0_2, 0xB, 0, 0x80); + if (gCurrentCourseId == 0x0012) { + func_8005DAD8(temp_s0_2, 0x000B, 0, 0x0080); } - phi_v0 = random_int(0x10U); + var_v0 = random_int(0x0010U); block_105: - phi_s2->unk562 = phi_v0; + var_s2->unk562 = var_v0; } default: return; case 8: - if (((s16) arg1 == 0) && ((temp_v0_3 = player + (arg2 * 0x48), ((s32) temp_v0_3->unk546 > 0)) || (temp_v0_3->unk544 == 0))) { + if (((s16) arg1 == 0) && ((temp_v0_3 = player + (arg2 * 0x48), (temp_v0_3->unk546 > 0)) || (temp_v0_3->unk544 == 0))) { if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) { - temp_s2_3 = player + ((s16) arg1 * 0x48); - temp_s0_3 = temp_s2_3 + 0x528; - func_8005D794(phi_f12, phi_f14, player, temp_s0_3, phi_f2, phi_f12, phi_f14, phi_t1, phi_t3); - func_8005D7D8(temp_s0_3, 3, 0x3F800000); - func_8005D800(temp_s0_3, 0xFFFFFF, 0xFF); + temp_s2 = player + ((s16) arg1 * 0x48); + temp_s0_3 = temp_s2 + 0x528; + func_8005D794(player, temp_s0_3, var_f2, var_f12, var_f14, (s8) var_t1, (s8) var_t3); + func_8005D7D8(temp_s0_3, 3, 1.0f); + func_8005D800(temp_s0_3, 0x00FFFFFF, 0x00FF); temp_v1_3 = (s16) arg1 * 8; - temp_s2_3->unk560 = (s16) (temp_s2_3->unk560 - temp_v1_3); - temp_s2_3->unk562 = (s16) (temp_s2_3->unk562 - temp_v1_3); - temp_s2_3->unk564 = (s16) (temp_s2_3->unk564 - temp_v1_3); - phi_t0 = (s16) arg1; - } - } else if (((s32) (player + (arg2 * 0x48))->unk546 > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { - temp_s2_4 = player + ((s16) arg1 * 0x48); - temp_s0_4 = temp_s2_4 + 0x528; - func_8005D794(phi_f12, phi_f14, player, temp_s0_4, phi_f2, phi_f12, phi_f14, phi_t1, phi_t3); - func_8005D7D8(temp_s0_4, 3, 0x3F800000); - func_8005D800(temp_s0_4, 0xFFFFFF, 0xFF); + temp_s2->unk560 = (s16) (temp_s2->unk560 - temp_v1_3); + temp_s2->unk562 = (s16) (temp_s2->unk562 - temp_v1_3); + temp_s2->unk564 = (s16) (temp_s2->unk564 - temp_v1_3); + } + } else if (((player + (arg2 * 0x48))->unk546 > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { + temp_s2_2 = player + ((s16) arg1 * 0x48); + temp_s0_4 = temp_s2_2 + 0x528; + func_8005D794(player, temp_s0_4, var_f2, var_f12, var_f14, (s8) var_t1, (s8) var_t3); + func_8005D7D8(temp_s0_4, 3, 1.0f); + func_8005D800(temp_s0_4, 0x00FFFFFF, 0x00FF); temp_v1_4 = (s16) arg1 * 8; - temp_s2_4->unk560 = (s16) (temp_s2_4->unk560 - temp_v1_4); - temp_s2_4->unk562 = (s16) (temp_s2_4->unk562 - temp_v1_4); - temp_s2_4->unk564 = (s16) (temp_s2_4->unk564 - temp_v1_4); - phi_t0 = (s16) arg1; + temp_s2_2->unk560 = (s16) (temp_s2_2->unk560 - temp_v1_4); + temp_s2_2->unk562 = (s16) (temp_s2_2->unk562 - temp_v1_4); + temp_s2_2->unk564 = (s16) (temp_s2_2->unk564 - temp_v1_4); } - temp_s2_5 = player + (phi_t0 * 0x48); - temp_s2_5->unk52C = (f32) ((f64) temp_s2_5->unk52C - 1.5); + temp_s2_3 = player + ((s16) arg1 * 0x48); + temp_s2_3->unk52C = (f32) ((f64) temp_s2_3->unk52C - 1.5); return; case 7: - if (((s16) arg1 == 0) && ((temp_v0_4 = player + (arg2 * 0x48), ((s32) temp_v0_4->unk546 > 0)) || (temp_v0_4->unk544 == 0))) { + if (((s16) arg1 == 0) && ((temp_v0_4 = player + (arg2 * 0x48), (temp_v0_4->unk546 > 0)) || (temp_v0_4->unk544 == 0))) { if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) { - temp_s2_6 = player + ((s16) arg1 * 0x48); - temp_s0_5 = temp_s2_6 + 0x528; - func_8005D794(phi_f12, phi_f14, player, temp_s0_5, phi_f2, phi_f12, phi_f14, phi_t1, phi_t3); - func_8005D7D8(temp_s0_5, 2, 0x3EEB851F); - func_8005DAD8(temp_s0_5, 2, 1, 0xA8); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_6; + var_s2 = player + ((s16) arg1 * 0x48); + temp_s0_5 = var_s2 + 0x528; + func_8005D794(player, temp_s0_5, var_f2, var_f12, var_f14, (s8) var_t1, (s8) var_t3); + func_8005D7D8(temp_s0_5, 2, 0.46f); + func_8005DAD8(temp_s0_5, 2, 1, 0x00A8); + var_v0 = random_int(0x0010U); goto block_105; } - } else if (((s32) (player + (arg2 * 0x48))->unk546 > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { - temp_s2_7 = player + ((s16) arg1 * 0x48); - temp_s0_6 = temp_s2_7 + 0x528; - func_8005D794(phi_f12, phi_f14, player, temp_s0_6, phi_f2, phi_f12, phi_f14, phi_t1, phi_t3); - func_8005D7D8(temp_s0_6, 2, 0x3EEB851F); - func_8005DAD8(temp_s0_6, 2, 1, 0xA8); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_7; + } else if (((player + (arg2 * 0x48))->unk546 > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { + var_s2 = player + ((s16) arg1 * 0x48); + temp_s0_6 = var_s2 + 0x528; + func_8005D794(player, temp_s0_6, var_f2, var_f12, var_f14, (s8) var_t1, (s8) var_t3); + func_8005D7D8(temp_s0_6, 2, 0.46f); + func_8005DAD8(temp_s0_6, 2, 1, 0x00A8); + var_v0 = random_int(0x0010U); goto block_105; } break; case 3: - if (((s16) arg1 == 0) && ((temp_v0_5 = player + (arg2 * 0x48), ((s32) temp_v0_5->unk546 > 0)) || (temp_v0_5->unk544 == 0))) { + if (((s16) arg1 == 0) && ((temp_v0_5 = player + (arg2 * 0x48), (temp_v0_5->unk546 > 0)) || (temp_v0_5->unk544 == 0))) { if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) { - temp_s2_8 = player + ((s16) arg1 * 0x48); - temp_s0_7 = temp_s2_8 + 0x528; - func_8005D794(phi_f12, phi_f14, player, temp_s0_7, phi_f2, phi_f12, phi_f14, phi_t1, phi_t3); - func_8005D7D8(temp_s0_7, 2, 0x3EEB851F); - func_8005DAD8(temp_s0_7, 3, 1, 0xA8); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_8; + var_s2 = player + ((s16) arg1 * 0x48); + temp_s0_7 = var_s2 + 0x528; + func_8005D794(player, temp_s0_7, var_f2, var_f12, var_f14, (s8) var_t1, (s8) var_t3); + func_8005D7D8(temp_s0_7, 2, 0.46f); + func_8005DAD8(temp_s0_7, 3, 1, 0x00A8); + var_v0 = random_int(0x0010U); goto block_105; } - } else if (((s32) (player + (arg2 * 0x48))->unk546 > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { - temp_s2_9 = player + ((s16) arg1 * 0x48); - temp_s0_8 = temp_s2_9 + 0x528; - func_8005D794(phi_f12, phi_f14, player, temp_s0_8, phi_f2, phi_f12, phi_f14, phi_t1, phi_t3); - func_8005D7D8(temp_s0_8, 2, 0x3EEB851F); - func_8005DAD8(temp_s0_8, 3, 1, 0xA8); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_9; + } else if (((player + (arg2 * 0x48))->unk546 > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { + var_s2 = player + ((s16) arg1 * 0x48); + temp_s0_8 = var_s2 + 0x528; + func_8005D794(player, temp_s0_8, var_f2, var_f12, var_f14, (s8) var_t1, (s8) var_t3); + func_8005D7D8(temp_s0_8, 2, 0.46f); + func_8005DAD8(temp_s0_8, 3, 1, 0x00A8); + var_v0 = random_int(0x0010U); goto block_105; } break; case 10: - if (((s16) arg1 == 0) && ((temp_v0_6 = player + (arg2 * 0x48), ((s32) temp_v0_6->unk546 > 0)) || (temp_v0_6->unk544 == 0))) { + if (((s16) arg1 == 0) && ((temp_v0_6 = player + (arg2 * 0x48), (temp_v0_6->unk546 > 0)) || (temp_v0_6->unk544 == 0))) { if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) { - temp_s2_10 = player + ((s16) arg1 * 0x48); - temp_s0_9 = temp_s2_10 + 0x528; - func_8005D794(phi_f12, phi_f14, player, temp_s0_9, phi_f2, phi_f12, phi_f14, phi_t1, phi_t3); - func_8005D7D8(temp_s0_9, 2, 0x3EEB851F); - func_8005DAD8(temp_s0_9, 4, 1, 0xA8); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_10; + var_s2 = player + ((s16) arg1 * 0x48); + temp_s0_9 = var_s2 + 0x528; + func_8005D794(player, temp_s0_9, var_f2, var_f12, var_f14, (s8) var_t1, (s8) var_t3); + func_8005D7D8(temp_s0_9, 2, 0.46f); + func_8005DAD8(temp_s0_9, 4, 1, 0x00A8); + var_v0 = random_int(0x0010U); goto block_105; } - } else if (((s32) (player + (arg2 * 0x48))->unk546 > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { - temp_s2_11 = player + ((s16) arg1 * 0x48); - temp_s0_10 = temp_s2_11 + 0x528; - func_8005D794(phi_f12, phi_f14, player, temp_s0_10, phi_f2, phi_f12, phi_f14, phi_t1, phi_t3); - func_8005D7D8(temp_s0_10, 2, 0x3EEB851F); - func_8005DAD8(temp_s0_10, 4, 1, 0xA8); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_11; + } else if (((player + (arg2 * 0x48))->unk546 > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { + var_s2 = player + ((s16) arg1 * 0x48); + temp_s0_10 = var_s2 + 0x528; + func_8005D794(player, temp_s0_10, var_f2, var_f12, var_f14, (s8) var_t1, (s8) var_t3); + func_8005D7D8(temp_s0_10, 2, 0.46f); + func_8005DAD8(temp_s0_10, 4, 1, 0x00A8); + var_v0 = random_int(0x0010U); goto block_105; } break; case 13: - if (((s16) arg1 == 0) && ((temp_v0_7 = player + (arg2 * 0x48), ((s32) temp_v0_7->unk546 > 0)) || (temp_v0_7->unk544 == 0))) { + if (((s16) arg1 == 0) && ((temp_v0_7 = player + (arg2 * 0x48), (temp_v0_7->unk546 > 0)) || (temp_v0_7->unk544 == 0))) { if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) { - temp_s2_12 = player + ((s16) arg1 * 0x48); - temp_s0_11 = temp_s2_12 + 0x528; - func_8005D794(phi_f12, phi_f14, player, temp_s0_11, phi_f2, phi_f12, phi_f14, phi_t1, phi_t3); - func_8005D7D8(temp_s0_11, 2, 0x3EEB851F); - func_8005DAD8(temp_s0_11, 5, 1, 0xA8); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_12; + var_s2 = player + ((s16) arg1 * 0x48); + temp_s0_11 = var_s2 + 0x528; + func_8005D794(player, temp_s0_11, var_f2, var_f12, var_f14, (s8) var_t1, (s8) var_t3); + func_8005D7D8(temp_s0_11, 2, 0.46f); + func_8005DAD8(temp_s0_11, 5, 1, 0x00A8); + var_v0 = random_int(0x0010U); goto block_105; } - } else if (((s32) (player + (arg2 * 0x48))->unk546 > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { - temp_s2_13 = player + ((s16) arg1 * 0x48); - temp_s0_12 = temp_s2_13 + 0x528; - func_8005D794(phi_f12, phi_f14, player, temp_s0_12, phi_f2, phi_f12, phi_f14, phi_t1, phi_t3); - func_8005D7D8(temp_s0_12, 2, 0x3EEB851F); - func_8005D82C(temp_s0_12, 0xFFA54F, 0xAF); - func_8005DAD8(temp_s0_12, 5, 1, 0xA8); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_13; + } else if (((player + (arg2 * 0x48))->unk546 > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { + var_s2 = player + ((s16) arg1 * 0x48); + temp_s0_12 = var_s2 + 0x528; + func_8005D794(player, temp_s0_12, var_f2, var_f12, var_f14, (s8) var_t1, (s8) var_t3); + func_8005D7D8(temp_s0_12, 2, 0.46f); + func_8005D82C(temp_s0_12, 0x00FFA54F, 0x00AF); + func_8005DAD8(temp_s0_12, 5, 1, 0x00A8); + var_v0 = random_int(0x0010U); goto block_105; } break; case 5: case 11: - if (((s16) arg1 == 0) && ((temp_v0_8 = player + (arg2 * 0x48), ((s32) temp_v0_8->unk546 > 0)) || (temp_v0_8->unk544 == 0))) { + if (((s16) arg1 == 0) && ((temp_v0_8 = player + (arg2 * 0x48), (temp_v0_8->unk546 > 0)) || (temp_v0_8->unk544 == 0))) { if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) { - temp_s2_14 = player + ((s16) arg1 * 0x48); - temp_s0_13 = temp_s2_14 + 0x528; - func_8005D794(phi_f12, phi_f14, player, temp_s0_13, phi_f2, phi_f12, phi_f14, phi_t1, phi_t3); - func_8005D7D8(temp_s0_13, 2, 0x3EEB851F); - func_8005DAD8(temp_s0_13, 6, 1, 0xA8); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_14; + var_s2 = player + ((s16) arg1 * 0x48); + temp_s0_13 = var_s2 + 0x528; + func_8005D794(player, temp_s0_13, var_f2, var_f12, var_f14, (s8) var_t1, (s8) var_t3); + func_8005D7D8(temp_s0_13, 2, 0.46f); + func_8005DAD8(temp_s0_13, 6, 1, 0x00A8); + var_v0 = random_int(0x0010U); goto block_105; } - } else if (((s32) (player + (arg2 * 0x48))->unk546 > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { - temp_s2_15 = player + ((s16) arg1 * 0x48); - temp_s0_14 = temp_s2_15 + 0x528; - func_8005D794(phi_f12, phi_f14, player, temp_s0_14, phi_f2, phi_f12, phi_f14, phi_t1, phi_t3); - func_8005D7D8(temp_s0_14, 2, 0x3EEB851F); - func_8005DAD8(temp_s0_14, 6, 1, 0xA8); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_15; + } else if (((player + (arg2 * 0x48))->unk546 > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { + var_s2 = player + ((s16) arg1 * 0x48); + temp_s0_14 = var_s2 + 0x528; + func_8005D794(player, temp_s0_14, var_f2, var_f12, var_f14, (s8) var_t1, (s8) var_t3); + func_8005D7D8(temp_s0_14, 2, 0.46f); + func_8005DAD8(temp_s0_14, 6, 1, 0x00A8); + var_v0 = random_int(0x0010U); goto block_105; } break; case 1: case 4: case 6: - if (((s16) arg1 == 0) && ((temp_v0_9 = player + (arg2 * 0x48), ((s32) temp_v0_9->unk546 > 0)) || (temp_v0_9->unk544 == 0))) { + if (((s16) arg1 == 0) && ((temp_v0_9 = player + (arg2 * 0x48), (temp_v0_9->unk546 > 0)) || (temp_v0_9->unk544 == 0))) { temp_f0 = player->unk_094; - if (((((temp_f0 / 18.0f) * 216.0f) >= 30.0f) && ((temp_lo = (s32) player->unk_0C0 / 182, ((temp_lo < 0x15) == 0)) || (temp_lo < -0x14))) || ((f64) (player->unk_22C - temp_f0) >= 0.04)) { - temp_s2_16 = player + ((s16) arg1 * 0x48); - temp_s0_15 = temp_s2_16 + 0x528; - func_8005D794(phi_f12, phi_f14, player, temp_s0_15, phi_f2, phi_f12, phi_f14, phi_t1, phi_t3); - func_8005D7D8(temp_s0_15, 2, 0x3EEB851F); - func_8005DAD8(temp_s0_15, 0, 0, 0x80); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_16; + if (((((temp_f0 / 18.0f) * 216.0f) >= 30.0f) && ((temp_lo = (s16) player->unk_0C0 / 182, ((temp_lo < 0x15) == 0)) || (temp_lo < -0x14))) || ((f64) (player->unk_22C - temp_f0) >= 0.04)) { + var_s2 = player + ((s16) arg1 * 0x48); + temp_s0_15 = var_s2 + 0x528; + func_8005D794(player, temp_s0_15, var_f2, var_f12, var_f14, (s8) var_t1, (s8) var_t3); + func_8005D7D8(temp_s0_15, 2, 0.46f); + func_8005DAD8(temp_s0_15, 0, 0, 0x0080); + var_v0 = random_int(0x0010U); goto block_105; } - } else if (((s32) (player + (arg2 * 0x48))->unk546 > 0) && (((temp_f0_2 = player->unk_094, (((temp_f0_2 / 18.0f) * 216.0f) >= 30.0f)) && ((temp_lo_2 = (s32) player->unk_0C0 / 182, ((temp_lo_2 < 0x15) == 0)) || (temp_lo_2 < -0x14))) || ((f64) (player->unk_22C - temp_f0_2) >= 0.04))) { - temp_s2_17 = player + ((s16) arg1 * 0x48); - temp_s0_16 = temp_s2_17 + 0x528; - func_8005D794(phi_f12, phi_f14, player, temp_s0_16, phi_f2, phi_f12, phi_f14, phi_t1, phi_t3); - func_8005D7D8(temp_s0_16, 2, 0x3EEB851F); - func_8005DAD8(temp_s0_16, 0, 0, 0x80); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_17; + } else if (((player + (arg2 * 0x48))->unk546 > 0) && (((temp_f0_2 = player->unk_094, (((temp_f0_2 / 18.0f) * 216.0f) >= 30.0f)) && ((temp_lo_2 = (s16) player->unk_0C0 / 182, ((temp_lo_2 < 0x15) == 0)) || (temp_lo_2 < -0x14))) || ((f64) (player->unk_22C - temp_f0_2) >= 0.04))) { + var_s2 = player + ((s16) arg1 * 0x48); + temp_s0_16 = var_s2 + 0x528; + func_8005D794(player, temp_s0_16, var_f2, var_f12, var_f14, (s8) var_t1, (s8) var_t3); + func_8005D7D8(temp_s0_16, 2, 0.46f); + func_8005DAD8(temp_s0_16, 0, 0, 0x0080); + var_v0 = random_int(0x0010U); goto block_105; } break; @@ -3591,74 +3422,70 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8005DAF4.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 792017ad9d422c2467bd42686f383a5c41f41c75 -void func_8005D794(f32, f32, Player *, void *, f32, f32, f32, s32, s32); /* extern */ -void func_8005D7D8(void *, ?, ?); /* extern */ -void func_8005D800(void *, ?, ?); /* extern */ -s32 random_int(u16); /* extern */ -static u16 D_800E4842; /* unable to generate initializer; const */ +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +static u16 D_800E4842; /* unable to generate initializer */ -void func_8005EA94(Player *player, s16 arg1, s32 arg2, s8 arg3) { +void func_8005EA94(Player *player, s16 arg1, s32 arg2, s32 arg3) { s32 sp48; s32 sp44; f32 sp40; f32 sp3C; f32 sp38; - void *sp34; + UnkPlayerStruct258 *sp34; + UnkPlayerStruct258 *temp_a1; + UnkPlayerStruct258 *temp_a1_2; f32 temp_f0; f32 temp_f0_2; - s32 temp_v0; - void *temp_a1; - void *temp_a1_2; + f32 var_f12; + f32 var_f14; + f32 var_f2; + s32 var_t0; + s32 var_t1; + u16 temp_v0; void *temp_v0_2; - s32 phi_t0; - f32 phi_f12; - f32 phi_f14; - f32 phi_f2; - s32 phi_t1; - sp48 = 0xFF; + sp48 = 0x000000FF; temp_v0 = random_int(D_800E4842); - phi_t0 = 0xFF; + var_t0 = 0x000000FF; if ((temp_v0 == 0) || (temp_v0 == 8)) { temp_f0 = player->boundingBoxCorners[2].cornerGroundY; - if ((f64) (D_801652A0[arg3] - temp_f0) >= 3.5) { + if ((f64) (D_801652A0[(s8) arg3] - temp_f0) >= 3.5) { sp44 = 1; + var_t0 = 0; sp40 = player->boundingBoxCorners[2].cornerPos[0]; sp3C = temp_f0 + 2.0f; sp38 = player->boundingBoxCorners[2].cornerPos[2]; - phi_t0 = 0; } } - phi_f12 = sp3C; - phi_f14 = sp38; - phi_f2 = sp40; - phi_t1 = sp44; + var_t1 = sp44; + var_f2 = sp40; + var_f12 = sp3C; + var_f14 = sp38; if ((temp_v0 == 2) || (temp_v0 == 6)) { temp_f0_2 = player->boundingBoxCorners[3].cornerGroundY; - if ((f64) (D_801652A0[arg3] - temp_f0_2) >= 3.5) { - phi_t0 = 0; - phi_f12 = temp_f0_2 + 2.0f; - phi_f14 = player->boundingBoxCorners[3].cornerPos[2]; - phi_f2 = player->boundingBoxCorners[3].cornerPos[0]; - phi_t1 = 0; + if ((f64) (D_801652A0[(s8) arg3] - temp_f0_2) >= 3.5) { + var_f2 = player->boundingBoxCorners[3].cornerPos[0]; + var_f14 = player->boundingBoxCorners[3].cornerPos[2]; + var_t1 = 0; + var_t0 = 0; + var_f12 = temp_f0_2 + 2.0f; } } - if (phi_t0 == 0) { - if ((arg1 == 0) && ((temp_v0_2 = player + (arg2 * 0x48), ((s32) temp_v0_2->unk546 > 0)) || (temp_v0_2->unk544 == 0))) { + if (var_t0 == 0) { + if ((arg1 == 0) && ((temp_v0_2 = player + (arg2 * 0x48), (temp_v0_2->unk546 > 0)) || (temp_v0_2->unk544 == 0))) { if (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f) { temp_a1 = player + (arg1 * 0x48) + 0x528; sp34 = temp_a1; - func_8005D794(phi_f12, phi_f14, player, temp_a1, phi_f2, phi_f12, phi_f14, phi_t0, phi_t1); - func_8005D7D8(sp34, 9, 0x3F4CCCCD); - func_8005D800(sp34, 0xFFFFFF, 0xAF); + func_8005D794(player, temp_a1, var_f2, var_f12, var_f14, (s8) var_t0, (s8) var_t1); + func_8005D7D8(sp34, 9, 0.8f); + func_8005D800(sp34, 0x00FFFFFF, 0x00AF); } - } else if (((s32) (player + (arg2 * 0x48))->unk546 > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { + } else if (((player + (arg2 * 0x48))->unk546 > 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { temp_a1_2 = player + (arg1 * 0x48) + 0x528; sp34 = temp_a1_2; - func_8005D794(phi_f12, phi_f14, player, temp_a1_2, phi_f2, phi_f12, phi_f14, phi_t0, phi_t1); - func_8005D7D8(sp34, 9, 0x3F4CCCCD); - func_8005D800(sp34, 0xFFFFFF, 0xAF); + func_8005D794(player, temp_a1_2, var_f2, var_f12, var_f14, (s8) var_t0, (s8) var_t1); + func_8005D7D8(sp34, 9, 0.8f); + func_8005D800(sp34, 0x00FFFFFF, 0x00AF); } } } @@ -3667,13 +3494,8 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8005EA94.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 792017ad9d422c2467bd42686f383a5c41f41c75 -void func_8005D794(f32, Player *, void *, f32, f32, f32, s32, s32); /* extern */ -void func_8005D7D8(void *, ?, ?); /* extern */ -void func_8005D800(void *, ?, ?); /* extern */ -void func_8005DAD8(void *, ?, ?, ?); /* extern */ -s16 random_int(u16); /* extern */ -static u16 D_800E4846; /* unable to generate initializer; const */ +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +static u16 D_800E4846; /* unable to generate initializer */ s16 gCurrentCourseId; /* unable to generate initializer */ void func_8005ED48(Player *player, s16 arg1, s32 arg2, s32 arg3) { @@ -3682,44 +3504,36 @@ void func_8005ED48(Player *player, s16 arg1, s32 arg2, s32 arg3) { f32 sp40; f32 sp3C; f32 sp38; - s16 temp_v0; + UnkPlayerStruct258 *temp_s0; + UnkPlayerStruct258 *temp_s0_10; + UnkPlayerStruct258 *temp_s0_11; + UnkPlayerStruct258 *temp_s0_12; + UnkPlayerStruct258 *temp_s0_13; + UnkPlayerStruct258 *temp_s0_14; + UnkPlayerStruct258 *temp_s0_15; + UnkPlayerStruct258 *temp_s0_16; + UnkPlayerStruct258 *temp_s0_2; + UnkPlayerStruct258 *temp_s0_3; + UnkPlayerStruct258 *temp_s0_4; + UnkPlayerStruct258 *temp_s0_5; + UnkPlayerStruct258 *temp_s0_6; + UnkPlayerStruct258 *temp_s0_7; + UnkPlayerStruct258 *temp_s0_8; + UnkPlayerStruct258 *temp_s0_9; + f32 var_f0; + f32 var_f12; + f32 var_f2; s16 temp_v1; s16 temp_v1_2; s32 temp_v1_3; s32 temp_v1_4; - void *temp_s0; - void *temp_s0_10; - void *temp_s0_11; - void *temp_s0_12; - void *temp_s0_13; - void *temp_s0_14; - void *temp_s0_15; - void *temp_s0_16; - void *temp_s0_2; - void *temp_s0_3; - void *temp_s0_4; - void *temp_s0_5; - void *temp_s0_6; - void *temp_s0_7; - void *temp_s0_8; - void *temp_s0_9; + s32 var_t2; + s32 var_t3; + u16 temp_v0; + u16 var_v0; void *temp_s2; - void *temp_s2_10; - void *temp_s2_11; - void *temp_s2_12; - void *temp_s2_13; - void *temp_s2_14; - void *temp_s2_15; - void *temp_s2_16; - void *temp_s2_17; void *temp_s2_2; void *temp_s2_3; - void *temp_s2_4; - void *temp_s2_5; - void *temp_s2_6; - void *temp_s2_7; - void *temp_s2_8; - void *temp_s2_9; void *temp_v0_2; void *temp_v0_3; void *temp_v0_4; @@ -3728,283 +3542,233 @@ void func_8005ED48(Player *player, s16 arg1, s32 arg2, s32 arg3) { void *temp_v0_7; void *temp_v0_8; void *temp_v0_9; - s32 phi_t2; - f32 phi_f12; - f32 phi_f0; - f32 phi_f2; - s32 phi_t3; - s16 phi_v1; - s16 phi_v1_2; - s16 phi_v1_3; - s16 phi_v1_4; - s16 phi_v1_5; - s16 phi_v1_6; - s16 phi_v1_7; - s16 phi_v1_8; - s16 phi_v1_9; - s16 phi_v1_10; - s16 phi_v0; - void *phi_s2; - - sp48 = 0xFF; + void *var_s2; + + sp48 = 0x000000FF; temp_v0 = random_int(D_800E4846); - phi_t2 = 0xFF; + var_t2 = 0x000000FF; if ((temp_v0 == 2) || (temp_v0 == 4)) { + var_t2 = (s32) player->boundingBoxCorners[2].surfaceType; sp44 = 1; sp3C = player->boundingBoxCorners[2].cornerGroundY + 2.0f; sp40 = player->boundingBoxCorners[2].cornerPos[0]; sp38 = player->boundingBoxCorners[2].cornerPos[2]; - phi_t2 = (s32) player->boundingBoxCorners[2].surfaceType; } - phi_f12 = sp38; - phi_f0 = sp40; - phi_f2 = sp3C; - phi_t3 = sp44; + var_t3 = sp44; + var_f0 = sp40; + var_f2 = sp3C; + var_f12 = sp38; if ((temp_v0 == 0) || (temp_v0 == 6)) { - phi_t2 = (s32) player->boundingBoxCorners[3].surfaceType; - phi_f12 = player->boundingBoxCorners[3].cornerPos[2]; - phi_f0 = player->boundingBoxCorners[3].cornerPos[0]; - phi_f2 = player->boundingBoxCorners[3].cornerGroundY + 2.0f; - phi_t3 = 0; + var_f0 = player->boundingBoxCorners[3].cornerPos[0]; + var_f12 = player->boundingBoxCorners[3].cornerPos[2]; + var_t3 = 0; + var_t2 = (s32) player->boundingBoxCorners[3].surfaceType; + var_f2 = player->boundingBoxCorners[3].cornerGroundY + 2.0f; } - switch (phi_t2) { + switch (var_t2) { case 2: - if ((arg1 == 0) && ((temp_v0_2 = player + (arg2 * 0x48), ((s32) temp_v0_2->unk546 > 0)) || (temp_v0_2->unk544 == 0))) { - temp_s2 = player + (arg1 * 0x48); - temp_s0 = temp_s2 + 0x528; - func_8005D794(phi_f12, player, temp_s0, phi_f0, phi_f2, phi_f12, phi_t2, phi_t3); - func_8005D7D8(temp_s0, 5, 0x3EEB851F); + if ((arg1 == 0) && ((temp_v0_2 = player + (arg2 * 0x48), (temp_v0_2->unk546 > 0)) || (temp_v0_2->unk544 == 0))) { + var_s2 = player + (arg1 * 0x48); + temp_s0 = var_s2 + 0x528; + func_8005D794(player, temp_s0, var_f0, var_f2, var_f12, (s8) var_t2, (s8) var_t3); + func_8005D7D8(temp_s0, 5, 0.46f); temp_v1 = gCurrentCourseId; - phi_v1 = temp_v1; - phi_s2 = temp_s2; if ((temp_v1 == 1) || (temp_v1 == 7)) { - func_8005DAD8(temp_s0, 1, 0, 0x80); - phi_v1 = gCurrentCourseId; + func_8005DAD8(temp_s0, 1, 0, 0x0080); } - phi_v1_2 = phi_v1; - if (phi_v1 == 0xB) { - func_8005DAD8(temp_s0, 7, 0, 0x80); - phi_v1_2 = gCurrentCourseId; + if (gCurrentCourseId == 0x000B) { + func_8005DAD8(temp_s0, 7, 0, 0x0080); } - phi_v1_3 = phi_v1_2; - if (phi_v1_2 == 9) { - func_8005DAD8(temp_s0, 8, 0, 0x80); - phi_v1_3 = gCurrentCourseId; + if (gCurrentCourseId == 9) { + func_8005DAD8(temp_s0, 8, 0, 0x0080); } - phi_v1_4 = phi_v1_3; - if (phi_v1_3 == 0xE) { - func_8005DAD8(temp_s0, 9, 0, 0x80); - phi_v1_4 = gCurrentCourseId; + if (gCurrentCourseId == 0x000E) { + func_8005DAD8(temp_s0, 9, 0, 0x0080); } - phi_v1_5 = phi_v1_4; - if (phi_v1_4 == 4) { - func_8005DAD8(temp_s0, 0xA, 0, 0x80); - phi_v1_5 = gCurrentCourseId; + if (gCurrentCourseId == 4) { + func_8005DAD8(temp_s0, 0x000A, 0, 0x0080); } - if (phi_v1_5 == 0x12) { - func_8005DAD8(temp_s0, 0xB, 0, 0x80); + if (gCurrentCourseId == 0x0012) { + func_8005DAD8(temp_s0, 0x000B, 0, 0x0080); } - phi_v0 = random_int(0x10U); + var_v0 = random_int(0x0010U); goto block_83; } - if ((s32) (player + (arg2 * 0x48))->unk546 > 0) { - temp_s2_2 = player + (arg1 * 0x48); - temp_s0_2 = temp_s2_2 + 0x528; - func_8005D794(phi_f12, player, temp_s0_2, phi_f0, phi_f2, phi_f12, phi_t2, phi_t3); - func_8005D7D8(temp_s0_2, 5, 0x3EEB851F); + if ((player + (arg2 * 0x48))->unk546 > 0) { + var_s2 = player + (arg1 * 0x48); + temp_s0_2 = var_s2 + 0x528; + func_8005D794(player, temp_s0_2, var_f0, var_f2, var_f12, (s8) var_t2, (s8) var_t3); + func_8005D7D8(temp_s0_2, 5, 0.46f); temp_v1_2 = gCurrentCourseId; - phi_v1_6 = temp_v1_2; - phi_s2 = temp_s2_2; if ((temp_v1_2 == 1) || (temp_v1_2 == 7)) { - func_8005DAD8(temp_s0_2, 1, 0, 0x80); - phi_v1_6 = gCurrentCourseId; + func_8005DAD8(temp_s0_2, 1, 0, 0x0080); } - phi_v1_7 = phi_v1_6; - if (phi_v1_6 == 0xB) { - func_8005DAD8(temp_s0_2, 7, 0, 0x80); - phi_v1_7 = gCurrentCourseId; + if (gCurrentCourseId == 0x000B) { + func_8005DAD8(temp_s0_2, 7, 0, 0x0080); } - phi_v1_8 = phi_v1_7; - if (phi_v1_7 == 9) { - func_8005DAD8(temp_s0_2, 8, 0, 0x80); - phi_v1_8 = gCurrentCourseId; + if (gCurrentCourseId == 9) { + func_8005DAD8(temp_s0_2, 8, 0, 0x0080); } - phi_v1_9 = phi_v1_8; - if (phi_v1_8 == 0xE) { - func_8005DAD8(temp_s0_2, 9, 0, 0x80); - phi_v1_9 = gCurrentCourseId; + if (gCurrentCourseId == 0x000E) { + func_8005DAD8(temp_s0_2, 9, 0, 0x0080); } - phi_v1_10 = phi_v1_9; - if (phi_v1_9 == 4) { - func_8005DAD8(temp_s0_2, 0xA, 0, 0x80); - phi_v1_10 = gCurrentCourseId; + if (gCurrentCourseId == 4) { + func_8005DAD8(temp_s0_2, 0x000A, 0, 0x0080); } - if (phi_v1_10 == 0x12) { - func_8005DAD8(temp_s0_2, 0xB, 0, 0x80); + if (gCurrentCourseId == 0x0012) { + func_8005DAD8(temp_s0_2, 0x000B, 0, 0x0080); } - phi_v0 = random_int(0x10U); + var_v0 = random_int(0x0010U); block_83: - phi_s2->unk562 = phi_v0; + var_s2->unk562 = var_v0; } default: return; case 8: - if ((arg1 == 0) && ((temp_v0_3 = player + (arg2 * 0x48), ((s32) temp_v0_3->unk546 > 0)) || (temp_v0_3->unk544 == 0))) { - temp_s2_3 = player + (arg1 * 0x48); - temp_s0_3 = temp_s2_3 + 0x528; - func_8005D794(phi_f12, player, temp_s0_3, phi_f0, phi_f2, phi_f12, phi_t2, phi_t3); - func_8005D7D8(temp_s0_3, 5, 0x3DCCCCCD); - func_8005D800(temp_s0_3, 0xFFFFFF, 0xFF); + if ((arg1 == 0) && ((temp_v0_3 = player + (arg2 * 0x48), (temp_v0_3->unk546 > 0)) || (temp_v0_3->unk544 == 0))) { + temp_s2 = player + (arg1 * 0x48); + temp_s0_3 = temp_s2 + 0x528; + func_8005D794(player, temp_s0_3, var_f0, var_f2, var_f12, (s8) var_t2, (s8) var_t3); + func_8005D7D8(temp_s0_3, 5, 0.1f); + func_8005D800(temp_s0_3, 0x00FFFFFF, 0x00FF); temp_v1_3 = arg1 * 8; - temp_s2_3->unk560 = (s16) (temp_s2_3->unk560 - temp_v1_3); - temp_s2_3->unk562 = (s16) (temp_s2_3->unk562 - temp_v1_3); - temp_s2_3->unk564 = (s16) (temp_s2_3->unk564 - temp_v1_3); - } else if ((s32) (player + (arg2 * 0x48))->unk546 > 0) { - temp_s2_4 = player + (arg1 * 0x48); - temp_s0_4 = temp_s2_4 + 0x528; - func_8005D794(phi_f12, player, temp_s0_4, phi_f0, phi_f2, phi_f12, phi_t2, phi_t3); - func_8005D7D8(temp_s0_4, 5, 0x3DCCCCCD); - func_8005D800(temp_s0_4, 0xFFFFFF, 0xFF); + temp_s2->unk560 = (s16) (temp_s2->unk560 - temp_v1_3); + temp_s2->unk562 = (s16) (temp_s2->unk562 - temp_v1_3); + temp_s2->unk564 = (s16) (temp_s2->unk564 - temp_v1_3); + } else if ((player + (arg2 * 0x48))->unk546 > 0) { + temp_s2_2 = player + (arg1 * 0x48); + temp_s0_4 = temp_s2_2 + 0x528; + func_8005D794(player, temp_s0_4, var_f0, var_f2, var_f12, (s8) var_t2, (s8) var_t3); + func_8005D7D8(temp_s0_4, 5, 0.1f); + func_8005D800(temp_s0_4, 0x00FFFFFF, 0x00FF); temp_v1_4 = arg1 * 8; - temp_s2_4->unk560 = (s16) (temp_s2_4->unk560 - temp_v1_4); - temp_s2_4->unk562 = (s16) (temp_s2_4->unk562 - temp_v1_4); - temp_s2_4->unk564 = (s16) (temp_s2_4->unk564 - temp_v1_4); + temp_s2_2->unk560 = (s16) (temp_s2_2->unk560 - temp_v1_4); + temp_s2_2->unk562 = (s16) (temp_s2_2->unk562 - temp_v1_4); + temp_s2_2->unk564 = (s16) (temp_s2_2->unk564 - temp_v1_4); } - temp_s2_5 = player + (arg1 * 0x48); - temp_s2_5->unk52C = (f32) ((f64) temp_s2_5->unk52C - 1.5); + temp_s2_3 = player + (arg1 * 0x48); + temp_s2_3->unk52C = (f32) ((f64) temp_s2_3->unk52C - 1.5); return; case 7: - if ((arg1 == 0) && ((temp_v0_4 = player + (arg2 * 0x48), ((s32) temp_v0_4->unk546 > 0)) || (temp_v0_4->unk544 == 0))) { - temp_s2_6 = player + (arg1 * 0x48); - temp_s0_5 = temp_s2_6 + 0x528; - func_8005D794(phi_f12, player, temp_s0_5, phi_f0, phi_f2, phi_f12, phi_t2, phi_t3); - func_8005D7D8(temp_s0_5, 5, 0x3EEB851F); - func_8005DAD8(temp_s0_5, 2, 1, 0xA8); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_6; + if ((arg1 == 0) && ((temp_v0_4 = player + (arg2 * 0x48), (temp_v0_4->unk546 > 0)) || (temp_v0_4->unk544 == 0))) { + var_s2 = player + (arg1 * 0x48); + temp_s0_5 = var_s2 + 0x528; + func_8005D794(player, temp_s0_5, var_f0, var_f2, var_f12, (s8) var_t2, (s8) var_t3); + func_8005D7D8(temp_s0_5, 5, 0.46f); + func_8005DAD8(temp_s0_5, 2, 1, 0x00A8); + var_v0 = random_int(0x0010U); goto block_83; } - if ((s32) (player + (arg2 * 0x48))->unk546 > 0) { - temp_s2_7 = player + (arg1 * 0x48); - temp_s0_6 = temp_s2_7 + 0x528; - func_8005D794(phi_f12, player, temp_s0_6, phi_f0, phi_f2, phi_f12, phi_t2, phi_t3); - func_8005D7D8(temp_s0_6, 5, 0x3EEB851F); - func_8005DAD8(temp_s0_6, 2, 1, 0xA8); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_7; + if ((player + (arg2 * 0x48))->unk546 > 0) { + var_s2 = player + (arg1 * 0x48); + temp_s0_6 = var_s2 + 0x528; + func_8005D794(player, temp_s0_6, var_f0, var_f2, var_f12, (s8) var_t2, (s8) var_t3); + func_8005D7D8(temp_s0_6, 5, 0.46f); + func_8005DAD8(temp_s0_6, 2, 1, 0x00A8); + var_v0 = random_int(0x0010U); goto block_83; } break; case 3: - if ((arg1 == 0) && ((temp_v0_5 = player + (arg2 * 0x48), ((s32) temp_v0_5->unk546 > 0)) || (temp_v0_5->unk544 == 0))) { - temp_s2_8 = player + (arg1 * 0x48); - temp_s0_7 = temp_s2_8 + 0x528; - func_8005D794(phi_f12, player, temp_s0_7, phi_f0, phi_f2, phi_f12, phi_t2, phi_t3); - func_8005D7D8(temp_s0_7, 5, 0x3EEB851F); - func_8005DAD8(temp_s0_7, 3, 1, 0xA8); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_8; + if ((arg1 == 0) && ((temp_v0_5 = player + (arg2 * 0x48), (temp_v0_5->unk546 > 0)) || (temp_v0_5->unk544 == 0))) { + var_s2 = player + (arg1 * 0x48); + temp_s0_7 = var_s2 + 0x528; + func_8005D794(player, temp_s0_7, var_f0, var_f2, var_f12, (s8) var_t2, (s8) var_t3); + func_8005D7D8(temp_s0_7, 5, 0.46f); + func_8005DAD8(temp_s0_7, 3, 1, 0x00A8); + var_v0 = random_int(0x0010U); goto block_83; } - if ((s32) (player + (arg2 * 0x48))->unk546 > 0) { - temp_s2_9 = player + (arg1 * 0x48); - temp_s0_8 = temp_s2_9 + 0x528; - func_8005D794(phi_f12, player, temp_s0_8, phi_f0, phi_f2, phi_f12, phi_t2, phi_t3); - func_8005D7D8(temp_s0_8, 5, 0x3EEB851F); - func_8005DAD8(temp_s0_8, 3, 1, 0xA8); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_9; + if ((player + (arg2 * 0x48))->unk546 > 0) { + var_s2 = player + (arg1 * 0x48); + temp_s0_8 = var_s2 + 0x528; + func_8005D794(player, temp_s0_8, var_f0, var_f2, var_f12, (s8) var_t2, (s8) var_t3); + func_8005D7D8(temp_s0_8, 5, 0.46f); + func_8005DAD8(temp_s0_8, 3, 1, 0x00A8); + var_v0 = random_int(0x0010U); goto block_83; } break; case 10: - if ((arg1 == 0) && ((temp_v0_6 = player + (arg2 * 0x48), ((s32) temp_v0_6->unk546 > 0)) || (temp_v0_6->unk544 == 0))) { - temp_s2_10 = player + (arg1 * 0x48); - temp_s0_9 = temp_s2_10 + 0x528; - func_8005D794(phi_f12, player, temp_s0_9, phi_f0, phi_f2, phi_f12, phi_t2, phi_t3); - func_8005D7D8(temp_s0_9, 5, 0x3EEB851F); - func_8005DAD8(temp_s0_9, 4, 1, 0xA8); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_10; + if ((arg1 == 0) && ((temp_v0_6 = player + (arg2 * 0x48), (temp_v0_6->unk546 > 0)) || (temp_v0_6->unk544 == 0))) { + var_s2 = player + (arg1 * 0x48); + temp_s0_9 = var_s2 + 0x528; + func_8005D794(player, temp_s0_9, var_f0, var_f2, var_f12, (s8) var_t2, (s8) var_t3); + func_8005D7D8(temp_s0_9, 5, 0.46f); + func_8005DAD8(temp_s0_9, 4, 1, 0x00A8); + var_v0 = random_int(0x0010U); goto block_83; } - if ((s32) (player + (arg2 * 0x48))->unk546 > 0) { - temp_s2_11 = player + (arg1 * 0x48); - temp_s0_10 = temp_s2_11 + 0x528; - func_8005D794(phi_f12, player, temp_s0_10, phi_f0, phi_f2, phi_f12, phi_t2, phi_t3); - func_8005D7D8(temp_s0_10, 5, 0x3EEB851F); - func_8005DAD8(temp_s0_10, 4, 1, 0xA8); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_11; + if ((player + (arg2 * 0x48))->unk546 > 0) { + var_s2 = player + (arg1 * 0x48); + temp_s0_10 = var_s2 + 0x528; + func_8005D794(player, temp_s0_10, var_f0, var_f2, var_f12, (s8) var_t2, (s8) var_t3); + func_8005D7D8(temp_s0_10, 5, 0.46f); + func_8005DAD8(temp_s0_10, 4, 1, 0x00A8); + var_v0 = random_int(0x0010U); goto block_83; } break; case 13: - if ((arg1 == 0) && ((temp_v0_7 = player + (arg2 * 0x48), ((s32) temp_v0_7->unk546 > 0)) || (temp_v0_7->unk544 == 0))) { - temp_s2_12 = player + (arg1 * 0x48); - temp_s0_11 = temp_s2_12 + 0x528; - func_8005D794(phi_f12, player, temp_s0_11, phi_f0, phi_f2, phi_f12, phi_t2, phi_t3); - func_8005D7D8(temp_s0_11, 5, 0x3EEB851F); - func_8005DAD8(temp_s0_11, 5, 1, 0xA8); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_12; + if ((arg1 == 0) && ((temp_v0_7 = player + (arg2 * 0x48), (temp_v0_7->unk546 > 0)) || (temp_v0_7->unk544 == 0))) { + var_s2 = player + (arg1 * 0x48); + temp_s0_11 = var_s2 + 0x528; + func_8005D794(player, temp_s0_11, var_f0, var_f2, var_f12, (s8) var_t2, (s8) var_t3); + func_8005D7D8(temp_s0_11, 5, 0.46f); + func_8005DAD8(temp_s0_11, 5, 1, 0x00A8); + var_v0 = random_int(0x0010U); goto block_83; } - if ((s32) (player + (arg2 * 0x48))->unk546 > 0) { - temp_s2_13 = player + (arg1 * 0x48); - temp_s0_12 = temp_s2_13 + 0x528; - func_8005D794(phi_f12, player, temp_s0_12, phi_f0, phi_f2, phi_f12, phi_t2, phi_t3); - func_8005D7D8(temp_s0_12, 5, 0x3EEB851F); - func_8005DAD8(temp_s0_12, 5, 1, 0xA8); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_13; + if ((player + (arg2 * 0x48))->unk546 > 0) { + var_s2 = player + (arg1 * 0x48); + temp_s0_12 = var_s2 + 0x528; + func_8005D794(player, temp_s0_12, var_f0, var_f2, var_f12, (s8) var_t2, (s8) var_t3); + func_8005D7D8(temp_s0_12, 5, 0.46f); + func_8005DAD8(temp_s0_12, 5, 1, 0x00A8); + var_v0 = random_int(0x0010U); goto block_83; } break; case 5: case 11: - if ((arg1 == 0) && ((temp_v0_8 = player + (arg2 * 0x48), ((s32) temp_v0_8->unk546 > 0)) || (temp_v0_8->unk544 == 0))) { - temp_s2_14 = player + (arg1 * 0x48); - temp_s0_13 = temp_s2_14 + 0x528; - func_8005D794(phi_f12, player, temp_s0_13, phi_f0, phi_f2, phi_f12, phi_t2, phi_t3); - func_8005D7D8(temp_s0_13, 5, 0x3EEB851F); - func_8005DAD8(temp_s0_13, 6, 1, 0xA8); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_14; + if ((arg1 == 0) && ((temp_v0_8 = player + (arg2 * 0x48), (temp_v0_8->unk546 > 0)) || (temp_v0_8->unk544 == 0))) { + var_s2 = player + (arg1 * 0x48); + temp_s0_13 = var_s2 + 0x528; + func_8005D794(player, temp_s0_13, var_f0, var_f2, var_f12, (s8) var_t2, (s8) var_t3); + func_8005D7D8(temp_s0_13, 5, 0.46f); + func_8005DAD8(temp_s0_13, 6, 1, 0x00A8); + var_v0 = random_int(0x0010U); goto block_83; } - if ((s32) (player + (arg2 * 0x48))->unk546 > 0) { - temp_s2_15 = player + (arg1 * 0x48); - temp_s0_14 = temp_s2_15 + 0x528; - func_8005D794(phi_f12, player, temp_s0_14, phi_f0, phi_f2, phi_f12, phi_t2, phi_t3); - func_8005D7D8(temp_s0_14, 5, 0x3EEB851F); - func_8005DAD8(temp_s0_14, 6, 1, 0xA8); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_15; + if ((player + (arg2 * 0x48))->unk546 > 0) { + var_s2 = player + (arg1 * 0x48); + temp_s0_14 = var_s2 + 0x528; + func_8005D794(player, temp_s0_14, var_f0, var_f2, var_f12, (s8) var_t2, (s8) var_t3); + func_8005D7D8(temp_s0_14, 5, 0.46f); + func_8005DAD8(temp_s0_14, 6, 1, 0x00A8); + var_v0 = random_int(0x0010U); goto block_83; } break; case 1: case 4: case 6: - if ((arg1 == 0) && ((temp_v0_9 = player + (arg2 * 0x48), ((s32) temp_v0_9->unk546 > 0)) || (temp_v0_9->unk544 == 0))) { - temp_s2_16 = player + (arg1 * 0x48); - temp_s0_15 = temp_s2_16 + 0x528; - func_8005D794(phi_f12, player, temp_s0_15, phi_f0, phi_f2, phi_f12, phi_t2, phi_t3); - func_8005D7D8(temp_s0_15, 5, 0x3EEB851F); - func_8005DAD8(temp_s0_15, 0, 0, 0x80); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_16; + if ((arg1 == 0) && ((temp_v0_9 = player + (arg2 * 0x48), (temp_v0_9->unk546 > 0)) || (temp_v0_9->unk544 == 0))) { + var_s2 = player + (arg1 * 0x48); + temp_s0_15 = var_s2 + 0x528; + func_8005D794(player, temp_s0_15, var_f0, var_f2, var_f12, (s8) var_t2, (s8) var_t3); + func_8005D7D8(temp_s0_15, 5, 0.46f); + func_8005DAD8(temp_s0_15, 0, 0, 0x0080); + var_v0 = random_int(0x0010U); goto block_83; } - if ((s32) (player + (arg2 * 0x48))->unk546 > 0) { - temp_s2_17 = player + (arg1 * 0x48); - temp_s0_16 = temp_s2_17 + 0x528; - func_8005D794(phi_f12, player, temp_s0_16, phi_f0, phi_f2, phi_f12, phi_t2, phi_t3); - func_8005D7D8(temp_s0_16, 5, 0x3EEB851F); - func_8005DAD8(temp_s0_16, 0, 0, 0x80); - phi_v0 = random_int(0x10U); - phi_s2 = temp_s2_17; + if ((player + (arg2 * 0x48))->unk546 > 0) { + var_s2 = player + (arg1 * 0x48); + temp_s0_16 = var_s2 + 0x528; + func_8005D794(player, temp_s0_16, var_f0, var_f2, var_f12, (s8) var_t2, (s8) var_t3); + func_8005D7D8(temp_s0_16, 5, 0.46f); + func_8005DAD8(temp_s0_16, 0, 0, 0x0080); + var_v0 = random_int(0x0010U); goto block_83; } break; @@ -4015,52 +3779,39 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8005ED48.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 792017ad9d422c2467bd42686f383a5c41f41c75 -void func_8005D794(f32, Player *, void *, f32, f32, f32, s32, s32); /* extern */ -void func_8005D7D8(void *, ?, ?); /* extern */ -void func_8005D800(void *, ?, ?); /* extern */ -void func_8005DAD8(void *, ?, ?, ?); /* extern */ -s16 random_int(?); /* extern */ +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b s16 gCurrentCourseId; /* unable to generate initializer */ void func_8005F90C(Player *player, s16 arg1, s32 arg2, s32 arg3) { + UnkPlayerStruct258 *temp_s0; + UnkPlayerStruct258 *temp_s0_10; + UnkPlayerStruct258 *temp_s0_11; + UnkPlayerStruct258 *temp_s0_12; + UnkPlayerStruct258 *temp_s0_13; + UnkPlayerStruct258 *temp_s0_14; + UnkPlayerStruct258 *temp_s0_15; + UnkPlayerStruct258 *temp_s0_16; + UnkPlayerStruct258 *temp_s0_2; + UnkPlayerStruct258 *temp_s0_3; + UnkPlayerStruct258 *temp_s0_4; + UnkPlayerStruct258 *temp_s0_5; + UnkPlayerStruct258 *temp_s0_6; + UnkPlayerStruct258 *temp_s0_7; + UnkPlayerStruct258 *temp_s0_8; + UnkPlayerStruct258 *temp_s0_9; + f32 var_f0; + f32 var_f12; + f32 var_f2; s16 temp_v1; s16 temp_v1_2; s32 temp_t2; s32 temp_t6; - void *temp_s0; - void *temp_s0_10; - void *temp_s0_11; - void *temp_s0_12; - void *temp_s0_13; - void *temp_s0_14; - void *temp_s0_15; - void *temp_s0_16; - void *temp_s0_2; - void *temp_s0_3; - void *temp_s0_4; - void *temp_s0_5; - void *temp_s0_6; - void *temp_s0_7; - void *temp_s0_8; - void *temp_s0_9; + s32 var_t1; + u16 var_v0_2; + u8 var_v0; void *temp_s2; - void *temp_s2_10; - void *temp_s2_11; - void *temp_s2_12; - void *temp_s2_13; - void *temp_s2_14; - void *temp_s2_15; - void *temp_s2_16; - void *temp_s2_17; void *temp_s2_2; void *temp_s2_3; - void *temp_s2_4; - void *temp_s2_5; - void *temp_s2_6; - void *temp_s2_7; - void *temp_s2_8; - void *temp_s2_9; void *temp_v0; void *temp_v0_2; void *temp_v0_3; @@ -4069,275 +3820,225 @@ void func_8005F90C(Player *player, s16 arg1, s32 arg2, s32 arg3) { void *temp_v0_6; void *temp_v0_7; void *temp_v0_8; - s32 phi_v0; - f32 phi_f12; - f32 phi_f0; - f32 phi_f2; - s32 phi_t1; - s16 phi_v1; - s16 phi_v1_2; - s16 phi_v1_3; - s16 phi_v1_4; - s16 phi_v1_5; - s16 phi_v1_6; - s16 phi_v1_7; - s16 phi_v1_8; - s16 phi_v1_9; - s16 phi_v1_10; - s16 phi_v0_2; - void *phi_s2; - - phi_t1 = 0; + void *var_s2; + + var_t1 = 0; if ((player->unk_0BC & 0x80) == 0x80) { - phi_v0 = (s32) player->boundingBoxCorners[2].surfaceType; - phi_f12 = player->pos[2]; - phi_f0 = player->pos[0]; - phi_f2 = player->pos[1] - player->boundingBoxSize; - phi_t1 = 1; + var_f0 = player->pos[0]; + var_f12 = player->pos[2]; + var_t1 = 1; + var_v0 = player->boundingBoxCorners[2].surfaceType; + var_f2 = player->pos[1] - player->boundingBoxSize; } else { - phi_v0 = (s32) player->boundingBoxCorners[3].surfaceType; - phi_f12 = player->pos[2]; - phi_f0 = player->pos[0]; - phi_f2 = player->pos[1] - player->boundingBoxSize; + var_f0 = player->pos[0]; + var_f12 = player->pos[2]; + var_v0 = player->boundingBoxCorners[3].surfaceType; + var_f2 = player->pos[1] - player->boundingBoxSize; } - switch (phi_v0) { + switch (var_v0) { case 2: - if ((arg1 == 0) && ((temp_v0 = player + (arg2 * 0x48), ((s32) temp_v0->unk546 > 0)) || (temp_v0->unk544 == 0))) { - temp_s2 = player + (arg1 * 0x48); - temp_s0 = temp_s2 + 0x528; - func_8005D794(phi_f12, player, temp_s0, phi_f0, phi_f2, phi_f12, phi_v0, phi_t1); - func_8005D7D8(temp_s0, 4, 0x3EEB851F); + if ((arg1 == 0) && ((temp_v0 = player + (arg2 * 0x48), (temp_v0->unk546 > 0)) || (temp_v0->unk544 == 0))) { + var_s2 = player + (arg1 * 0x48); + temp_s0 = var_s2 + 0x528; + func_8005D794(player, temp_s0, var_f0, var_f2, var_f12, (s8) (s32) var_v0, (s8) var_t1); + func_8005D7D8(temp_s0, 4, 0.46f); temp_v1 = gCurrentCourseId; - phi_v1 = temp_v1; - phi_s2 = temp_s2; if ((temp_v1 == 1) || (temp_v1 == 7)) { - func_8005DAD8(temp_s0, 1, 0, 0x80); - phi_v1 = gCurrentCourseId; + func_8005DAD8(temp_s0, 1, 0, 0x0080); } - phi_v1_2 = phi_v1; - if (phi_v1 == 0xB) { - func_8005DAD8(temp_s0, 7, 0, 0x80); - phi_v1_2 = gCurrentCourseId; + if (gCurrentCourseId == 0x000B) { + func_8005DAD8(temp_s0, 7, 0, 0x0080); } - phi_v1_3 = phi_v1_2; - if (phi_v1_2 == 9) { - func_8005DAD8(temp_s0, 8, 0, 0x80); - phi_v1_3 = gCurrentCourseId; + if (gCurrentCourseId == 9) { + func_8005DAD8(temp_s0, 8, 0, 0x0080); } - phi_v1_4 = phi_v1_3; - if (phi_v1_3 == 0xE) { - func_8005DAD8(temp_s0, 9, 0, 0x80); - phi_v1_4 = gCurrentCourseId; + if (gCurrentCourseId == 0x000E) { + func_8005DAD8(temp_s0, 9, 0, 0x0080); } - phi_v1_5 = phi_v1_4; - if (phi_v1_4 == 4) { - func_8005DAD8(temp_s0, 0xA, 0, 0x80); - phi_v1_5 = gCurrentCourseId; + if (gCurrentCourseId == 4) { + func_8005DAD8(temp_s0, 0x000A, 0, 0x0080); } - if (phi_v1_5 == 0x12) { - func_8005DAD8(temp_s0, 0xB, 0, 0x80); + if (gCurrentCourseId == 0x0012) { + func_8005DAD8(temp_s0, 0x000B, 0, 0x0080); } - phi_v0_2 = random_int(0x10); + var_v0_2 = random_int(0x0010U); goto block_80; } - if ((s32) (player + (arg2 * 0x48))->unk546 > 0) { - temp_s2_2 = player + (arg1 * 0x48); - temp_s0_2 = temp_s2_2 + 0x528; - func_8005D794(phi_f12, player, temp_s0_2, phi_f0, phi_f2, phi_f12, phi_v0, phi_t1); - func_8005D7D8(temp_s0_2, 4, 0x3EEB851F); + if ((player + (arg2 * 0x48))->unk546 > 0) { + var_s2 = player + (arg1 * 0x48); + temp_s0_2 = var_s2 + 0x528; + func_8005D794(player, temp_s0_2, var_f0, var_f2, var_f12, (s8) (s32) var_v0, (s8) var_t1); + func_8005D7D8(temp_s0_2, 4, 0.46f); temp_v1_2 = gCurrentCourseId; - phi_v1_6 = temp_v1_2; - phi_s2 = temp_s2_2; if ((temp_v1_2 == 1) || (temp_v1_2 == 7)) { - func_8005DAD8(temp_s0_2, 1, 0, 0x80); - phi_v1_6 = gCurrentCourseId; + func_8005DAD8(temp_s0_2, 1, 0, 0x0080); } - phi_v1_7 = phi_v1_6; - if (phi_v1_6 == 0xB) { - func_8005DAD8(temp_s0_2, 7, 0, 0x80); - phi_v1_7 = gCurrentCourseId; + if (gCurrentCourseId == 0x000B) { + func_8005DAD8(temp_s0_2, 7, 0, 0x0080); } - phi_v1_8 = phi_v1_7; - if (phi_v1_7 == 9) { - func_8005DAD8(temp_s0_2, 8, 0, 0x80); - phi_v1_8 = gCurrentCourseId; + if (gCurrentCourseId == 9) { + func_8005DAD8(temp_s0_2, 8, 0, 0x0080); } - phi_v1_9 = phi_v1_8; - if (phi_v1_8 == 0xE) { - func_8005DAD8(temp_s0_2, 9, 0, 0x80); - phi_v1_9 = gCurrentCourseId; + if (gCurrentCourseId == 0x000E) { + func_8005DAD8(temp_s0_2, 9, 0, 0x0080); } - phi_v1_10 = phi_v1_9; - if (phi_v1_9 == 4) { - func_8005DAD8(temp_s0_2, 0xA, 0, 0x80); - phi_v1_10 = gCurrentCourseId; + if (gCurrentCourseId == 4) { + func_8005DAD8(temp_s0_2, 0x000A, 0, 0x0080); } - if (phi_v1_10 == 0x12) { - func_8005DAD8(temp_s0_2, 0xB, 0, 0x80); + if (gCurrentCourseId == 0x0012) { + func_8005DAD8(temp_s0_2, 0x000B, 0, 0x0080); } - phi_v0_2 = random_int(0x10); + var_v0_2 = random_int(0x0010U); block_80: - phi_s2->unk562 = phi_v0_2; + var_s2->unk562 = var_v0_2; } default: return; case 8: - if ((arg1 == 0) && ((temp_v0_2 = player + (arg2 * 0x48), ((s32) temp_v0_2->unk546 > 0)) || (temp_v0_2->unk544 == 0))) { - temp_s2_3 = player + (arg1 * 0x48); - temp_s0_3 = temp_s2_3 + 0x528; - func_8005D794(phi_f12, player, temp_s0_3, phi_f0, phi_f2, phi_f12, phi_v0, phi_t1); - func_8005D7D8(temp_s0_3, 4, 0x3DCCCCCD); - func_8005D800(temp_s0_3, 0xFFFFFF, 0xFF); + if ((arg1 == 0) && ((temp_v0_2 = player + (arg2 * 0x48), (temp_v0_2->unk546 > 0)) || (temp_v0_2->unk544 == 0))) { + temp_s2 = player + (arg1 * 0x48); + temp_s0_3 = temp_s2 + 0x528; + func_8005D794(player, temp_s0_3, var_f0, var_f2, var_f12, (s8) (s32) var_v0, (s8) var_t1); + func_8005D7D8(temp_s0_3, 4, 0.1f); + func_8005D800(temp_s0_3, 0x00FFFFFF, 0x00FF); temp_t6 = arg1 * 8; - temp_s2_3->unk560 = (s16) (temp_s2_3->unk560 - temp_t6); - temp_s2_3->unk562 = (s16) (temp_s2_3->unk562 - temp_t6); - temp_s2_3->unk564 = (s16) (temp_s2_3->unk564 - temp_t6); - } else if ((s32) (player + (arg2 * 0x48))->unk546 > 0) { - temp_s2_4 = player + (arg1 * 0x48); - temp_s0_4 = temp_s2_4 + 0x528; - func_8005D794(phi_f12, player, temp_s0_4, phi_f0, phi_f2, phi_f12, phi_v0, phi_t1); - func_8005D7D8(temp_s0_4, 4, 0x3DCCCCCD); - func_8005D800(temp_s0_4, 0xFFFFFF, 0xFF); + temp_s2->unk560 = (s16) (temp_s2->unk560 - temp_t6); + temp_s2->unk562 = (s16) (temp_s2->unk562 - temp_t6); + temp_s2->unk564 = (s16) (temp_s2->unk564 - temp_t6); + } else if ((player + (arg2 * 0x48))->unk546 > 0) { + temp_s2_2 = player + (arg1 * 0x48); + temp_s0_4 = temp_s2_2 + 0x528; + func_8005D794(player, temp_s0_4, var_f0, var_f2, var_f12, (s8) (s32) var_v0, (s8) var_t1); + func_8005D7D8(temp_s0_4, 4, 0.1f); + func_8005D800(temp_s0_4, 0x00FFFFFF, 0x00FF); temp_t2 = arg1 * 8; - temp_s2_4->unk560 = (s16) (temp_s2_4->unk560 - temp_t2); - temp_s2_4->unk562 = (s16) (temp_s2_4->unk562 - temp_t2); - temp_s2_4->unk564 = (s16) (temp_s2_4->unk564 - temp_t2); + temp_s2_2->unk560 = (s16) (temp_s2_2->unk560 - temp_t2); + temp_s2_2->unk562 = (s16) (temp_s2_2->unk562 - temp_t2); + temp_s2_2->unk564 = (s16) (temp_s2_2->unk564 - temp_t2); } - temp_s2_5 = player + (arg1 * 0x48); - temp_s2_5->unk52C = (f32) ((f64) temp_s2_5->unk52C - 1.5); + temp_s2_3 = player + (arg1 * 0x48); + temp_s2_3->unk52C = (f32) ((f64) temp_s2_3->unk52C - 1.5); return; case 7: - if ((arg1 == 0) && ((temp_v0_3 = player + (arg2 * 0x48), ((s32) temp_v0_3->unk546 > 0)) || (temp_v0_3->unk544 == 0))) { - temp_s2_6 = player + (arg1 * 0x48); - temp_s0_5 = temp_s2_6 + 0x528; - func_8005D794(phi_f12, player, temp_s0_5, phi_f0, phi_f2, phi_f12, phi_v0, phi_t1); - func_8005D7D8(temp_s0_5, 4, 0x3EEB851F); - func_8005DAD8(temp_s0_5, 2, 1, 0xA8); - phi_v0_2 = random_int(0x10); - phi_s2 = temp_s2_6; + if ((arg1 == 0) && ((temp_v0_3 = player + (arg2 * 0x48), (temp_v0_3->unk546 > 0)) || (temp_v0_3->unk544 == 0))) { + var_s2 = player + (arg1 * 0x48); + temp_s0_5 = var_s2 + 0x528; + func_8005D794(player, temp_s0_5, var_f0, var_f2, var_f12, (s8) (s32) var_v0, (s8) var_t1); + func_8005D7D8(temp_s0_5, 4, 0.46f); + func_8005DAD8(temp_s0_5, 2, 1, 0x00A8); + var_v0_2 = random_int(0x0010U); goto block_80; } - if ((s32) (player + (arg2 * 0x48))->unk546 > 0) { - temp_s2_7 = player + (arg1 * 0x48); - temp_s0_6 = temp_s2_7 + 0x528; - func_8005D794(phi_f12, player, temp_s0_6, phi_f0, phi_f2, phi_f12, phi_v0, phi_t1); - func_8005D7D8(temp_s0_6, 4, 0x3EEB851F); - func_8005DAD8(temp_s0_6, 2, 1, 0xA8); - phi_v0_2 = random_int(0x10); - phi_s2 = temp_s2_7; + if ((player + (arg2 * 0x48))->unk546 > 0) { + var_s2 = player + (arg1 * 0x48); + temp_s0_6 = var_s2 + 0x528; + func_8005D794(player, temp_s0_6, var_f0, var_f2, var_f12, (s8) (s32) var_v0, (s8) var_t1); + func_8005D7D8(temp_s0_6, 4, 0.46f); + func_8005DAD8(temp_s0_6, 2, 1, 0x00A8); + var_v0_2 = random_int(0x0010U); goto block_80; } break; case 3: - if ((arg1 == 0) && ((temp_v0_4 = player + (arg2 * 0x48), ((s32) temp_v0_4->unk546 > 0)) || (temp_v0_4->unk544 == 0))) { - temp_s2_8 = player + (arg1 * 0x48); - temp_s0_7 = temp_s2_8 + 0x528; - func_8005D794(phi_f12, player, temp_s0_7, phi_f0, phi_f2, phi_f12, phi_v0, phi_t1); - func_8005D7D8(temp_s0_7, 4, 0x3EEB851F); - func_8005DAD8(temp_s0_7, 3, 1, 0xA8); - phi_v0_2 = random_int(0x10); - phi_s2 = temp_s2_8; + if ((arg1 == 0) && ((temp_v0_4 = player + (arg2 * 0x48), (temp_v0_4->unk546 > 0)) || (temp_v0_4->unk544 == 0))) { + var_s2 = player + (arg1 * 0x48); + temp_s0_7 = var_s2 + 0x528; + func_8005D794(player, temp_s0_7, var_f0, var_f2, var_f12, (s8) (s32) var_v0, (s8) var_t1); + func_8005D7D8(temp_s0_7, 4, 0.46f); + func_8005DAD8(temp_s0_7, 3, 1, 0x00A8); + var_v0_2 = random_int(0x0010U); goto block_80; } - if ((s32) (player + (arg2 * 0x48))->unk546 > 0) { - temp_s2_9 = player + (arg1 * 0x48); - temp_s0_8 = temp_s2_9 + 0x528; - func_8005D794(phi_f12, player, temp_s0_8, phi_f0, phi_f2, phi_f12, phi_v0, phi_t1); - func_8005D7D8(temp_s0_8, 4, 0x3EEB851F); - func_8005DAD8(temp_s0_8, 3, 1, 0xA8); - phi_v0_2 = random_int(0x10); - phi_s2 = temp_s2_9; + if ((player + (arg2 * 0x48))->unk546 > 0) { + var_s2 = player + (arg1 * 0x48); + temp_s0_8 = var_s2 + 0x528; + func_8005D794(player, temp_s0_8, var_f0, var_f2, var_f12, (s8) (s32) var_v0, (s8) var_t1); + func_8005D7D8(temp_s0_8, 4, 0.46f); + func_8005DAD8(temp_s0_8, 3, 1, 0x00A8); + var_v0_2 = random_int(0x0010U); goto block_80; } break; case 10: - if ((arg1 == 0) && ((temp_v0_5 = player + (arg2 * 0x48), ((s32) temp_v0_5->unk546 > 0)) || (temp_v0_5->unk544 == 0))) { - temp_s2_10 = player + (arg1 * 0x48); - temp_s0_9 = temp_s2_10 + 0x528; - func_8005D794(phi_f12, player, temp_s0_9, phi_f0, phi_f2, phi_f12, phi_v0, phi_t1); - func_8005D7D8(temp_s0_9, 4, 0x3EEB851F); - func_8005DAD8(temp_s0_9, 4, 1, 0xA8); - phi_v0_2 = random_int(0x10); - phi_s2 = temp_s2_10; + if ((arg1 == 0) && ((temp_v0_5 = player + (arg2 * 0x48), (temp_v0_5->unk546 > 0)) || (temp_v0_5->unk544 == 0))) { + var_s2 = player + (arg1 * 0x48); + temp_s0_9 = var_s2 + 0x528; + func_8005D794(player, temp_s0_9, var_f0, var_f2, var_f12, (s8) (s32) var_v0, (s8) var_t1); + func_8005D7D8(temp_s0_9, 4, 0.46f); + func_8005DAD8(temp_s0_9, 4, 1, 0x00A8); + var_v0_2 = random_int(0x0010U); goto block_80; } - if ((s32) (player + (arg2 * 0x48))->unk546 > 0) { - temp_s2_11 = player + (arg1 * 0x48); - temp_s0_10 = temp_s2_11 + 0x528; - func_8005D794(phi_f12, player, temp_s0_10, phi_f0, phi_f2, phi_f12, phi_v0, phi_t1); - func_8005D7D8(temp_s0_10, 4, 0x3EEB851F); - func_8005DAD8(temp_s0_10, 4, 1, 0xA8); - phi_v0_2 = random_int(0x10); - phi_s2 = temp_s2_11; + if ((player + (arg2 * 0x48))->unk546 > 0) { + var_s2 = player + (arg1 * 0x48); + temp_s0_10 = var_s2 + 0x528; + func_8005D794(player, temp_s0_10, var_f0, var_f2, var_f12, (s8) (s32) var_v0, (s8) var_t1); + func_8005D7D8(temp_s0_10, 4, 0.46f); + func_8005DAD8(temp_s0_10, 4, 1, 0x00A8); + var_v0_2 = random_int(0x0010U); goto block_80; } break; case 13: - if ((arg1 == 0) && ((temp_v0_6 = player + (arg2 * 0x48), ((s32) temp_v0_6->unk546 > 0)) || (temp_v0_6->unk544 == 0))) { - temp_s2_12 = player + (arg1 * 0x48); - temp_s0_11 = temp_s2_12 + 0x528; - func_8005D794(phi_f12, player, temp_s0_11, phi_f0, phi_f2, phi_f12, phi_v0, phi_t1); - func_8005D7D8(temp_s0_11, 4, 0x3EEB851F); - func_8005DAD8(temp_s0_11, 5, 1, 0xA8); - phi_v0_2 = random_int(0x10); - phi_s2 = temp_s2_12; + if ((arg1 == 0) && ((temp_v0_6 = player + (arg2 * 0x48), (temp_v0_6->unk546 > 0)) || (temp_v0_6->unk544 == 0))) { + var_s2 = player + (arg1 * 0x48); + temp_s0_11 = var_s2 + 0x528; + func_8005D794(player, temp_s0_11, var_f0, var_f2, var_f12, (s8) (s32) var_v0, (s8) var_t1); + func_8005D7D8(temp_s0_11, 4, 0.46f); + func_8005DAD8(temp_s0_11, 5, 1, 0x00A8); + var_v0_2 = random_int(0x0010U); goto block_80; } - if ((s32) (player + (arg2 * 0x48))->unk546 > 0) { - temp_s2_13 = player + (arg1 * 0x48); - temp_s0_12 = temp_s2_13 + 0x528; - func_8005D794(phi_f12, player, temp_s0_12, phi_f0, phi_f2, phi_f12, phi_v0, phi_t1); - func_8005D7D8(temp_s0_12, 4, 0x3EEB851F); - func_8005DAD8(temp_s0_12, 5, 1, 0xA8); - phi_v0_2 = random_int(0x10); - phi_s2 = temp_s2_13; + if ((player + (arg2 * 0x48))->unk546 > 0) { + var_s2 = player + (arg1 * 0x48); + temp_s0_12 = var_s2 + 0x528; + func_8005D794(player, temp_s0_12, var_f0, var_f2, var_f12, (s8) (s32) var_v0, (s8) var_t1); + func_8005D7D8(temp_s0_12, 4, 0.46f); + func_8005DAD8(temp_s0_12, 5, 1, 0x00A8); + var_v0_2 = random_int(0x0010U); goto block_80; } break; case 5: case 11: - if ((arg1 == 0) && ((temp_v0_7 = player + (arg2 * 0x48), ((s32) temp_v0_7->unk546 > 0)) || (temp_v0_7->unk544 == 0))) { - temp_s2_14 = player + (arg1 * 0x48); - temp_s0_13 = temp_s2_14 + 0x528; - func_8005D794(phi_f12, player, temp_s0_13, phi_f0, phi_f2, phi_f12, phi_v0, phi_t1); - func_8005D7D8(temp_s0_13, 4, 0x3EEB851F); - func_8005DAD8(temp_s0_13, 6, 1, 0xA8); - phi_v0_2 = random_int(0x10); - phi_s2 = temp_s2_14; + if ((arg1 == 0) && ((temp_v0_7 = player + (arg2 * 0x48), (temp_v0_7->unk546 > 0)) || (temp_v0_7->unk544 == 0))) { + var_s2 = player + (arg1 * 0x48); + temp_s0_13 = var_s2 + 0x528; + func_8005D794(player, temp_s0_13, var_f0, var_f2, var_f12, (s8) (s32) var_v0, (s8) var_t1); + func_8005D7D8(temp_s0_13, 4, 0.46f); + func_8005DAD8(temp_s0_13, 6, 1, 0x00A8); + var_v0_2 = random_int(0x0010U); goto block_80; } - if ((s32) (player + (arg2 * 0x48))->unk546 > 0) { - temp_s2_15 = player + (arg1 * 0x48); - temp_s0_14 = temp_s2_15 + 0x528; - func_8005D794(phi_f12, player, temp_s0_14, phi_f0, phi_f2, phi_f12, phi_v0, phi_t1); - func_8005D7D8(temp_s0_14, 4, 0x3EEB851F); - func_8005DAD8(temp_s0_14, 6, 1, 0xA8); - phi_v0_2 = random_int(0x10); - phi_s2 = temp_s2_15; + if ((player + (arg2 * 0x48))->unk546 > 0) { + var_s2 = player + (arg1 * 0x48); + temp_s0_14 = var_s2 + 0x528; + func_8005D794(player, temp_s0_14, var_f0, var_f2, var_f12, (s8) (s32) var_v0, (s8) var_t1); + func_8005D7D8(temp_s0_14, 4, 0.46f); + func_8005DAD8(temp_s0_14, 6, 1, 0x00A8); + var_v0_2 = random_int(0x0010U); goto block_80; } break; case 1: case 4: case 6: - if ((arg1 == 0) && ((temp_v0_8 = player + (arg2 * 0x48), ((s32) temp_v0_8->unk546 > 0)) || (temp_v0_8->unk544 == 0))) { - temp_s2_16 = player + (arg1 * 0x48); - temp_s0_15 = temp_s2_16 + 0x528; - func_8005D794(phi_f12, player, temp_s0_15, phi_f0, phi_f2, phi_f12, phi_v0, phi_t1); - func_8005D7D8(temp_s0_15, 4, 0x3EEB851F); - func_8005DAD8(temp_s0_15, 0, 0, 0x80); - phi_v0_2 = random_int(0x10); - phi_s2 = temp_s2_16; + if ((arg1 == 0) && ((temp_v0_8 = player + (arg2 * 0x48), (temp_v0_8->unk546 > 0)) || (temp_v0_8->unk544 == 0))) { + var_s2 = player + (arg1 * 0x48); + temp_s0_15 = var_s2 + 0x528; + func_8005D794(player, temp_s0_15, var_f0, var_f2, var_f12, (s8) (s32) var_v0, (s8) var_t1); + func_8005D7D8(temp_s0_15, 4, 0.46f); + func_8005DAD8(temp_s0_15, 0, 0, 0x0080); + var_v0_2 = random_int(0x0010U); goto block_80; } - if ((s32) (player + (arg2 * 0x48))->unk546 > 0) { - temp_s2_17 = player + (arg1 * 0x48); - temp_s0_16 = temp_s2_17 + 0x528; - func_8005D794(phi_f12, player, temp_s0_16, phi_f0, phi_f2, phi_f12, phi_v0, phi_t1); - func_8005D7D8(temp_s0_16, 4, 0x3EEB851F); - func_8005DAD8(temp_s0_16, 0, 0, 0x80); - phi_v0_2 = random_int(0x10); - phi_s2 = temp_s2_17; + if ((player + (arg2 * 0x48))->unk546 > 0) { + var_s2 = player + (arg1 * 0x48); + temp_s0_16 = var_s2 + 0x528; + func_8005D794(player, temp_s0_16, var_f0, var_f2, var_f12, (s8) (s32) var_v0, (s8) var_t1); + func_8005D7D8(temp_s0_16, 4, 0.46f); + func_8005DAD8(temp_s0_16, 0, 0, 0x0080); + var_v0_2 = random_int(0x0010U); goto block_80; } break; @@ -4348,243 +4049,197 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8005F90C.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8005D794(void *, void *, f32, f32, f32, s32, s32); // extern -void func_8005D7D8(void *, ?, ?); // extern -void func_8005D800(void *, ?, ?); // extern -void func_80062B18(f32 *, f32 *, f32 *, ?, f32, f32, s32, s32); // extern -extern f32 D_800EE560; -extern f64 D_800EE568; -extern f32 D_800EE570; -extern f64 D_800EE578; - -void func_80060504(void *arg0, s16 arg1, s32 arg2, ? arg3) { +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +void func_80060504(Player *player, s16 arg1, s32 arg2, s32 arg3) { f32 sp50; f32 sp4C; f32 sp48; void *sp34; + UnkPlayerStruct258 *temp_s0; + UnkPlayerStruct258 *temp_s0_2; + UnkPlayerStruct258 *temp_s0_3; f32 temp_f16; f32 temp_f16_2; - s32 temp_lo; - s32 temp_v0; - void *temp_s0; - void *temp_s0_2; - void *temp_s0_3; - void *temp_v0_2; + f32 var_f0; + s32 var_v0; + u16 temp_v0; void *temp_v1; - s32 phi_v0; - void *phi_v1; - f32 phi_f0; - if ((arg0->unk44 & 0x20) == 0x20) { - phi_v0 = 5; + if ((player->unk_044 & 0x20) == 0x20) { + var_v0 = 5; } else { - phi_v0 = 0xE; + var_v0 = 0xE; } - temp_v0 = random_int(phi_v0 & 0xFFFF); + temp_v0 = random_int(var_v0 & 0xFFFF); if ((temp_v0 == 1) || (temp_v0 == 2) || (temp_v0 == 3)) { - if ((arg1 == 0) && ((temp_v0_2 = arg0 + (arg2 * 0x48), (temp_v0_2->unk276 > 0)) || (temp_v0_2->unk274 == 0))) { - temp_f16 = arg0->unk18 - 2.5; + if ((arg1 == 0) && ((player->unk_258[arg2].unk_01E > 0) || (player->unk_258[arg2].unk_01C == 0))) { + temp_f16 = (f32) ((f64) player->pos[1] - 2.5); sp4C = temp_f16; - sp48 = arg0->unk1C; - temp_s0 = arg0 + (arg1 * 0x48) + 0x258; - sp50 = arg0->unk14; - func_8005D794(arg0, temp_s0, sp50, temp_f16, sp48, 0, 0); - func_8005D7D8(temp_s0, 1, 0x3F000000); - } else if ((arg0 + (arg2 * 0x48))->unk276 > 0) { - temp_f16_2 = arg0->unk18 - 2.5; + sp48 = player->pos[2]; + temp_s0 = &player->unk_258[arg1]; + sp50 = player->pos[0]; + func_8005D794(player, temp_s0, sp50, temp_f16, sp48, (s8) 0, (s8) 0); + func_8005D7D8(temp_s0, 1, 0.5f); + } else if (player->unk_258[arg2].unk_01E > 0) { + temp_f16_2 = (f32) ((f64) player->pos[1] - 2.5); sp4C = temp_f16_2; - sp48 = arg0->unk1C; - temp_s0_2 = arg0 + (arg1 * 0x48) + 0x258; - sp50 = arg0->unk14; - func_8005D794(arg0, temp_s0_2, sp50, temp_f16_2, sp48, 0, 0); - func_8005D7D8(temp_s0_2, 1, 0x3F000000); - } - } - temp_lo = arg1 * 0x48; - temp_v1 = arg0 + temp_lo; - temp_v1->unk27C = 0.0f; - temp_s0_3 = temp_v1 + 0x258; - if ((arg0->unk44 & 0x20) == 0x20) { - temp_v1->unk298 = 0; - if ((arg0->unkBC & 0x2000) == 0x2000) { + sp48 = player->pos[2]; + temp_s0_2 = &player->unk_258[arg1]; + sp50 = player->pos[0]; + func_8005D794(player, temp_s0_2, sp50, temp_f16_2, sp48, (s8) 0, (s8) 0); + func_8005D7D8(temp_s0_2, 1, 0.5f); + } + } + temp_v1 = player + (arg1 * 0x48); + player->unk_258[arg1].unk_024 = 0.0f; + temp_s0_3 = &player->unk_258[arg1]; + if ((player->unk_044 & 0x20) == 0x20) { + player->unk_258[arg1].unk_040 = 0; + if ((player->unk_0BC & 0x2000) == 0x2000) { sp34 = temp_v1; - func_8005D800(temp_s0_3, 0xFFFF00, 0x80); - temp_v1->unk290 = 1; - phi_v1 = temp_v1; + func_8005D800(temp_s0_3, 0x00FFFF00, 0x0080); + player->unk_258[arg1].unk_038 = 1; } else { sp34 = temp_v1; - func_8005D800(temp_s0_3, 0xFFFFFF, 0x70); + func_8005D800(temp_s0_3, 0x00FFFFFF, 0x0070); goto block_19; } } else { - temp_v1->unk298 = 1; - if ((arg0->unkBC & 0x2000) == 0x2000) { + player->unk_258[arg1].unk_040 = 1; + if ((player->unk_0BC & 0x2000) == 0x2000) { sp34 = temp_v1; - func_8005D800(temp_s0_3, 0xFFFF00, 0x80); - temp_v1->unk290 = 1; - phi_v1 = temp_v1; + func_8005D800(temp_s0_3, 0x00FFFF00, 0x0080); + player->unk_258[arg1].unk_038 = 1; } else { sp34 = temp_v1; - func_8005D800(temp_s0_3, 0xFFFFFF, 0x70); + func_8005D800(temp_s0_3, 0x00FFFFFF, 0x0070); block_19: - (arg0 + temp_lo)->unk290 = 0; - phi_v1 = arg0 + temp_lo; + temp_v1->unk290 = 0; } } - if (phi_v1->unk298 == 0) { - phi_f0 = -((arg0->unk98 / D_800EE560) + D_800EE568); + if (temp_v1->unk298 == 0) { + var_f0 = (f32) -((f64) (player->unk_098 / 3000.0f) + 0.1); } else { - phi_f0 = -((arg0->unk98 / D_800EE570) + D_800EE578); + var_f0 = (f32) -((f64) (player->unk_098 / 5000.0f) + 0.1); } - sp34 = phi_v1; - func_80062B18(&sp50, &sp4C, &sp48, 0, 4.5f, (phi_v1->unk276 * phi_f0) + -5.5, -(phi_v1->unk278 - (arg0->unkC0 / 2)), arg0->unk206 * -2); - phi_v1->unk258 = arg0->unk14 + sp50; - sp4C += arg0->unk18 - arg0->unk70; - phi_v1->unk260 = arg0->unk1C + sp48; - phi_v1->unk268 = 0; - phi_v1->unk25C = phi_v1->unk27C + sp4C; + sp34 = temp_v1; + func_80062B18(&sp50, &sp4C, &sp48, 0.0f, 4.5f, (f32) ((f64) ((f32) temp_v1->unk276 * var_f0) + -5.5), (u16) (s32) -(s16) (temp_v1->unk278 - ((s16) player->unk_0C0 / 2)), (u16) (player->unk_206 * -2)); + sp34->unk258 = (f32) (player->pos[0] + sp50); + sp4C += player->pos[1] - player->boundingBoxSize; + sp34->unk260 = (f32) (player->pos[2] + sp48); + sp34->unk268 = 0; + sp34->unk25C = (f32) (sp34->unk27C + sp4C); } #else GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80060504.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8005D794(f32, f32, void *, void *, f32, f32, f32, s32, s32); // extern -void func_8005D7D8(void *, ?, f32); // extern -void func_8005D800(void *, ?, ?); // extern -void func_80062B18(f32 *, f32 *, f32 *, ?, f32, f32, s32, s32); // extern -extern f64 D_800EE580; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +s16 gCurrentCourseId; /* unable to generate initializer */ -void func_800608E0(void *arg0, s16 arg1, ? arg2, s8 arg3) { +void func_800608E0(Player *player, s16 arg1, s32 arg2, s8 arg3) { f32 sp54; f32 sp50; f32 sp4C; f32 sp48; - f32 temp_f0; + UnkPlayerStruct258 *temp_s2; f32 temp_f12; f32 temp_f2; - s16 temp_v0; - void *temp_s1; - void *temp_s2; - f32 phi_f0; + f32 var_f0; temp_f2 = D_801652A0[arg3]; - temp_f12 = temp_f2 - arg0->unk18; - temp_f0 = 8.0f - temp_f12; - phi_f0 = temp_f0; - if (temp_f0 <= 0.0) { - phi_f0 = 0.0f; + temp_f12 = temp_f2 - player->pos[1]; + var_f0 = 8.0f - temp_f12; + if ((f64) var_f0 <= 0.0) { + var_f0 = 0.0f; } sp4C = temp_f12 - 3.0f; - if (((arg0->unkDE & 1) != 0) && (gCurrentCourseId != 6)) { - sp4C = (temp_f2 - arg0->unk18) + D_800EE580; - phi_f0 = 2.5f; - } - temp_s1 = arg0 + (arg1 * 0x48); - temp_s2 = temp_s1 + 0x258; - sp54 = phi_f0; - func_8005D794(temp_f12, 0.0f, arg0, temp_s2, 0.0f, 0.0f, 0.0f, 0, 0); - func_8005D7D8(temp_s2, 3, phi_f0); - temp_v0 = gCurrentCourseId; - if ((temp_v0 == 2) || (temp_v0 == 0x13)) { - func_8005D800(temp_s2, 0, 0xAF); + if ((player->unk_0DE & 1) && (gCurrentCourseId != 6)) { + var_f0 = 2.5f; + sp4C = (f32) ((f64) (temp_f2 - player->pos[1]) + 0.1); + } + temp_s2 = &player->unk_258[arg1]; + sp54 = var_f0; + func_8005D794(player, temp_s2, 0.0f, 0.0f, 0.0f, (s8) 0, (s8) 0); + func_8005D7D8(temp_s2, 3, var_f0); + if ((gCurrentCourseId == 2) || (gCurrentCourseId == 0x0013)) { + func_8005D800(temp_s2, 0, 0x00AF); } else { - func_8005D800(temp_s2, 0xFFFFFF, 0xCF); + func_8005D800(temp_s2, 0x00FFFFFF, 0x00CF); } - func_80062B18(&sp50, &sp4C, &sp48, 0, sp4C, ((-temp_s1->unk276 * (arg0->unk94 / 18.0f) * 216.0f) / 10.0f) + -4.0f, -temp_s1->unk278, arg0->unk206 * -2); - temp_s1->unk258 = arg0->unk14 + sp50; - temp_s1->unk260 = arg0->unk1C + sp48; - temp_s1->unk25C = arg0->unk18 + sp4C; + func_80062B18(&sp50, &sp4C, &sp48, 0.0f, sp4C, (((f32) -player->unk_258[arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 10.0f) + -4.0f, (u16) (s32) -player->unk_258[arg1].unk_020, (u16) (player->unk_206 * -2)); + player->unk_258[arg1].unk_000[0] = player->pos[0] + sp50; + player->unk_258[arg1].unk_000[1] = player->pos[1] + sp4C; + player->unk_258[arg1].unk_000[2] = player->pos[2] + sp48; } #else GLOBAL_ASM("asm/non_matchings/code_80057C60/func_800608E0.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_800608E0(s16, s8, s32); // extern +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800608E0(s16, s8, s32); /* extern */ +s16 gCurrentCourseId; /* unable to generate initializer */ -void func_80060B14(s32 arg0, s16 arg1, s32 arg2, s8 arg3, s8 arg4) { +void func_80060B14(Player *player, s16 arg1, s32 arg2, s8 arg3, s8 arg4) { s16 temp_v0; - void *temp_v0_2; temp_v0 = gCurrentCourseId; - if ((temp_v0 != 0x10) && (temp_v0 != 0xD)) { - if ((arg1 == 0) && ((temp_v0_2 = arg0 + (arg2 * 0x48), (temp_v0_2->unk276 > 0)) || (temp_v0_2->unk274 == 0))) { - func_800608E0(arg1, arg3, arg4); + if ((temp_v0 != 0x0010) && (temp_v0 != 0x000D)) { + if ((arg1 == 0) && ((player->unk_258[arg2].unk_01E > 0) || (player->unk_258[arg2].unk_01C == 0))) { + func_800608E0(arg1, arg3, (s32) arg4); return; } - if ((arg0 + (arg2 * 0x48))->unk276 > 0) { - func_800608E0(arg1, arg3, arg4); + if (player->unk_258[arg2].unk_01E > 0) { + func_800608E0(arg1, arg3, (s32) arg4); } - // Duplicate return node #8. Try simplifying control flow for better match } } #else GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80060B14.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8005D794(void *, void *, f32, f32, f32, s32, s32); // extern -void func_8005D7D8(void *, ?, ?); // extern -void func_8005D800(void *, ?, ?); // extern -f32 sins(s32); // extern -f32 coss(s32); // extern -extern f64 D_800EE588; -extern f64 D_800EE590; -extern f64 D_800EE598; -extern f64 D_800EE5A0; - -void func_80060BCC(void *arg0, s16 arg1, s32 arg2, ? arg3) { +#ifdef NEEDS_RODATA +// data_0DD0A0_3_0.s +extern f64 D_800EE588;// = -1.8; +extern f64 D_800EE590;// = -1.8; +extern f64 D_800EE598;// = -1.8; +extern f64 D_800EE5A0;// = -1.8; + +void func_80060BCC(Player *player, s16 arg1, s32 arg2, s32 arg3) { s32 sp54; + s32 stackPadding0; s32 sp4C; f32 sp48; f32 sp44; - s32 sp3C; - s16 temp_v0; - s32 temp_a0; - s32 temp_a0_2; - void *temp_s0; - void *temp_s0_2; - void *temp_s1; - void *temp_s1_2; - void *temp_v0_2; - temp_v0 = gCurrentCourseId; - if ((temp_v0 != 0x10) && (temp_v0 != 0xD) && (sp54 = random_int(0x168) - 0xB4, sp4C = random_int(6), sp44 = random_int(6), sp48 = random_int(3), (arg0 == gPlayerOne))) { - if ((arg1 == 0) && ((temp_v0_2 = arg0 + (arg2 * 0x48), (temp_v0_2->unk546 > 0)) || (temp_v0_2->unk544 == 0))) { - temp_s0 = arg0 + (arg1 * 0x48); - temp_s1 = temp_s0 + 0x528; - func_8005D794(arg0, temp_s1, 0.0f, 0.0f, 0.0f, 0, 0); - func_8005D7D8(temp_s1, 0xB, 0x3ECCCCCD); - func_8005D800(temp_s1, 0xFFFFFF, 0xFF); - temp_a0 = (sp54 * 0xB6) & 0xFFFF; - sp3C = temp_a0; - temp_s0->unk530 = (coss(temp_a0) * D_800EE588) + arg0->unk1C; - temp_s0->unk528 = (sins(temp_a0) * D_800EE590) + arg0->unk14; - temp_s0->unk52C = (arg0->unk18 - arg0->unk70) + sp4C + 2.0f; - temp_s0->unk540 = sp44 + 1.0f; - temp_s0->unk534 = (sp48 + 2.0f) / 10.0f; - return; - } - if ((arg0 + (arg2 * 0x48))->unk546 > 0) { - temp_s0_2 = arg0 + (arg1 * 0x48); - temp_s1_2 = temp_s0_2 + 0x528; - func_8005D794(arg0, temp_s1_2, 0.0f, 0.0f, 0.0f, 0, 0); - func_8005D7D8(temp_s1_2, 0xB, 0x3ECCCCCD); - func_8005D800(temp_s1_2, 0xFFFFFF, 0xFF); - temp_a0_2 = (sp54 * 0xB6) & 0xFFFF; - sp3C = temp_a0_2; - temp_s0_2->unk530 = (coss(temp_a0_2) * D_800EE598) + arg0->unk1C; - temp_s0_2->unk528 = (sins(temp_a0_2) * D_800EE5A0) + arg0->unk14; - temp_s0_2->unk52C = (arg0->unk18 - arg0->unk70) + sp4C + 2.0f; - temp_s0_2->unk540 = sp44 + 1.0f; - temp_s0_2->unk534 = (sp48 + 2.0f) / 10.0f; - } - // Duplicate return node #9. Try simplifying control flow for better match + if (gCurrentCourseId == COURSE_SKYSCRAPER) return; + if (gCurrentCourseId == COURSE_RAINBOW_ROAD) return; + sp54 = random_int(0x0168U) - 0xB4; + sp4C = random_int(6U); + sp44 = random_int(6U); + sp48 = random_int(3U); + if (player != gPlayerOne) return; + if ((arg1 == 0) && ((player->unk_258[arg2 + 10].unk_01E > 0) || (player->unk_258[arg2 + 10].unk_01C == 0))) { + func_8005D794(player, &player->unk_258[arg1 + 10], 0.0f, 0.0f, 0.0f, (s8) 0, (s8) 0); + func_8005D7D8(&player->unk_258[arg1 + 10], 0x0B, 0.4f); + func_8005D800(&player->unk_258[arg1 + 10], 0x00FFFFFF, 0x00FF); + player->unk_258[arg1 + 10].unk_000[2] = player->pos[2] + (coss(sp54 * 0xB6) * -1.8); + player->unk_258[arg1 + 10].unk_000[0] = player->pos[0] + (sins(sp54 * 0xB6) * -1.8); + player->unk_258[arg1 + 10].unk_000[1] = (player->pos[1] - player->boundingBoxSize) + sp4C + 2.0f; + player->unk_258[arg1 + 10].unk_018 = sp44 + 1.0f; + player->unk_258[arg1 + 10].unk_00C = (sp48 + 2.0f) / 10.0f; + } + else if (player->unk_258[arg2 + 10].unk_01E > 0) { + func_8005D794(player, &player->unk_258[arg1 + 10], 0.0f, 0.0f, 0.0f, (s8) 0, (s8) 0); + func_8005D7D8(&player->unk_258[arg1 + 10], 0x0B, 0.4f); + func_8005D800(&player->unk_258[arg1 + 10], 0x00FFFFFF, 0x00FF); + player->unk_258[arg1 + 10].unk_000[2] = player->pos[2] + (coss(sp54 * 0xB6) * -1.8); + player->unk_258[arg1 + 10].unk_000[0] = player->pos[0] + (sins(sp54 * 0xB6) * -1.8); + player->unk_258[arg1 + 10].unk_000[1] = (player->pos[1] - player->boundingBoxSize) + sp4C + 2.0f; + player->unk_258[arg1 + 10].unk_018 = sp44 + 1.0f; + player->unk_258[arg1 + 10].unk_00C = (sp48 + 2.0f) / 10.0f; } } #else @@ -4618,7 +4273,7 @@ void func_80061094(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { } } -void func_80061130(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { +void func_80061130(Player* player, s16 arg1, UNUSED s32 arg2, UNUSED s8 arg3, UNUSED s8 arg4) { func_8005D794(player, &player->unk_258[arg1], 0.0f, 0.0f, 0.0f, 0, 0); func_8005D7D8(&player->unk_258[arg1], 7, 0.6f); func_8005D800(&player->unk_258[arg1], 0xFFFFFF, 0xD0); @@ -4630,429 +4285,249 @@ void func_80061130(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { player->unk_258[arg1].unk_024 = 0.0f; } -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_80061130(s16, s8, s32); // extern - -void func_80061224(void *arg0, s16 arg1, s32 arg2, s8 arg3, s8 arg4) { - s16 temp_a1; - - temp_a1 = arg1; - if ((arg1 == 0) && (((arg0 + (arg2 * 0x48))->unk276 > 0) || ((arg0 + (arg1 * 0x48))->unk274 == 0))) { - func_80061130(temp_a1, arg3, arg4); - return; +void func_80061224(Player *player, s16 arg1, s32 arg2, s8 arg3, s8 arg4) { + if ((arg1 == 0) && ((player->unk_258[arg2].unk_01E > 0) || (player->unk_258[arg1].unk_01C == 0))) { + func_80061130(player, arg1, arg2, arg3, arg4); } - if ((arg0 + (arg2 * 0x48))->unk276 >= 2) { - arg1 = temp_a1; - func_80061130(temp_a1, arg3, arg4); + else if (player->unk_258[arg2].unk_01E >= 2) { + func_80061130(player, arg1, arg2, arg3, arg4); if (arg1 == 9) { - arg0->unk44 = arg0->unk44 & 0xFDFF; + player->unk_044 &= ~0x0200; } } } -#else -GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80061224.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_800612F8(void *arg0, ? arg1, ? arg2, ? arg3) { - f32 temp_f10; - s32 temp_s2; - s32 temp_v0; - void *temp_s0; - void *phi_s0; - s32 phi_s2; - f32 phi_f10; +void func_800612F8(Player *player, s32 arg1, s32 arg2, s32 arg3) { + s32 var_s2; - phi_s0 = arg0; - phi_s2 = 0; - do { - phi_s0->unkAE4 = 1; - phi_s0->unkAF0 = arg0->unk18 + 5.0f; - phi_s0->unkAE8 = phi_s2 - arg0->unk2E; - temp_v0 = random_int(0x64); - temp_f10 = temp_v0; - phi_f10 = temp_f10; - if (temp_v0 < 0) { - phi_f10 = temp_f10 + 4294967296.0f; - } - phi_s0->unkB02 = 0; - phi_s0->unkADA = 1; - phi_s0->unkAE6 = 0; - phi_s0->unkB06 = 0xFF; - temp_s2 = phi_s2 + 0x1C70; - temp_s0 = phi_s0 + 0x48; - temp_s0->unkAA4 = (phi_f10 / 100.0f) + 1.5; - temp_s0->unkA88 = arg0->unk1C; - temp_s0->unkA80 = arg0->unk14; - phi_s0 = temp_s0; - phi_s2 = temp_s2; - } while (temp_s2 != 0x11C60); - arg0->unk46 = arg0->unk46 & 0xFFF7; + for (var_s2 = 0; var_s2 < 10; var_s2++){ + player->unk_258[0x1E + var_s2].unk_01C = 1; + player->unk_258[0x1E + var_s2].unk_028 = player->pos[1] + 5.0f; + player->unk_258[0x1E + var_s2].unk_020 = (0x1C70 * var_s2) - player->unk_02C[1]; + player->unk_258[0x1E + var_s2].unk_024 = (random_int(0x0064U) / 100.0f) + 1.5; + player->unk_258[0x1E + var_s2].unk_03A = 0; + player->unk_258[0x1E + var_s2].unk_012 = 1; + player->unk_258[0x1E + var_s2].unk_01E = 0; + player->unk_258[0x1E + var_s2].unk_03E = 0x00FF; + player->unk_258[0x1E + var_s2].unk_000[2] = player->pos[2]; + player->unk_258[0x1E + var_s2].unk_000[0] = player->pos[0]; + } + player->unk_046 &= ~0x0008; } -#else -GLOBAL_ASM("asm/non_matchings/code_80057C60/func_800612F8.s") -#endif - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern f64 D_800EE5B8; -void func_80061430(void *arg0, ? arg1, ? arg2, ? arg3) { - f32 temp_f10; - f32 temp_f10_2; - f64 temp_f22; - s32 temp_s1; - s32 temp_v0; - s32 temp_v0_2; - void *temp_s0; - void *phi_s0; - s32 phi_s1; - f32 phi_f10; - f32 phi_f10_2; - - temp_f22 = D_800EE5B8; - phi_s0 = arg0; - phi_s1 = 0; - do { - phi_s0->unkAE4 = 1; - phi_s0->unkAF0 = arg0->unk18 - 4.0f; - phi_s0->unkAE8 = phi_s1 - arg0->unk2E; - temp_v0 = random_int(0x64); - temp_f10 = temp_v0; - phi_f10 = temp_f10; - if (temp_v0 < 0) { - phi_f10 = temp_f10 + 4294967296.0f; - } - phi_s0->unkAEC = (phi_f10 / 100.0f) + temp_f22; - temp_v0_2 = random_int(0x64); - temp_f10_2 = temp_v0_2; - phi_f10_2 = temp_f10_2; - if (temp_v0_2 < 0) { - phi_f10_2 = temp_f10_2 + 4294967296.0f; - } - phi_s0->unkB02 = 0; - phi_s0->unkADA = 9; - phi_s0->unkAE6 = 0; - phi_s0->unkB06 = 0xFF; - temp_s1 = phi_s1 + 0x1C70; - temp_s0 = phi_s0 + 0x48; - temp_s0->unkAA4 = (phi_f10_2 / 100.0f) + 1.5; - temp_s0->unkA88 = arg0->unk1C; - temp_s0->unkA80 = arg0->unk14; - phi_s0 = temp_s0; - phi_s1 = temp_s1; - } while (temp_s1 != 0xC710); - arg0->unk44 = arg0->unk44 & 0xEFFF; +#ifdef NEEDS_RODATA +// data_0DD0A0_3_0.s +extern f64 D_800EE5B8;// = 1.9; +void func_80061430(Player *player, s32 arg1, s32 arg2, s32 arg3) { + s32 var_s2; + + for (var_s2 = 0; var_s2 < 7; var_s2++){ + player->unk_258[0x1E + var_s2].unk_01C = 1; + player->unk_258[0x1E + var_s2].unk_028 = player->pos[1] - 4.0f; + player->unk_258[0x1E + var_s2].unk_020 = (0x1C70 * var_s2) - player->unk_02C[1]; + // ??? + player->unk_258[0x1E + var_s2].unk_024 = (random_int(0x0064U) / 100.0f) + 1.9; + player->unk_258[0x1E + var_s2].unk_024 = (random_int(0x0064U) / 100.0f) + 1.5; + player->unk_258[0x1E + var_s2].unk_03A = 0; + player->unk_258[0x1E + var_s2].unk_012 = 9; + player->unk_258[0x1E + var_s2].unk_01E = 0; + player->unk_258[0x1E + var_s2].unk_03E = 0x00FF; + player->unk_258[0x1E + var_s2].unk_000[2] = player->pos[2]; + player->unk_258[0x1E + var_s2].unk_000[0] = player->pos[0]; + } + player->unk_044 &= ~0x1000; } #else GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80061430.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern s32 D_800E4848; -extern f32 D_800EE5C0; +#ifdef NEEDS_RODATA +// data_0DD0A0_2.s +extern f32 D_800E4848[0xA];// = { -182.0f, 182.0f, 364.0f, -364.0f, 546.0f, -546.0f, 728.0f, -728.0f, 910.0f, -910.0f }; -void func_800615AC(void *arg0, s16 arg1, ? arg2, ? arg3) { - ? sp28; - void *sp24; - ? *temp_t6; +void func_800615AC(Player *player, s16 arg1, s32 arg2, s32 arg3) { + s32 test = 2; + s32 stackPadding0; + s32 stackPadding1; f32 temp_f0; - s32 *temp_t7; - void *temp_v1; - s32 *phi_t7; - ? *phi_t6; - - phi_t7 = &D_800E4848; - phi_t6 = &sp28; - do { - temp_t7 = phi_t7 + 0xC; - temp_t6 = phi_t6 + 0xC; - temp_t6->unk-C = *phi_t7; - temp_t6->unk-8 = temp_t7->unk-8; - temp_t6->unk-4 = temp_t7->unk-4; - phi_t7 = temp_t7; - phi_t6 = temp_t6; - } while (temp_t7 != (&D_800E4848 + 0x24)); - temp_t6->unk0 = temp_t7->unk0; - temp_v1 = arg0 + (arg1 * 0x48); - if (random_int(3) == 2.0f) { - temp_v1->unkAE4 = 1; - temp_v1->unkAC8 = arg0->unk14; - temp_v1->unkAD0 = arg0->unk1C; - temp_v1->unkAE8 = (sp + (arg1 * 4))->unk28 + -arg0->unk2E; - sp24 = temp_v1; - temp_v1->unkAE0 = random_int(1) + 2.0f; - temp_f0 = random_int(4) - 2; - temp_v1->unkADC = temp_f0; - temp_v1->unkACC = arg0->unk18 + temp_f0; - temp_v1->unkADA = 5; - temp_v1->unkAE6 = 0; - temp_v1->unkB06 = 0xFF; - temp_v1->unkB00 = 0; - temp_v1->unkAD4 = D_800EE5C0; + f32 sp28[10] = { -182.0f, 182.0f, 364.0f, -364.0f, 546.0f, -546.0f, 728.0f, -728.0f, 910.0f, -910.0f }; + + if (random_int(3U) == 2.0f) { + player->unk_258[0x1E + arg1].unk_01C = 1; + player->unk_258[0x1E + arg1].unk_000[0] = player->pos[0]; + player->unk_258[0x1E + arg1].unk_000[2] = player->pos[2]; + player->unk_258[0x1E + arg1].unk_020 = -player->unk_02C[1] + sp28[arg1]; + player->unk_258[0x1E + arg1].unk_018 = random_int(1U) + 2.0f; + temp_f0 = random_int(4U); + temp_f0 -= test; + player->unk_258[0x1E + arg1].unk_014 = temp_f0; + player->unk_258[0x1E + arg1].unk_000[1] = player->pos[1] + temp_f0; + player->unk_258[0x1E + arg1].unk_00C = 0.15f; + player->unk_258[0x1E + arg1].unk_012 = 5; + player->unk_258[0x1E + arg1].unk_01E = 0; + player->unk_258[0x1E + arg1].unk_03E = 0x00FF; + player->unk_258[0x1E + arg1].unk_038 = 0; } } #else GLOBAL_ASM("asm/non_matchings/code_80057C60/func_800615AC.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8005D794(void *, s32, f32, f32, f32, s32, s32); // extern -void func_8005D7D8(s32, ?, ?); // extern -void func_8005D800(s32, ?, ?); // extern -f32 sins(s32); // extern -f32 coss(s32); // extern - -void func_80061754(void *arg0, s16 arg1, ? arg2, ? arg3) { +void func_80061754(Player *player, s16 arg1, s32 arg2, s32 arg3, s32 arg4) { s32 sp54; + s16 temp_s1; s32 sp4C; f32 sp48; f32 sp44; - s32 sp3C; - s16 temp_s1; - s32 temp_a1; - s32 temp_s1_2; - s32 temp_v1; - void *temp_s0; - - sp54 = random_int(0x168) - 0xB4; - sp4C = random_int(6); - temp_s1 = random_int(0x60); - sp44 = random_int(6); - temp_s0 = arg0 + (arg1 * 0x48); - temp_a1 = temp_s0 + 0xAC8; - sp48 = random_int(2); - sp3C = temp_a1; - func_8005D794(arg0, temp_a1, 0.0f, 0.0f, 0.0f, 0, 0); - func_8005D7D8(sp3C, 6, 0x3F800000); - temp_v1 = arg0->unkBC; - if (((temp_v1 << 6) < 0) || ((temp_v1 << 7) < 0) || ((temp_v1 & 0x400) != 0) || (temp_v1 & 0x80000000)) { - func_8005D800(sp3C, 0xFFFFFF, 0xA0); - temp_s0->unkB00 = temp_s0->unkB00 - temp_s1; - temp_s0->unkB02 = temp_s0->unkB02 - temp_s1; - temp_s0->unkB04 = temp_s0->unkB04 - temp_s1; + + sp54 = random_int(0x0168U) - 0xB4; + sp4C = random_int(6U); + temp_s1 = random_int(0x0060U); + sp44 = random_int(6U); + sp48 = random_int(2U); + func_8005D794(player, &player->unk_258[0x1E + arg1], 0.0f, 0.0f, 0.0f, (s8) 0, (s8) 0); + func_8005D7D8(&player->unk_258[0x1E + arg1], 6, 1.0f); + /* + Exactly 3 of the player->unk_0BC references here must be needlessly XOR'd with 0, otherwise player->unk_0BC is erroneously + saved to $v0 instead of $v1. + ALTERNATIVELY + Changing the return type of func_8005D7D8 to some non-void type will also fix the mismatch. However, that is a nonseical + solution as func_8005D7D8 is supposed to be a void return type + */ + if ((player->unk_0BC & 0x02000000) || ((player->unk_0BC ^ 0) & 0x01000000) || ((player->unk_0BC ^ 0) & 0x400) || ((player->unk_0BC ^ 0) & 0x80000000)) { + func_8005D800(&player->unk_258[0x1E + arg1], 0x00FFFFFF, 0x00A0); + player->unk_258[0x1E + arg1].unk_038 -= temp_s1; + player->unk_258[0x1E + arg1].unk_03A -= temp_s1; + player->unk_258[0x1E + arg1].unk_03C -= temp_s1; } else { - func_8005D800(sp3C, 0, 0xA0); - temp_s0->unkB00 = temp_s0->unkB00 + temp_s1; - temp_s0->unkB02 = temp_s0->unkB02 + temp_s1; - temp_s0->unkB04 = temp_s0->unkB04 + temp_s1; - } - temp_s1_2 = (sp54 * 0xB6) & 0xFFFF; - temp_s0->unkAD0 = (coss(temp_s1_2 & 0xFFFF) * -5.0f) + arg0->unk1C; - temp_s0->unkAC8 = (sins(temp_s1_2 & 0xFFFF) * -5.0f) + arg0->unk14; - temp_s0->unkACC = (arg0->unk18 - arg0->unk70) + sp4C + 2.0f; - temp_s0->unkAE0 = sp44 + 1.0f; - temp_s0->unkAD4 = sp48 + 1.0f; + func_8005D800(&player->unk_258[0x1E + arg1], 0, 0x00A0); + player->unk_258[0x1E + arg1].unk_038 += temp_s1; + player->unk_258[0x1E + arg1].unk_03A += temp_s1; + player->unk_258[0x1E + arg1].unk_03C += temp_s1; + } + player->unk_258[0x1E + arg1].unk_000[2] = player->pos[2] + (coss(sp54 * 0xB6) * -5.0f); + player->unk_258[0x1E + arg1].unk_000[0] = player->pos[0] + (sins(sp54 * 0xB6) * -5.0f); + player->unk_258[0x1E + arg1].unk_000[1] = (player->pos[1] - player->boundingBoxSize) + sp4C + 2.0f; + player->unk_258[0x1E + arg1].unk_018 = sp44 + 1.0f; + player->unk_258[0x1E + arg1].unk_00C = sp48 + 1.0f; } -#else -GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80061754.s") -#endif - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_80061754(s16, s8, s32); // extern -void func_8006199C(s32 arg0, s16 arg1, s32 arg2, s8 arg3, s8 arg4) { - void *temp_v0; - - if ((arg1 == 0) && ((temp_v0 = arg0 + (arg2 * 0x48), (temp_v0->unkAE6 > 0)) || (temp_v0->unkAE4 == 0))) { - func_80061754(arg1, arg3, arg4); - return; - } - if ((arg0 + (arg2 * 0x48))->unkAE6 > 0) { - func_80061754(arg1, arg3, arg4); +void func_8006199C(Player *player, s16 arg1, s32 arg2, s8 arg3, s8 arg4) { + if ((arg1 == 0) && ((player->unk_258[0x1E + arg2].unk_01E > 0) || (player->unk_258[0x1E + arg2].unk_01C == 0))) { + func_80061754(player, arg1, arg2, (s32) arg3, arg4); + } else if (player->unk_258[0x1E + arg2].unk_01E > 0) { + func_80061754(player, arg1, arg2, (s32) arg3, arg4); } } -#else -GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006199C.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8005D794(void *, void *, f32, f32, f32, s32, s32); // extern -void func_8005D7D8(void *, ?, ?); // extern -void func_8005D800(void *, ?, ?); // extern -f32 sins(s32); // extern -f32 coss(s32); // extern - -void func_80061A34(void *arg0, s16 arg1, s32 arg2, ? arg3) { +void func_80061A34(Player *player, s16 arg1, s32 arg2, s32 arg3) { s32 sp54; + s32 stackPadding0; s32 sp4C; f32 sp48; - s32 sp3C; - s32 temp_a0; - s32 temp_a0_2; - void *temp_s0; - void *temp_s0_2; - void *temp_s1; - void *temp_s1_2; - void *temp_v0; - - sp54 = random_int(0x168) - 0xB4; - sp4C = random_int(6); - random_int(6); - sp48 = random_int(3); - if ((arg1 == 0) && ((temp_v0 = arg0 + (arg2 * 0x48), (temp_v0->unkAE6 > 0)) || (temp_v0->unkAE4 == 0))) { - temp_s0 = arg0 + (arg1 * 0x48); - temp_s1 = temp_s0 + 0xAC8; - func_8005D794(arg0, temp_s1, 0.0f, 0.0f, 0.0f, 0, 0); - func_8005D7D8(temp_s1, 7, 0x3F800000); - func_8005D800(temp_s1, 0xFFFFFF, 0xFF); - temp_a0 = (sp54 * 0xB6) & 0xFFFF; - sp3C = temp_a0; - temp_s0->unkAD0 = (coss(temp_a0) * -2.0) + arg0->unk1C; - temp_s0->unkAC8 = (sins(temp_a0) * -2.0) + arg0->unk14; - temp_s0->unkACC = (arg0->unk18 - arg0->unk70) + sp4C + 2.0f; - temp_s0->unkAD4 = (sp48 + 2.0f) / 10.0f; - return; - } - if ((arg0 + (arg2 * 0x48))->unkAE6 > 0) { - temp_s0_2 = arg0 + (arg1 * 0x48); - temp_s1_2 = temp_s0_2 + 0xAC8; - func_8005D794(arg0, temp_s1_2, 0.0f, 0.0f, 0.0f, 0, 0); - func_8005D7D8(temp_s1_2, 7, 0x3F800000); - func_8005D800(temp_s1_2, 0xFFFFFF, 0xFF); - temp_a0_2 = (sp54 * 0xB6) & 0xFFFF; - sp3C = temp_a0_2; - temp_s0_2->unkAD0 = (coss(temp_a0_2) * -2.0) + arg0->unk1C; - temp_s0_2->unkAC8 = (sins(temp_a0_2) * -2.0) + arg0->unk14; - temp_s0_2->unkACC = (arg0->unk18 - arg0->unk70) + sp4C + 2.0f; - temp_s0_2->unkAD4 = (sp48 + 2.0f) / 10.0f; + s32 stackPadding1; + + sp54 = random_int(0x0168U) - 0xB4; + sp4C = random_int(6U); + random_int(6U); + sp48 = (f32) random_int(3U); + if ((arg1 == 0) && ((player->unk_258[0x1E + arg2].unk_01E > 0) || (player->unk_258[0x1E + arg2].unk_01C == 0))) { + func_8005D794(player, &player->unk_258[0x1E + arg1], 0.0f, 0.0f, 0.0f, (s8) 0, (s8) 0); + func_8005D7D8(&player->unk_258[0x1E + arg1], 7, 1.0f); + func_8005D800(&player->unk_258[0x1E + arg1], 0x00FFFFFF, 0x00FF); + player->unk_258[0x1E + arg1].unk_000[2] = player->pos[2] + (coss(sp54 * 0xB6) * -2.0); + player->unk_258[0x1E + arg1].unk_000[0] = player->pos[0] + (sins(sp54 * 0xB6) * -2.0); + player->unk_258[0x1E + arg1].unk_000[1] = (player->pos[1] - player->boundingBoxSize) + sp4C + 2.0f; + player->unk_258[0x1E + arg1].unk_00C = (sp48 + 2.0f) / 10.0f; + } else if (player->unk_258[0x1E + arg2].unk_01E > 0) { + func_8005D794(player, &player->unk_258[0x1E + arg1], 0.0f, 0.0f, 0.0f, (s8) 0, (s8) 0); + func_8005D7D8(&player->unk_258[0x1E + arg1], 7, 1.0f); + func_8005D800(&player->unk_258[0x1E + arg1], 0x00FFFFFF, 0x00FF); + player->unk_258[0x1E + arg1].unk_000[2] = player->pos[2] + (coss(sp54 * 0xB6) * -2.0); + player->unk_258[0x1E + arg1].unk_000[0] = player->pos[0] + (sins(sp54 * 0xB6) * -2.0); + player->unk_258[0x1E + arg1].unk_000[1] = (player->pos[1] - player->boundingBoxSize) + (f32) sp4C + 2.0f; + player->unk_258[0x1E + arg1].unk_00C = (sp48 + 2.0f) / 10.0f; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80061A34.s") -#endif - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern s32 D_800E4870; -extern f32 D_800EE5C4; - -void func_80061D4C(void *arg0, s16 arg1, ? arg2, ? arg3) { - ? sp20; - void *sp1C; - ? *temp_t6; - s32 *temp_t7; - void *temp_v1; - s32 *phi_t7; - ? *phi_t6; - phi_t7 = &D_800E4870; - phi_t6 = &sp20; - do { - temp_t7 = phi_t7 + 0xC; - temp_t6 = phi_t6 + 0xC; - temp_t6->unk-C = *phi_t7; - temp_t6->unk-8 = temp_t7->unk-8; - temp_t6->unk-4 = temp_t7->unk-4; - phi_t7 = temp_t7; - phi_t6 = temp_t6; - } while (temp_t7 != (&D_800E4870 + 0x24)); - temp_t6->unk0 = temp_t7->unk0; - arg0 = arg0; - temp_v1 = arg0 + (arg1 * 0x48); - if (random_int(3) == 2.0f) { - temp_v1->unkAE4 = 1; - temp_v1->unkAC8 = arg0->unk14; - temp_v1->unkACC = arg0->unk18 + 2.0f; - temp_v1->unkAD0 = arg0->unk1C; - temp_v1->unkAE8 = (sp + (arg1 * 4))->unk20 + -arg0->unk2E; - sp1C = temp_v1; - temp_v1->unkAE0 = random_int(3) + 2.0f; - temp_v1->unkADC = random_int(4) - 2; - temp_v1->unkADA = 2; - temp_v1->unkAE6 = 0; - temp_v1->unkB06 = 0xFF; - temp_v1->unkAD4 = D_800EE5C4; +#ifdef NEEDS_RODATA +// data_0DD0A0_2.s +extern f32 D_800E4870[0xA];// = { -182.0f, 182.0f, 364.0f, -364.0f, 546.0f, -546.0f, 728.0f, -728.0f, 910.0f, -910.0f }; + +void func_80061D4C(Player *player, s16 arg1, s32 arg2, s32 arg3) { + s32 test = 2; + s32 stackPadding0; + s32 stackPadding1; + s32 stackPadding2; + f32 sp20[10] = { -182.0f, 182.0f, 364.0f, -364.0f, 546.0f, -546.0f, 728.0f, -728.0f, 910.0f, -910.0f }; + + if (random_int(3U) == 2.0f) { + player->unk_258[0x1E + arg1].unk_01C = 1; + player->unk_258[0x1E + arg1].unk_000[0] = player->pos[0]; + player->unk_258[0x1E + arg1].unk_000[1] = player->pos[1] + 2.0f; + player->unk_258[0x1E + arg1].unk_000[2] = player->pos[2]; + player->unk_258[0x1E + arg1].unk_020 = -player->unk_02C[1] + sp20[arg1]; + player->unk_258[0x1E + arg1].unk_018 = random_int(3U) + 2.0f; + player->unk_258[0x1E + arg1].unk_014 = random_int(4U); + player->unk_258[0x1E + arg1].unk_014 -= test; + player->unk_258[0x1E + arg1].unk_00C = 0.4f; + player->unk_258[0x1E + arg1].unk_012 = 2; + player->unk_258[0x1E + arg1].unk_01E = 0; + player->unk_258[0x1E + arg1].unk_03E = 0x00FF; } } #else GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80061D4C.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8005D794(void *, void *, f32, f32, f32, s32, s32); // extern -void func_8005D7D8(void *, ?, ?); // extern -void func_8005D800(void *, ?, ?); // extern -f32 sins(s32); // extern -f32 coss(s32); // extern - -void func_80061EF4(void *arg0, s16 arg1, s32 arg2, ? arg3) { - s32 sp48; - s32 sp44; - f32 sp3C; - void *sp30; +void func_80061EF4(Player *player, s16 arg1, s32 arg2, s32 arg3) { + s32 stackPadding0; + s32 var_t0 = 0x000000FF; + s32 var_t1; s32 temp_v1; - void *temp_a1; - void *temp_a1_2; - void *temp_s0; - void *temp_s0_2; - void *temp_v0; - s32 phi_t0; - f32 phi_f2; - s32 phi_t1; + f32 var_f2; + s32 stackPadding1; - sp48 = 0xFF; - temp_v1 = random_int(8) & 1; - phi_t0 = 0xFF; + if(1) {}; + temp_v1 = random_int(8U) & 1; if (temp_v1 == 1) { - sp44 = 1; - sp3C = arg0->unk18; - phi_t0 = 0; + var_t1 = 1; + var_t0 = 0; + var_f2 = player->pos[1]; } - phi_f2 = sp3C; - phi_t1 = sp44; if (temp_v1 == 0) { - phi_t0 = 0; - phi_f2 = arg0->unk18; - phi_t1 = 0; - } - if (phi_t0 == 0) { - if ((arg1 == 0) && ((temp_v0 = arg0 + (arg2 * 0x48), (temp_v0->unkAE6 > 0)) || (temp_v0->unkAE4 == 0))) { - temp_s0 = arg0 + (arg1 * 0x48); - temp_a1 = temp_s0 + 0xAC8; - sp30 = temp_a1; - func_8005D794(arg0, temp_a1, 0.0f, phi_f2, 0.0f, phi_t0, phi_t1); - func_8005D7D8(sp30, 3, 0x3F000000); - func_8005D800(sp30, 0xFFFFFF, 0x60); - temp_s0->unkAE8 = 0; - if (temp_s0->unkAD8 == 1) { - temp_s0->unkAE8 = temp_s0->unkAE8 + 0x888; + var_t1 = 0; + var_t0 = 0; + var_f2 = player->pos[1]; + } + if (var_t0 == 0) { + if ((arg1 == 0) && ((player->unk_258[0x1E + arg2].unk_01E > 0) || (player->unk_258[0x1E + arg2].unk_01C == 0))) { + func_8005D794(player, &player->unk_258[0x1E + arg1], 0.0f, var_f2, 0.0f, (s8) var_t0, (s8) var_t1); + func_8005D7D8(&player->unk_258[0x1E + arg1], 3, 0.5f); + func_8005D800(&player->unk_258[0x1E + arg1], 0x00FFFFFF, 0x0060); + player->unk_258[0x1E + arg1].unk_020 = 0; + if (player->unk_258[0x1E + arg1].unk_010 == 1) { + player->unk_258[0x1E + arg1].unk_020 += 0x888; } else { - temp_s0->unkAE8 = temp_s0->unkAE8 - 0x888; - } - temp_s0->unkAD0 = (coss(((temp_s0->unkAE8 - arg0->unk2E) - arg0->unkC0) & 0xFFFF) * 5.0f) + arg0->unk1C; - temp_s0->unkAC8 = (sins(((temp_s0->unkAE8 - arg0->unk2E) - arg0->unkC0) & 0xFFFF) * 5.0f) + arg0->unk14; - return; - } - if ((arg0 + (arg2 * 0x48))->unkAE6 > 0) { - temp_s0_2 = arg0 + (arg1 * 0x48); - temp_a1_2 = temp_s0_2 + 0xAC8; - sp30 = temp_a1_2; - func_8005D794(arg0, temp_a1_2, 0.0f, phi_f2, 0.0f, phi_t0, phi_t1); - func_8005D7D8(sp30, 3, 0x3F000000); - func_8005D800(sp30, 0xFFFFFF, 0x60); - temp_s0_2->unkAE8 = 0; - if (temp_s0_2->unkAD8 == 1) { - temp_s0_2->unkAE8 = temp_s0_2->unkAE8 + 0x888; + player->unk_258[0x1E + arg1].unk_020 -= 0x888; + } + player->unk_258[0x1E + arg1].unk_000[2] = player->pos[2] + (coss(player->unk_258[0x1E + arg1].unk_020 - player->unk_02C[1] - player->unk_0C0) * 5.0f); + player->unk_258[0x1E + arg1].unk_000[0] = player->pos[0] + (sins(player->unk_258[0x1E + arg1].unk_020 - player->unk_02C[1] - player->unk_0C0) * 5.0f); + } else if (player->unk_258[0x1E + arg2].unk_01E > 0) { + func_8005D794(player, &player->unk_258[0x1E + arg1], 0.0f, var_f2, 0.0f, (s8) var_t0, (s8) var_t1); + func_8005D7D8(&player->unk_258[0x1E + arg1], 3, 0.5f); + func_8005D800(&player->unk_258[0x1E + arg1], 0x00FFFFFF, 0x0060); + player->unk_258[0x1E + arg1].unk_020 = 0; + if (player->unk_258[0x1E + arg1].unk_010 == 1) { + player->unk_258[0x1E + arg1].unk_020 += 0x888; } else { - temp_s0_2->unkAE8 = temp_s0_2->unkAE8 - 0x888; + player->unk_258[0x1E + arg1].unk_020 -= 0x888; } - temp_s0_2->unkAD0 = (coss(((temp_s0_2->unkAE8 - arg0->unk2E) - arg0->unkC0) & 0xFFFF) * 5.0f) + arg0->unk1C; - temp_s0_2->unkAC8 = (sins(((temp_s0_2->unkAE8 - arg0->unk2E) - arg0->unkC0) & 0xFFFF) * 5.0f) + arg0->unk14; + player->unk_258[0x1E + arg1].unk_000[2] = player->pos[2] + (coss(player->unk_258[0x1E + arg1].unk_020 - player->unk_02C[1] - player->unk_0C0) * 5.0f); + player->unk_258[0x1E + arg1].unk_000[0] = player->pos[0] + (sins(player->unk_258[0x1E + arg1].unk_020 - player->unk_02C[1] - player->unk_0C0) * 5.0f); } - // Duplicate return node #17. Try simplifying control flow for better match } } -#else -GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80061EF4.s") -#endif void func_800621BC(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3) { s32 temp_v1; @@ -5125,192 +4600,97 @@ void func_80062484(Player* player, UnkPlayerStruct258* arg1, s32 arg2) { arg1->unk_01E = 0; } -#ifdef MIPS_TO_C -//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 -void func_8005DAD8(void *, s16, ?, ?); /* extern */ -void func_80062484(void *, void *, s32); /* extern */ -s16 gCurrentCourseId; /* unable to generate initializer */ +#ifdef NEEDS_RODATA +// data_0DD0A0_3_0.s +// jpt_800EE5C8 -void func_800624D8(void *arg0, s16 arg1, s8 arg2, s8 arg3) { - s16 temp_v0; - s32 temp_s1; - s32 temp_s1_2; - s32 temp_s1_3; - s32 temp_s1_4; - s32 temp_s1_5; - s32 temp_s1_6; - s32 temp_s1_7; - s32 temp_s1_8; - s32 temp_s1_9; - u16 temp_t6; - void *phi_s0; - s16 phi_v0; - s16 phi_v0_2; - s16 phi_v0_3; - s16 phi_v0_4; - s16 phi_v0_5; - s32 phi_s1; - void *phi_s0_2; - s32 phi_s1_2; - void *phi_s0_3; - s32 phi_s1_3; - void *phi_s0_4; - s32 phi_s1_4; - void *phi_s0_5; - s32 phi_s1_5; - void *phi_s0_6; - s32 phi_s1_6; - void *phi_s0_7; - s32 phi_s1_7; - void *phi_s0_8; - s32 phi_s1_8; - void *phi_s0_9; - s32 phi_s1_9; - s16 phi_t6; - - temp_t6 = arg0->unkF8; - switch (temp_t6) { +void func_800624D8(Player *player, s32 arg1, s32 arg2, s32 arg3) { + s32 var_s1; + + switch (player->unk_0F8) { case 2: - phi_s0 = arg0 + 0xAC8; - phi_s1 = 0; - do { - temp_v0 = gCurrentCourseId; - phi_v0 = temp_v0; - if ((temp_v0 == 1) || (temp_v0 == 7)) { - func_8005DAD8(phi_s0, 1, 0, 0xA8); - phi_v0 = gCurrentCourseId; - } - phi_v0_2 = phi_v0; - if (phi_v0 == 0xB) { - func_8005DAD8(phi_s0, 7, 0, 0xA8); - phi_v0_2 = gCurrentCourseId; - } - phi_v0_3 = phi_v0_2; - if (phi_v0_2 == 9) { - func_8005DAD8(phi_s0, 8, 0, 0xA8); - phi_v0_3 = gCurrentCourseId; - } - phi_v0_4 = phi_v0_3; - if (phi_v0_3 == 0xE) { - func_8005DAD8(phi_s0, 9, 0, 0xA8); - phi_v0_4 = gCurrentCourseId; - } - phi_v0_5 = phi_v0_4; - if (phi_v0_4 == 4) { - func_8005DAD8(phi_s0, 0xA, 0, 0xA8); - phi_v0_5 = gCurrentCourseId; - } - if (phi_v0_5 == 0x12) { - func_8005DAD8(phi_s0, 0xB, 0, 0xA8); - } - func_80062484(arg0, phi_s0, phi_s1); - temp_s1 = phi_s1 + 1; - phi_s0 += 0x48; - phi_s1 = temp_s1; - } while (temp_s1 != 0xA); - arg0->unk44 = arg0->unk44 & 0xFEFF; - return; + for (var_s1 = 0; var_s1 < 10; var_s1++) { + if ((gCurrentCourseId == COURSE_CHOCO_MOUNTAIN) || (gCurrentCourseId == COURSE_ROYAL_RACEWAY)) { + func_8005DAD8(&player->unk_258[0x1E + var_s1], 1, 0, 0x00A8); + } + if (gCurrentCourseId == COURSE_KALAMARI_DESERT) { + func_8005DAD8(&player->unk_258[0x1E + var_s1], 7, 0, 0x00A8); + } + if (gCurrentCourseId == COURSE_MOO_MOO_FARM) { + func_8005DAD8(&player->unk_258[0x1E + var_s1], 8, 0, 0x00A8); + } + if (gCurrentCourseId == COURSE_WARIO_STADIUM) { + func_8005DAD8(&player->unk_258[0x1E + var_s1], 9, 0, 0x00A8); + } + if (gCurrentCourseId == COURSE_YOSHI_VALLEY) { + func_8005DAD8(&player->unk_258[0x1E + var_s1], 0x000A, 0, 0x00A8); + } + if (gCurrentCourseId == COURSE_DK_JUNGLE) { + func_8005DAD8(&player->unk_258[0x1E + var_s1], 0x000B, 0, 0x00A8); + } + func_80062484(player, &player->unk_258[0x1E + var_s1], var_s1); + } + player->unk_044 &= ~0x0100; + break; case 8: - phi_s0_2 = arg0 + 0xAC8; - phi_s1_2 = 0; - do { - func_8005DAD8(phi_s0_2, 2, 1, 0xA8); - func_80062484(arg0, phi_s0_2, phi_s1_2); - temp_s1_2 = phi_s1_2 + 1; - phi_s0_2 += 0x48; - phi_s1_2 = temp_s1_2; - } while (temp_s1_2 != 0xA); - arg0->unk44 = arg0->unk44 & 0xFEFF; - return; + for (var_s1 = 0; var_s1 < 10; var_s1++) { + func_8005DAD8(&player->unk_258[0x1E + var_s1], 2, 1, 0x00A8); + func_80062484(player, &player->unk_258[0x1E + var_s1], var_s1); + } + player->unk_044 &= ~0x0100; + break; case 7: - phi_s0_3 = arg0 + 0xAC8; - phi_s1_3 = 0; - do { - func_8005DAD8(phi_s0_3, 2, 1, 0xA8); - func_80062484(arg0, phi_s0_3, phi_s1_3); - temp_s1_3 = phi_s1_3 + 1; - phi_s0_3 += 0x48; - phi_s1_3 = temp_s1_3; - } while (temp_s1_3 != 0xA); - arg0->unk44 = arg0->unk44 & 0xFEFF; - return; + for (var_s1 = 0; var_s1 < 10; var_s1++) { + func_8005DAD8(&player->unk_258[0x1E + var_s1], 2, 1, 0x00A8); + func_80062484(player, &player->unk_258[0x1E + var_s1], var_s1); + } + player->unk_044 &= ~0x0100; + break; case 3: - phi_s0_4 = arg0 + 0xAC8; - phi_s1_4 = 0; - do { - func_8005DAD8(phi_s0_4, 3, 1, 0xA8); - func_80062484(arg0, phi_s0_4, phi_s1_4); - temp_s1_4 = phi_s1_4 + 1; - phi_s0_4 += 0x48; - phi_s1_4 = temp_s1_4; - } while (temp_s1_4 != 0xA); - phi_t6 = arg0->unk44 & 0xFEFF; -block_42: - arg0->unk44 = phi_t6; - return; + for (var_s1 = 0; var_s1 < 10; var_s1++) { + func_8005DAD8(&player->unk_258[0x1E + var_s1], 3, 1, 0x00A8); + func_80062484(player, &player->unk_258[0x1E + var_s1], var_s1); + } + player->unk_044 &= ~0x0100; + break; case 10: - phi_s0_5 = arg0 + 0xAC8; - phi_s1_5 = 0; - do { - func_8005DAD8(phi_s0_5, 4, 1, 0xA8); - func_80062484(arg0, phi_s0_5, phi_s1_5); - temp_s1_5 = phi_s1_5 + 1; - phi_s0_5 += 0x48; - phi_s1_5 = temp_s1_5; - } while (temp_s1_5 != 0xA); - arg0->unk44 = arg0->unk44 & 0xFEFF; - return; + for (var_s1 = 0; var_s1 < 10; var_s1++) { + func_8005DAD8(&player->unk_258[0x1E + var_s1], 4, 1, 0x00A8); + func_80062484(player, &player->unk_258[0x1E + var_s1], var_s1); + } + player->unk_044 &= ~0x0100; + break; case 13: - phi_s0_6 = arg0 + 0xAC8; - phi_s1_6 = 0; - do { - func_8005DAD8(phi_s0_6, 5, 1, 0xA8); - func_80062484(arg0, phi_s0_6, phi_s1_6); - temp_s1_6 = phi_s1_6 + 1; - phi_s0_6 += 0x48; - phi_s1_6 = temp_s1_6; - } while (temp_s1_6 != 0xA); - arg0->unk44 = arg0->unk44 & 0xFEFF; - return; + for (var_s1 = 0; var_s1 < 10; var_s1++) { + func_8005DAD8(&player->unk_258[0x1E + var_s1], 5, 1, 0x00A8); + func_80062484(player, &player->unk_258[0x1E + var_s1], var_s1); + } + player->unk_044 &= ~0x0100; + break; case 5: case 11: - phi_s0_7 = arg0 + 0xAC8; - phi_s1_7 = 0; - do { - func_8005DAD8(phi_s0_7, 6, 1, 0xA8); - func_80062484(arg0, phi_s0_7, phi_s1_7); - temp_s1_7 = phi_s1_7 + 1; - phi_s0_7 += 0x48; - phi_s1_7 = temp_s1_7; - } while (temp_s1_7 != 0xA); - arg0->unk44 = arg0->unk44 & 0xFEFF; - return; + for (var_s1 = 0; var_s1 < 10; var_s1++) { + func_8005DAD8(&player->unk_258[0x1E + var_s1], 6, 1, 0x00A8); + func_80062484(player, &player->unk_258[0x1E + var_s1], var_s1); + } + player->unk_044 &= ~0x0100; + break; case 1: case 4: case 6: - phi_s0_8 = arg0 + 0xAC8; - phi_s1_8 = 0; - do { - func_8005DAD8(phi_s0_8, 0, 0, 0xA8); - func_80062484(arg0, phi_s0_8, phi_s1_8); - temp_s1_8 = phi_s1_8 + 1; - phi_s0_8 += 0x48; - phi_s1_8 = temp_s1_8; - } while (temp_s1_8 != 0xA); - arg0->unk44 = arg0->unk44 & 0xFEFF; - return; + for (var_s1 = 0; var_s1 < 10; var_s1++) { + func_8005DAD8(&player->unk_258[0x1E + var_s1], 0, 0, 0x00A8); + func_80062484(player, &player->unk_258[0x1E + var_s1], var_s1); + } + player->unk_044 &= ~0x0100; + break; default: - phi_s0_9 = arg0 + 0xAC8; - phi_s1_9 = 0; - do { - func_8005DAD8(phi_s0_9, 0, 0, 0xA8); - func_80062484(arg0, phi_s0_9, phi_s1_9); - temp_s1_9 = phi_s1_9 + 1; - phi_s0_9 += 0x48; - phi_s1_9 = temp_s1_9; - } while (temp_s1_9 != 0xA); - phi_t6 = arg0->unk44 & 0xFEFF; - goto block_42; + for (var_s1 = 0; var_s1 < 10; var_s1++) { + func_8005DAD8(&player->unk_258[0x1E + var_s1], 0, 0, 0x00A8); + func_80062484(player, &player->unk_258[0x1E + var_s1], var_s1); + } + player->unk_044 &= ~0x0100; + break; } } #else @@ -5406,88 +4786,73 @@ void func_80062B18(f32 *arg0, f32 *arg1, f32 *arg2, f32 arg3, f32 arg4, f32 arg5 *arg2 = (coss(arg6) * arg5) + (((arg3 * temp_f20) * sp30) + ((arg4 * sp2C) * sp28)); } -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_80062B18(f32 *, f32 *, f32 *, ?, f32, f32, s32, s32); // extern -extern ? D_800E4898; -extern f64 D_800EE610; -extern f64 D_800EE618; -extern f64 D_800EE620; -extern f64 D_800EE628; -extern f64 D_800EE630; -extern f32 D_800EE638; -extern f32 D_800EE63C; -extern f64 D_800EE640; - -void func_80062C74(void *arg0, s16 arg1, ? arg2, ? arg3) { - ? sp48; +#ifdef NEEDS_RODATA +// data_0DD0A0_2_0.s +// may be plain data? +extern f32 D_800E4898[8];// = { 4.5, 4.5, 4.5, 4.5, 4.5, 5.5, 4.5, 6.5 }; +// data_0DD0A0_3_0.s +extern f64 D_800EE610;// = 0.07; +extern f64 D_800EE618;// = 0.3; +extern f64 D_800EE620;// = 0.1; +extern f64 D_800EE628;// = 0.1; +extern f64 D_800EE630;// = 0.3; +extern f32 D_800EE638;// = 5000.0f; +extern f32 D_800EE63C;// = 6000.0f; +extern f64 D_800EE640;// = 0.06; + + +void func_80062C74(Player *player, s16 arg1, s32 arg2, s32 arg3) { + f32 sp48[8] = { 4.5f, 4.5f, 4.5f, 4.5f, 4.5f, 5.5f, 4.5f, 6.5f }; + f32 var_f6; f32 sp40; f32 sp3C; f32 sp38; - void *sp30; - f64 temp_f2; - u16 temp_t7; - void *temp_v0; - f64 phi_f6; - f64 phi_f2; - - sp48.unk0 = D_800E4898.unk0; - sp48.unk4 = D_800E4898.unk4; - sp48.unk8 = D_800E4898.unk8; - temp_v0 = arg0 + (arg1 * 0x48); - sp48.unkC = D_800E4898.unkC; - sp48.unk10 = D_800E4898.unk10; - sp48.unk14 = D_800E4898.unk14; - sp48.unk18 = D_800E4898.unk18; - sp48.unk1C = D_800E4898.unk1C; - temp_v0->unk276 = temp_v0->unk276 + 1; - if (temp_v0->unk276 == 0xC) { - temp_v0->unk274 = 0; - temp_v0->unk276 = 0; - temp_v0->unk26A = 0; - } - temp_v0->unk270 = 2.0f; - if (temp_v0->unk298 == 0) { - temp_v0->unk264 = temp_v0->unk264 + D_800EE610; - temp_v0->unk27C = temp_v0->unk27C + D_800EE618; - if (temp_v0->unk276 >= 3) { - temp_v0->unk296 = temp_v0->unk296 - 3; - } - if (temp_v0->unk296 <= 0) { - temp_v0->unk296 = 0; - } - phi_f2 = D_800EE620; + s16 thing; + + player->unk_258[arg1].unk_01E += 1; + if (player->unk_258[arg1].unk_01E == 0x000C) { + player->unk_258[arg1].unk_01C = 0; + player->unk_258[arg1].unk_01E = 0; + player->unk_258[arg1].unk_012 = 0; + } + player->unk_258[arg1].unk_018 = 2.0f; + if (player->unk_258[arg1].unk_040 == 0) { + player->unk_258[arg1].unk_00C = player->unk_258[arg1].unk_00C + 0.07; + player->unk_258[arg1].unk_024 = player->unk_258[arg1].unk_024 + 0.3; + if (player->unk_258[arg1].unk_01E >= 3) { + player->unk_258[arg1].unk_03E -= 3; + } + if (player->unk_258[arg1].unk_03E <= 0) { + player->unk_258[arg1].unk_03E = 0; + } } else { - temp_f2 = D_800EE628; - temp_v0->unk264 = temp_v0->unk264 + temp_f2; - temp_v0->unk27C = temp_v0->unk27C + D_800EE630; - phi_f2 = temp_f2; - if (temp_v0->unk276 >= 3) { - temp_v0->unk296 = temp_v0->unk296 - 2; + player->unk_258[arg1].unk_00C = player->unk_258[arg1].unk_00C + 0.1; + player->unk_258[arg1].unk_024 = player->unk_258[arg1].unk_024 + 0.3; + if (player->unk_258[arg1].unk_01E >= 3) { + player->unk_258[arg1].unk_03E -= 2; } - if (temp_v0->unk296 <= 0) { - temp_v0->unk296 = 0; + if (player->unk_258[arg1].unk_03E <= 0) { + player->unk_258[arg1].unk_03E = 0; } } - if (temp_v0->unk298 == 0) { - phi_f6 = -((arg0->unk98 / D_800EE638) + phi_f2); + thing = player->unk_258[arg1].unk_020 - (player->unk_0C0 / 2); + if (player->unk_258[arg1].unk_040 == 0) { + var_f6 = -((player->unk_098 / 5000.0f) + 0.1); } else { - phi_f6 = -((arg0->unk98 / D_800EE63C) + phi_f2); + var_f6 = -((player->unk_098 / 6000.0f) + 0.1); } - if (((arg0->unkBC & 0x2000) == 0x2000) && (temp_v0->unk276 >= 6)) { - temp_v0->unk264 = temp_v0->unk264 + D_800EE640; + if (((player->unk_0BC & 0x2000) == 0x2000) && (player->unk_258[arg1].unk_01E >= 6)) { + player->unk_258[arg1].unk_00C = player->unk_258[arg1].unk_00C + 0.06; } - temp_t7 = temp_v0->unk268 + 1; - temp_v0->unk268 = temp_t7; - if ((temp_t7 & 0xFFFF) >= 3) { - temp_v0->unk268 = 0; + player->unk_258[arg1].unk_010++; + if (player->unk_258[arg1].unk_010 >= 3) { + player->unk_258[arg1].unk_010 = 0; } - sp30 = temp_v0; - func_80062B18(&sp40, &sp38, &sp3C, 0, *(&sp48 + (arg0->unk254 * 4)), (temp_v0->unk276 * phi_f6) + -5.5, -(temp_v0->unk278 - (arg0->unkC0 / 2)), arg0->unk206 * -2); - temp_v0->unk258 = arg0->unk14 + sp40; - sp38 += arg0->unk18 - arg0->unk70; - temp_v0->unk260 = arg0->unk1C + sp3C; - temp_v0->unk25C = temp_v0->unk27C + sp38; + func_80062B18(&sp40, &sp38, &sp3C, 0.0f, sp48[player->characterId], (player->unk_258[arg1].unk_01E * var_f6) + -5.5, -thing, -player->unk_206 * 2); + player->unk_258[arg1].unk_000[0] = player->pos[0] + sp40; + sp38 = (player->pos[1] - player->boundingBoxSize) + sp38; + player->unk_258[arg1].unk_000[2] = player->pos[2] + sp3C; + player->unk_258[arg1].unk_000[1] = player->unk_258[arg1].unk_024 + sp38; } #else GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80062C74.s") @@ -5747,39 +5112,26 @@ void func_80063D58(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { } } -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_80062B18(f32 *, f32 *, f32 *, ?, f32, f32, s32, s32); // extern - -// Separated from asm in code_80057C60/func_80063D58.s -UNUSED void func_80063FBC(void *arg0, s16 arg1, ? arg2, ? arg3) { +void func_80063FBC(Player *player, s16 arg1, s32 arg2, s32 arg3) { f32 sp3C; f32 sp38; f32 sp34; - void *sp30; - void *temp_v0; - temp_v0 = arg0 + (arg1 * 0x48); - if (temp_v0->unk538 == 1) { - sp30 = temp_v0; - func_80062B18(&sp3C, &sp34, &sp38, 0x40400000, 0.0f, (f32) (-5.5 - (f64) ((f32) temp_v0->unk546 * (((arg0->unk94 / 18.0f) * 216.0f) / 15.0f))), -(s32) temp_v0->unk548, 0); + if (player->unk_258[10 + arg1].unk_010 == 1) { + func_80062B18(&sp3C, &sp34, &sp38, 3.0f, 0.0f, -5.5 - (player->unk_258[10 + arg1].unk_01E * (((player->unk_094 / 18.0f) * 216.0f) / 15.0f)), -player->unk_258[10 + arg1].unk_020, 0); } else { - sp30 = temp_v0; - func_80062B18(&sp3C, &sp34, &sp38, 0xC0400000, 0.0f, (f32) (-5.5 - (f64) ((f32) temp_v0->unk546 * (((arg0->unk94 / 18.0f) * 216.0f) / 15.0f))), -(s32) temp_v0->unk548, 0); + func_80062B18(&sp3C, &sp34, &sp38, -3.0f, 0.0f, -5.5 - (player->unk_258[10 + arg1].unk_01E * (((player->unk_094 / 18.0f) * 216.0f) / 15.0f)), -player->unk_258[10 + arg1].unk_020, 0); } - sp30->unk528 = (f32) (arg0->unk14 + sp3C); - sp30->unk530 = (f32) (arg0->unk1C + sp38); - sp30->unk546 = (s16) (sp30->unk546 + 1); - sp30->unk52C = (f32) ((arg0->unk18 - arg0->unk70) + sp34); - if (sp30->unk546 == 6) { - sp30->unk544 = 0; - sp30->unk546 = 0; - sp30->unk53A = 0; + player->unk_258[10 + arg1].unk_000[0] = player->pos[0] + sp3C; + player->unk_258[10 + arg1].unk_000[2] = player->pos[2] + sp38; + player->unk_258[10 + arg1].unk_000[1] = (player->pos[1] - player->boundingBoxSize) + sp34; + player->unk_258[10 + arg1].unk_01E++; + if (player->unk_258[10 + arg1].unk_01E == 6) { + player->unk_258[10 + arg1].unk_01C = 0; + player->unk_258[10 + arg1].unk_01E = 0; + player->unk_258[10 + arg1].unk_012 = 0; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80063FBC.s") -#endif void func_80064184(Player* player, s16 arg1, s8 arg2, UNUSED s8 arg3) { f32 sp44; @@ -5827,52 +5179,40 @@ void func_800643A8(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { player->unk_258[10 + arg1].unk_00C += D_800EE6E8; player->unk_258[10 + arg1].unk_03E -= 8; - if ( player->unk_258[10 + arg1].unk_03E <= 0) { + if (player->unk_258[10 + arg1].unk_03E <= 0) { player->unk_258[10 + arg1].unk_03E = 0; } } -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -f32 sins(u16, s32); // extern -f32 coss(u16); // extern -extern f64 D_800EE6F0; -extern f64 D_800EE6F8; +#ifdef NEEDS_RODATA +// data_0DD0A0_3_0.s +extern f64 D_800EE6F0;// = -0.7; +extern f64 D_800EE6F8;// = 0.2; -void func_800644E8(void *arg0, s16 arg1, ? arg2, ? arg3) { - f32 sp34; - s32 sp2C; - void *sp24; - f64 sp18; - f32 temp_f4; - f64 temp_f2; - f64 temp_f6; - void *temp_v0; +void func_800644E8(Player *player, s16 arg1, s32 arg2, s32 arg3) { + f32 thing2; + s32 stackPadding0; + s32 thing; + s32 stackPadding1; - temp_v0 = arg0 + (arg1 * 0x48); - if (temp_v0->unkAE6 >= 9) { - temp_v0->unkAE6 = 9; - } - temp_f4 = temp_v0->unkAEC; - sp34 = temp_f4; - sp2C = temp_v0->unkAE6; - sp24 = temp_v0; - temp_f2 = D_800EE6F0 * sp2C; - temp_v0->unkAD0 = (coss(temp_v0->unkAE8) * temp_f2) + arg0->unk1C; - sp18 = temp_f2; - temp_f6 = (sins(temp_v0->unkAE8, sp2C) * temp_f2) + arg0->unk14; - temp_v0->unkAE6 = temp_v0->unkAE6 + 1; - temp_v0->unkAC8 = temp_f6; - temp_v0->unkACC = temp_v0->unkAF0 + ((sp2C * temp_f4) - (D_800EE6F8 * (sp2C * sp2C))); - if (temp_v0->unkAE6 == 0xA) { - temp_v0->unkAE6 = 0; - temp_v0->unkAE4 = 0; - temp_v0->unkADA = 0; - } - if (temp_v0->unkAE6 >= 7) { - temp_v0->unkB06 = temp_v0->unkB06 - 0x60; - if (temp_v0->unkB06 <= 0) { - temp_v0->unkB06 = 0; + if (player->unk_258[30 + arg1].unk_01E >= 9) { + player->unk_258[30 + arg1].unk_01E = 9; + } + thing2 = player->unk_258[30 + arg1].unk_024; + thing = player->unk_258[30 + arg1].unk_01E; + player->unk_258[30 + arg1].unk_000[2] = player->pos[2] + (coss(player->unk_258[30 + arg1].unk_020) * (-0.7 * thing)); + player->unk_258[30 + arg1].unk_000[0] = player->pos[0] + (sins(player->unk_258[30 + arg1].unk_020) * (-0.7 * thing)); + player->unk_258[30 + arg1].unk_01E++; + player->unk_258[30 + arg1].unk_000[1] = player->unk_258[30 + arg1].unk_028 + (f32) ((thing * thing2) - (0.2 * (thing * thing))); + if (player->unk_258[30 + arg1].unk_01E == 0x000A) { + player->unk_258[30 + arg1].unk_01E = 0; + player->unk_258[30 + arg1].unk_01C = 0; + player->unk_258[30 + arg1].unk_012 = 0; + } + if (player->unk_258[30 + arg1].unk_01E >= 7) { + player->unk_258[30 + arg1].unk_03E -= 0x60; + if (player->unk_258[30 + arg1].unk_03E <= 0) { + player->unk_258[30 + arg1].unk_03E = 0; } } } @@ -5880,46 +5220,32 @@ void func_800644E8(void *arg0, s16 arg1, ? arg2, ? arg3) { GLOBAL_ASM("asm/non_matchings/code_80057C60/func_800644E8.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -f32 sins(u16); // extern -f32 coss(u16); // extern -extern f64 D_800EE700; -extern f64 D_800EE708; +#ifdef NEEDS_RODATA +// data_0DD0A0_3_0.s +extern f64 D_800EE6F0;// = -0.6; +extern f64 D_800EE6F8;// = 0.1; -void func_80064664(void *arg0, s16 arg1, ? arg2, ? arg3) { - f32 sp34; - s32 sp2C; - void *sp24; - f64 sp18; +void func_80064664(Player *player, s16 arg1, s32 arg2, s32 arg3) { f32 temp_f4; - f64 temp_f2; - f64 temp_f6; - s16 temp_v1; - void *temp_v0; - - temp_v0 = arg0 + (arg1 * 0x48); - temp_f4 = temp_v0->unkAEC; - temp_v1 = temp_v0->unkAE6; - sp34 = temp_f4; - sp24 = temp_v0; - sp2C = temp_v1; - temp_f2 = D_800EE700 * temp_v1; - temp_v0->unkAD0 = (coss(temp_v0->unkAE8) * temp_f2) + arg0->unk1C; - sp18 = temp_f2; - temp_f6 = (sins(temp_v0->unkAE8) * temp_f2) + arg0->unk14; - temp_v0->unkAE6 = temp_v0->unkAE6 + 1; - temp_v0->unkAC8 = temp_f6; - temp_v0->unkACC = temp_v0->unkAF0 + ((temp_v1 * temp_f4) - (D_800EE708 * (temp_v1 * temp_v1))); - if (temp_v0->unkAE6 == 0x19) { - temp_v0->unkAE6 = 0; - temp_v0->unkAE4 = 0; - temp_v0->unkADA = 0; - } - if (temp_v0->unkAE6 >= 7) { - temp_v0->unkB06 = temp_v0->unkB06 - 6; - if (temp_v0->unkB06 <= 0) { - temp_v0->unkB06 = 0; + s32 stackPadding0; + s32 temp_v1; + s32 stackPadding1; + + temp_v1 = player->unk_258[30 + arg1].unk_01E; + temp_f4 = player->unk_258[30 + arg1].unk_024; + player->unk_258[30 + arg1].unk_000[2] = player->pos[2] + (coss(player->unk_258[30 + arg1].unk_020) * (-0.6 * temp_v1)); + player->unk_258[30 + arg1].unk_000[0] = player->pos[0] + (sins(player->unk_258[30 + arg1].unk_020) * (-0.6 * temp_v1)); + player->unk_258[30 + arg1].unk_01E++; + player->unk_258[30 + arg1].unk_000[1] = player->unk_258[30 + arg1].unk_028 + (f32) ((temp_v1 * temp_f4) - (0.1 * (temp_v1 * temp_v1))); + if (player->unk_258[30 + arg1].unk_01E == 0x0019) { + player->unk_258[30 + arg1].unk_01E = 0; + player->unk_258[30 + arg1].unk_01C = 0; + player->unk_258[30 + arg1].unk_012 = 0; + } + if (player->unk_258[30 + arg1].unk_01E >= 7) { + player->unk_258[30 + arg1].unk_03E -= 0x6; + if (player->unk_258[30 + arg1].unk_03E <= 0) { + player->unk_258[30 + arg1].unk_03E = 0; } } } @@ -6157,55 +5483,29 @@ void func_800651F4(Player* player, UNUSED s16 arg1, UNUSED s8 arg2, s8 arg3) { } } -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_80021E10(? *, s32, s32); // extern -void func_80021F84(? *, s32); // extern -void func_80022180(void *, ? *); // extern -extern s16 D_80164AF0; -extern void *gDisplayListHead; - -void func_800652D4(s32 arg0, s32 arg1, s32 arg2) { - ? sp20; - void *temp_v1; +void func_800652D4(Vec3f arg0, Vec3s arg1, f32 arg2) { + Mat4 sp20; - func_80021E10(&sp20, arg0, arg1); - func_80021F84(&sp20, arg2); - func_80022180(gGfxPool + (D_80164AF0 << 6) + 0xFAC0, &sp20); - temp_v1 = gDisplayListHead; - gDisplayListHead = temp_v1 + 8; - temp_v1->unk0 = 0x1020040; - temp_v1->unk4 = (gGfxPool + (D_80164AF0 << 6) + 0xFAC0) & 0x1FFFFFFF; + func_80021E10(sp20, arg0, arg1); + func_80021F84(sp20, arg2); + func_80022180(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB], sp20); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } -#else -GLOBAL_ASM("asm/non_matchings/code_80057C60/func_800652D4.s") -#endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8004B72C(s16, s16, s16, s16, s32, s32, s32); // extern -void func_800652D4(f32 *, s16 *, f32, s8); // extern +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b extern ? D_06000224; -extern Gfx D_0D008DB8; -extern Gfx D_0D008E48; -extern s8 D_0D02BC58; -extern ? D_800E48B8; -extern ? D_800E48C0; -extern f64 D_800EE7C0; -extern s16 D_80164AF0; -extern s32 D_8018D930; -extern f32 gCourseTimer; -extern ? **gDisplayListHead; +extern ? D_8018D930; +static ? D_800E48B8; /* unable to generate initializer */ +static ? D_800E48C0; /* unable to generate initializer */ -void func_8006538C(void *arg0, s8 arg1, s16 arg2, s8 arg3) { +void func_8006538C(Player *player, s8 arg1, s16 arg2, s8 arg3) { f32 spBC; f32 spB8; f32 spB4; s16 spB0; s16 spAE; s16 spAC; - ? spA4; - ? sp9C; s16 sp9A; s16 sp98; s16 sp96; @@ -6213,273 +5513,216 @@ void func_8006538C(void *arg0, s8 arg1, s16 arg2, s8 arg3) { s16 sp92; s16 sp90; s16 sp8E; - ? **sp70; - ? **sp6C; - ? **sp48; - ? **sp44; + Gfx *sp70; + Gfx *sp6C; + Gfx *sp48; + Gfx *sp44; void *sp3C; - ? **temp_v0; - ? **temp_v0_10; - ? **temp_v0_12; - ? **temp_v0_13; - ? **temp_v0_14; - ? **temp_v0_15; - ? **temp_v0_16; - ? **temp_v0_17; - ? **temp_v0_18; - ? **temp_v0_19; - ? **temp_v0_20; - ? **temp_v0_2; - ? **temp_v0_3; - ? **temp_v0_4; - ? **temp_v0_5; - ? **temp_v0_6; - ? **temp_v0_7; - ? **temp_v0_8; - ? **temp_v0_9; + ? *var_s0; + Gfx *temp_v0; + Gfx *temp_v0_10; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_14; + Gfx *temp_v0_15; + Gfx *temp_v0_16; + Gfx *temp_v0_17; + Gfx *temp_v0_18; + Gfx *temp_v0_19; + Gfx *temp_v0_20; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; + s16 temp_a3; s32 temp_v0_11; s32 temp_v1; - s8 temp_t9; void *temp_t0; - ? *phi_s0; - ? **phi_v0; - - spA4.unk0 = D_800E48B8.unk0; - spA4.unk4 = D_800E48B8.unk4; - sp9C.unk0 = D_800E48C0.unk0; - temp_t0 = arg0 + (arg2 * 0x48); - sp9C.unk4 = D_800E48C0.unk4; - if (temp_t0->unk274 == 1) { - spB4 = temp_t0->unk258; - spB8 = temp_t0->unk25C; + + spA4[0].unk0 = D_800E48B8.unk0; + spA4[0].unk4 = (s32) D_800E48B8.unk4; + sp9C[0].unk0 = D_800E48C0.unk0; + temp_t0 = player + (arg2 * 0x48); + sp9C[0].unk4 = (s32) D_800E48C0.unk4; + if (player->unk_258[arg2].unk_01C == 1) { + spB4 = player->unk_258[arg2].unk_000[0]; + spB8 = player->unk_258[arg2].unk_000[1]; spAC = 0; - spBC = temp_t0->unk260; + spBC = player->unk_258[arg2].unk_000[2]; spB0 = 0; - spAE = (arg0 + (arg3 * 2))->unk48; - if (((arg0->unkBC & 0x200) != 0) && ((gCourseTimer - *(&D_8018D930 + (arg1 * 4))) < 9)) { + spAE = player->unk_048[arg3]; + if ((player->unk_0BC & 0x200) && (((s32) gCourseTimer - *(&D_8018D930 + (arg1 * 4))) < 9)) { sp9A = (spA8 >> 0x10) & 0xFF; sp98 = (spA8 >> 8) & 0xFF; sp96 = spA8 & 0xFF; sp92 = (spA0 >> 0x10) & 0xFF; sp90 = (spA0 >> 8) & 0xFF; sp8E = spA0 & 0xFF; - sp94 = temp_t0->unk296; + sp94 = player->unk_258[arg2].unk_03E; sp3C = temp_t0; - func_800652D4(&spB4, &spAC, (temp_t0->unk264 * arg0->unk224) * D_800EE7C0, arg3); + func_800652D4(&spB4, &spAC, (f32) ((f64) (player->unk_258[arg2].unk_00C * player->unk_224) * 1.4)); temp_v0 = gDisplayListHead; gDisplayListHead = temp_v0 + 8; - temp_v0->unk4 = &D_0D008DB8; - temp_v0->unk0 = &D_06000224; + var_s0 = &D_06000224; + temp_v0->words.w1 = (u32) D_0D008DB8; + temp_v0->words.w0 = (u32) &D_06000224; temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0xFD900000; - temp_v0_2->unk4 = (temp_t0->unk268 << 0xA) + &D_0D02BC58; + temp_v0_2->words.w0 = 0xFD900000; + temp_v0_2->words.w1 = (u32) ((sp3C->unk268 << 0xA) + D_0D02BC58); temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0xF5900000; - temp_v0_3->unk4 = 0x7000000; + temp_v0_3->words.w0 = 0xF5900000; + temp_v0_3->words.w1 = 0x07000000; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk0 = 0xE6000000; - temp_v0_4->unk4 = 0; + temp_v0_4->words.w0 = 0xE6000000; + temp_v0_4->words.w1 = 0; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk0 = 0xF3000000; - temp_v0_5->unk4 = 0x71FF200; + temp_v0_5->words.w0 = 0xF3000000; + temp_v0_5->words.w1 = 0x071FF200; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk0 = 0xE7000000; - temp_v0_6->unk4 = 0; + temp_v0_6->words.w0 = 0xE7000000; + temp_v0_6->words.w1 = 0; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; sp70 = temp_v0_7; - temp_v0_7->unk0 = 0xF5880800; - temp_v0_7->unk4 = 0; + temp_v0_7->words.w0 = 0xF5880800; + temp_v0_7->words.w1 = 0; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; sp6C = temp_v0_8; - temp_v0_8->unk0 = 0xF2000000; - sp6C->unk4 = 0x7C07C; - func_8004B72C(sp9A, sp98, sp96, sp92, sp90, sp8E, sp94); + temp_v0_8->words.w0 = 0xF2000000; + sp6C->words.w1 = 0x0007C07C; + func_8004B72C((s32) sp9A, (s32) sp98, (s32) sp96, (s32) sp92, (s32) sp90, (s32) sp8E, (s32) sp94); temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk4 = 3; - temp_v0_9->unk0 = 0xB9000002; + temp_v0_9->words.w1 = 3; + temp_v0_9->words.w0 = 0xB9000002; temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk4 = &D_0D008E48; - phi_s0 = &D_06000224; - phi_v0 = temp_v0_10; + temp_v0_10->words.w1 = (u32) D_0D008E48; } else { - temp_t9 = temp_t0->unk290 * 4; - temp_v0_11 = *(&spA4 + temp_t9); + temp_a3 = player->unk_258[arg2].unk_038; + temp_v0_11 = (&spA4[0])[temp_a3]; sp9A = (temp_v0_11 >> 0x10) & 0xFF; sp98 = (temp_v0_11 >> 8) & 0xFF; sp96 = temp_v0_11 & 0xFF; - temp_v1 = *(&sp9C + temp_t9); + temp_v1 = (&sp9C[0])[temp_a3]; sp92 = (temp_v1 >> 0x10) & 0xFF; sp90 = (temp_v1 >> 8) & 0xFF; sp8E = temp_v1 & 0xFF; - sp94 = temp_t0->unk296; + sp94 = player->unk_258[arg2].unk_03E; sp3C = temp_t0; - func_800652D4(&spB4, &spAC, temp_t0->unk264 * arg0->unk0, temp_t9); + func_800652D4(&spB4, &spAC, player->unk_258[arg2].unk_00C * player->unk0); temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk4 = &D_0D008DB8; - temp_v0_12->unk0 = 0x6000000; + var_s0 = (? *)0x06000000; + temp_v0_12->words.w1 = (u32) D_0D008DB8; + temp_v0_12->words.w0 = (u32) (? *)0x06000000; temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk0 = 0xFD900000; - temp_v0_13->unk4 = (temp_t0->unk268 << 0xA) + &D_0D02BC58; + temp_v0_13->words.w0 = 0xFD900000; + temp_v0_13->words.w1 = (u32) ((sp3C->unk268 << 0xA) + D_0D02BC58); temp_v0_14 = gDisplayListHead; gDisplayListHead = temp_v0_14 + 8; - temp_v0_14->unk0 = 0xF5900000; - temp_v0_14->unk4 = 0x7000000; + temp_v0_14->words.w0 = 0xF5900000; + temp_v0_14->words.w1 = 0x07000000; temp_v0_15 = gDisplayListHead; gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk0 = 0xE6000000; - temp_v0_15->unk4 = 0; + temp_v0_15->words.w0 = 0xE6000000; + temp_v0_15->words.w1 = 0; temp_v0_16 = gDisplayListHead; gDisplayListHead = temp_v0_16 + 8; - temp_v0_16->unk0 = 0xF3000000; - temp_v0_16->unk4 = 0x71FF200; + temp_v0_16->words.w0 = 0xF3000000; + temp_v0_16->words.w1 = 0x071FF200; temp_v0_17 = gDisplayListHead; gDisplayListHead = temp_v0_17 + 8; - temp_v0_17->unk0 = 0xE7000000; - temp_v0_17->unk4 = 0; + temp_v0_17->words.w0 = 0xE7000000; + temp_v0_17->words.w1 = 0; temp_v0_18 = gDisplayListHead; gDisplayListHead = temp_v0_18 + 8; sp48 = temp_v0_18; - temp_v0_18->unk0 = 0xF5880800; - sp48->unk4 = 0; + temp_v0_18->words.w0 = 0xF5880800; + sp48->words.w1 = 0; temp_v0_19 = gDisplayListHead; gDisplayListHead = temp_v0_19 + 8; sp44 = temp_v0_19; - temp_v0_19->unk0 = 0xF2000000; - sp44->unk4 = 0x7C07C; - func_8004B72C(sp9A, sp98, sp96, sp92, sp90, sp8E, sp94); + temp_v0_19->words.w0 = 0xF2000000; + sp44->words.w1 = 0x0007C07C; + func_8004B72C((s32) sp9A, (s32) sp98, (s32) sp96, (s32) sp92, (s32) sp90, (s32) sp8E, (s32) sp94); temp_v0_20 = gDisplayListHead; gDisplayListHead = temp_v0_20 + 8; - temp_v0_20->unk4 = &D_0D008E48; - phi_s0 = 0x6000000; - phi_v0 = temp_v0_20; + temp_v0_20->words.w1 = (u32) D_0D008E48; } - *phi_v0 = phi_s0; - D_80164AF0 = D_80164AF0 + 1; + gDisplayListHead->words.w0 = var_s0; + D_80164AF0 += 1; } } #else GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006538C.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8004B35C(s16, s16, s16, s16); // extern -void func_800652D4(f32 *, s16 *, f32, s8); // extern -extern Gfx D_0D008DB8; -extern Gfx D_0D008E48; -extern s16 D_80164AF0; -extern s32 D_8018D48C; -extern void *gDisplayListHead; - -void func_800658A0(void *arg0, ? arg1, s16 arg2, s8 arg3) { - f32 sp5C; - f32 sp58; - f32 sp54; - s16 sp50; - s16 sp4E; - s16 sp4C; - s16 sp4A; - s16 sp48; - s16 sp46; - s16 sp44; - void *sp24; - f32 *temp_a0; - s16 *temp_a1; - void *temp_v0; - void *temp_v0_10; - void *temp_v0_2; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - void *temp_v0_6; - void *temp_v0_7; - void *temp_v0_8; - void *temp_v0_9; - - temp_v0 = arg0 + (arg2 * 0x48); - if (temp_v0->unk274 == 1) { - temp_a1 = &sp4C; - sp4A = temp_v0->unk290; - sp48 = temp_v0->unk292; - sp46 = temp_v0->unk294; - temp_a0 = &sp54; - sp44 = temp_v0->unk296; - sp54 = temp_v0->unk258; - sp58 = temp_v0->unk25C; - sp4C = 0; - sp5C = temp_v0->unk260; - sp50 = 0; - sp4E = (arg0 + (arg3 * 2))->unk48; - func_800652D4(temp_a0, temp_a1, temp_v0->unk264 * arg0->unk224, arg3); - temp_v0_2 = gDisplayListHead; - gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0x6000000; - temp_v0_2->unk4 = &D_0D008DB8; - temp_v0_3 = gDisplayListHead; - gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0xFD700000; - temp_v0_3->unk4 = D_8018D48C; - temp_v0_4 = gDisplayListHead; - gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x7000000; - temp_v0_4->unk0 = 0xF5700000; - temp_v0_5 = gDisplayListHead; - gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0; - temp_v0_5->unk0 = 0xE6000000; - temp_v0_6 = gDisplayListHead; - gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0x71FF200; - temp_v0_6->unk0 = 0xF3000000; - temp_v0_7 = gDisplayListHead; - gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0; - temp_v0_7->unk0 = 0xE7000000; - temp_v0_8 = gDisplayListHead; - gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0; - temp_v0_8->unk0 = 0xF5680800; - temp_v0_9 = gDisplayListHead; - gDisplayListHead = temp_v0_9 + 8; - sp24 = temp_v0_9; - temp_v0_9->unk4 = 0x7C07C; - temp_v0_9->unk0 = 0xF2000000; - func_8004B35C(sp4A, sp48, sp46, sp44); - temp_v0_10 = gDisplayListHead; - gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk0 = 0x6000000; - temp_v0_10->unk4 = &D_0D008E48; - D_80164AF0 = D_80164AF0 + 1; +void func_800658A0(Player *player, s8 arg1, s16 arg2, s8 arg3) { + Vec3f sp54; + Vec3s sp4C; + s16 red; + s16 green; + s16 blue; + s16 alpha; + + if (player->unk_258[arg2].unk_01C == 1) { + red = player->unk_258[arg2].unk_038; + green = player->unk_258[arg2].unk_03A; + blue = player->unk_258[arg2].unk_03C; + alpha = player->unk_258[arg2].unk_03E; + sp54[0] = player->unk_258[arg2].unk_000[0]; + sp54[1] = player->unk_258[arg2].unk_000[1]; + sp54[2] = player->unk_258[arg2].unk_000[2]; + sp4C[0] = 0; + sp4C[1] = player->unk_048[arg3]; + sp4C[2] = 0; + func_800652D4(sp54, sp4C, player->unk_258[arg2].unk_00C * player->unk_224); + gSPDisplayList(gDisplayListHead++, D_0D008DB8); + gDPLoadTextureBlock(gDisplayListHead++, D_8018D48C, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + func_8004B35C(red, green, blue, alpha); + gSPDisplayList(gDisplayListHead++, D_0D008E48); + D_80164AF0 += 1; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80057C60/func_800658A0.s") -#endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8004B72C(s16, s16, s16, s16, s32, s32, s32); // extern -void func_800652D4(f32 *, s16 *, f32, s8); // extern -extern Gfx D_0D008DB8; -extern Gfx D_0D008DF8; -extern Gfx D_0D008E48; -extern ? D_800E4770; -extern ? D_800E48C8; -extern s16 D_80164AF0; -extern s32 *gDisplayListHead; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800652D4(f32 *, s16 *, f32, s8); /* extern */ +extern u32 D_8018D420; +extern u32 D_8018D424; +extern u32 D_8018D428; +extern u32 D_8018D42C; +extern u32 D_8018D430; +extern u32 D_8018D434; +static u32 *D_800E4770[0xC] = { + &D_8018D420, + &D_8018D424, + &D_8018D428, + &D_8018D428, + &D_8018D42C, + &D_8018D42C, + &D_8018D430, + &D_8018D430, + &D_8018D434, + &D_8018D434, + &D_8018D434, + &D_8018D434, +}; +static ? D_800E48C8; /* unable to generate initializer */ -void func_80065AB0(void *arg0, ? arg1, s16 arg2, s8 arg3) { +void func_80065AB0(Player *player, s32 arg1, s16 arg2, s8 arg3) { f32 spBC; f32 spB8; f32 spB4; @@ -6493,51 +5736,48 @@ void func_80065AB0(void *arg0, ? arg1, s16 arg2, s8 arg3) { s16 sp9E; s16 sp9C; s16 sp9A; - ? sp8C; - s32 *sp6C; - s32 *sp44; - f32 *temp_a0; - s16 *temp_a1; - 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_16; - s32 *temp_v0_17; - s32 *temp_v0_18; - s32 *temp_v0_19; - s32 *temp_v0_20; - s32 *temp_v0_21; - 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; + RGBA16 sp8C[3] = { + {{0x00, 0xFF, 0xFF, 0xFF}}, + {{0x00, 0xFF, 0xFF, 0x00}}, + {{0x00, 0xFF, 0x96, 0x00}}, + }; + Gfx *sp6C; + Gfx *sp44; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_14; + Gfx *temp_v0_15; + Gfx *temp_v0_16; + Gfx *temp_v0_17; + Gfx *temp_v0_18; + Gfx *temp_v0_19; + Gfx *temp_v0_20; + Gfx *temp_v0_21; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; s32 temp_v0; + s32 var_s0; void *temp_v1; - s32 phi_s0; - sp8C.unk0 = D_800E48C8.unk0; - sp8C.unk4 = D_800E48C8.unk4; - sp8C.unk8 = D_800E48C8.unk8; - temp_v1 = arg0 + (arg2 * 0x48); + temp_v1 = player + (arg2 * 0x48); if (temp_v1->unk544 == 1) { - phi_s0 = 0; - if (arg0->unk204 >= 0x32) { - phi_s0 = 1; + var_s0 = 0; + if (player->unk_204 >= 0x32) { + var_s0 = 1; } - temp_a0 = &spB4; spA6 = temp_v1->unk560; spA4 = temp_v1->unk562; spA2 = temp_v1->unk564; spA0 = temp_v1->unk566; - temp_v0 = *(&sp8C + (temp_v1->unk568 * 4)); - temp_a1 = &spAC; + temp_v0 = (&sp8C[0])[temp_v1->unk568]; sp9E = (temp_v0 >> 0x10) & 0xFF; sp9C = (temp_v0 >> 8) & 0xFF; sp9A = temp_v0 & 0xFF; @@ -6546,96 +5786,22 @@ void func_80065AB0(void *arg0, ? arg1, s16 arg2, s8 arg3) { spAC = 0; spBC = temp_v1->unk530; spB0 = 0; - spAE = (arg0 + (arg3 * 2))->unk48; - func_800652D4(temp_a0, temp_a1, temp_v1->unk534 * arg0->unk224, arg3); - if (phi_s0 == 0) { - temp_v0_2 = gDisplayListHead; - gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0x6000000; - temp_v0_2->unk4 = &D_0D008DB8; - temp_v0_3 = gDisplayListHead; - gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0xFD900000; - temp_v0_3->unk4 = **(&D_800E4770 + (phi_s0 * 4)); - temp_v0_4 = gDisplayListHead; - gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk0 = 0xF5900000; - temp_v0_4->unk4 = 0x7000000; - temp_v0_5 = gDisplayListHead; - gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk0 = 0xE6000000; - temp_v0_5->unk4 = 0; - temp_v0_6 = gDisplayListHead; - gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk0 = 0xF3000000; - temp_v0_6->unk4 = 0x707F400; - temp_v0_7 = gDisplayListHead; - gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk0 = 0xE7000000; - temp_v0_7->unk4 = 0; - temp_v0_8 = gDisplayListHead; - gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk0 = 0xF5880400; - temp_v0_8->unk4 = 0; - temp_v0_9 = gDisplayListHead; - gDisplayListHead = temp_v0_9 + 8; - sp6C = temp_v0_9; - temp_v0_9->unk0 = 0xF2000000; - sp6C->unk4 = 0x3C03C; - func_8004B72C(spA6, spA4, spA2, sp9E, sp9C, sp9A, spA0); - temp_v0_10 = gDisplayListHead; - gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk0 = 0xB900031D; - temp_v0_10->unk4 = 0x504A50; - temp_v0_11 = gDisplayListHead; - gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk0 = 0x6000000; - temp_v0_11->unk4 = &D_0D008DF8; + spAE = player->unk_048[arg3]; + func_800652D4(&spB4, &spAC, temp_v1->unk534 * player->unk_224, arg3); + if (var_s0 == 0) { + gSPDisplayList(gDisplayListHead++, D_0D008DB8); + gDPLoadTextureBlock(gDisplayListHead++, D_800E4770[var_s0], G_IM_FMT_I, G_IM_SIZ_8b, 16, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + func_8004B72C((s32) spA6, (s32) spA4, (s32) spA2, (s32) sp9E, (s32) sp9C, (s32) sp9A, (s32) spA0); + gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_XLU_SURF, G_RM_ZB_XLU_SURF2); + gSPDisplayList(gDisplayListHead++, D_0D008DF8); } else { - temp_v0_12 = gDisplayListHead; - gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk0 = 0x6000000; - temp_v0_12->unk4 = &D_0D008DB8; - temp_v0_13 = gDisplayListHead; - gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk0 = 0xFD900000; - temp_v0_13->unk4 = **(&D_800E4770 + (phi_s0 * 4)); - temp_v0_14 = gDisplayListHead; - gDisplayListHead = temp_v0_14 + 8; - temp_v0_14->unk0 = 0xF5900000; - temp_v0_14->unk4 = 0x7000000; - temp_v0_15 = gDisplayListHead; - gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk0 = 0xE6000000; - temp_v0_15->unk4 = 0; - temp_v0_16 = gDisplayListHead; - gDisplayListHead = temp_v0_16 + 8; - temp_v0_16->unk0 = 0xF3000000; - temp_v0_16->unk4 = 0x71FF200; - temp_v0_17 = gDisplayListHead; - gDisplayListHead = temp_v0_17 + 8; - temp_v0_17->unk0 = 0xE7000000; - temp_v0_17->unk4 = 0; - temp_v0_18 = gDisplayListHead; - gDisplayListHead = temp_v0_18 + 8; - temp_v0_18->unk0 = 0xF5880800; - temp_v0_18->unk4 = 0; - temp_v0_19 = gDisplayListHead; - gDisplayListHead = temp_v0_19 + 8; - sp44 = temp_v0_19; - temp_v0_19->unk0 = 0xF2000000; - sp44->unk4 = 0x7C07C; - func_8004B72C(spA6, spA4, spA2, sp9E, sp9C, sp9A, spA0); - temp_v0_20 = gDisplayListHead; - gDisplayListHead = temp_v0_20 + 8; - temp_v0_20->unk0 = 0xB900031D; - temp_v0_20->unk4 = 0x504A50; - temp_v0_21 = gDisplayListHead; - gDisplayListHead = temp_v0_21 + 8; - temp_v0_21->unk0 = 0x6000000; - temp_v0_21->unk4 = &D_0D008E48; + gSPDisplayList(gDisplayListHead++, D_0D008DB8); + gDPLoadTextureBlock(gDisplayListHead++, D_800E4770[var_s0], G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + func_8004B72C((s32) spA6, (s32) spA4, (s32) spA2, (s32) sp9E, (s32) sp9C, (s32) sp9A, (s32) spA0); + gDPSetRenderMode(gDisplayListHead++, G_RM_ZB_XLU_SURF, G_RM_ZB_XLU_SURF2); + gSPDisplayList(gDisplayListHead++, D_0D008E48); } - D_80164AF0 = D_80164AF0 + 1; + D_80164AF0 += 1; } } #else @@ -6643,24 +5809,42 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80065AB0.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8004B35C(s16, s16, s16, ?); // extern -void func_8004B72C(s16, s16, s16, s16, s32, s32, s32); // extern -void func_800652D4(f32 *, s16 *, f32); // extern +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800652D4(f32 *, s16 *, f32); /* extern */ extern ? D_05FF8DB8; -extern Gfx D_0D008C90; -extern Gfx D_0D008DA0; -extern Gfx D_0D008DB8; -extern Gfx D_0D008E48; -extern ? D_800E47DC; -extern ? D_800E480C; -extern ? D_800E8C00; -extern s16 D_80164AF0; -extern s32 D_8018D494; -extern s32 D_8018D498; -extern void *gDisplayListHead; +extern u32 D_8018D494; +extern u32 D_8018D498; +static s32 D_800E47DC[0xC] = { + 0x00FBFFFB, + 0x00A06011, + 0x00E0C090, + 0x00D0B080, + 0x00907040, + 0x00C07010, + 0x00D0F0FF, + 0x00E09030, + 0x00C09030, + 0x00604020, + 0x00F0D0B0, + 0x00A08030, +}; +static s32 D_800E480C[0xC] = { + 0x00B0B0B0, + 0x00804011, + 0x00B08050, + 0x00A07040, + 0x00603011, + 0x00804010, + 0x007090A0, + 0x00A06030, + 0x00A07010, + 0x00301011, + 0x00B0A080, + 0x00806010, +}; +static ? D_800E8C00; /* unable to generate initializer */ -void func_80065F0C(void *arg0, ? arg1, s16 arg2, s8 arg3) { +void func_80065F0C(Player *player, s32 arg1, s16 arg2, s8 arg3) { f32 spE4; f32 spE0; f32 spDC; @@ -6672,203 +5856,201 @@ void func_80065F0C(void *arg0, ? arg1, s16 arg2, s8 arg3) { s16 spC8; s16 spC6; void *sp44; - s16 *temp_a1; + Gfx *temp_s0; + Gfx *temp_s0_10; + Gfx *temp_s0_11; + Gfx *temp_s0_12; + Gfx *temp_s0_13; + Gfx *temp_s0_14; + Gfx *temp_s0_15; + Gfx *temp_s0_16; + Gfx *temp_s0_17; + Gfx *temp_s0_18; + Gfx *temp_s0_19; + Gfx *temp_s0_20; + Gfx *temp_s0_21; + Gfx *temp_s0_22; + Gfx *temp_s0_23; + Gfx *temp_s0_24; + Gfx *temp_s0_25; + Gfx *temp_s0_26; + Gfx *temp_s0_27; + Gfx *temp_s0_28; + Gfx *temp_s0_29; + Gfx *temp_s0_2; + Gfx *temp_s0_30; + Gfx *temp_s0_31; + Gfx *temp_s0_3; + Gfx *temp_s0_4; + Gfx *temp_s0_5; + Gfx *temp_s0_6; + Gfx *temp_s0_7; + Gfx *temp_s0_8; + Gfx *temp_s0_9; s16 temp_a0; + s16 temp_a1; s16 temp_ra; s16 temp_s2; s16 temp_s3; s32 temp_a2; - s32 temp_t6; s32 temp_v1; - void *temp_s0; - void *temp_s0_10; - void *temp_s0_11; - void *temp_s0_12; - void *temp_s0_13; - void *temp_s0_14; - void *temp_s0_15; - void *temp_s0_16; - void *temp_s0_17; - void *temp_s0_18; - void *temp_s0_19; - void *temp_s0_20; - void *temp_s0_21; - void *temp_s0_22; - void *temp_s0_23; - void *temp_s0_24; - void *temp_s0_25; - void *temp_s0_26; - void *temp_s0_27; - void *temp_s0_28; - void *temp_s0_29; - void *temp_s0_2; - void *temp_s0_30; - void *temp_s0_31; - void *temp_s0_3; - void *temp_s0_4; - void *temp_s0_5; - void *temp_s0_6; - void *temp_s0_7; - void *temp_s0_8; - void *temp_s0_9; void *temp_v0; - temp_v0 = arg0 + (arg2 * 0x48); + temp_v0 = player + (arg2 * 0x48); if ((temp_v0->unk544 == 1) && (temp_v0->unk546 != 0)) { spDC = temp_v0->unk528; - temp_a1 = &spD4; spE0 = temp_v0->unk52C; spD4 = 0; spE4 = temp_v0->unk530; spD8 = 0; - spD6 = (arg0 + (arg3 * 2))->unk48; + spD6 = player->unk_048[arg3]; sp44 = temp_v0; - func_800652D4(&spDC, temp_a1, temp_v0->unk534 * arg0->unk224); - if (temp_v0->unk53C != 8) { - temp_a0 = temp_v0->unk562; - temp_t6 = temp_v0->unk560 * 4; - temp_v1 = *(&D_800E47DC + temp_t6); + func_800652D4(&spDC, &spD4, temp_v0->unk534 * player->unk_224); + if ((s32) sp44->unk53C != 8) { + temp_a1 = sp44->unk560; + temp_a0 = sp44->unk562; + temp_v1 = D_800E47DC[temp_a1]; temp_ra = ((temp_v1 >> 0x10) & 0xFF) - temp_a0; - temp_a2 = *(&D_800E480C + temp_t6); + temp_a2 = D_800E480C[temp_a1]; temp_s2 = ((temp_v1 >> 8) & 0xFF) - temp_a0; temp_s3 = (temp_v1 & 0xFF) - temp_a0; spCA = ((temp_a2 >> 0x10) & 0xFF) - temp_a0; spC8 = ((temp_a2 >> 8) & 0xFF) - temp_a0; spC6 = (temp_a2 & 0xFF) - temp_a0; - spCC = temp_v0->unk566; - if (temp_v0->unk568 == 0) { + spCC = sp44->unk566; + if (sp44->unk568 == 0) { temp_s0 = gDisplayListHead; gDisplayListHead = temp_s0 + 8; - temp_s0->unk4 = &D_0D008DB8; - temp_s0->unk0 = 0x6000000; + temp_s0->words.w1 = (u32) D_0D008DB8; + temp_s0->words.w0 = 0x06000000; temp_s0_2 = gDisplayListHead; gDisplayListHead = temp_s0_2 + 8; - temp_s0_2->unk0 = 0xFD900000; - temp_s0_2->unk4 = D_8018D494; + temp_s0_2->words.w0 = 0xFD900000; + temp_s0_2->words.w1 = D_8018D494; temp_s0_3 = gDisplayListHead; gDisplayListHead = temp_s0_3 + 8; - temp_s0_3->unk4 = 0x7000000; - temp_s0_3->unk0 = 0xF5900000; + temp_s0_3->words.w1 = 0x07000000; + temp_s0_3->words.w0 = 0xF5900000; temp_s0_4 = gDisplayListHead; gDisplayListHead = temp_s0_4 + 8; - temp_s0_4->unk4 = 0; - temp_s0_4->unk0 = 0xE6000000; + temp_s0_4->words.w1 = 0; + temp_s0_4->words.w0 = 0xE6000000; temp_s0_5 = gDisplayListHead; gDisplayListHead = temp_s0_5 + 8; - temp_s0_5->unk4 = 0x71FF200; - temp_s0_5->unk0 = 0xF3000000; + temp_s0_5->words.w1 = 0x071FF200; + temp_s0_5->words.w0 = 0xF3000000; temp_s0_6 = gDisplayListHead; gDisplayListHead = temp_s0_6 + 8; - temp_s0_6->unk4 = 0; - temp_s0_6->unk0 = 0xE7000000; + temp_s0_6->words.w1 = 0; + temp_s0_6->words.w0 = 0xE7000000; temp_s0_7 = gDisplayListHead; gDisplayListHead = temp_s0_7 + 8; - temp_s0_7->unk4 = 0; - temp_s0_7->unk0 = 0xF5880800; + temp_s0_7->words.w1 = 0; + temp_s0_7->words.w0 = 0xF5880800; temp_s0_8 = gDisplayListHead; gDisplayListHead = temp_s0_8 + 8; - temp_s0_8->unk4 = 0x7C07C; - temp_s0_8->unk0 = 0xF2000000; - func_8004B72C(temp_ra, temp_s2, temp_s3, spCA, spC8, spC6, spCC); + temp_s0_8->words.w1 = 0x0007C07C; + temp_s0_8->words.w0 = 0xF2000000; + func_8004B72C((s32) temp_ra, (s32) temp_s2, (s32) temp_s3, (s32) spCA, (s32) spC8, (s32) spC6, (s32) spCC); temp_s0_9 = gDisplayListHead; gDisplayListHead = temp_s0_9 + 8; - temp_s0_9->unk0 = &D_05FF8DB8; - temp_s0_9->unk4 = &D_0D008E48; + temp_s0_9->words.w0 = (u32) &D_05FF8DB8; + temp_s0_9->words.w1 = (u32) D_0D008E48; } else { temp_s0_10 = gDisplayListHead; gDisplayListHead = temp_s0_10 + 8; - temp_s0_10->unk4 = 0xD010000; - temp_s0_10->unk0 = 0x6000000; + temp_s0_10->words.w1 = 0x0D010000; + temp_s0_10->words.w0 = 0x06000000; temp_s0_11 = gDisplayListHead; gDisplayListHead = temp_s0_11 + 8; - temp_s0_11->unk0 = 0xFD900000; - temp_s0_11->unk4 = D_8018D494; + temp_s0_11->words.w0 = 0xFD900000; + temp_s0_11->words.w1 = D_8018D494; temp_s0_12 = gDisplayListHead; gDisplayListHead = temp_s0_12 + 8; - temp_s0_12->unk4 = 0x7000000; - temp_s0_12->unk0 = 0xF5900000; + temp_s0_12->words.w1 = 0x07000000; + temp_s0_12->words.w0 = 0xF5900000; temp_s0_13 = gDisplayListHead; gDisplayListHead = temp_s0_13 + 8; - temp_s0_13->unk4 = 0; - temp_s0_13->unk0 = 0xE6000000; + temp_s0_13->words.w1 = 0; + temp_s0_13->words.w0 = 0xE6000000; temp_s0_14 = gDisplayListHead; gDisplayListHead = temp_s0_14 + 8; - temp_s0_14->unk4 = 0x71FF200; - temp_s0_14->unk0 = 0xF3000000; + temp_s0_14->words.w1 = 0x071FF200; + temp_s0_14->words.w0 = 0xF3000000; temp_s0_15 = gDisplayListHead; gDisplayListHead = temp_s0_15 + 8; - temp_s0_15->unk4 = 0; - temp_s0_15->unk0 = 0xE7000000; + temp_s0_15->words.w1 = 0; + temp_s0_15->words.w0 = 0xE7000000; temp_s0_16 = gDisplayListHead; gDisplayListHead = temp_s0_16 + 8; - temp_s0_16->unk4 = 0; - temp_s0_16->unk0 = 0xF5880800; + temp_s0_16->words.w1 = 0; + temp_s0_16->words.w0 = 0xF5880800; temp_s0_17 = gDisplayListHead; gDisplayListHead = temp_s0_17 + 8; - temp_s0_17->unk4 = 0x7C07C; - temp_s0_17->unk0 = 0xF2000000; - func_8004B72C(temp_ra, temp_s2, temp_s3, spCA, spC8, spC6, spCC); + temp_s0_17->words.w1 = 0x0007C07C; + temp_s0_17->words.w0 = 0xF2000000; + func_8004B72C((s32) temp_ra, (s32) temp_s2, (s32) temp_s3, (s32) spCA, (s32) spC8, (s32) spC6, (s32) spCC); temp_s0_18 = gDisplayListHead; gDisplayListHead = temp_s0_18 + 8; - temp_s0_18->unk4 = 3; - temp_s0_18->unk0 = 0xB9000002; + temp_s0_18->words.w1 = 3; + temp_s0_18->words.w0 = 0xB9000002; temp_s0_19 = gDisplayListHead; gDisplayListHead = temp_s0_19 + 8; - temp_s0_19->unk0 = 0x6000000; - temp_s0_19->unk4 = &D_0D008E48; + temp_s0_19->words.w0 = 0x06000000; + temp_s0_19->words.w1 = (u32) D_0D008E48; } } else { temp_s0_20 = gDisplayListHead; gDisplayListHead = temp_s0_20 + 8; - temp_s0_20->unk4 = &D_0D008C90; - temp_s0_20->unk0 = 0x6000000; + temp_s0_20->words.w1 = (u32) D_0D008C90; + temp_s0_20->words.w0 = 0x06000000; temp_s0_21 = gDisplayListHead; gDisplayListHead = temp_s0_21 + 8; - temp_s0_21->unk4 = 0; - temp_s0_21->unk0 = 0xBA000E02; + temp_s0_21->words.w1 = 0; + temp_s0_21->words.w0 = 0xBA000E02; temp_s0_22 = gDisplayListHead; gDisplayListHead = temp_s0_22 + 8; - temp_s0_22->unk0 = 0xFD100000; - temp_s0_22->unk4 = D_8018D498; + temp_s0_22->words.w0 = 0xFD100000; + temp_s0_22->words.w1 = D_8018D498; temp_s0_23 = gDisplayListHead; gDisplayListHead = temp_s0_23 + 8; - temp_s0_23->unk4 = 0x7080200; - temp_s0_23->unk0 = 0xF5100000; + temp_s0_23->words.w1 = 0x07080200; + temp_s0_23->words.w0 = 0xF5100000; temp_s0_24 = gDisplayListHead; gDisplayListHead = temp_s0_24 + 8; - temp_s0_24->unk4 = 0; - temp_s0_24->unk0 = 0xE6000000; + temp_s0_24->words.w1 = 0; + temp_s0_24->words.w0 = 0xE6000000; temp_s0_25 = gDisplayListHead; gDisplayListHead = temp_s0_25 + 8; - temp_s0_25->unk4 = 0x77FF100; - temp_s0_25->unk0 = 0xF3000000; + temp_s0_25->words.w1 = 0x077FF100; + temp_s0_25->words.w0 = 0xF3000000; temp_s0_26 = gDisplayListHead; gDisplayListHead = temp_s0_26 + 8; - temp_s0_26->unk4 = 0; - temp_s0_26->unk0 = 0xE7000000; + temp_s0_26->words.w1 = 0; + temp_s0_26->words.w0 = 0xE7000000; temp_s0_27 = gDisplayListHead; gDisplayListHead = temp_s0_27 + 8; - temp_s0_27->unk0 = 0xF5101000; - temp_s0_27->unk4 = 0x80200; + temp_s0_27->words.w0 = 0xF5101000; + temp_s0_27->words.w1 = 0x00080200; temp_s0_28 = gDisplayListHead; gDisplayListHead = temp_s0_28 + 8; - temp_s0_28->unk0 = 0xF2000000; - temp_s0_28->unk4 = 0x7C0FC; - func_8004B35C(temp_v0->unk560, temp_v0->unk562, temp_v0->unk564, 0xFF); + temp_s0_28->words.w0 = 0xF2000000; + temp_s0_28->words.w1 = 0x0007C0FC; + func_8004B35C((s32) sp44->unk560, (s32) sp44->unk562, (s32) sp44->unk564, 0x000000FF); temp_s0_29 = gDisplayListHead; gDisplayListHead = temp_s0_29 + 8; - temp_s0_29->unk0 = 0xB900031D; - temp_s0_29->unk4 = 0x553078; + temp_s0_29->words.w0 = 0xB900031D; + temp_s0_29->words.w1 = 0x00553078; temp_s0_30 = gDisplayListHead; gDisplayListHead = temp_s0_30 + 8; - temp_s0_30->unk4 = &D_800E8C00; - temp_s0_30->unk0 = 0x400103F; + temp_s0_30->words.w1 = (u32) &D_800E8C00; + temp_s0_30->words.w0 = 0x0400103F; temp_s0_31 = gDisplayListHead; gDisplayListHead = temp_s0_31 + 8; - temp_s0_31->unk0 = 0x6000000; - temp_s0_31->unk4 = &D_0D008DA0; + temp_s0_31->words.w0 = 0x06000000; + temp_s0_31->words.w1 = (u32) D_0D008DA0; } - D_80164AF0 = D_80164AF0 + 1; + D_80164AF0 += 1; } } #else @@ -6876,16 +6058,11 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80065F0C.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8004B35C(s16, s16, s16, s16); // extern -void func_800652D4(f32 *, s16 *, f32, s8); // extern -extern Gfx D_0D008DB8; -extern Gfx D_0D008E48; -extern s16 D_80164AF0; -extern s32 D_8018D48C; -extern void *gDisplayListHead; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800652D4(f32 *, s16 *, f32, s8); /* extern */ +extern u32 D_8018D48C; -void func_800664E0(void *arg0, ? arg1, s16 arg2, s8 arg3) { +void func_800664E0(Player *player, s32 arg1, s16 arg2, s8 arg3) { f32 sp5C; f32 sp58; f32 sp54; @@ -6896,81 +6073,77 @@ void func_800664E0(void *arg0, ? arg1, s16 arg2, s8 arg3) { s16 sp48; s16 sp46; s16 sp44; - void *sp24; - void *sp20; - f32 *temp_a0; - s16 *temp_a1; + Gfx *sp24; + Gfx *sp20; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; void *temp_v0; - void *temp_v0_10; - void *temp_v0_11; - void *temp_v0_2; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - void *temp_v0_6; - void *temp_v0_7; - void *temp_v0_8; - void *temp_v0_9; - temp_v0 = arg0 + (arg2 * 0x48); + temp_v0 = player + (arg2 * 0x48); if (temp_v0->unk544 == 1) { - temp_a1 = &sp4C; sp4A = temp_v0->unk560; sp48 = temp_v0->unk562; sp46 = temp_v0->unk564; - temp_a0 = &sp54; sp44 = temp_v0->unk566; sp54 = temp_v0->unk528; sp58 = temp_v0->unk52C; sp4C = 0; sp5C = temp_v0->unk530; sp50 = 0; - sp4E = (arg0 + (arg3 * 2))->unk48; - func_800652D4(temp_a0, temp_a1, temp_v0->unk534 * arg0->unk224, arg3); + sp4E = player->unk_048[arg3]; + func_800652D4(&sp54, &sp4C, temp_v0->unk534 * player->unk_224, arg3); temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0x6000000; - temp_v0_2->unk4 = &D_0D008DB8; + temp_v0_2->words.w0 = 0x06000000; + temp_v0_2->words.w1 = (u32) D_0D008DB8; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = 3; - temp_v0_3->unk0 = 0xB9000002; + temp_v0_3->words.w1 = 3; + temp_v0_3->words.w0 = 0xB9000002; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk0 = 0xFD700000; - temp_v0_4->unk4 = D_8018D48C; + temp_v0_4->words.w0 = 0xFD700000; + temp_v0_4->words.w1 = D_8018D48C; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0x7000000; - temp_v0_5->unk0 = 0xF5700000; + temp_v0_5->words.w1 = 0x07000000; + temp_v0_5->words.w0 = 0xF5700000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0; - temp_v0_6->unk0 = 0xE6000000; + temp_v0_6->words.w1 = 0; + temp_v0_6->words.w0 = 0xE6000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0x71FF200; - temp_v0_7->unk0 = 0xF3000000; + temp_v0_7->words.w1 = 0x071FF200; + temp_v0_7->words.w0 = 0xF3000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0; - temp_v0_8->unk0 = 0xE7000000; + temp_v0_8->words.w1 = 0; + temp_v0_8->words.w0 = 0xE7000000; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; sp24 = temp_v0_9; - temp_v0_9->unk4 = 0; - temp_v0_9->unk0 = 0xF5680800; + temp_v0_9->words.w1 = 0; + temp_v0_9->words.w0 = 0xF5680800; temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; sp20 = temp_v0_10; - temp_v0_10->unk4 = 0x7C07C; - temp_v0_10->unk0 = 0xF2000000; - func_8004B35C(sp4A, sp48, sp46, sp44); + temp_v0_10->words.w1 = 0x0007C07C; + temp_v0_10->words.w0 = 0xF2000000; + func_8004B35C((s32) sp4A, (s32) sp48, (s32) sp46, (s32) sp44); temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk0 = 0x6000000; - temp_v0_11->unk4 = &D_0D008E48; - D_80164AF0 = D_80164AF0 + 1; + temp_v0_11->words.w0 = 0x06000000; + temp_v0_11->words.w1 = (u32) D_0D008E48; + D_80164AF0 += 1; } } #else @@ -6978,7 +6151,11 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_800664E0.s") #endif #ifdef MIPS_TO_C -UNUSED void func_80066714(void *arg0, ? arg1, s16 arg2, s8 arg3) { +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800652D4(f32 *, s16 *, f32, s8); /* extern */ +static ? D_800E8B00; /* unable to generate initializer */ + +void func_80066714(Player *player, s32 arg1, s16 arg2, s8 arg3) { f32 sp64; f32 sp60; f32 sp5C; @@ -6989,23 +6166,23 @@ UNUSED void func_80066714(void *arg0, ? arg1, s16 arg2, s8 arg3) { s16 sp50; s16 sp4E; s16 sp4C; - void *sp2C; - void *sp28; + Gfx *sp2C; + Gfx *sp28; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; void *temp_v0; - void *temp_v0_10; - void *temp_v0_11; - void *temp_v0_12; - void *temp_v0_13; - void *temp_v0_2; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - void *temp_v0_6; - void *temp_v0_7; - void *temp_v0_8; - void *temp_v0_9; - temp_v0 = arg0 + (arg2 * 0x48); + temp_v0 = player + (arg2 * 0x48); if (temp_v0->unk544 == 1) { sp52 = temp_v0->unk560; sp50 = temp_v0->unk562; @@ -7016,59 +6193,59 @@ UNUSED void func_80066714(void *arg0, ? arg1, s16 arg2, s8 arg3) { sp54 = 0; sp64 = temp_v0->unk530; sp58 = 0; - sp56 = (arg0 + (arg3 * 2))->unk48; - func_800652D4(&sp5C, &sp54, temp_v0->unk534 * arg0->unk224, arg3); + sp56 = player->unk_048[arg3]; + func_800652D4(&sp5C, &sp54, temp_v0->unk534 * player->unk_224, arg3); temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0x06000000; - temp_v0_2->unk4 = &D_0D008C90; + temp_v0_2->words.w0 = 0x06000000; + temp_v0_2->words.w1 = (u32) D_0D008C90; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = 0; - temp_v0_3->unk0 = 0xBA000E02; + temp_v0_3->words.w1 = 0; + temp_v0_3->words.w0 = 0xBA000E02; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk0 = 0xFD100000; - temp_v0_4->unk4 = &D_0D000200; + temp_v0_4->words.w0 = 0xFD100000; + temp_v0_4->words.w1 = (u32) D_0D000200; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk0 = 0xF5100000; - temp_v0_5->unk4 = 0x07080200; + temp_v0_5->words.w0 = 0xF5100000; + temp_v0_5->words.w1 = 0x07080200; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0; - temp_v0_6->unk0 = 0xE6000000; + temp_v0_6->words.w1 = 0; + temp_v0_6->words.w0 = 0xE6000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0x077FF100; - temp_v0_7->unk0 = 0xF3000000; + temp_v0_7->words.w1 = 0x077FF100; + temp_v0_7->words.w0 = 0xF3000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0; - temp_v0_8->unk0 = 0xE7000000; + temp_v0_8->words.w1 = 0; + temp_v0_8->words.w0 = 0xE7000000; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; sp2C = temp_v0_9; - temp_v0_9->unk0 = 0xF5101000; - temp_v0_9->unk4 = 0x80200; + temp_v0_9->words.w0 = 0xF5101000; + temp_v0_9->words.w1 = 0x00080200; temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; sp28 = temp_v0_10; - temp_v0_10->unk0 = 0xF2000000; - temp_v0_10->unk4 = 0x7C0FC; - func_8004B35C(sp52, sp50, sp4E, sp4C); + temp_v0_10->words.w0 = 0xF2000000; + temp_v0_10->words.w1 = 0x0007C0FC; + func_8004B35C((s32) sp52, (s32) sp50, (s32) sp4E, (s32) sp4C); temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk0 = 0xB900031D; - temp_v0_11->unk4 = 0x504A50; + temp_v0_11->words.w0 = 0xB900031D; + temp_v0_11->words.w1 = 0x00504A50; temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk4 = &D_800E8B00; - temp_v0_12->unk0 = 0x0400103F; + temp_v0_12->words.w1 = (u32) &D_800E8B00; + temp_v0_12->words.w0 = 0x0400103F; temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk0 = 0x06000000; - temp_v0_13->unk4 = &D_0D008DA0; + temp_v0_13->words.w0 = 0x06000000; + temp_v0_13->words.w1 = (u32) D_0D008DA0; D_80164AF0 += 1; } } @@ -7077,16 +6254,11 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80066714.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8004B35C(s16, s16, s16, s16); // extern -void func_800652D4(f32 *, s16 *, f32, s8); // extern -extern Gfx D_0D008DB8; -extern Gfx D_0D008E48; -extern s16 D_80164AF0; -extern s32 D_8018D48C; -extern void *gDisplayListHead; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800652D4(f32 *, s16 *, f32, s8); /* extern */ +extern u32 D_8018D48C; -void func_80066998(void *arg0, ? arg1, s16 arg2, s8 arg3) { +void func_80066998(Player *player, s8 arg1, s16 arg2, s8 arg3) { f32 sp5C; f32 sp58; f32 sp54; @@ -7097,74 +6269,68 @@ void func_80066998(void *arg0, ? arg1, s16 arg2, s8 arg3) { s16 sp48; s16 sp46; s16 sp44; - void *sp24; - f32 *temp_a0; - s16 *temp_a1; - void *temp_v0; - void *temp_v0_10; - void *temp_v0_2; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - void *temp_v0_6; - void *temp_v0_7; - void *temp_v0_8; - void *temp_v0_9; - - temp_v0 = arg0 + (arg2 * 0x48); - if (temp_v0->unk274 == 1) { - temp_a1 = &sp4C; - sp4A = temp_v0->unk290; - sp48 = temp_v0->unk292; - sp46 = temp_v0->unk294; - sp44 = temp_v0->unk296; - temp_a0 = &sp54; - sp54 = temp_v0->unk258; - sp58 = temp_v0->unk25C; + Gfx *sp24; + Gfx *temp_v0; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; + + if (player->unk_258[arg2].unk_01C == 1) { + sp4A = player->unk_258[arg2].unk_038; + sp48 = player->unk_258[arg2].unk_03A; + sp46 = player->unk_258[arg2].unk_03C; + sp44 = player->unk_258[arg2].unk_03E; + sp54 = player->unk_258[arg2].unk_000[0]; + sp58 = player->unk_258[arg2].unk_000[1]; sp4C = 0x4000; - sp5C = temp_v0->unk260; + sp5C = player->unk_258[arg2].unk_000[2]; sp50 = 0; - sp4E = (arg0 + (arg3 * 2))->unk48; - func_800652D4(temp_a0, temp_a1, temp_v0->unk264 * arg0->unk224, arg3); + sp4E = player->unk_048[arg3]; + func_800652D4(&sp54, &sp4C, player->unk_258[arg2].unk_00C * player->unk_224, arg3); + temp_v0 = gDisplayListHead; + gDisplayListHead = temp_v0 + 8; + temp_v0->words.w0 = 0x06000000; + temp_v0->words.w1 = (u32) D_0D008DB8; temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0x6000000; - temp_v0_2->unk4 = &D_0D008DB8; + temp_v0_2->words.w0 = 0xFD700000; + temp_v0_2->words.w1 = D_8018D48C; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0xFD700000; - temp_v0_3->unk4 = D_8018D48C; + temp_v0_3->words.w1 = 0x07000000; + temp_v0_3->words.w0 = 0xF5700000; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x7000000; - temp_v0_4->unk0 = 0xF5700000; + temp_v0_4->words.w1 = 0; + temp_v0_4->words.w0 = 0xE6000000; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0; - temp_v0_5->unk0 = 0xE6000000; + temp_v0_5->words.w1 = 0x071FF200; + temp_v0_5->words.w0 = 0xF3000000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0x71FF200; - temp_v0_6->unk0 = 0xF3000000; + temp_v0_6->words.w1 = 0; + temp_v0_6->words.w0 = 0xE7000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0; - temp_v0_7->unk0 = 0xE7000000; + temp_v0_7->words.w1 = 0; + temp_v0_7->words.w0 = 0xF5680800; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0; - temp_v0_8->unk0 = 0xF5680800; + sp24 = temp_v0_8; + temp_v0_8->words.w1 = 0x0007C07C; + temp_v0_8->words.w0 = 0xF2000000; + func_8004B35C((s32) sp4A, (s32) sp48, (s32) sp46, (s32) sp44); temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; - sp24 = temp_v0_9; - temp_v0_9->unk4 = 0x7C07C; - temp_v0_9->unk0 = 0xF2000000; - func_8004B35C(sp4A, sp48, sp46, sp44); - temp_v0_10 = gDisplayListHead; - gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk0 = 0x6000000; - temp_v0_10->unk4 = &D_0D008E48; - D_80164AF0 = D_80164AF0 + 1; + temp_v0_9->words.w0 = 0x06000000; + temp_v0_9->words.w1 = (u32) D_0D008E48; + D_80164AF0 += 1; } } #else @@ -7172,21 +6338,13 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80066998.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_800652D4(f32 *, s16 *, f32); // extern -f32 sins(u16); // extern -f32 coss(u16); // extern -extern Gfx D_0D008C78; -extern Gfx D_0D008DA0; -extern Gfx D_0D008DB8; -extern ? D_800E8900; -extern u16 D_80164714; -extern s16 D_80164AF0; -extern s32 D_8018D4C4; -extern s32 D_8018D4C8; -extern s32 *gDisplayListHead; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800652D4(f32 *, s16 *, f32); /* extern */ +extern u32 D_8018D4C4; +extern u32 D_8018D4C8; +static struct _struct_D_800E8900_0x10 D_800E8900[0]; /* unable to generate initializer */ -void func_80066BAC(void *arg0, ? arg1, s16 arg2, s8 arg3) { +void func_80066BAC(Player *player, s32 arg1, s16 arg2, s8 arg3) { f32 spE4; f32 spE0; f32 spDC; @@ -7195,246 +6353,241 @@ void func_80066BAC(void *arg0, ? arg1, s16 arg2, s8 arg3) { s16 spD4; void *sp24; void *sp20; - 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_16; - s32 *temp_v0_17; - s32 *temp_v0_18; - s32 *temp_v0_19; - s32 *temp_v0_20; - s32 *temp_v0_21; - s32 *temp_v0_22; - s32 *temp_v0_23; - s32 *temp_v0_24; - s32 *temp_v0_25; - s32 *temp_v0_26; - s32 *temp_v0_27; - s32 *temp_v0_28; - s32 *temp_v0_29; - s32 *temp_v0_2; - s32 *temp_v0_30; - s32 *temp_v0_31; - s32 *temp_v0_32; - s32 *temp_v0_33; - s32 *temp_v0_34; - s32 *temp_v0_35; - s32 *temp_v0_36; - s32 *temp_v0_37; - s32 *temp_v0_38; - s32 *temp_v0_39; - s32 *temp_v0_3; - s32 *temp_v0_40; - s32 *temp_v0_41; - s32 *temp_v0_42; - s32 *temp_v0_43; - s32 *temp_v0_4; - s32 *temp_v0_5; - s32 *temp_v0_6; - s32 *temp_v0_7; - s32 *temp_v0_8; - s32 *temp_v0_9; + Gfx *temp_v0; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_14; + Gfx *temp_v0_15; + Gfx *temp_v0_16; + Gfx *temp_v0_17; + Gfx *temp_v0_18; + Gfx *temp_v0_19; + Gfx *temp_v0_20; + Gfx *temp_v0_21; + Gfx *temp_v0_22; + Gfx *temp_v0_23; + Gfx *temp_v0_24; + Gfx *temp_v0_25; + Gfx *temp_v0_26; + Gfx *temp_v0_27; + Gfx *temp_v0_28; + Gfx *temp_v0_29; + Gfx *temp_v0_2; + Gfx *temp_v0_30; + Gfx *temp_v0_31; + Gfx *temp_v0_32; + Gfx *temp_v0_33; + Gfx *temp_v0_34; + Gfx *temp_v0_35; + Gfx *temp_v0_36; + Gfx *temp_v0_37; + Gfx *temp_v0_38; + Gfx *temp_v0_39; + Gfx *temp_v0_3; + Gfx *temp_v0_40; + Gfx *temp_v0_41; + Gfx *temp_v0_42; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; void *temp_ra; - void *temp_v0; - s32 *phi_v0; - temp_ra = arg0 + (arg2 * 0x48); - if ((temp_ra->unk274 == 1) && (temp_ra->unk290 != 0xFF)) { - if (arg0->unk124 >= 300.0f) { - spE0 = arg0->unk18 + 5.0f; + temp_ra = player + (arg2 * 0x48); + if ((player->unk_258[arg2].unk_01C == 1) && (player->unk_258[arg2].unk_038 != 0x00FF)) { + if (player->unk_110.unk3C[2] >= 300.0f) { + spE0 = player->pos[1] + 5.0f; } else { - spE0 = arg0->unk18 - 3.0f; + spE0 = player->pos[1] - 3.0f; } - temp_v0 = arg0 + (arg3 * 2); sp24 = temp_ra; - sp20 = temp_v0; - spE4 = (coss(temp_v0->unk48) * -10.0f) + arg0->unk1C; - spDC = (sins(sp20->unk48) * -10.0f) + arg0->unk14; - if (arg0->unk124 >= 300.0f) { - spD4 = *(&D_80164714 + (arg3 * 0xB8)) - 0x4000; + sp20 = player + (arg3 * 2); + spE4 = (coss((u16) player->unk_048[arg3]) * -10.0f) + player->pos[2]; + spDC = (sins(sp20->unk48) * -10.0f) + player->pos[0]; + if (player->unk_110.unk3C[2] >= 300.0f) { + spD4 = *(cameras->rot + (arg3 * 0xB8)) - 0x4000; } else { spD4 = 0; } spD8 = 0; - spD6 = sp20->unk48; + spD6 = (s16) sp20->unk48; sp24 = temp_ra; - func_800652D4(&spDC, &spD4, temp_ra->unk264 * arg0->unk224); - if (temp_ra->unk290 == 0) { + func_800652D4(&spDC, &spD4, player->unk_258[arg2].unk_00C * player->unk_224); + if (sp24->unk290 == 0) { + temp_v0 = gDisplayListHead; + gDisplayListHead = temp_v0 + 8; + temp_v0->words.w1 = (u32) D_0D008DB8; + temp_v0->words.w0 = 0x06000000; temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk4 = &D_0D008DB8; - temp_v0_2->unk0 = 0x6000000; + temp_v0_2->words.w1 = -0x00000C07U; + temp_v0_2->words.w0 = 0xFC127E24; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = -0xC07; - temp_v0_3->unk0 = 0xFC127E24; + temp_v0_3->words.w1 = 0x00504B50; + temp_v0_3->words.w0 = 0xB900031D; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x504B50; - temp_v0_4->unk0 = 0xB900031D; + temp_v0_4->words.w0 = 0xFD700000; + temp_v0_4->words.w1 = D_8018D4C4; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk0 = 0xFD700000; - temp_v0_5->unk4 = D_8018D4C4; + temp_v0_5->words.w1 = 0x07000000; + temp_v0_5->words.w0 = 0xF5700000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0x7000000; - temp_v0_6->unk0 = 0xF5700000; + temp_v0_6->words.w1 = 0; + temp_v0_6->words.w0 = 0xE6000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0; - temp_v0_7->unk0 = 0xE6000000; + temp_v0_7->words.w1 = 0x073FF200; + temp_v0_7->words.w0 = 0xF3000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0x73FF200; - temp_v0_8->unk0 = 0xF3000000; + temp_v0_8->words.w1 = 0; + temp_v0_8->words.w0 = 0xE7000000; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk4 = 0; - temp_v0_9->unk0 = 0xE7000000; + temp_v0_9->words.w1 = 0; + temp_v0_9->words.w0 = 0xF5680800; temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk4 = 0; - temp_v0_10->unk0 = 0xF5680800; + temp_v0_10->words.w1 = 0x0007C0FC; + temp_v0_10->words.w0 = 0xF2000000; temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk4 = 0x7C0FC; - temp_v0_11->unk0 = 0xF2000000; + temp_v0_11->words.w0 = 0x0400103F; + temp_v0_11->words.w1 = (u32) &D_800E8900[sp24->unk290]; temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk0 = 0x400103F; - temp_v0_12->unk4 = (temp_ra->unk290 * 0x10) + &D_800E8900; + temp_v0_12->words.w1 = (u32) D_0D008C78; + temp_v0_12->words.w0 = 0x06000000; temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk4 = &D_0D008C78; - temp_v0_13->unk0 = 0x6000000; + temp_v0_13->words.w0 = 0xFD700000; + temp_v0_13->words.w1 = D_8018D4C8; temp_v0_14 = gDisplayListHead; gDisplayListHead = temp_v0_14 + 8; - temp_v0_14->unk0 = 0xFD700000; - temp_v0_14->unk4 = D_8018D4C8; + temp_v0_14->words.w1 = 0x07000000; + temp_v0_14->words.w0 = 0xF5700000; temp_v0_15 = gDisplayListHead; gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk4 = 0x7000000; - temp_v0_15->unk0 = 0xF5700000; + temp_v0_15->words.w1 = 0; + temp_v0_15->words.w0 = 0xE6000000; temp_v0_16 = gDisplayListHead; gDisplayListHead = temp_v0_16 + 8; - temp_v0_16->unk4 = 0; - temp_v0_16->unk0 = 0xE6000000; + temp_v0_16->words.w1 = 0x073FF200; + temp_v0_16->words.w0 = 0xF3000000; temp_v0_17 = gDisplayListHead; gDisplayListHead = temp_v0_17 + 8; - temp_v0_17->unk4 = 0x73FF200; - temp_v0_17->unk0 = 0xF3000000; + temp_v0_17->words.w1 = 0; + temp_v0_17->words.w0 = 0xE7000000; temp_v0_18 = gDisplayListHead; gDisplayListHead = temp_v0_18 + 8; - temp_v0_18->unk4 = 0; - temp_v0_18->unk0 = 0xE7000000; + temp_v0_18->words.w1 = 0; + temp_v0_18->words.w0 = 0xF5680800; temp_v0_19 = gDisplayListHead; gDisplayListHead = temp_v0_19 + 8; - temp_v0_19->unk4 = 0; - temp_v0_19->unk0 = 0xF5680800; + temp_v0_19->words.w1 = 0x0007C0FC; + temp_v0_19->words.w0 = 0xF2000000; temp_v0_20 = gDisplayListHead; gDisplayListHead = temp_v0_20 + 8; - temp_v0_20->unk4 = 0x7C0FC; - temp_v0_20->unk0 = 0xF2000000; + temp_v0_20->words.w0 = 0x0400103F; + temp_v0_20->words.w1 = (u32) ((sp24->unk290 * 0x10) + 0x40 + D_800E8900); temp_v0_21 = gDisplayListHead; gDisplayListHead = temp_v0_21 + 8; - temp_v0_21->unk0 = 0x400103F; - temp_v0_21->unk4 = (temp_ra->unk290 * 0x10) + 0x40 + &D_800E8900; + temp_v0_21->words.w1 = (u32) D_0D008DA0; + } else { temp_v0_22 = gDisplayListHead; gDisplayListHead = temp_v0_22 + 8; - temp_v0_22->unk4 = &D_0D008DA0; - phi_v0 = temp_v0_22; - } else { + temp_v0_22->words.w1 = 0x0D008DB8; + temp_v0_22->words.w0 = 0x06000000; temp_v0_23 = gDisplayListHead; gDisplayListHead = temp_v0_23 + 8; - temp_v0_23->unk4 = 0xD008DB8; - temp_v0_23->unk0 = 0x6000000; + temp_v0_23->words.w1 = -0x00000C07U; + temp_v0_23->words.w0 = 0xFC127E24; temp_v0_24 = gDisplayListHead; gDisplayListHead = temp_v0_24 + 8; - temp_v0_24->unk4 = -0xC07; - temp_v0_24->unk0 = 0xFC127E24; + temp_v0_24->words.w1 = 0x00504B50; + temp_v0_24->words.w0 = 0xB900031D; temp_v0_25 = gDisplayListHead; gDisplayListHead = temp_v0_25 + 8; - temp_v0_25->unk4 = 0x504B50; - temp_v0_25->unk0 = 0xB900031D; + temp_v0_25->words.w0 = 0xFD700000; + temp_v0_25->words.w1 = D_8018D4C8; temp_v0_26 = gDisplayListHead; gDisplayListHead = temp_v0_26 + 8; - temp_v0_26->unk0 = 0xFD700000; - temp_v0_26->unk4 = D_8018D4C8; + temp_v0_26->words.w1 = 0x07000000; + temp_v0_26->words.w0 = 0xF5700000; temp_v0_27 = gDisplayListHead; gDisplayListHead = temp_v0_27 + 8; - temp_v0_27->unk4 = 0x7000000; - temp_v0_27->unk0 = 0xF5700000; + temp_v0_27->words.w1 = 0; + temp_v0_27->words.w0 = 0xE6000000; temp_v0_28 = gDisplayListHead; gDisplayListHead = temp_v0_28 + 8; - temp_v0_28->unk4 = 0; - temp_v0_28->unk0 = 0xE6000000; + temp_v0_28->words.w1 = 0x073FF200; + temp_v0_28->words.w0 = 0xF3000000; temp_v0_29 = gDisplayListHead; gDisplayListHead = temp_v0_29 + 8; - temp_v0_29->unk4 = 0x73FF200; - temp_v0_29->unk0 = 0xF3000000; + temp_v0_29->words.w1 = 0; + temp_v0_29->words.w0 = 0xE7000000; temp_v0_30 = gDisplayListHead; gDisplayListHead = temp_v0_30 + 8; - temp_v0_30->unk4 = 0; - temp_v0_30->unk0 = 0xE7000000; + temp_v0_30->words.w1 = 0; + temp_v0_30->words.w0 = 0xF5680800; temp_v0_31 = gDisplayListHead; gDisplayListHead = temp_v0_31 + 8; - temp_v0_31->unk4 = 0; - temp_v0_31->unk0 = 0xF5680800; + temp_v0_31->words.w1 = 0x0007C0FC; + temp_v0_31->words.w0 = 0xF2000000; temp_v0_32 = gDisplayListHead; gDisplayListHead = temp_v0_32 + 8; - temp_v0_32->unk4 = 0x7C0FC; - temp_v0_32->unk0 = 0xF2000000; + temp_v0_32->words.w0 = 0x0400103F; + temp_v0_32->words.w1 = (u32) &D_800E8900[sp24->unk290]; temp_v0_33 = gDisplayListHead; gDisplayListHead = temp_v0_33 + 8; - temp_v0_33->unk0 = 0x400103F; - temp_v0_33->unk4 = (temp_ra->unk290 * 0x10) + &D_800E8900; + temp_v0_33->words.w1 = (u32) D_0D008C78; + temp_v0_33->words.w0 = 0x06000000; temp_v0_34 = gDisplayListHead; gDisplayListHead = temp_v0_34 + 8; - temp_v0_34->unk4 = &D_0D008C78; - temp_v0_34->unk0 = 0x6000000; + temp_v0_34->words.w0 = 0xFD700000; + temp_v0_34->words.w1 = D_8018D4C4; temp_v0_35 = gDisplayListHead; gDisplayListHead = temp_v0_35 + 8; - temp_v0_35->unk0 = 0xFD700000; - temp_v0_35->unk4 = D_8018D4C4; + temp_v0_35->words.w1 = 0x07000000; + temp_v0_35->words.w0 = 0xF5700000; temp_v0_36 = gDisplayListHead; gDisplayListHead = temp_v0_36 + 8; - temp_v0_36->unk4 = 0x7000000; - temp_v0_36->unk0 = 0xF5700000; + temp_v0_36->words.w1 = 0; + temp_v0_36->words.w0 = 0xE6000000; temp_v0_37 = gDisplayListHead; gDisplayListHead = temp_v0_37 + 8; - temp_v0_37->unk4 = 0; - temp_v0_37->unk0 = 0xE6000000; + temp_v0_37->words.w1 = 0x073FF200; + temp_v0_37->words.w0 = 0xF3000000; temp_v0_38 = gDisplayListHead; gDisplayListHead = temp_v0_38 + 8; - temp_v0_38->unk4 = 0x73FF200; - temp_v0_38->unk0 = 0xF3000000; + temp_v0_38->words.w1 = 0; + temp_v0_38->words.w0 = 0xE7000000; temp_v0_39 = gDisplayListHead; gDisplayListHead = temp_v0_39 + 8; - temp_v0_39->unk4 = 0; - temp_v0_39->unk0 = 0xE7000000; + temp_v0_39->words.w1 = 0; + temp_v0_39->words.w0 = 0xF5680800; temp_v0_40 = gDisplayListHead; gDisplayListHead = temp_v0_40 + 8; - temp_v0_40->unk4 = 0; - temp_v0_40->unk0 = 0xF5680800; + temp_v0_40->words.w1 = 0x0007C0FC; + temp_v0_40->words.w0 = 0xF2000000; temp_v0_41 = gDisplayListHead; gDisplayListHead = temp_v0_41 + 8; - temp_v0_41->unk4 = 0x7C0FC; - temp_v0_41->unk0 = 0xF2000000; + temp_v0_41->words.w0 = 0x0400103F; + temp_v0_41->words.w1 = (u32) ((sp24->unk290 * 0x10) + 0x40 + D_800E8900); temp_v0_42 = gDisplayListHead; gDisplayListHead = temp_v0_42 + 8; - temp_v0_42->unk0 = 0x400103F; - temp_v0_42->unk4 = (temp_ra->unk290 * 0x10) + 0x40 + &D_800E8900; - temp_v0_43 = gDisplayListHead; - gDisplayListHead = temp_v0_43 + 8; - temp_v0_43->unk4 = &D_0D008DA0; - phi_v0 = temp_v0_43; + temp_v0_42->words.w1 = (u32) D_0D008DA0; } - *phi_v0 = 0x6000000; - D_80164AF0 = D_80164AF0 + 1; + gDisplayListHead->words.w0 = 0x06000000; + D_80164AF0 += 1; } } #else @@ -7442,18 +6595,12 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80066BAC.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8004B35C(s16, s16, s16, s16); // extern -void func_800652D4(f32 *, s16 *, f32, s8); // extern +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800652D4(f32 *, s16 *, f32, s8); /* extern */ extern ? D_06000224; -extern Gfx D_0D008DB8; -extern Gfx D_0D008E48; -extern Gfx D_0D008E70; -extern s16 D_80164AF0; -extern s32 D_8018D48C; -extern ? **gDisplayListHead; +extern u32 D_8018D48C; -void func_80067280(void *arg0, ? arg1, s16 arg2, s8 arg3) { +void func_80067280(Player *player, s32 arg1, s16 arg2, s8 arg3) { f32 sp84; f32 sp80; f32 sp7C; @@ -7464,31 +6611,30 @@ void func_80067280(void *arg0, ? arg1, s16 arg2, s8 arg3) { s16 sp70; s16 sp6E; s16 sp6C; - ? **sp4C; - ? **sp28; - ? **temp_v0_10; - ? **temp_v0_11; - ? **temp_v0_12; - ? **temp_v0_13; - ? **temp_v0_14; - ? **temp_v0_15; - ? **temp_v0_16; - ? **temp_v0_17; - ? **temp_v0_18; - ? **temp_v0_19; - ? **temp_v0_2; - ? **temp_v0_3; - ? **temp_v0_4; - ? **temp_v0_5; - ? **temp_v0_6; - ? **temp_v0_7; - ? **temp_v0_8; - ? **temp_v0_9; + Gfx *sp4C; + Gfx *sp28; + ? *var_s0; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_14; + Gfx *temp_v0_15; + Gfx *temp_v0_16; + Gfx *temp_v0_17; + Gfx *temp_v0_18; + Gfx *temp_v0_19; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; void *temp_v0; - ? *phi_s0; - ? **phi_v0; - temp_v0 = arg0 + (arg2 * 0x48); + temp_v0 = player + (arg2 * 0x48); if (temp_v0->unkAE4 == 1) { sp72 = temp_v0->unkB00; sp70 = temp_v0->unkB02; @@ -7496,96 +6642,94 @@ void func_80067280(void *arg0, ? arg1, s16 arg2, s8 arg3) { sp6C = temp_v0->unkB06; sp7C = temp_v0->unkAC8; sp80 = temp_v0->unkACC; - sp74 = -0x71C; + sp74 = -0x071C; sp78 = 0; sp84 = temp_v0->unkAD0; - if (temp_v0->unkAD8 == 1) { - sp76 = (arg0 + (arg3 * 2))->unk48 - 0x2000; - func_800652D4(&sp7C, &sp74, temp_v0->unkAD4 * arg0->unk224, arg3); + if (temp_v0->unkAD8 == (u16) 1) { + sp76 = player->unk_048[arg3] - 0x2000; + func_800652D4(&sp7C, &sp74, temp_v0->unkAD4 * player->unk_224, arg3); temp_v0_2 = gDisplayListHead; + var_s0 = &D_06000224; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk4 = &D_0D008DB8; - temp_v0_2->unk0 = &D_06000224; + temp_v0_2->words.w1 = (u32) D_0D008DB8; + temp_v0_2->words.w0 = (u32) &D_06000224; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0xFD700000; - temp_v0_3->unk4 = D_8018D48C; + temp_v0_3->words.w0 = 0xFD700000; + temp_v0_3->words.w1 = D_8018D48C; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x7000000; - temp_v0_4->unk0 = 0xF5700000; + temp_v0_4->words.w1 = 0x07000000; + temp_v0_4->words.w0 = 0xF5700000; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0; - temp_v0_5->unk0 = 0xE6000000; + temp_v0_5->words.w1 = 0; + temp_v0_5->words.w0 = 0xE6000000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0x71FF200; - temp_v0_6->unk0 = 0xF3000000; + temp_v0_6->words.w1 = 0x071FF200; + temp_v0_6->words.w0 = 0xF3000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0; - temp_v0_7->unk0 = 0xE7000000; + temp_v0_7->words.w1 = 0; + temp_v0_7->words.w0 = 0xE7000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0; - temp_v0_8->unk0 = 0xF5680800; + temp_v0_8->words.w1 = 0; + temp_v0_8->words.w0 = 0xF5680800; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; sp4C = temp_v0_9; - temp_v0_9->unk4 = 0x7C07C; - temp_v0_9->unk0 = 0xF2000000; - func_8004B35C(sp72, sp70, sp6E, sp6C); + temp_v0_9->words.w1 = 0x0007C07C; + temp_v0_9->words.w0 = 0xF2000000; + func_8004B35C((s32) sp72, (s32) sp70, (s32) sp6E, (s32) sp6C); temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk4 = &D_0D008E70; - phi_s0 = &D_06000224; - phi_v0 = temp_v0_10; + temp_v0_10->words.w1 = (u32) D_0D008E70; } else { - sp76 = (arg0 + (arg3 * 2))->unk48 + 0x2000; - func_800652D4(&sp7C, &sp74, temp_v0->unkAD4 * arg0->unk0, arg3); + sp76 = player->unk_048[arg3] + 0x2000; + func_800652D4(&sp7C, &sp74, temp_v0->unkAD4 * player->unk0, arg3); temp_v0_11 = gDisplayListHead; + var_s0 = (? *)0x06000000; gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk4 = &D_0D008DB8; - temp_v0_11->unk0 = 0x6000000; + temp_v0_11->words.w1 = (u32) D_0D008DB8; + temp_v0_11->words.w0 = (u32) (? *)0x06000000; temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk0 = 0xFD700000; - temp_v0_12->unk4 = D_8018D48C; + temp_v0_12->words.w0 = 0xFD700000; + temp_v0_12->words.w1 = D_8018D48C; temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk4 = 0x7000000; - temp_v0_13->unk0 = 0xF5700000; + temp_v0_13->words.w1 = 0x07000000; + temp_v0_13->words.w0 = 0xF5700000; temp_v0_14 = gDisplayListHead; gDisplayListHead = temp_v0_14 + 8; - temp_v0_14->unk4 = 0; - temp_v0_14->unk0 = 0xE6000000; + temp_v0_14->words.w1 = 0; + temp_v0_14->words.w0 = 0xE6000000; temp_v0_15 = gDisplayListHead; gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk4 = 0x71FF200; - temp_v0_15->unk0 = 0xF3000000; + temp_v0_15->words.w1 = 0x071FF200; + temp_v0_15->words.w0 = 0xF3000000; temp_v0_16 = gDisplayListHead; gDisplayListHead = temp_v0_16 + 8; - temp_v0_16->unk4 = 0; - temp_v0_16->unk0 = 0xE7000000; + temp_v0_16->words.w1 = 0; + temp_v0_16->words.w0 = 0xE7000000; temp_v0_17 = gDisplayListHead; gDisplayListHead = temp_v0_17 + 8; - temp_v0_17->unk4 = 0; - temp_v0_17->unk0 = 0xF5680800; + temp_v0_17->words.w1 = 0; + temp_v0_17->words.w0 = 0xF5680800; temp_v0_18 = gDisplayListHead; gDisplayListHead = temp_v0_18 + 8; sp28 = temp_v0_18; - temp_v0_18->unk4 = 0x7C07C; - temp_v0_18->unk0 = 0xF2000000; - func_8004B35C(sp72, sp70, sp6E, sp6C); + temp_v0_18->words.w1 = 0x0007C07C; + temp_v0_18->words.w0 = 0xF2000000; + func_8004B35C((s32) sp72, (s32) sp70, (s32) sp6E, (s32) sp6C); temp_v0_19 = gDisplayListHead; gDisplayListHead = temp_v0_19 + 8; - temp_v0_19->unk4 = &D_0D008E48; - phi_s0 = 0x6000000; - phi_v0 = temp_v0_19; + temp_v0_19->words.w1 = (u32) D_0D008E48; } - *phi_v0 = phi_s0; - D_80164AF0 = D_80164AF0 + 1; + gDisplayListHead->words.w0 = var_s0; + D_80164AF0 += 1; } } #else @@ -7593,139 +6737,130 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80067280.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8004B72C(?, ?, ?, ?, s32, s32, s32); // extern -void func_800652D4(f32 *, s16 *, f32); // extern +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800652D4(f32 *, s16 *, f32); /* extern */ extern ? D_05FF8DB8; -extern Gfx D_0D008DB8; -extern Gfx D_0D008E48; -extern Gfx D_0D008E70; -extern s8 D_0D02AC58; -extern s16 D_80164AF0; -extern void *gDisplayListHead; -void func_80067604(void *arg0, ? arg1, s16 arg2, s8 arg3) { +void func_80067604(Player *player, s32 arg1, s16 arg2, s8 arg3) { f32 sp94; f32 sp90; f32 sp8C; s16 sp88; s16 sp86; s16 sp84; - void *sp54; - void *sp30; + Gfx *sp54; + Gfx *sp30; void *sp28; - s16 *temp_a1; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_14; + Gfx *temp_v0_15; + Gfx *temp_v0_16; + Gfx *temp_v0_17; + Gfx *temp_v0_18; + Gfx *temp_v0_19; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; 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_2; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - void *temp_v0_6; - void *temp_v0_7; - void *temp_v0_8; - void *temp_v0_9; - temp_v0 = arg0 + (arg2 * 0x48); + temp_v0 = player + (arg2 * 0x48); if (temp_v0->unkAE4 == 1) { sp8C = temp_v0->unkAC8; - temp_a1 = &sp84; sp90 = temp_v0->unkACC; sp84 = 0; sp94 = temp_v0->unkAD0; sp88 = 0; - sp86 = (arg0 + (arg3 * 2))->unk48; + sp86 = player->unk_048[arg3]; sp28 = temp_v0; - func_800652D4(&sp8C, temp_a1, temp_v0->unkAD4 * arg0->unk224); - if (temp_v0->unkAD8 == 1) { + func_800652D4(&sp8C, &sp84, temp_v0->unkAD4 * player->unk_224); + if (sp28->unkAD8 == 1) { temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0x6000000; - temp_v0_2->unk4 = &D_0D008DB8; + temp_v0_2->words.w0 = 0x06000000; + temp_v0_2->words.w1 = (u32) D_0D008DB8; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0xFD900000; - temp_v0_3->unk4 = &D_0D02AC58; + temp_v0_3->words.w0 = 0xFD900000; + temp_v0_3->words.w1 = (u32) D_0D02AC58; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x7000000; - temp_v0_4->unk0 = 0xF5900000; + temp_v0_4->words.w1 = 0x07000000; + temp_v0_4->words.w0 = 0xF5900000; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0; - temp_v0_5->unk0 = 0xE6000000; + temp_v0_5->words.w1 = 0; + temp_v0_5->words.w0 = 0xE6000000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0x71FF200; - temp_v0_6->unk0 = 0xF3000000; + temp_v0_6->words.w1 = 0x071FF200; + temp_v0_6->words.w0 = 0xF3000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0; - temp_v0_7->unk0 = 0xE7000000; + temp_v0_7->words.w1 = 0; + temp_v0_7->words.w0 = 0xE7000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0; - temp_v0_8->unk0 = 0xF5880800; + temp_v0_8->words.w1 = 0; + temp_v0_8->words.w0 = 0xF5880800; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; sp54 = temp_v0_9; - temp_v0_9->unk0 = 0xF2000000; - temp_v0_9->unk4 = 0x7C07C; - func_8004B72C(0xFF, 0xFF, 0xDF, 0xFF, 0x5F, 0, 0x60); + temp_v0_9->words.w0 = 0xF2000000; + temp_v0_9->words.w1 = 0x0007C07C; + func_8004B72C(0x000000FF, 0x000000FF, 0x000000DF, 0x000000FF, 0x0000005F, 0, 0x00000060); temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk0 = &D_05FF8DB8; - temp_v0_10->unk4 = &D_0D008E70; + temp_v0_10->words.w0 = (u32) &D_05FF8DB8; + temp_v0_10->words.w1 = (u32) D_0D008E70; } else { temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk4 = 0xD010000; - temp_v0_11->unk0 = 0x6000000; + temp_v0_11->words.w1 = 0x0D010000; + temp_v0_11->words.w0 = 0x06000000; temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk0 = 0xFD900000; - temp_v0_12->unk4 = &D_0D02AC58; + temp_v0_12->words.w0 = 0xFD900000; + temp_v0_12->words.w1 = (u32) D_0D02AC58; temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk4 = 0x7000000; - temp_v0_13->unk0 = 0xF5900000; + temp_v0_13->words.w1 = 0x07000000; + temp_v0_13->words.w0 = 0xF5900000; temp_v0_14 = gDisplayListHead; gDisplayListHead = temp_v0_14 + 8; - temp_v0_14->unk4 = 0; - temp_v0_14->unk0 = 0xE6000000; + temp_v0_14->words.w1 = 0; + temp_v0_14->words.w0 = 0xE6000000; temp_v0_15 = gDisplayListHead; gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk4 = 0x71FF200; - temp_v0_15->unk0 = 0xF3000000; + temp_v0_15->words.w1 = 0x071FF200; + temp_v0_15->words.w0 = 0xF3000000; temp_v0_16 = gDisplayListHead; gDisplayListHead = temp_v0_16 + 8; - temp_v0_16->unk4 = 0; - temp_v0_16->unk0 = 0xE7000000; + temp_v0_16->words.w1 = 0; + temp_v0_16->words.w0 = 0xE7000000; temp_v0_17 = gDisplayListHead; gDisplayListHead = temp_v0_17 + 8; - temp_v0_17->unk4 = 0; - temp_v0_17->unk0 = 0xF5880800; + temp_v0_17->words.w1 = 0; + temp_v0_17->words.w0 = 0xF5880800; temp_v0_18 = gDisplayListHead; gDisplayListHead = temp_v0_18 + 8; sp30 = temp_v0_18; - temp_v0_18->unk0 = 0xF2000000; - temp_v0_18->unk4 = 0x7C07C; - func_8004B72C(0xFF, 0xFF, 0xDF, 0xFF, 0x5F, 0, 0x60); + temp_v0_18->words.w0 = 0xF2000000; + temp_v0_18->words.w1 = 0x0007C07C; + func_8004B72C(0x000000FF, 0x000000FF, 0x000000DF, 0x000000FF, 0x0000005F, 0, 0x00000060); temp_v0_19 = gDisplayListHead; gDisplayListHead = temp_v0_19 + 8; - temp_v0_19->unk0 = 0x6000000; - temp_v0_19->unk4 = &D_0D008E48; + temp_v0_19->words.w0 = 0x06000000; + temp_v0_19->words.w1 = (u32) D_0D008E48; } - D_80164AF0 = D_80164AF0 + 1; + D_80164AF0 += 1; } } #else @@ -7733,177 +6868,168 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80067604.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_800652D4(f32, f32 *, s16 *, f32, void *); // extern -extern Gfx D_0D008C78; -extern Gfx D_0D008C90; -extern Gfx D_0D008DA0; -extern ? D_800E52D0; -extern ? D_800E8800; -extern ? D_800E8840; -extern s16 D_80164AF0; -extern s32 D_8018D4AC; -extern s32 D_8018D4B0; -extern void *gDisplayListHead; - -void func_80067964(void *arg0, ? arg1, f32 arg2, ? arg3, s8 arg4) { +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800652D4(s32, f32 *, s16 *, f32, Player *); /* extern */ +extern u32 D_8018D4AC; +extern u32 D_8018D4B0; +static ? D_800E52D0; /* unable to generate initializer */ +static ? D_800E8800; /* unable to generate initializer */ +static ? D_800E8840; /* unable to generate initializer */ + +void func_80067964(Player *player, s8 arg1, s32 arg2, s8 arg3, s32 arg4) { f32 spA4; f32 spA0; f32 sp9C; s16 sp98; s16 sp96; s16 sp94; - f32 *temp_a0; - s16 *temp_a1; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_14; + Gfx *temp_v0_15; + Gfx *temp_v0_16; + Gfx *temp_v0_17; + Gfx *temp_v0_18; + Gfx *temp_v0_19; + Gfx *temp_v0_20; + Gfx *temp_v0_21; + Gfx *temp_v0_22; + Gfx *temp_v0_23; + Gfx *temp_v0_24; + Gfx *temp_v0_25; + Gfx *temp_v0_26; + Gfx *temp_v0_27; + Gfx *temp_v0_28; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; 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; - temp_v0 = arg0 + (arg4 * 0x48); + temp_v0 = player + ((s8) arg4 * 0x48); if (temp_v0->unk814 == 1) { - temp_a0 = &sp9C; - temp_a1 = &sp94; sp9C = temp_v0->unk7F8; spA0 = temp_v0->unk7FC; sp94 = 0; spA4 = temp_v0->unk800; sp98 = 0; sp96 = temp_v0->unk818; - func_800652D4(arg2, temp_a0, temp_a1, arg0->unk224 * arg2, arg0); + func_800652D4(arg2, &sp9C, &sp94, player->unk_224 * (bitwise f32) arg2, player); temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk4 = &D_0D008C90; - temp_v0_2->unk0 = 0x6000000; + temp_v0_2->words.w1 = (u32) D_0D008C90; + temp_v0_2->words.w0 = 0x06000000; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = 0x3000; - temp_v0_3->unk0 = 0xB6000000; + temp_v0_3->words.w1 = 0x00003000; + temp_v0_3->words.w0 = 0xB6000000; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk0 = 0xFD100000; - temp_v0_4->unk4 = &D_800E52D0; + temp_v0_4->words.w0 = 0xFD100000; + temp_v0_4->words.w1 = (u32) &D_800E52D0; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0; - temp_v0_5->unk0 = 0xE8000000; + temp_v0_5->words.w1 = 0; + temp_v0_5->words.w0 = 0xE8000000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0x7000000; - temp_v0_6->unk0 = 0xF5000100; + temp_v0_6->words.w1 = 0x07000000; + temp_v0_6->words.w0 = 0xF5000100; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0; - temp_v0_7->unk0 = 0xE6000000; + temp_v0_7->words.w1 = 0; + temp_v0_7->words.w0 = 0xE6000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0x73FC000; - temp_v0_8->unk0 = 0xF0000000; + temp_v0_8->words.w1 = 0x073FC000; + temp_v0_8->words.w0 = 0xF0000000; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk4 = 0; - temp_v0_9->unk0 = 0xE7000000; + temp_v0_9->words.w1 = 0; + temp_v0_9->words.w0 = 0xE7000000; temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk4 = 0x8000; - temp_v0_10->unk0 = 0xBA000E02; + temp_v0_10->words.w1 = 0x00008000; + temp_v0_10->words.w0 = 0xBA000E02; temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk0 = 0xFD500000; - temp_v0_11->unk4 = D_8018D4AC; + temp_v0_11->words.w0 = 0xFD500000; + temp_v0_11->words.w1 = D_8018D4AC; temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk4 = 0x7080200; - temp_v0_12->unk0 = 0xF5500000; + temp_v0_12->words.w1 = 0x07080200; + temp_v0_12->words.w0 = 0xF5500000; temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk4 = 0; - temp_v0_13->unk0 = 0xE6000000; + temp_v0_13->words.w1 = 0; + temp_v0_13->words.w0 = 0xE6000000; temp_v0_14 = gDisplayListHead; gDisplayListHead = temp_v0_14 + 8; - temp_v0_14->unk4 = 0x73FF100; - temp_v0_14->unk0 = 0xF3000000; + temp_v0_14->words.w1 = 0x073FF100; + temp_v0_14->words.w0 = 0xF3000000; temp_v0_15 = gDisplayListHead; gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk4 = 0; - temp_v0_15->unk0 = 0xE7000000; + temp_v0_15->words.w1 = 0; + temp_v0_15->words.w0 = 0xE7000000; temp_v0_16 = gDisplayListHead; gDisplayListHead = temp_v0_16 + 8; - temp_v0_16->unk0 = 0xF5481000; - temp_v0_16->unk4 = 0x80200; + temp_v0_16->words.w0 = 0xF5481000; + temp_v0_16->words.w1 = 0x00080200; temp_v0_17 = gDisplayListHead; gDisplayListHead = temp_v0_17 + 8; - temp_v0_17->unk0 = 0xF2000000; - temp_v0_17->unk4 = 0xFC07C; + temp_v0_17->words.w0 = 0xF2000000; + temp_v0_17->words.w1 = 0x000FC07C; temp_v0_18 = gDisplayListHead; gDisplayListHead = temp_v0_18 + 8; - temp_v0_18->unk4 = &D_800E8840; - temp_v0_18->unk0 = 0x400103F; + temp_v0_18->words.w1 = (u32) &D_800E8840; + temp_v0_18->words.w0 = 0x0400103F; temp_v0_19 = gDisplayListHead; gDisplayListHead = temp_v0_19 + 8; - temp_v0_19->unk4 = &D_0D008C78; - temp_v0_19->unk0 = 0x6000000; + temp_v0_19->words.w1 = (u32) D_0D008C78; + temp_v0_19->words.w0 = 0x06000000; temp_v0_20 = gDisplayListHead; gDisplayListHead = temp_v0_20 + 8; - temp_v0_20->unk0 = 0xFD500000; - temp_v0_20->unk4 = D_8018D4B0; + temp_v0_20->words.w0 = 0xFD500000; + temp_v0_20->words.w1 = D_8018D4B0; temp_v0_21 = gDisplayListHead; gDisplayListHead = temp_v0_21 + 8; - temp_v0_21->unk4 = 0x7080200; - temp_v0_21->unk0 = 0xF5500000; + temp_v0_21->words.w1 = 0x07080200; + temp_v0_21->words.w0 = 0xF5500000; temp_v0_22 = gDisplayListHead; gDisplayListHead = temp_v0_22 + 8; - temp_v0_22->unk4 = 0; - temp_v0_22->unk0 = 0xE6000000; + temp_v0_22->words.w1 = 0; + temp_v0_22->words.w0 = 0xE6000000; temp_v0_23 = gDisplayListHead; gDisplayListHead = temp_v0_23 + 8; - temp_v0_23->unk4 = 0x73FF100; - temp_v0_23->unk0 = 0xF3000000; + temp_v0_23->words.w1 = 0x073FF100; + temp_v0_23->words.w0 = 0xF3000000; temp_v0_24 = gDisplayListHead; gDisplayListHead = temp_v0_24 + 8; - temp_v0_24->unk4 = 0; - temp_v0_24->unk0 = 0xE7000000; + temp_v0_24->words.w1 = 0; + temp_v0_24->words.w0 = 0xE7000000; temp_v0_25 = gDisplayListHead; gDisplayListHead = temp_v0_25 + 8; - temp_v0_25->unk0 = 0xF5481000; - temp_v0_25->unk4 = 0x80200; + temp_v0_25->words.w0 = 0xF5481000; + temp_v0_25->words.w1 = 0x00080200; temp_v0_26 = gDisplayListHead; gDisplayListHead = temp_v0_26 + 8; - temp_v0_26->unk0 = 0xF2000000; - temp_v0_26->unk4 = 0xFC07C; + temp_v0_26->words.w0 = 0xF2000000; + temp_v0_26->words.w1 = 0x000FC07C; temp_v0_27 = gDisplayListHead; gDisplayListHead = temp_v0_27 + 8; - temp_v0_27->unk4 = &D_800E8800; - temp_v0_27->unk0 = 0x400103F; + temp_v0_27->words.w1 = (u32) &D_800E8800; + temp_v0_27->words.w0 = 0x0400103F; temp_v0_28 = gDisplayListHead; gDisplayListHead = temp_v0_28 + 8; - temp_v0_28->unk4 = &D_0D008DA0; - temp_v0_28->unk0 = 0x6000000; - D_80164AF0 = D_80164AF0 + 1; + temp_v0_28->words.w1 = (u32) D_0D008DA0; + temp_v0_28->words.w0 = 0x06000000; + D_80164AF0 += 1; } } #else @@ -7911,18 +7037,11 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80067964.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8004B414(s16, s16, s16, ?); // extern -void func_800652D4(f32 *, s16 *, f32); // extern -f32 sins(s32, s8, s8); // extern -f32 coss(s32); // extern -extern Gfx D_0D008DB8; -extern Gfx D_0D008E20; -extern ? D_800E48D4; -extern s16 D_80164AF0; -extern void *gDisplayListHead; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800652D4(f32 *, s16 *, f32); /* extern */ +static ? D_800E48D4; /* unable to generate initializer */ -void func_80067D3C(void *arg0, s8 arg1, s32 arg2, s8 arg3, f32 arg4, s32 arg5) { +void func_80067D3C(Player *player, s8 arg1, s32 arg2, s32 arg3, f32 arg4, s32 arg5) { f32 sp84; f32 sp80; f32 sp7C; @@ -7931,73 +7050,73 @@ void func_80067D3C(void *arg0, s8 arg1, s32 arg2, s8 arg3, f32 arg4, s32 arg5) { s16 sp74; ? sp54; void *sp24; + Gfx *temp_v0_10; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; void *temp_v0; - void *temp_v0_10; - 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; - sp54.unk0 = D_800E48D4.unk0; - sp54.unk4 = D_800E48D4.unk4; - sp54.unkC = D_800E48D4.unkC; - sp54.unk8 = D_800E48D4.unk8; - sp54.unk10 = D_800E48D4.unk10; - sp54.unk14 = D_800E48D4.unk14; - temp_v0 = arg0 + (arg3 * 0x48); - sp54.unk1C = D_800E48D4.unk1C; - sp54.unk18 = D_800E48D4.unk18; + sp54.unk0 = (s32) D_800E48D4.unk0; + sp54.unk4 = (s32) D_800E48D4.unk4; + sp54.unkC = (s32) D_800E48D4.unkC; + sp54.unk8 = (s32) D_800E48D4.unk8; + sp54.unk10 = (s32) D_800E48D4.unk10; + sp54.unk14 = (s32) D_800E48D4.unk14; + temp_v0 = player + ((s8) arg3 * 0x48); + sp54.unk1C = (s32) D_800E48D4.unk1C; + sp54.unk18 = (s32) D_800E48D4.unk18; if (temp_v0->unk814 == 1) { sp74 = 0; sp78 = 0; - sp76 = (arg0 + (arg1 * 2))->unk48; + sp76 = player->unk_048[arg1]; sp24 = temp_v0; - sp7C = (sins((0x4000 - (arg0->unk2E + arg0->unkC0)) & 0xFFFF, arg1, arg3) * arg4) + arg0->unk14; - sp80 = ((arg0->unk18 + arg0->unk70) - (sp + (arg0->unk254 * 4))->unk54) - 2.0f; - sp84 = (coss((0x4000 - (arg0->unk2E + arg0->unkC0)) & 0xFFFF) * arg4) + arg0->unk1C; - func_800652D4(&sp7C, &sp74, temp_v0->unk804 * arg0->unk224); + sp7C = (sins((0x4000 - (player->unk_02C[1] + player->unk_0C0)) & 0xFFFF) * arg4) + player->pos[0]; + sp80 = ((player->pos[1] + player->boundingBoxSize) - (sp + (player->characterId * 4))->unk54) - 2.0f; + sp84 = (coss((0x4000 - (player->unk_02C[1] + player->unk_0C0)) & 0xFFFF) * arg4) + player->pos[2]; + func_800652D4(&sp7C, &sp74, temp_v0->unk804 * player->unk_224); temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0x6000000; - temp_v0_2->unk4 = &D_0D008DB8; + temp_v0_2->words.w0 = 0x06000000; + temp_v0_2->words.w1 = (u32) D_0D008DB8; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0xFD900000; - temp_v0_3->unk4 = arg2; + temp_v0_3->words.w0 = 0xFD900000; + temp_v0_3->words.w1 = (u32) arg2; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x7000000; - temp_v0_4->unk0 = 0xF5900000; + temp_v0_4->words.w1 = 0x07000000; + temp_v0_4->words.w0 = 0xF5900000; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0; - temp_v0_5->unk0 = 0xE6000000; + temp_v0_5->words.w1 = 0; + temp_v0_5->words.w0 = 0xE6000000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0x71FF200; - temp_v0_6->unk0 = 0xF3000000; + temp_v0_6->words.w1 = 0x071FF200; + temp_v0_6->words.w0 = 0xF3000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0; - temp_v0_7->unk0 = 0xE7000000; + temp_v0_7->words.w1 = 0; + temp_v0_7->words.w0 = 0xE7000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0; - temp_v0_8->unk0 = 0xF5880800; + temp_v0_8->words.w1 = 0; + temp_v0_8->words.w0 = 0xF5880800; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk4 = 0x7C07C; - temp_v0_9->unk0 = 0xF2000000; - func_8004B414((arg5 >> 0x10) & 0xFF, (arg5 >> 8) & 0xFF, arg5 & 0xFF, 0xFF); + temp_v0_9->words.w1 = 0x0007C07C; + temp_v0_9->words.w0 = 0xF2000000; + func_8004B414((s32) (s16) ((arg5 >> 0x10) & 0xFF), (s32) (s16) ((arg5 >> 8) & 0xFF), (s32) (s16) (arg5 & 0xFF), 0x000000FF); temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk0 = 0x6000000; - temp_v0_10->unk4 = &D_0D008E20; - D_80164AF0 = D_80164AF0 + 1; + temp_v0_10->words.w0 = 0x06000000; + temp_v0_10->words.w1 = (u32) D_0D008E20; + D_80164AF0 += 1; } } #else @@ -8005,19 +7124,11 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80067D3C.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8004B414(s16, s16, s16, ?); // extern -void func_800652D4(f32 *, s16 *, f32); // extern -f32 sins(s32, s8, s8); // extern -f32 coss(s32); // extern -extern Gfx D_0D008DB8; -extern Gfx D_0D008E20; -extern ? D_800E48F4; -extern f64 D_800EE7C8; -extern s16 D_80164AF0; -extern void *gDisplayListHead; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800652D4(f32 *, s16 *, f32); /* extern */ +static ? D_800E48F4; /* unable to generate initializer */ -void func_8006801C(void *arg0, s8 arg1, s32 arg2, s8 arg3, f32 arg4, s32 arg5) { +void func_8006801C(Player *player, s8 arg1, s32 arg2, s32 arg3, f32 arg4, s32 arg5) { f32 sp84; f32 sp80; f32 sp7C; @@ -8026,73 +7137,73 @@ void func_8006801C(void *arg0, s8 arg1, s32 arg2, s8 arg3, f32 arg4, s32 arg5) { s16 sp74; ? sp54; void *sp24; + Gfx *temp_v0_10; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; void *temp_v0; - void *temp_v0_10; - 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; - sp54.unk0 = D_800E48F4.unk0; - sp54.unk4 = D_800E48F4.unk4; - sp54.unkC = D_800E48F4.unkC; - sp54.unk8 = D_800E48F4.unk8; - sp54.unk10 = D_800E48F4.unk10; - sp54.unk14 = D_800E48F4.unk14; - temp_v0 = arg0 + (arg3 * 0x48); - sp54.unk1C = D_800E48F4.unk1C; - sp54.unk18 = D_800E48F4.unk18; + sp54.unk0 = (s32) D_800E48F4.unk0; + sp54.unk4 = (s32) D_800E48F4.unk4; + sp54.unkC = (s32) D_800E48F4.unkC; + sp54.unk8 = (s32) D_800E48F4.unk8; + sp54.unk10 = (s32) D_800E48F4.unk10; + sp54.unk14 = (s32) D_800E48F4.unk14; + temp_v0 = player + ((s8) arg3 * 0x48); + sp54.unk1C = (s32) D_800E48F4.unk1C; + sp54.unk18 = (s32) D_800E48F4.unk18; if (temp_v0->unk814 == 1) { sp74 = 0; sp78 = 0; - sp76 = (arg0 + (arg1 * 2))->unk48; + sp76 = player->unk_048[arg1]; sp24 = temp_v0; - sp7C = (sins((0x4000 - (arg0->unk2E + arg0->unkC0)) & 0xFFFF, arg1, arg3) * arg4) + arg0->unk14; - sp80 = ((arg0->unk18 + arg0->unk70) - (sp + (arg0->unk254 * 4))->unk54) - 2.0f; - sp84 = (coss((0x4000 - (arg0->unk2E + arg0->unkC0)) & 0xFFFF) * arg4) + arg0->unk1C; - func_800652D4(&sp7C, &sp74, (temp_v0->unk804 * arg0->unk224) * D_800EE7C8); + sp7C = (sins((0x4000 - (player->unk_02C[1] + player->unk_0C0)) & 0xFFFF) * arg4) + player->pos[0]; + sp80 = ((player->pos[1] + player->boundingBoxSize) - (sp + (player->characterId * 4))->unk54) - 2.0f; + sp84 = (coss((0x4000 - (player->unk_02C[1] + player->unk_0C0)) & 0xFFFF) * arg4) + player->pos[2]; + func_800652D4(&sp7C, &sp74, (f32) ((f64) (temp_v0->unk804 * player->unk_224) * 0.8)); temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0x6000000; - temp_v0_2->unk4 = &D_0D008DB8; + temp_v0_2->words.w0 = 0x06000000; + temp_v0_2->words.w1 = (u32) D_0D008DB8; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0xFD900000; - temp_v0_3->unk4 = arg2; + temp_v0_3->words.w0 = 0xFD900000; + temp_v0_3->words.w1 = (u32) arg2; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x7000000; - temp_v0_4->unk0 = 0xF5900000; + temp_v0_4->words.w1 = 0x07000000; + temp_v0_4->words.w0 = 0xF5900000; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0; - temp_v0_5->unk0 = 0xE6000000; + temp_v0_5->words.w1 = 0; + temp_v0_5->words.w0 = 0xE6000000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0x71FF200; - temp_v0_6->unk0 = 0xF3000000; + temp_v0_6->words.w1 = 0x071FF200; + temp_v0_6->words.w0 = 0xF3000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0; - temp_v0_7->unk0 = 0xE7000000; + temp_v0_7->words.w1 = 0; + temp_v0_7->words.w0 = 0xE7000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0; - temp_v0_8->unk0 = 0xF5880800; + temp_v0_8->words.w1 = 0; + temp_v0_8->words.w0 = 0xF5880800; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk4 = 0x7C07C; - temp_v0_9->unk0 = 0xF2000000; - func_8004B414((arg5 >> 0x10) & 0xFF, (arg5 >> 8) & 0xFF, arg5 & 0xFF, 0xFF); + temp_v0_9->words.w1 = 0x0007C07C; + temp_v0_9->words.w0 = 0xF2000000; + func_8004B414((s32) (s16) ((arg5 >> 0x10) & 0xFF), (s32) (s16) ((arg5 >> 8) & 0xFF), (s32) (s16) (arg5 & 0xFF), 0x000000FF); temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk0 = 0x6000000; - temp_v0_10->unk4 = &D_0D008E20; - D_80164AF0 = D_80164AF0 + 1; + temp_v0_10->words.w0 = 0x06000000; + temp_v0_10->words.w1 = (u32) D_0D008E20; + D_80164AF0 += 1; } } #else @@ -8100,22 +7211,15 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006801C.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_800652D4(f32 *, s16 *, f32); // extern -f32 sins(u16); // extern -f32 coss(u16); // extern -extern Gfx D_0D008C78; -extern Gfx D_0D008C90; -extern Gfx D_0D008DA0; -extern ? D_800E52D0; -extern ? D_800E8880; -extern ? D_800E88C0; -extern s16 D_80164AF0; -extern s32 D_8018D4B4; -extern s32 D_8018D4B8; -extern void *gDisplayListHead; - -void func_80068310(void *arg0, ? arg1, ? arg2, s8 arg3, s8 arg4) { +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800652D4(f32 *, s16 *, f32); /* extern */ +extern u32 D_8018D4B4; +extern u32 D_8018D4B8; +static ? D_800E52D0; /* unable to generate initializer */ +static ? D_800E8880; /* unable to generate initializer */ +static ? D_800E88C0; /* unable to generate initializer */ + +void func_80068310(Player *player, s8 arg1, s32 arg2, s8 arg3, s32 arg4) { f32 spA4; f32 spA0; f32 sp9C; @@ -8124,156 +7228,152 @@ void func_80068310(void *arg0, ? arg1, ? arg2, s8 arg3, s8 arg4) { s16 sp94; void *sp28; void *sp24; - f32 *temp_a0; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_14; + Gfx *temp_v0_15; + Gfx *temp_v0_16; + Gfx *temp_v0_17; + Gfx *temp_v0_18; + Gfx *temp_v0_19; + Gfx *temp_v0_20; + Gfx *temp_v0_21; + Gfx *temp_v0_22; + Gfx *temp_v0_23; + Gfx *temp_v0_24; + Gfx *temp_v0_25; + Gfx *temp_v0_26; + Gfx *temp_v0_27; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; f32 temp_f4; 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_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; - void *temp_v1; - temp_v0 = arg0 + (arg4 * 0x48); + temp_v0 = player + ((s8) arg4 * 0x48); if (temp_v0->unk814 == 1) { - temp_v1 = arg0 + (arg3 * 2); spA0 = temp_v0->unk7FC; - sp24 = temp_v1; + sp24 = player + (arg3 * 2); sp28 = temp_v0; - spA4 = (coss(temp_v1->unk48) * -10.0f) + arg0->unk1C; + spA4 = (coss((u16) player->unk_048[arg3]) * -10.0f) + player->pos[2]; temp_f4 = sins(sp24->unk48) * -10.0f; sp94 = 0; - temp_a0 = &sp9C; - sp9C = temp_f4 + arg0->unk14; + sp9C = temp_f4 + player->pos[0]; sp98 = 0; - sp96 = sp24->unk48; - func_800652D4(temp_a0, &sp94, temp_v0->unk804 * arg0->unk224); + sp96 = (s16) sp24->unk48; + func_800652D4(&sp9C, &sp94, temp_v0->unk804 * player->unk_224); temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk4 = &D_0D008C90; - temp_v0_2->unk0 = 0x6000000; + temp_v0_2->words.w1 = (u32) D_0D008C90; + temp_v0_2->words.w0 = 0x06000000; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0xFD100000; - temp_v0_3->unk4 = &D_800E52D0; + temp_v0_3->words.w0 = 0xFD100000; + temp_v0_3->words.w1 = (u32) &D_800E52D0; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0; - temp_v0_4->unk0 = 0xE8000000; + temp_v0_4->words.w1 = 0; + temp_v0_4->words.w0 = 0xE8000000; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0x7000000; - temp_v0_5->unk0 = 0xF5000100; + temp_v0_5->words.w1 = 0x07000000; + temp_v0_5->words.w0 = 0xF5000100; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0; - temp_v0_6->unk0 = 0xE6000000; + temp_v0_6->words.w1 = 0; + temp_v0_6->words.w0 = 0xE6000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0x73FC000; - temp_v0_7->unk0 = 0xF0000000; + temp_v0_7->words.w1 = 0x073FC000; + temp_v0_7->words.w0 = 0xF0000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0; - temp_v0_8->unk0 = 0xE7000000; + temp_v0_8->words.w1 = 0; + temp_v0_8->words.w0 = 0xE7000000; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk4 = 0x8000; - temp_v0_9->unk0 = 0xBA000E02; + temp_v0_9->words.w1 = 0x00008000; + temp_v0_9->words.w0 = 0xBA000E02; temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk0 = 0xFD500000; - temp_v0_10->unk4 = D_8018D4B4; + temp_v0_10->words.w0 = 0xFD500000; + temp_v0_10->words.w1 = D_8018D4B4; temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk4 = 0x7080200; - temp_v0_11->unk0 = 0xF5500000; + temp_v0_11->words.w1 = 0x07080200; + temp_v0_11->words.w0 = 0xF5500000; temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk4 = 0; - temp_v0_12->unk0 = 0xE6000000; + temp_v0_12->words.w1 = 0; + temp_v0_12->words.w0 = 0xE6000000; temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk4 = 0x73FF100; - temp_v0_13->unk0 = 0xF3000000; + temp_v0_13->words.w1 = 0x073FF100; + temp_v0_13->words.w0 = 0xF3000000; temp_v0_14 = gDisplayListHead; gDisplayListHead = temp_v0_14 + 8; - temp_v0_14->unk4 = 0; - temp_v0_14->unk0 = 0xE7000000; + temp_v0_14->words.w1 = 0; + temp_v0_14->words.w0 = 0xE7000000; temp_v0_15 = gDisplayListHead; gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk0 = 0xF5481000; - temp_v0_15->unk4 = 0x80200; + temp_v0_15->words.w0 = 0xF5481000; + temp_v0_15->words.w1 = 0x00080200; temp_v0_16 = gDisplayListHead; gDisplayListHead = temp_v0_16 + 8; - temp_v0_16->unk0 = 0xF2000000; - temp_v0_16->unk4 = 0xFC07C; + temp_v0_16->words.w0 = 0xF2000000; + temp_v0_16->words.w1 = 0x000FC07C; temp_v0_17 = gDisplayListHead; gDisplayListHead = temp_v0_17 + 8; - temp_v0_17->unk4 = &D_800E8880; - temp_v0_17->unk0 = 0x400103F; + temp_v0_17->words.w1 = (u32) &D_800E8880; + temp_v0_17->words.w0 = 0x0400103F; temp_v0_18 = gDisplayListHead; gDisplayListHead = temp_v0_18 + 8; - temp_v0_18->unk4 = &D_0D008C78; - temp_v0_18->unk0 = 0x6000000; + temp_v0_18->words.w1 = (u32) D_0D008C78; + temp_v0_18->words.w0 = 0x06000000; temp_v0_19 = gDisplayListHead; gDisplayListHead = temp_v0_19 + 8; - temp_v0_19->unk0 = 0xFD500000; - temp_v0_19->unk4 = D_8018D4B8; + temp_v0_19->words.w0 = 0xFD500000; + temp_v0_19->words.w1 = D_8018D4B8; temp_v0_20 = gDisplayListHead; gDisplayListHead = temp_v0_20 + 8; - temp_v0_20->unk4 = 0x7080200; - temp_v0_20->unk0 = 0xF5500000; + temp_v0_20->words.w1 = 0x07080200; + temp_v0_20->words.w0 = 0xF5500000; temp_v0_21 = gDisplayListHead; gDisplayListHead = temp_v0_21 + 8; - temp_v0_21->unk4 = 0; - temp_v0_21->unk0 = 0xE6000000; + temp_v0_21->words.w1 = 0; + temp_v0_21->words.w0 = 0xE6000000; temp_v0_22 = gDisplayListHead; gDisplayListHead = temp_v0_22 + 8; - temp_v0_22->unk4 = 0x73FF100; - temp_v0_22->unk0 = 0xF3000000; + temp_v0_22->words.w1 = 0x073FF100; + temp_v0_22->words.w0 = 0xF3000000; temp_v0_23 = gDisplayListHead; gDisplayListHead = temp_v0_23 + 8; - temp_v0_23->unk4 = 0; - temp_v0_23->unk0 = 0xE7000000; + temp_v0_23->words.w1 = 0; + temp_v0_23->words.w0 = 0xE7000000; temp_v0_24 = gDisplayListHead; gDisplayListHead = temp_v0_24 + 8; - temp_v0_24->unk0 = 0xF5481000; - temp_v0_24->unk4 = 0x80200; + temp_v0_24->words.w0 = 0xF5481000; + temp_v0_24->words.w1 = 0x00080200; temp_v0_25 = gDisplayListHead; gDisplayListHead = temp_v0_25 + 8; - temp_v0_25->unk0 = 0xF2000000; - temp_v0_25->unk4 = 0xFC07C; + temp_v0_25->words.w0 = 0xF2000000; + temp_v0_25->words.w1 = 0x000FC07C; temp_v0_26 = gDisplayListHead; gDisplayListHead = temp_v0_26 + 8; - temp_v0_26->unk4 = &D_800E88C0; - temp_v0_26->unk0 = 0x400103F; + temp_v0_26->words.w1 = (u32) &D_800E88C0; + temp_v0_26->words.w0 = 0x0400103F; temp_v0_27 = gDisplayListHead; gDisplayListHead = temp_v0_27 + 8; - temp_v0_27->unk4 = &D_0D008DA0; - temp_v0_27->unk0 = 0x6000000; - D_80164AF0 = D_80164AF0 + 1; + temp_v0_27->words.w1 = (u32) D_0D008DA0; + temp_v0_27->words.w0 = 0x06000000; + D_80164AF0 += 1; } } #else @@ -8281,21 +7381,14 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80068310.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_800652D4(f32 *, s16 *, f32); // extern -f32 sins(u16); // extern -f32 coss(u16); // extern -extern Gfx D_0D008C78; -extern Gfx D_0D008DA0; -extern Gfx D_0D008DB8; -extern ? D_800E8A00; -extern ? D_800E8A40; -extern s16 D_80164AF0; -extern s32 D_8018D4C4; -extern s32 D_8018D4C8; -extern void *gDisplayListHead; - -void func_80068724(void *arg0, ? arg1, ? arg2, s8 arg3, s8 arg4) { +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800652D4(f32 *, s16 *, f32); /* extern */ +extern u32 D_8018D4C4; +extern u32 D_8018D4C8; +static ? D_800E8A00; /* unable to generate initializer */ +static ? D_800E8A40; /* unable to generate initializer */ + +void func_80068724(Player *player, s8 arg1, s32 arg2, s8 arg3, s32 arg4) { f32 sp8C; f32 sp88; f32 sp84; @@ -8304,131 +7397,127 @@ void func_80068724(void *arg0, ? arg1, ? arg2, s8 arg3, s8 arg4) { s16 sp7C; void *sp24; void *sp20; - f32 *temp_a0; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_14; + Gfx *temp_v0_15; + Gfx *temp_v0_16; + Gfx *temp_v0_17; + Gfx *temp_v0_18; + Gfx *temp_v0_19; + Gfx *temp_v0_20; + Gfx *temp_v0_21; + Gfx *temp_v0_22; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; f32 temp_f8; 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_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; - void *temp_v1; - temp_v0 = arg0 + (arg4 * 0x48); + temp_v0 = player + ((s8) arg4 * 0x48); if (temp_v0->unk814 == 1) { - temp_v1 = arg0 + (arg3 * 2); - sp88 = arg0->unk18 - 3.0f; - sp20 = temp_v1; + sp88 = player->pos[1] - 3.0f; + sp20 = player + (arg3 * 2); sp24 = temp_v0; - sp8C = (coss(temp_v1->unk48) * -10.0f) + arg0->unk1C; + sp8C = (coss((u16) player->unk_048[arg3]) * -10.0f) + player->pos[2]; temp_f8 = sins(sp20->unk48) * -10.0f; sp7C = 0; - temp_a0 = &sp84; - sp84 = temp_f8 + arg0->unk14; + sp84 = temp_f8 + player->pos[0]; sp80 = 0; - sp7E = sp20->unk48; - func_800652D4(temp_a0, &sp7C, temp_v0->unk804 * arg0->unk224); + sp7E = (s16) sp20->unk48; + func_800652D4(&sp84, &sp7C, temp_v0->unk804 * player->unk_224); temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk4 = &D_0D008DB8; - temp_v0_2->unk0 = 0x6000000; + temp_v0_2->words.w1 = (u32) D_0D008DB8; + temp_v0_2->words.w0 = 0x06000000; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = -0xC07; - temp_v0_3->unk0 = 0xFC127E24; + temp_v0_3->words.w1 = -0x00000C07U; + temp_v0_3->words.w0 = 0xFC127E24; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x504B50; - temp_v0_4->unk0 = 0xB900031D; + temp_v0_4->words.w1 = 0x00504B50; + temp_v0_4->words.w0 = 0xB900031D; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk0 = 0xFD700000; - temp_v0_5->unk4 = D_8018D4C4; + temp_v0_5->words.w0 = 0xFD700000; + temp_v0_5->words.w1 = D_8018D4C4; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0x7000000; - temp_v0_6->unk0 = 0xF5700000; + temp_v0_6->words.w1 = 0x07000000; + temp_v0_6->words.w0 = 0xF5700000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0; - temp_v0_7->unk0 = 0xE6000000; + temp_v0_7->words.w1 = 0; + temp_v0_7->words.w0 = 0xE6000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0x73FF200; - temp_v0_8->unk0 = 0xF3000000; + temp_v0_8->words.w1 = 0x073FF200; + temp_v0_8->words.w0 = 0xF3000000; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk4 = 0; - temp_v0_9->unk0 = 0xE7000000; + temp_v0_9->words.w1 = 0; + temp_v0_9->words.w0 = 0xE7000000; temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk4 = 0; - temp_v0_10->unk0 = 0xF5680800; + temp_v0_10->words.w1 = 0; + temp_v0_10->words.w0 = 0xF5680800; temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk4 = 0x7C0FC; - temp_v0_11->unk0 = 0xF2000000; + temp_v0_11->words.w1 = 0x0007C0FC; + temp_v0_11->words.w0 = 0xF2000000; temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk4 = &D_800E8A00; - temp_v0_12->unk0 = 0x400103F; + temp_v0_12->words.w1 = (u32) &D_800E8A00; + temp_v0_12->words.w0 = 0x0400103F; temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk4 = &D_0D008C78; - temp_v0_13->unk0 = 0x6000000; + temp_v0_13->words.w1 = (u32) D_0D008C78; + temp_v0_13->words.w0 = 0x06000000; temp_v0_14 = gDisplayListHead; gDisplayListHead = temp_v0_14 + 8; - temp_v0_14->unk0 = 0xFD700000; - temp_v0_14->unk4 = D_8018D4C8; + temp_v0_14->words.w0 = 0xFD700000; + temp_v0_14->words.w1 = D_8018D4C8; temp_v0_15 = gDisplayListHead; gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk4 = 0x7000000; - temp_v0_15->unk0 = 0xF5700000; + temp_v0_15->words.w1 = 0x07000000; + temp_v0_15->words.w0 = 0xF5700000; temp_v0_16 = gDisplayListHead; gDisplayListHead = temp_v0_16 + 8; - temp_v0_16->unk4 = 0; - temp_v0_16->unk0 = 0xE6000000; + temp_v0_16->words.w1 = 0; + temp_v0_16->words.w0 = 0xE6000000; temp_v0_17 = gDisplayListHead; gDisplayListHead = temp_v0_17 + 8; - temp_v0_17->unk4 = 0x73FF200; - temp_v0_17->unk0 = 0xF3000000; + temp_v0_17->words.w1 = 0x073FF200; + temp_v0_17->words.w0 = 0xF3000000; temp_v0_18 = gDisplayListHead; gDisplayListHead = temp_v0_18 + 8; - temp_v0_18->unk4 = 0; - temp_v0_18->unk0 = 0xE7000000; + temp_v0_18->words.w1 = 0; + temp_v0_18->words.w0 = 0xE7000000; temp_v0_19 = gDisplayListHead; gDisplayListHead = temp_v0_19 + 8; - temp_v0_19->unk4 = 0; - temp_v0_19->unk0 = 0xF5680800; + temp_v0_19->words.w1 = 0; + temp_v0_19->words.w0 = 0xF5680800; temp_v0_20 = gDisplayListHead; gDisplayListHead = temp_v0_20 + 8; - temp_v0_20->unk4 = 0x7C0FC; - temp_v0_20->unk0 = 0xF2000000; + temp_v0_20->words.w1 = 0x0007C0FC; + temp_v0_20->words.w0 = 0xF2000000; temp_v0_21 = gDisplayListHead; gDisplayListHead = temp_v0_21 + 8; - temp_v0_21->unk4 = &D_800E8A40; - temp_v0_21->unk0 = 0x400103F; + temp_v0_21->words.w1 = (u32) &D_800E8A40; + temp_v0_21->words.w0 = 0x0400103F; temp_v0_22 = gDisplayListHead; gDisplayListHead = temp_v0_22 + 8; - temp_v0_22->unk4 = &D_0D008DA0; - temp_v0_22->unk0 = 0x6000000; - D_80164AF0 = D_80164AF0 + 1; + temp_v0_22->words.w1 = (u32) D_0D008DA0; + temp_v0_22->words.w0 = 0x06000000; + D_80164AF0 += 1; } } #else @@ -8436,112 +7525,99 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80068724.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8004B35C(?, ?, ?, ?); // extern -void func_800652D4(f32 *, s16 *, f32); // extern -f32 sins(u16); // extern -f32 coss(u16); // extern -extern Gfx D_0D008D58; -extern Gfx D_0D008DA0; -extern ? D_800E8B40; -extern s16 D_80164AF0; -extern s32 D_8018D4A0; -extern void *gDisplayListHead; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800652D4(f32 *, s16 *, f32); /* extern */ +extern u32 D_8018D4A0; +static ? D_800E8B40; /* unable to generate initializer */ -void func_80068AA4(void *arg0, ? arg1, ? arg2, s8 arg3, s8 arg4) { +void func_80068AA4(Player *player, s8 arg1, s32 arg2, s8 arg3, s32 arg4) { f32 sp6C; f32 sp68; f32 sp64; s16 sp60; s16 sp5E; s16 sp5C; - void *sp38; + Gfx *sp38; void *sp28; void *sp24; - f32 *temp_a0; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; f64 temp_f18; void *temp_v0; - void *temp_v0_10; - void *temp_v0_11; - void *temp_v0_12; - void *temp_v0_13; - 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; - void *temp_v1; - temp_v0 = arg0 + (arg4 * 0x48); - if (temp_v0->unk814 == 1) { - temp_v1 = arg0 + (arg3 * 2); - if (temp_v1->unk244 < 0xD) { - sp68 = arg0->unk18 - 3.0f; - sp24 = temp_v1; - sp28 = temp_v0; - sp6C = (coss(temp_v1->unk48) * (-2.5 * temp_v0->unk816)) + arg0->unk1C; - temp_f18 = sins(temp_v1->unk48); - temp_a0 = &sp64; - sp5C = 0; - sp64 = (temp_f18 * (-2.5 * temp_v0->unk816)) + arg0->unk14; - sp60 = 0; - sp5E = temp_v1->unk48; - func_800652D4(temp_a0, &sp5C, temp_v0->unk804 * arg0->unk224); - temp_v0_2 = gDisplayListHead; - gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0x6000000; - temp_v0_2->unk4 = &D_0D008D58; - temp_v0_3 = gDisplayListHead; - gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = 0; - temp_v0_3->unk0 = 0xBA000E02; - temp_v0_4 = gDisplayListHead; - gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk0 = 0xFD700000; - temp_v0_4->unk4 = D_8018D4A0; - temp_v0_5 = gDisplayListHead; - gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0x7080200; - temp_v0_5->unk0 = 0xF5700000; - temp_v0_6 = gDisplayListHead; - gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0; - temp_v0_6->unk0 = 0xE6000000; - temp_v0_7 = gDisplayListHead; - gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0x73FF100; - temp_v0_7->unk0 = 0xF3000000; - temp_v0_8 = gDisplayListHead; - gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0; - temp_v0_8->unk0 = 0xE7000000; - temp_v0_9 = gDisplayListHead; - gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk0 = 0xF5681000; - temp_v0_9->unk4 = 0x80200; - temp_v0_10 = gDisplayListHead; - gDisplayListHead = temp_v0_10 + 8; - sp38 = temp_v0_10; - temp_v0_10->unk4 = 0xFC07C; - temp_v0_10->unk0 = 0xF2000000; - func_8004B35C(0xFF, 0xFF, 0xFF, 0xFF); - temp_v0_11 = gDisplayListHead; - gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk0 = 0xB900031D; - temp_v0_11->unk4 = 0x504B50; - temp_v0_12 = gDisplayListHead; - gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk4 = &D_800E8B40; - temp_v0_12->unk0 = 0x400103F; - temp_v0_13 = gDisplayListHead; - gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk0 = 0x6000000; - temp_v0_13->unk4 = &D_0D008DA0; - D_80164AF0 = D_80164AF0 + 1; - } + temp_v0 = player + ((s8) arg4 * 0x48); + if ((temp_v0->unk814 == 1) && ((s32) player->unk_244[arg3] < 0xD)) { + sp68 = player->pos[1] - 3.0f; + sp24 = player + (arg3 * 2); + sp28 = temp_v0; + sp6C = (f32) (((f64) coss((u16) player->unk_048[arg3]) * (-2.5 * (f64) temp_v0->unk816)) + (f64) player->pos[2]); + temp_f18 = (f64) sins((u16) player->unk_048[arg3]); + sp5C = 0; + sp64 = (f32) ((temp_f18 * (-2.5 * (f64) temp_v0->unk816)) + (f64) player->pos[0]); + sp60 = 0; + sp5E = player->unk_048[arg3]; + func_800652D4(&sp64, &sp5C, temp_v0->unk804 * player->unk_224); + temp_v0_2 = gDisplayListHead; + gDisplayListHead = temp_v0_2 + 8; + temp_v0_2->words.w0 = 0x06000000; + temp_v0_2->words.w1 = (u32) D_0D008D58; + temp_v0_3 = gDisplayListHead; + gDisplayListHead = temp_v0_3 + 8; + temp_v0_3->words.w1 = 0; + temp_v0_3->words.w0 = 0xBA000E02; + temp_v0_4 = gDisplayListHead; + gDisplayListHead = temp_v0_4 + 8; + temp_v0_4->words.w0 = 0xFD700000; + temp_v0_4->words.w1 = D_8018D4A0; + temp_v0_5 = gDisplayListHead; + gDisplayListHead = temp_v0_5 + 8; + temp_v0_5->words.w1 = 0x07080200; + temp_v0_5->words.w0 = 0xF5700000; + temp_v0_6 = gDisplayListHead; + gDisplayListHead = temp_v0_6 + 8; + temp_v0_6->words.w1 = 0; + temp_v0_6->words.w0 = 0xE6000000; + temp_v0_7 = gDisplayListHead; + gDisplayListHead = temp_v0_7 + 8; + temp_v0_7->words.w1 = 0x073FF100; + temp_v0_7->words.w0 = 0xF3000000; + temp_v0_8 = gDisplayListHead; + gDisplayListHead = temp_v0_8 + 8; + temp_v0_8->words.w1 = 0; + temp_v0_8->words.w0 = 0xE7000000; + temp_v0_9 = gDisplayListHead; + gDisplayListHead = temp_v0_9 + 8; + temp_v0_9->words.w0 = 0xF5681000; + temp_v0_9->words.w1 = 0x00080200; + temp_v0_10 = gDisplayListHead; + gDisplayListHead = temp_v0_10 + 8; + sp38 = temp_v0_10; + temp_v0_10->words.w1 = 0x000FC07C; + temp_v0_10->words.w0 = 0xF2000000; + func_8004B35C(0x000000FF, 0x000000FF, 0x000000FF, 0x000000FF); + temp_v0_11 = gDisplayListHead; + gDisplayListHead = temp_v0_11 + 8; + temp_v0_11->words.w0 = 0xB900031D; + temp_v0_11->words.w1 = 0x00504B50; + temp_v0_12 = gDisplayListHead; + gDisplayListHead = temp_v0_12 + 8; + temp_v0_12->words.w1 = (u32) &D_800E8B40; + temp_v0_12->words.w0 = 0x0400103F; + temp_v0_13 = gDisplayListHead; + gDisplayListHead = temp_v0_13 + 8; + temp_v0_13->words.w0 = 0x06000000; + temp_v0_13->words.w1 = (u32) D_0D008DA0; + D_80164AF0 += 1; } } #else @@ -8549,22 +7625,15 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80068AA4.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_800652D4(f32 *, s16 *, f32); // extern -f32 sins(u16); // extern -f32 coss(u16); // extern -extern Gfx D_0D008C78; -extern Gfx D_0D008C90; -extern Gfx D_0D008DA0; -extern ? D_800E52D0; -extern ? D_800E8B80; -extern ? D_800E8BC0; -extern s16 D_80164AF0; -extern s32 D_8018D4A4; -extern s32 D_8018D4A8; -extern void *gDisplayListHead; - -void func_80068DA0(void *arg0, ? arg1, ? arg2, s8 arg3, s8 arg4) { +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800652D4(f32 *, s16 *, f32); /* extern */ +extern u32 D_8018D4A4; +extern u32 D_8018D4A8; +static ? D_800E52D0; /* unable to generate initializer */ +static ? D_800E8B80; /* unable to generate initializer */ +static ? D_800E8BC0; /* unable to generate initializer */ + +void func_80068DA0(Player *player, s8 arg1, s32 arg2, s8 arg3, s32 arg4) { f32 spA4; f32 spA0; f32 sp9C; @@ -8573,158 +7642,152 @@ void func_80068DA0(void *arg0, ? arg1, ? arg2, s8 arg3, s8 arg4) { s16 sp94; void *sp28; void *sp24; - f32 *temp_a0; + Gfx *temp_v0; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_14; + Gfx *temp_v0_15; + Gfx *temp_v0_16; + Gfx *temp_v0_17; + Gfx *temp_v0_18; + Gfx *temp_v0_19; + Gfx *temp_v0_20; + Gfx *temp_v0_21; + Gfx *temp_v0_22; + Gfx *temp_v0_23; + Gfx *temp_v0_24; + Gfx *temp_v0_25; + Gfx *temp_v0_26; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; f32 temp_f16; - 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_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; void *temp_v1; - temp_v1 = arg0 + (arg4 * 0x48); - if (temp_v1->unk814 == 1) { - temp_v0 = arg0 + (arg3 * 2); - if (temp_v0->unk244 < 0xD) { - spA0 = temp_v1->unk7FC + (arg0->unk18 - 3.0f); - sp28 = temp_v1; - sp24 = temp_v0; - spA4 = (coss(temp_v0->unk48) * -10.0f) + arg0->unk1C; - temp_f16 = sins(temp_v0->unk48) * -10.0f; - sp94 = 0; - temp_a0 = &sp9C; - sp9C = temp_f16 + arg0->unk14; - sp98 = 0; - sp96 = temp_v0->unk48; - func_800652D4(temp_a0, &sp94, temp_v1->unk804 * arg0->unk224); - temp_v0_2 = gDisplayListHead; - gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk4 = &D_0D008C90; - temp_v0_2->unk0 = 0x6000000; - temp_v0_3 = gDisplayListHead; - gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0xFD100000; - temp_v0_3->unk4 = &D_800E52D0; - temp_v0_4 = gDisplayListHead; - gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0; - temp_v0_4->unk0 = 0xE8000000; - temp_v0_5 = gDisplayListHead; - gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0x7000000; - temp_v0_5->unk0 = 0xF5000100; - temp_v0_6 = gDisplayListHead; - gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0; - temp_v0_6->unk0 = 0xE6000000; - temp_v0_7 = gDisplayListHead; - gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0x73FC000; - temp_v0_7->unk0 = 0xF0000000; - temp_v0_8 = gDisplayListHead; - gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0; - temp_v0_8->unk0 = 0xE7000000; - temp_v0_9 = gDisplayListHead; - gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk4 = 0x8000; - temp_v0_9->unk0 = 0xBA000E02; - temp_v0_10 = gDisplayListHead; - gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk0 = 0xFD500000; - temp_v0_10->unk4 = D_8018D4A4; - temp_v0_11 = gDisplayListHead; - gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk4 = 0x7000000; - temp_v0_11->unk0 = 0xF5500000; - temp_v0_12 = gDisplayListHead; - gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk4 = 0; - temp_v0_12->unk0 = 0xE6000000; - temp_v0_13 = gDisplayListHead; - gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk4 = 0x73FF100; - temp_v0_13->unk0 = 0xF3000000; - temp_v0_14 = gDisplayListHead; - gDisplayListHead = temp_v0_14 + 8; - temp_v0_14->unk4 = 0; - temp_v0_14->unk0 = 0xE7000000; - temp_v0_15 = gDisplayListHead; - gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk4 = 0; - temp_v0_15->unk0 = 0xF5481000; - temp_v0_16 = gDisplayListHead; - gDisplayListHead = temp_v0_16 + 8; - temp_v0_16->unk4 = 0xFC07C; - temp_v0_16->unk0 = 0xF2000000; - temp_v0_17 = gDisplayListHead; - gDisplayListHead = temp_v0_17 + 8; - temp_v0_17->unk4 = &D_800E8B80; - temp_v0_17->unk0 = 0x400103F; - temp_v0_18 = gDisplayListHead; - gDisplayListHead = temp_v0_18 + 8; - temp_v0_18->unk4 = &D_0D008C78; - temp_v0_18->unk0 = 0x6000000; - temp_v0_19 = gDisplayListHead; - gDisplayListHead = temp_v0_19 + 8; - temp_v0_19->unk0 = 0xFD500000; - temp_v0_19->unk4 = D_8018D4A8; - temp_v0_20 = gDisplayListHead; - gDisplayListHead = temp_v0_20 + 8; - temp_v0_20->unk4 = 0x7000000; - temp_v0_20->unk0 = 0xF5500000; - temp_v0_21 = gDisplayListHead; - gDisplayListHead = temp_v0_21 + 8; - temp_v0_21->unk4 = 0; - temp_v0_21->unk0 = 0xE6000000; - temp_v0_22 = gDisplayListHead; - gDisplayListHead = temp_v0_22 + 8; - temp_v0_22->unk4 = 0x73FF100; - temp_v0_22->unk0 = 0xF3000000; - temp_v0_23 = gDisplayListHead; - gDisplayListHead = temp_v0_23 + 8; - temp_v0_23->unk4 = 0; - temp_v0_23->unk0 = 0xE7000000; - temp_v0_24 = gDisplayListHead; - gDisplayListHead = temp_v0_24 + 8; - temp_v0_24->unk4 = 0; - temp_v0_24->unk0 = 0xF5481000; - temp_v0_25 = gDisplayListHead; - gDisplayListHead = temp_v0_25 + 8; - temp_v0_25->unk4 = 0xFC07C; - temp_v0_25->unk0 = 0xF2000000; - temp_v0_26 = gDisplayListHead; - gDisplayListHead = temp_v0_26 + 8; - temp_v0_26->unk4 = &D_800E8BC0; - temp_v0_26->unk0 = 0x400103F; - temp_v0_27 = gDisplayListHead; - gDisplayListHead = temp_v0_27 + 8; - temp_v0_27->unk4 = &D_0D008DA0; - temp_v0_27->unk0 = 0x6000000; - D_80164AF0 = D_80164AF0 + 1; - } + temp_v1 = player + ((s8) arg4 * 0x48); + if ((temp_v1->unk814 == 1) && ((s32) player->unk_244[arg3] < 0xD)) { + spA0 = temp_v1->unk7FC + (player->pos[1] - 3.0f); + sp28 = temp_v1; + sp24 = player + (arg3 * 2); + spA4 = (coss((u16) player->unk_048[arg3]) * -10.0f) + player->pos[2]; + temp_f16 = sins((u16) player->unk_048[arg3]) * -10.0f; + sp94 = 0; + sp9C = temp_f16 + player->pos[0]; + sp98 = 0; + sp96 = player->unk_048[arg3]; + func_800652D4(&sp9C, &sp94, temp_v1->unk804 * player->unk_224); + temp_v0 = gDisplayListHead; + gDisplayListHead = temp_v0 + 8; + temp_v0->words.w1 = (u32) D_0D008C90; + temp_v0->words.w0 = 0x06000000; + temp_v0_2 = gDisplayListHead; + gDisplayListHead = temp_v0_2 + 8; + temp_v0_2->words.w0 = 0xFD100000; + temp_v0_2->words.w1 = (u32) &D_800E52D0; + temp_v0_3 = gDisplayListHead; + gDisplayListHead = temp_v0_3 + 8; + temp_v0_3->words.w1 = 0; + temp_v0_3->words.w0 = 0xE8000000; + temp_v0_4 = gDisplayListHead; + gDisplayListHead = temp_v0_4 + 8; + temp_v0_4->words.w1 = 0x07000000; + temp_v0_4->words.w0 = 0xF5000100; + temp_v0_5 = gDisplayListHead; + gDisplayListHead = temp_v0_5 + 8; + temp_v0_5->words.w1 = 0; + temp_v0_5->words.w0 = 0xE6000000; + temp_v0_6 = gDisplayListHead; + gDisplayListHead = temp_v0_6 + 8; + temp_v0_6->words.w1 = 0x073FC000; + temp_v0_6->words.w0 = 0xF0000000; + temp_v0_7 = gDisplayListHead; + gDisplayListHead = temp_v0_7 + 8; + temp_v0_7->words.w1 = 0; + temp_v0_7->words.w0 = 0xE7000000; + temp_v0_8 = gDisplayListHead; + gDisplayListHead = temp_v0_8 + 8; + temp_v0_8->words.w1 = 0x00008000; + temp_v0_8->words.w0 = 0xBA000E02; + temp_v0_9 = gDisplayListHead; + gDisplayListHead = temp_v0_9 + 8; + temp_v0_9->words.w0 = 0xFD500000; + temp_v0_9->words.w1 = D_8018D4A4; + temp_v0_10 = gDisplayListHead; + gDisplayListHead = temp_v0_10 + 8; + temp_v0_10->words.w1 = 0x07000000; + temp_v0_10->words.w0 = 0xF5500000; + temp_v0_11 = gDisplayListHead; + gDisplayListHead = temp_v0_11 + 8; + temp_v0_11->words.w1 = 0; + temp_v0_11->words.w0 = 0xE6000000; + temp_v0_12 = gDisplayListHead; + gDisplayListHead = temp_v0_12 + 8; + temp_v0_12->words.w1 = 0x073FF100; + temp_v0_12->words.w0 = 0xF3000000; + temp_v0_13 = gDisplayListHead; + gDisplayListHead = temp_v0_13 + 8; + temp_v0_13->words.w1 = 0; + temp_v0_13->words.w0 = 0xE7000000; + temp_v0_14 = gDisplayListHead; + gDisplayListHead = temp_v0_14 + 8; + temp_v0_14->words.w1 = 0; + temp_v0_14->words.w0 = 0xF5481000; + temp_v0_15 = gDisplayListHead; + gDisplayListHead = temp_v0_15 + 8; + temp_v0_15->words.w1 = 0x000FC07C; + temp_v0_15->words.w0 = 0xF2000000; + temp_v0_16 = gDisplayListHead; + gDisplayListHead = temp_v0_16 + 8; + temp_v0_16->words.w1 = (u32) &D_800E8B80; + temp_v0_16->words.w0 = 0x0400103F; + temp_v0_17 = gDisplayListHead; + gDisplayListHead = temp_v0_17 + 8; + temp_v0_17->words.w1 = (u32) D_0D008C78; + temp_v0_17->words.w0 = 0x06000000; + temp_v0_18 = gDisplayListHead; + gDisplayListHead = temp_v0_18 + 8; + temp_v0_18->words.w0 = 0xFD500000; + temp_v0_18->words.w1 = D_8018D4A8; + temp_v0_19 = gDisplayListHead; + gDisplayListHead = temp_v0_19 + 8; + temp_v0_19->words.w1 = 0x07000000; + temp_v0_19->words.w0 = 0xF5500000; + temp_v0_20 = gDisplayListHead; + gDisplayListHead = temp_v0_20 + 8; + temp_v0_20->words.w1 = 0; + temp_v0_20->words.w0 = 0xE6000000; + temp_v0_21 = gDisplayListHead; + gDisplayListHead = temp_v0_21 + 8; + temp_v0_21->words.w1 = 0x073FF100; + temp_v0_21->words.w0 = 0xF3000000; + temp_v0_22 = gDisplayListHead; + gDisplayListHead = temp_v0_22 + 8; + temp_v0_22->words.w1 = 0; + temp_v0_22->words.w0 = 0xE7000000; + temp_v0_23 = gDisplayListHead; + gDisplayListHead = temp_v0_23 + 8; + temp_v0_23->words.w1 = 0; + temp_v0_23->words.w0 = 0xF5481000; + temp_v0_24 = gDisplayListHead; + gDisplayListHead = temp_v0_24 + 8; + temp_v0_24->words.w1 = 0x000FC07C; + temp_v0_24->words.w0 = 0xF2000000; + temp_v0_25 = gDisplayListHead; + gDisplayListHead = temp_v0_25 + 8; + temp_v0_25->words.w1 = (u32) &D_800E8BC0; + temp_v0_25->words.w0 = 0x0400103F; + temp_v0_26 = gDisplayListHead; + gDisplayListHead = temp_v0_26 + 8; + temp_v0_26->words.w1 = (u32) D_0D008DA0; + temp_v0_26->words.w0 = 0x06000000; + D_80164AF0 += 1; } } #else @@ -8838,18 +7901,39 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_800691B8.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8004B72C(s16, s16, s16, s16, s32, s32, s32); // extern -void func_800652D4(f32 *, s16 *, f32, s8); // extern -extern Gfx D_0D008DB8; -extern Gfx D_0D008E48; -extern ? D_800E47DC; -extern ? D_800E480C; -extern s16 D_80164AF0; -extern s32 D_8018D494; -extern s32 *gDisplayListHead; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800652D4(f32 *, s16 *, f32, s8); /* extern */ +extern u32 D_8018D494; +static s32 D_800E47DC[0xC] = { + 0x00FBFFFB, + 0x00A06011, + 0x00E0C090, + 0x00D0B080, + 0x00907040, + 0x00C07010, + 0x00D0F0FF, + 0x00E09030, + 0x00C09030, + 0x00604020, + 0x00F0D0B0, + 0x00A08030, +}; +static s32 D_800E480C[0xC] = { + 0x00B0B0B0, + 0x00804011, + 0x00B08050, + 0x00A07040, + 0x00603011, + 0x00804010, + 0x007090A0, + 0x00A06030, + 0x00A07010, + 0x00301011, + 0x00B0A080, + 0x00806010, +}; -void func_80069444(void *arg0, ? arg1, s16 arg2, s8 arg3) { +void func_80069444(Player *player, s32 arg1, s16 arg2, s8 arg3) { f32 sp7C; f32 sp78; f32 sp74; @@ -8863,26 +7947,26 @@ void func_80069444(void *arg0, ? arg1, s16 arg2, s8 arg3) { s16 sp62; s16 sp60; s16 sp5E; - s32 *sp3C; - s32 *temp_v0_10; - 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; - s32 temp_t9; + Gfx *sp3C; + Gfx *temp_v0_10; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; + s16 temp_a0; s32 temp_v0; s32 temp_v1; void *temp_a1; - temp_a1 = arg0 + (arg2 * 0x48); + temp_a1 = player + (arg2 * 0x48); if (temp_a1->unkAE4 == 1) { - temp_t9 = temp_a1->unkB00 * 4; - temp_v0 = *(&D_800E47DC + temp_t9); - temp_v1 = *(&D_800E480C + temp_t9); + temp_a0 = temp_a1->unkB00; + temp_v0 = D_800E47DC[temp_a0]; + temp_v1 = D_800E480C[temp_a0]; sp6A = (temp_v0 >> 0x10) & 0xFF; sp68 = (temp_v0 >> 8) & 0xFF; sp66 = temp_v0 & 0xFF; @@ -8895,47 +7979,47 @@ void func_80069444(void *arg0, ? arg1, s16 arg2, s8 arg3) { sp6C = 0; sp7C = temp_a1->unkAD0; sp70 = 0; - sp6E = (arg0 + (arg3 * 2))->unk48; - func_800652D4(&sp74, &sp6C, arg0->unk224 * 1.5, arg3); + sp6E = player->unk_048[arg3]; + func_800652D4(&sp74, &sp6C, (f32) ((f64) player->unk_224 * 1.5), arg3); temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0x6000000; - temp_v0_2->unk4 = &D_0D008DB8; + temp_v0_2->words.w0 = 0x06000000; + temp_v0_2->words.w1 = (u32) D_0D008DB8; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0xFD900000; - temp_v0_3->unk4 = D_8018D494; + temp_v0_3->words.w0 = 0xFD900000; + temp_v0_3->words.w1 = D_8018D494; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk0 = 0xF5900000; - temp_v0_4->unk4 = 0x7000000; + temp_v0_4->words.w0 = 0xF5900000; + temp_v0_4->words.w1 = 0x07000000; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk0 = 0xE6000000; - temp_v0_5->unk4 = 0; + temp_v0_5->words.w0 = 0xE6000000; + temp_v0_5->words.w1 = 0; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk0 = 0xF3000000; - temp_v0_6->unk4 = 0x71FF200; + temp_v0_6->words.w0 = 0xF3000000; + temp_v0_6->words.w1 = 0x071FF200; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk0 = 0xE7000000; - temp_v0_7->unk4 = 0; + temp_v0_7->words.w0 = 0xE7000000; + temp_v0_7->words.w1 = 0; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk0 = 0xF5880800; - temp_v0_8->unk4 = 0; + temp_v0_8->words.w0 = 0xF5880800; + temp_v0_8->words.w1 = 0; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; sp3C = temp_v0_9; - temp_v0_9->unk0 = 0xF2000000; - sp3C->unk4 = 0x7C07C; - func_8004B72C(sp6A, sp68, sp66, sp62, sp60, sp5E, sp64); + temp_v0_9->words.w0 = 0xF2000000; + sp3C->words.w1 = 0x0007C07C; + func_8004B72C((s32) sp6A, (s32) sp68, (s32) sp66, (s32) sp62, (s32) sp60, (s32) sp5E, (s32) sp64); temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk0 = 0x6000000; - temp_v0_10->unk4 = &D_0D008E48; - D_80164AF0 = D_80164AF0 + 1; + temp_v0_10->words.w0 = 0x06000000; + temp_v0_10->words.w1 = (u32) D_0D008E48; + D_80164AF0 += 1; } } #else @@ -8943,17 +8027,12 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80069444.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8004B35C(?, ?, ?, s16); // extern -void func_800652D4(f32 *, s16 *, f32, s8); // extern -extern Gfx D_0D008D58; -extern Gfx D_0D008DA0; -extern Gfx D_800E87C0; -extern s16 D_80164AF0; -extern s32 D_8018D488; -extern void *gDisplayListHead; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800652D4(f32 *, s16 *, f32, s8); /* extern */ +extern u32 D_8018D488; +static ? D_800E87C0; /* unable to generate initializer */ -void func_800696CC(void *arg0, ? arg1, s16 arg2, s8 arg3, f32 arg4) { +void func_800696CC(Player *player, s32 arg1, s16 arg2, s8 arg3, f32 arg4) { f32 sp64; f32 sp60; f32 sp5C; @@ -8961,88 +8040,84 @@ void func_800696CC(void *arg0, ? arg1, s16 arg2, s8 arg3, f32 arg4) { s16 sp56; s16 sp54; s16 sp52; - void *sp30; - void *sp2C; - f32 *temp_a0; - s16 *temp_a1; + Gfx *sp30; + Gfx *sp2C; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; void *temp_v0; - void *temp_v0_10; - void *temp_v0_11; - void *temp_v0_12; - void *temp_v0_13; - void *temp_v0_2; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - void *temp_v0_6; - void *temp_v0_7; - void *temp_v0_8; - void *temp_v0_9; - temp_v0 = arg0 + (arg2 * 0x48); + temp_v0 = player + (arg2 * 0x48); if (temp_v0->unkAE4 == 1) { sp52 = temp_v0->unkB06; - temp_a0 = &sp5C; sp5C = temp_v0->unkAC8; - temp_a1 = &sp54; sp60 = temp_v0->unkACC; sp54 = 0; sp64 = temp_v0->unkAD0; sp58 = 0; - sp56 = (arg0 + (arg3 * 2))->unk48; - func_800652D4(temp_a0, temp_a1, arg0->unk224 * arg4, arg3); + sp56 = player->unk_048[arg3]; + func_800652D4(&sp5C, &sp54, player->unk_224 * arg4, arg3); temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0x6000000; - temp_v0_2->unk4 = &D_0D008D58; + temp_v0_2->words.w0 = 0x06000000; + temp_v0_2->words.w1 = (u32) D_0D008D58; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = 0; - temp_v0_3->unk0 = 0xBA000E02; + temp_v0_3->words.w1 = 0; + temp_v0_3->words.w0 = 0xBA000E02; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk0 = 0xFD700000; - temp_v0_4->unk4 = D_8018D488; + temp_v0_4->words.w0 = 0xFD700000; + temp_v0_4->words.w1 = D_8018D488; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0x7080200; - temp_v0_5->unk0 = 0xF5700000; + temp_v0_5->words.w1 = 0x07080200; + temp_v0_5->words.w0 = 0xF5700000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0; - temp_v0_6->unk0 = 0xE6000000; + temp_v0_6->words.w1 = 0; + temp_v0_6->words.w0 = 0xE6000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0x71FF200; - temp_v0_7->unk0 = 0xF3000000; + temp_v0_7->words.w1 = 0x071FF200; + temp_v0_7->words.w0 = 0xF3000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0; - temp_v0_8->unk0 = 0xE7000000; + temp_v0_8->words.w1 = 0; + temp_v0_8->words.w0 = 0xE7000000; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; sp30 = temp_v0_9; - temp_v0_9->unk0 = 0xF5680800; - temp_v0_9->unk4 = 0x80200; + temp_v0_9->words.w0 = 0xF5680800; + temp_v0_9->words.w1 = 0x00080200; temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; sp2C = temp_v0_10; - temp_v0_10->unk0 = 0xF2000000; - temp_v0_10->unk4 = 0x7C07C; - func_8004B35C(0xFF, 0xFF, 0, sp52); + temp_v0_10->words.w0 = 0xF2000000; + temp_v0_10->words.w1 = 0x0007C07C; + func_8004B35C(0x000000FF, 0x000000FF, 0, (s32) sp52); temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk0 = 0xB900031D; - temp_v0_11->unk4 = 0x504B50; + temp_v0_11->words.w0 = 0xB900031D; + temp_v0_11->words.w1 = 0x00504B50; temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk4 = &D_800E87C0; - temp_v0_12->unk0 = 0x400103F; + temp_v0_12->words.w1 = (u32) &D_800E87C0; + temp_v0_12->words.w0 = 0x0400103F; temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk0 = 0x6000000; - temp_v0_13->unk4 = &D_0D008DA0; - D_80164AF0 = D_80164AF0 + 1; + temp_v0_13->words.w0 = 0x06000000; + temp_v0_13->words.w1 = (u32) D_0D008DA0; + D_80164AF0 += 1; } } #else @@ -9050,17 +8125,12 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_800696CC.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8004B35C(?, ?, ?, s16); // extern -void func_800652D4(f32 *, s16 *, f32, s8); // extern -extern Gfx D_0D008D58; -extern Gfx D_0D008DA0; -extern Gfx D_800E87C0; -extern s16 D_80164AF0; -extern s32 D_8018D488; -extern void *gDisplayListHead; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800652D4(f32 *, s16 *, f32, s8); /* extern */ +extern u32 D_8018D488; +static ? D_800E87C0; /* unable to generate initializer */ -void func_80069938(void *arg0, ? arg1, s16 arg2, s8 arg3) { +void func_80069938(Player *player, s32 arg1, s16 arg2, s8 arg3) { f32 sp64; f32 sp60; f32 sp5C; @@ -9068,88 +8138,84 @@ void func_80069938(void *arg0, ? arg1, s16 arg2, s8 arg3) { s16 sp56; s16 sp54; s16 sp52; - void *sp30; - void *sp2C; - f32 *temp_a0; - s16 *temp_a1; + Gfx *sp30; + Gfx *sp2C; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; void *temp_v0; - void *temp_v0_10; - void *temp_v0_11; - void *temp_v0_12; - void *temp_v0_13; - void *temp_v0_2; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - void *temp_v0_6; - void *temp_v0_7; - void *temp_v0_8; - void *temp_v0_9; - temp_v0 = arg0 + (arg2 * 0x48); + temp_v0 = player + (arg2 * 0x48); if (temp_v0->unkAE4 == 1) { sp52 = temp_v0->unkB06; - temp_a0 = &sp5C; - temp_a1 = &sp54; sp5C = temp_v0->unkAC8; sp60 = temp_v0->unkACC; sp54 = 0; sp64 = temp_v0->unkAD0; - sp56 = (arg0 + (arg3 * 2))->unk48; + sp56 = player->unk_048[arg3]; sp58 = temp_v0->unkB00; - func_800652D4(temp_a0, temp_a1, temp_v0->unkAD4 * arg0->unk224, arg3); + func_800652D4(&sp5C, &sp54, temp_v0->unkAD4 * player->unk_224, arg3); temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0x6000000; - temp_v0_2->unk4 = &D_0D008D58; + temp_v0_2->words.w0 = 0x06000000; + temp_v0_2->words.w1 = (u32) D_0D008D58; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = 0; - temp_v0_3->unk0 = 0xBA000E02; + temp_v0_3->words.w1 = 0; + temp_v0_3->words.w0 = 0xBA000E02; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk0 = 0xFD700000; - temp_v0_4->unk4 = D_8018D488; + temp_v0_4->words.w0 = 0xFD700000; + temp_v0_4->words.w1 = D_8018D488; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0x7080200; - temp_v0_5->unk0 = 0xF5700000; + temp_v0_5->words.w1 = 0x07080200; + temp_v0_5->words.w0 = 0xF5700000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0; - temp_v0_6->unk0 = 0xE6000000; + temp_v0_6->words.w1 = 0; + temp_v0_6->words.w0 = 0xE6000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0x71FF200; - temp_v0_7->unk0 = 0xF3000000; + temp_v0_7->words.w1 = 0x071FF200; + temp_v0_7->words.w0 = 0xF3000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0; - temp_v0_8->unk0 = 0xE7000000; + temp_v0_8->words.w1 = 0; + temp_v0_8->words.w0 = 0xE7000000; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; sp30 = temp_v0_9; - temp_v0_9->unk0 = 0xF5680800; - temp_v0_9->unk4 = 0x80200; + temp_v0_9->words.w0 = 0xF5680800; + temp_v0_9->words.w1 = 0x00080200; temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; sp2C = temp_v0_10; - temp_v0_10->unk0 = 0xF2000000; - temp_v0_10->unk4 = 0x7C07C; - func_8004B35C(0xFF, 0xFF, 0, sp52); + temp_v0_10->words.w0 = 0xF2000000; + temp_v0_10->words.w1 = 0x0007C07C; + func_8004B35C(0x000000FF, 0x000000FF, 0, (s32) sp52); temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk0 = 0xB900031D; - temp_v0_11->unk4 = 0x504B50; + temp_v0_11->words.w0 = 0xB900031D; + temp_v0_11->words.w1 = 0x00504B50; temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk4 = &D_800E87C0; - temp_v0_12->unk0 = 0x400103F; + temp_v0_12->words.w1 = (u32) &D_800E87C0; + temp_v0_12->words.w0 = 0x0400103F; temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk0 = 0x6000000; - temp_v0_13->unk4 = &D_0D008DA0; - D_80164AF0 = D_80164AF0 + 1; + temp_v0_13->words.w0 = 0x06000000; + temp_v0_13->words.w1 = (u32) D_0D008DA0; + D_80164AF0 += 1; } } #else @@ -9157,16 +8223,11 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80069938.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8004B35C(s16, s16, s16, s16); // extern -void func_800652D4(f32 *, s16 *, f32, s8); // extern -extern Gfx D_0D008DB8; -extern Gfx D_0D008E48; -extern s16 D_80164AF0; -extern s32 D_8018D48C; -extern void *gDisplayListHead; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800652D4(f32 *, s16 *, f32, s8); /* extern */ +extern u32 D_8018D48C; -void func_80069BA8(void *arg0, ? arg1, s16 arg2, s8 arg3) { +void func_80069BA8(Player *player, s32 arg1, s16 arg2, s8 arg3) { f32 sp5C; f32 sp58; f32 sp54; @@ -9177,74 +8238,70 @@ void func_80069BA8(void *arg0, ? arg1, s16 arg2, s8 arg3) { s16 sp48; s16 sp46; s16 sp44; - void *sp24; - f32 *temp_a0; - s16 *temp_a1; + Gfx *sp24; + Gfx *temp_v0_10; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; void *temp_v0; - void *temp_v0_10; - void *temp_v0_2; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - void *temp_v0_6; - void *temp_v0_7; - void *temp_v0_8; - void *temp_v0_9; - temp_v0 = arg0 + (arg2 * 0x48); + temp_v0 = player + (arg2 * 0x48); if (temp_v0->unkAE4 == 1) { - temp_a1 = &sp4C; sp4A = temp_v0->unkB00; sp48 = temp_v0->unkB02; sp46 = temp_v0->unkB04; - temp_a0 = &sp54; sp44 = temp_v0->unkB06; sp54 = temp_v0->unkAC8; sp58 = temp_v0->unkACC; sp4C = 0; sp5C = temp_v0->unkAD0; sp50 = 0; - sp4E = (arg0 + (arg3 * 2))->unk48; - func_800652D4(temp_a0, temp_a1, temp_v0->unkAD4 * arg0->unk224, arg3); + sp4E = player->unk_048[arg3]; + func_800652D4(&sp54, &sp4C, temp_v0->unkAD4 * player->unk_224, arg3); temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0x6000000; - temp_v0_2->unk4 = &D_0D008DB8; + temp_v0_2->words.w0 = 0x06000000; + temp_v0_2->words.w1 = (u32) D_0D008DB8; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0xFD700000; - temp_v0_3->unk4 = D_8018D48C; + temp_v0_3->words.w0 = 0xFD700000; + temp_v0_3->words.w1 = D_8018D48C; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x7000000; - temp_v0_4->unk0 = 0xF5700000; + temp_v0_4->words.w1 = 0x07000000; + temp_v0_4->words.w0 = 0xF5700000; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0; - temp_v0_5->unk0 = 0xE6000000; + temp_v0_5->words.w1 = 0; + temp_v0_5->words.w0 = 0xE6000000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0x71FF200; - temp_v0_6->unk0 = 0xF3000000; + temp_v0_6->words.w1 = 0x071FF200; + temp_v0_6->words.w0 = 0xF3000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0; - temp_v0_7->unk0 = 0xE7000000; + temp_v0_7->words.w1 = 0; + temp_v0_7->words.w0 = 0xE7000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0; - temp_v0_8->unk0 = 0xF5680800; + temp_v0_8->words.w1 = 0; + temp_v0_8->words.w0 = 0xF5680800; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; sp24 = temp_v0_9; - temp_v0_9->unk4 = 0x7C07C; - temp_v0_9->unk0 = 0xF2000000; - func_8004B35C(sp4A, sp48, sp46, sp44); + temp_v0_9->words.w1 = 0x0007C07C; + temp_v0_9->words.w0 = 0xF2000000; + func_8004B35C((s32) sp4A, (s32) sp48, (s32) sp46, (s32) sp44); temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk0 = 0x6000000; - temp_v0_10->unk4 = &D_0D008E48; - D_80164AF0 = D_80164AF0 + 1; + temp_v0_10->words.w0 = 0x06000000; + temp_v0_10->words.w1 = (u32) D_0D008E48; + D_80164AF0 += 1; } } #else @@ -9252,102 +8309,95 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80069BA8.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8004B35C(?, ?, ?, ?); // extern -void func_800652D4(f32 *, s16 *, f32); // extern -extern Gfx D_0D008D58; -extern Gfx D_0D008DA0; -extern ? D_800E8740; -extern s16 D_80164AF0; -extern s32 D_8018D49C; -extern void *gDisplayListHead; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800652D4(f32 *, s16 *, f32); /* extern */ +extern u32 D_8018D49C; +static ? D_800E8740; /* unable to generate initializer */ -void func_80069DB8(void *arg0, ? arg1, s16 arg2, s8 arg3) { +void func_80069DB8(Player *player, s32 arg1, s16 arg2, s8 arg3) { f32 sp64; f32 sp60; f32 sp5C; s16 sp58; s16 sp56; s16 sp54; - void *sp2C; - void *sp28; - s16 *temp_a1; + Gfx *sp2C; + Gfx *sp28; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; void *temp_v0; - void *temp_v0_10; - void *temp_v0_11; - void *temp_v0_12; - void *temp_v0_13; - void *temp_v0_2; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - void *temp_v0_6; - void *temp_v0_7; - void *temp_v0_8; - void *temp_v0_9; - temp_v0 = arg0 + (arg2 * 0x48); + temp_v0 = player + (arg2 * 0x48); if (temp_v0->unkAE4 == 1) { sp5C = temp_v0->unkAC8; - temp_a1 = &sp54; sp60 = temp_v0->unkACC; sp54 = 0; sp64 = temp_v0->unkAD0; sp58 = 0; - sp56 = (arg0 + (arg3 * 2))->unk48; - func_800652D4(&sp5C, temp_a1, temp_v0->unkAD4 * arg0->unk224); + sp56 = player->unk_048[arg3]; + func_800652D4(&sp5C, &sp54, temp_v0->unkAD4 * player->unk_224); temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0x6000000; - temp_v0_2->unk4 = &D_0D008D58; + temp_v0_2->words.w0 = 0x06000000; + temp_v0_2->words.w1 = (u32) D_0D008D58; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = 0; - temp_v0_3->unk0 = 0xBA000E02; + temp_v0_3->words.w1 = 0; + temp_v0_3->words.w0 = 0xBA000E02; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk0 = 0xFD700000; - temp_v0_4->unk4 = D_8018D49C; + temp_v0_4->words.w0 = 0xFD700000; + temp_v0_4->words.w1 = D_8018D49C; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0x7080200; - temp_v0_5->unk0 = 0xF5700000; + temp_v0_5->words.w1 = 0x07080200; + temp_v0_5->words.w0 = 0xF5700000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0; - temp_v0_6->unk0 = 0xE6000000; + temp_v0_6->words.w1 = 0; + temp_v0_6->words.w0 = 0xE6000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0x70FF200; - temp_v0_7->unk0 = 0xF3000000; + temp_v0_7->words.w1 = 0x070FF200; + temp_v0_7->words.w0 = 0xF3000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0; - temp_v0_8->unk0 = 0xE7000000; + temp_v0_8->words.w1 = 0; + temp_v0_8->words.w0 = 0xE7000000; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; sp2C = temp_v0_9; - temp_v0_9->unk0 = 0xF5700800; - temp_v0_9->unk4 = 0x80200; + temp_v0_9->words.w0 = 0xF5700800; + temp_v0_9->words.w1 = 0x00080200; temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; sp28 = temp_v0_10; - temp_v0_10->unk4 = 0x3C03C; - temp_v0_10->unk0 = 0xF2000000; - func_8004B35C(0xFF, 0xFF, 0xFF, 0xFF); + temp_v0_10->words.w1 = 0x0003C03C; + temp_v0_10->words.w0 = 0xF2000000; + func_8004B35C(0x000000FF, 0x000000FF, 0x000000FF, 0x000000FF); temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk0 = 0xB900031D; - temp_v0_11->unk4 = 0x504B50; + temp_v0_11->words.w0 = 0xB900031D; + temp_v0_11->words.w1 = 0x00504B50; temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk4 = &D_800E8740; - temp_v0_12->unk0 = 0x400103F; + temp_v0_12->words.w1 = (u32) &D_800E8740; + temp_v0_12->words.w0 = 0x0400103F; temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk0 = 0x6000000; - temp_v0_13->unk4 = &D_0D008DA0; - D_80164AF0 = D_80164AF0 + 1; + temp_v0_13->words.w0 = 0x06000000; + temp_v0_13->words.w1 = (u32) D_0D008DA0; + D_80164AF0 += 1; } } #else @@ -9355,102 +8405,94 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80069DB8.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8004B35C(?, ?, ?, ?); // extern -void func_800652D4(f32 *, s16 *, f32); // extern -extern Vtx D_0D008B78; -extern Gfx D_0D008D58; -extern Gfx D_0D008DA0; -extern s16 D_80164AF0; -extern s32 D_8018D49C; -extern void *gDisplayListHead; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800652D4(f32 *, s16 *, f32); /* extern */ +extern u32 D_8018D49C; -void func_8006A01C(void *arg0, ? arg1, s16 arg2, s8 arg3) { +void func_8006A01C(Player *player, s32 arg1, s16 arg2, s8 arg3) { f32 sp5C; f32 sp58; f32 sp54; s16 sp50; s16 sp4E; s16 sp4C; - void *sp2C; - void *sp28; - s16 *temp_a1; + Gfx *sp2C; + Gfx *sp28; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; void *temp_v0; - void *temp_v0_10; - void *temp_v0_11; - void *temp_v0_12; - void *temp_v0_13; - void *temp_v0_2; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - void *temp_v0_6; - void *temp_v0_7; - void *temp_v0_8; - void *temp_v0_9; - temp_v0 = arg0 + (arg2 * 0x48); - if (temp_v0->unk274 == 1) { + temp_v0 = player + (arg2 * 0x48); + if (player->unk_258[arg2].unk_01C == 1) { sp54 = temp_v0->unk528; - temp_a1 = &sp4C; sp58 = temp_v0->unk52C; sp4C = 0; sp5C = temp_v0->unk530; sp50 = 0; - sp4E = (arg0 + (arg3 * 2))->unk48; - func_800652D4(&sp54, temp_a1, temp_v0->unk534 * arg0->unk224); + sp4E = player->unk_048[arg3]; + func_800652D4(&sp54, &sp4C, temp_v0->unk534 * player->unk_224); temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0x6000000; - temp_v0_2->unk4 = &D_0D008D58; + temp_v0_2->words.w0 = 0x06000000; + temp_v0_2->words.w1 = (u32) D_0D008D58; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk4 = 0; - temp_v0_3->unk0 = 0xBA000E02; + temp_v0_3->words.w1 = 0; + temp_v0_3->words.w0 = 0xBA000E02; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk0 = 0xFD700000; - temp_v0_4->unk4 = D_8018D49C; + temp_v0_4->words.w0 = 0xFD700000; + temp_v0_4->words.w1 = D_8018D49C; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0x7080200; - temp_v0_5->unk0 = 0xF5700000; + temp_v0_5->words.w1 = 0x07080200; + temp_v0_5->words.w0 = 0xF5700000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0; - temp_v0_6->unk0 = 0xE6000000; + temp_v0_6->words.w1 = 0; + temp_v0_6->words.w0 = 0xE6000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0x70FF200; - temp_v0_7->unk0 = 0xF3000000; + temp_v0_7->words.w1 = 0x070FF200; + temp_v0_7->words.w0 = 0xF3000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk4 = 0; - temp_v0_8->unk0 = 0xE7000000; + temp_v0_8->words.w1 = 0; + temp_v0_8->words.w0 = 0xE7000000; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; sp2C = temp_v0_9; - temp_v0_9->unk0 = 0xF5700800; - temp_v0_9->unk4 = 0x80200; + temp_v0_9->words.w0 = 0xF5700800; + temp_v0_9->words.w1 = 0x00080200; temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; sp28 = temp_v0_10; - temp_v0_10->unk4 = 0x3C03C; - temp_v0_10->unk0 = 0xF2000000; - func_8004B35C(0xFF, 0xFF, 0xFF, 0xFF); + temp_v0_10->words.w1 = 0x0003C03C; + temp_v0_10->words.w0 = 0xF2000000; + func_8004B35C(0x000000FF, 0x000000FF, 0x000000FF, 0x000000FF); temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk0 = 0xB900031D; - temp_v0_11->unk4 = 0x504B50; + temp_v0_11->words.w0 = 0xB900031D; + temp_v0_11->words.w1 = 0x00504B50; temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk4 = &D_0D008B78; - temp_v0_12->unk0 = 0x400103F; + temp_v0_12->words.w1 = (u32) D_0D008B78; + temp_v0_12->words.w0 = 0x0400103F; temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk0 = 0x6000000; - temp_v0_13->unk4 = &D_0D008DA0; - D_80164AF0 = D_80164AF0 + 1; + temp_v0_13->words.w0 = 0x06000000; + temp_v0_13->words.w1 = (u32) D_0D008DA0; + D_80164AF0 += 1; } } #else @@ -9458,17 +8500,43 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006A01C.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8004B414(s16, s16, s16, ?); // extern -void func_800652D4(f32 *, s16 *, f32, s8); // extern -extern Gfx D_0D008D58; -extern Gfx D_0D008DA0; -extern ? D_800E47A0; -extern ? D_800E8780; -extern s16 D_80164AF0; -extern void *gDisplayListHead; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_800652D4(f32 *, s16 *, f32, s8); /* extern */ +extern u32 D_8018D438; +extern u32 D_8018D43C; +extern u32 D_8018D440; +extern u32 D_8018D444; +extern u32 D_8018D448; +extern u32 D_8018D44C; +extern u32 D_8018D450; +extern u32 D_8018D454; +extern u32 D_8018D458; +extern u32 D_8018D45C; +extern u32 D_8018D460; +extern u32 D_8018D464; +extern u32 D_8018D468; +extern u32 D_8018D46C; +extern u32 D_8018D470; +static u32 *D_800E47A0[0xF] = { + &D_8018D438, + &D_8018D43C, + &D_8018D440, + &D_8018D444, + &D_8018D448, + &D_8018D44C, + &D_8018D450, + &D_8018D454, + &D_8018D458, + &D_8018D45C, + &D_8018D460, + &D_8018D464, + &D_8018D468, + &D_8018D46C, + &D_8018D470, +}; +static ? D_800E8780; /* unable to generate initializer */ -void func_8006A280(void *arg0, ? arg1, s16 arg2, s8 arg3) { +void func_8006A280(Player *player, s8 arg1, s16 arg2, s8 arg3) { f32 sp64; f32 sp60; f32 sp5C; @@ -9479,87 +8547,81 @@ void func_8006A280(void *arg0, ? arg1, s16 arg2, s8 arg3) { s16 sp50; s16 sp4E; void *sp18; - f32 *temp_a0; - s16 *temp_a1; - void *temp_t0; - void *temp_v0; - void *temp_v0_10; - void *temp_v0_11; - void *temp_v0_12; - void *temp_v0_2; - void *temp_v0_3; - void *temp_v0_4; - void *temp_v0_5; - void *temp_v0_6; - void *temp_v0_7; - void *temp_v0_8; - void *temp_v0_9; - - temp_t0 = arg0 + (arg2 * 0x48); - if (temp_t0->unk274 == 1) { - temp_a1 = &sp54; - sp52 = temp_t0->unk290; - sp50 = temp_t0->unk292; - temp_a0 = &sp5C; - sp4E = temp_t0->unk294; - sp5C = temp_t0->unk258; - sp60 = temp_t0->unk25C; + Gfx *temp_v0; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_2; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; + + if (player->unk_258[arg2].unk_01C == 1) { + sp52 = player->unk_258[arg2].unk_038; + sp50 = player->unk_258[arg2].unk_03A; + sp4E = player->unk_258[arg2].unk_03C; + sp5C = player->unk_258[arg2].unk_000[0]; + sp60 = player->unk_258[arg2].unk_000[1]; sp54 = 0; - sp64 = temp_t0->unk260; + sp64 = player->unk_258[arg2].unk_000[2]; sp58 = 0; - sp56 = (arg0 + (arg3 * 2))->unk48; - sp18 = temp_t0; - func_800652D4(temp_a0, temp_a1, temp_t0->unk264 * arg0->unk224, arg3); + sp56 = player->unk_048[arg3]; + sp18 = player + (arg2 * 0x48); + func_800652D4(&sp5C, &sp54, player->unk_258[arg2].unk_00C * player->unk_224, arg3); temp_v0 = gDisplayListHead; gDisplayListHead = temp_v0 + 8; - temp_v0->unk0 = 0x6000000; - temp_v0->unk4 = &D_0D008D58; + temp_v0->words.w0 = 0x06000000; + temp_v0->words.w1 = (u32) D_0D008D58; temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk4 = 0; - temp_v0_2->unk0 = 0xBA000E02; + temp_v0_2->words.w1 = 0; + temp_v0_2->words.w0 = 0xBA000E02; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0xFD900000; - temp_v0_3->unk4 = **(&D_800E47A0 + (temp_t0->unk276 * 4)); + temp_v0_3->words.w0 = 0xFD900000; + temp_v0_3->words.w1 = *D_800E47A0[sp18->unk276]; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = 0x7080200; - temp_v0_4->unk0 = 0xF5900000; + temp_v0_4->words.w1 = 0x07080200; + temp_v0_4->words.w0 = 0xF5900000; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk4 = 0; - temp_v0_5->unk0 = 0xE6000000; + temp_v0_5->words.w1 = 0; + temp_v0_5->words.w0 = 0xE6000000; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk4 = 0x73FF200; - temp_v0_6->unk0 = 0xF3000000; + temp_v0_6->words.w1 = 0x073FF200; + temp_v0_6->words.w0 = 0xF3000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk4 = 0; - temp_v0_7->unk0 = 0xE7000000; + temp_v0_7->words.w1 = 0; + temp_v0_7->words.w0 = 0xE7000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk0 = 0xF5800800; - temp_v0_8->unk4 = 0x80200; + temp_v0_8->words.w0 = 0xF5800800; + temp_v0_8->words.w1 = 0x00080200; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk0 = 0xF2000000; - temp_v0_9->unk4 = 0xFC0FC; - func_8004B414(sp52, sp50, sp4E, 0xFF); + temp_v0_9->words.w0 = 0xF2000000; + temp_v0_9->words.w1 = 0x000FC0FC; + func_8004B414((s32) sp52, (s32) sp50, (s32) sp4E, 0x000000FF); temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; - temp_v0_10->unk0 = 0xB900031D; - temp_v0_10->unk4 = 0x504B50; + temp_v0_10->words.w0 = 0xB900031D; + temp_v0_10->words.w1 = 0x00504B50; temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk4 = &D_800E8780; - temp_v0_11->unk0 = 0x400103F; + temp_v0_11->words.w1 = (u32) &D_800E8780; + temp_v0_11->words.w0 = 0x0400103F; temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk0 = 0x6000000; - temp_v0_12->unk4 = &D_0D008DA0; - D_80164AF0 = D_80164AF0 + 1; + temp_v0_12->words.w0 = 0x06000000; + temp_v0_12->words.w1 = (u32) D_0D008DA0; + D_80164AF0 += 1; } } #else @@ -9567,14 +8629,10 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006A280.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_80062B18(?, f32, f32 *, f32 *, f32 *, ?, f32, f32, s32, s32); // extern -extern f32 D_800EE7D0; -extern f64 D_800EE7D8; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b extern ? D_8018D4D0; extern ? D_8018D530; extern ? D_8018D590; -extern u16 gPlayerBalloonStatus; extern ? D_8018D620; extern ? D_8018D650; extern ? D_8018D6B0; @@ -9586,8 +8644,9 @@ extern ? D_8018D800; extern ? D_8018D830; extern ? D_8018D860; extern ? D_8018D890; +extern ? gPlayerBalloonStatus; -void func_8006A50C(void *arg0, ? arg1, f32 arg2, s8 arg3, s8 arg4, s16 arg5) { +void func_8006A50C(Player *player, f32 arg1, f32 arg2, s8 arg3, s8 arg4, s16 arg5) { f32 sp44; f32 sp40; f32 sp3C; @@ -9602,7 +8661,7 @@ void func_8006A50C(void *arg0, ? arg1, f32 arg2, s8 arg3, s8 arg4, s16 arg5) { temp_t0 = (arg3 * 6) + temp_v0 + &gPlayerBalloonStatus; *temp_t0 = 0; temp_v1 = arg4 * 4; - *(&D_8018D650 + ((arg3 * 0xC) + temp_v1)) = D_800EE7D0; + *(&D_8018D650 + ((arg3 * 0xC) + temp_v1)) = 0.1f; *(&D_8018D6B0 + ((arg3 * 0xC) + temp_v1)) = 0.0f; *(&D_8018D710 + ((arg3 * 0xC) + temp_v1)) = 0.0f; *(&D_8018D770 + ((arg3 * 6) + temp_v0)) = 0; @@ -9610,44 +8669,27 @@ void func_8006A50C(void *arg0, ? arg1, f32 arg2, s8 arg3, s8 arg4, s16 arg5) { *(&D_8018D7D0 + ((arg3 * 6) + temp_v0)) = 0; *(&D_8018D800 + ((arg3 * 6) + temp_v0)) = 5; *(&D_8018D830 + ((arg3 * 6) + temp_v0)) = 1; - *(&D_8018D620 + ((arg3 * 6) + temp_v0)) = -arg0->unk2E - arg0->unkC0; + *(&D_8018D620 + ((arg3 * 6) + temp_v0)) = -player->unk_02C[1] - player->unk_0C0; sp34 = temp_t0; sp30 = temp_v1; sp38 = temp_v0; - func_80062B18(arg1, arg2, &sp44, &sp40, &sp3C, arg1, 4.0f, arg2 + D_800EE7D8, -arg0->unk2E, 0); - *(&D_8018D4D0 + ((arg3 * 0xC) + temp_v1)) = arg0->unk14 + sp44; - *(&D_8018D590 + ((arg3 * 0xC) + temp_v1)) = arg0->unk1C + sp3C; - *(&D_8018D530 + ((arg3 * 0xC) + temp_v1)) = (arg0->unk18 - arg0->unk70) + sp40; - *temp_t0 = *temp_t0 | 1; - *(&D_8018D860 + ((arg3 * 6) + temp_v0)) = arg5; - *(&D_8018D890 + ((arg3 * 6) + temp_v0)) = 0; + func_80062B18(&sp44, &sp40, &sp3C, arg1, 4.0f, (f32) ((f64) arg2 + -3.8), (u16) (s32) -player->unk_02C[1], (u16) 0); + *(&D_8018D4D0 + ((arg3 * 0xC) + sp30)) = player->pos[0] + sp44; + *(&D_8018D590 + ((arg3 * 0xC) + sp30)) = player->pos[2] + sp3C; + *(&D_8018D530 + ((arg3 * 0xC) + sp30)) = (player->pos[1] - player->boundingBoxSize) + sp40; + *sp34 |= 1; + *(&D_8018D860 + ((arg3 * 6) + sp38)) = arg5; + *(&D_8018D890 + ((arg3 * 6) + sp38)) = 0; } #else GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006A50C.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void move_s16_towards(void *, s16, ?); // extern -void func_80062B18(f32 *, f32 *, f32 *, s32, f32, f32, s32, s32); // extern -void func_8006B974(void *, s8, s8); // extern -extern ? D_800E4914; -extern f64 D_800EE7E0; -extern f64 D_800EE7E8; -extern f64 D_800EE7F0; -extern f32 D_800EE7F8; -extern f64 D_800EE800; -extern f32 D_800EE808; -extern f64 D_800EE810; -extern f32 D_800EE818; -extern f64 D_800EE820; -extern f32 D_800EE828; -extern f64 D_800EE830; -extern f64 D_800EE838; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b extern ? D_8018D4D0; extern ? D_8018D530; extern ? D_8018D590; -extern u16 gPlayerBalloonStatus; extern ? D_8018D620; extern ? D_8018D650; extern ? D_8018D6B0; @@ -9660,8 +8702,10 @@ extern ? D_8018D830; extern ? D_8018D860; extern ? D_8018D890; extern ? D_8018D8D0; +extern ? gPlayerBalloonStatus; +static ? D_800E4914; /* unable to generate initializer */ -void func_8006A7C0(void *arg0, s32 arg1, f32 arg2, s8 arg3, s8 arg4) { +void func_8006A7C0(Player *player, f32 arg1, f32 arg2, s8 arg3, s8 arg4) { ? sp80; f32 sp78; f32 sp74; @@ -9677,181 +8721,152 @@ void func_8006A7C0(void *arg0, s32 arg1, f32 arg2, s8 arg3, s8 arg4) { s16 *sp34; f32 *temp_a1; f32 *temp_t2; - f32 *temp_v0_4; + f32 *temp_v0_2; f32 *temp_v1; f32 *temp_v1_2; f32 *temp_v1_3; - f32 temp_f12; + f32 *var_t2; f32 temp_f8; - f64 temp_f0; - f64 temp_f0_2; - s16 *temp_a1_2; - s16 *temp_a1_3; + f32 var_f12; + f64 var_f0; + f64 var_f0_2; + s16 *temp_a0; s16 *temp_a2; s16 *temp_v0; - s16 *temp_v0_2; - s16 *temp_v0_3; - s32 temp_t0; + s16 *var_a1; + s16 *var_v0; s32 temp_t1; - s32 temp_t3; - s32 temp_t6; s32 temp_t8; - s32 temp_t9; + s32 var_t0; + s32 var_t1; u16 *temp_t7; - f64 phi_f0; - f32 phi_f2; - f64 phi_f0_2; - f32 phi_f12; - s32 phi_t0; - f32 phi_f12_2; - s16 *phi_v0; - s32 phi_v1; - s32 phi_a0; - s16 *phi_a1; - - sp80.unk0 = D_800E4914.unk0; - sp80.unk4 = D_800E4914.unk4; - sp80.unk8 = D_800E4914.unk8; - sp80.unkC = D_800E4914.unkC; - sp80.unk10 = D_800E4914.unk10; - sp80.unk14 = D_800E4914.unk14; - sp80.unk18 = D_800E4914.unk18; - sp80.unk1C = D_800E4914.unk1C; - temp_f12 = arg0->unk94; - temp_t0 = arg4 * 2; - temp_t7 = (arg3 * 6) + temp_t0 + &gPlayerBalloonStatus; + + sp80.unk0 = (s32) D_800E4914.unk0; + sp80.unk4 = (s32) D_800E4914.unk4; + sp80.unk8 = (s32) D_800E4914.unk8; + sp80.unkC = (s32) D_800E4914.unkC; + sp80.unk10 = (s32) D_800E4914.unk10; + sp80.unk14 = (s32) D_800E4914.unk14; + sp80.unk18 = (s32) D_800E4914.unk18; + sp80.unk1C = (s32) D_800E4914.unk1C; + var_f12 = player->unk_094; + var_t0 = arg4 * 2; + temp_t7 = (arg3 * 6) + var_t0 + &gPlayerBalloonStatus; sp58 = temp_t7; temp_t1 = arg4 * 4; - sp6C = (-(temp_f12 / 18.0f) * 216.0f) / 10.0f; - phi_t0 = temp_t0; - phi_f12_2 = temp_f12; + sp6C = (-(var_f12 / 18.0f) * 216.0f) / 10.0f; if ((*temp_t7 & 2) != 2) { temp_a1 = (arg3 * 0xC) + temp_t1 + &D_8018D650; - *temp_a1 = *temp_a1 + (D_800EE7E8 + (-temp_f12 * D_800EE7E0)); - temp_f0 = *temp_a1; + *temp_a1 = (f32) ((f64) *temp_a1 + (-0.003 + ((f64) -var_f12 * 0.0006))); + var_f0 = (f64) *temp_a1; temp_v1 = (arg3 * 0xC) + temp_t1 + &D_8018D6B0; temp_t2 = (arg3 * 0xC) + temp_t1 + &D_8018D710; - phi_f0 = temp_f0; - if (D_800EE7F0 <= temp_f0) { - *temp_a1 = D_800EE7F8; - phi_f0 = *temp_a1; - } - phi_f2 = *temp_a1; - if (phi_f0 <= D_800EE800) { - *temp_a1 = D_800EE808; - phi_f2 = *temp_a1; - } - *temp_v1 = *temp_v1 + phi_f2; - temp_f0_2 = *temp_v1; - phi_f0_2 = temp_f0_2; - if (D_800EE810 <= temp_f0_2) { - *temp_v1 = D_800EE818; - phi_f0_2 = *temp_v1; - } - phi_f12 = *temp_v1; - if (phi_f0_2 <= D_800EE820) { - *temp_v1 = D_800EE828; - phi_f12 = *temp_v1; - } - *temp_t2 = *temp_t2 + phi_f12; + if (var_f0 >= 0.05) { + *temp_a1 = 0.05f; + var_f0 = (f64) *temp_a1; + } + if (var_f0 <= -0.05) { + *temp_a1 = -0.05f; + } + *temp_v1 += *temp_a1; + var_f0_2 = (f64) *temp_v1; + if (var_f0_2 >= 0.06) { + *temp_v1 = 0.06f; + var_f0_2 = (f64) *temp_v1; + } + if (var_f0_2 <= -0.06) { + *temp_v1 = -0.06f; + } + *temp_t2 += *temp_v1; if (*temp_t2 < 0.0f) { sp60 = temp_v1; sp50 = temp_a1; - sp5C = temp_t0; + sp5C = var_t0; sp4C = temp_t2; - temp_f8 = random_int(0xB) / 0xA; + temp_f8 = (f32) (random_int(0x000BU) / 10); *temp_v1 = 0.0f; *temp_t2 = 0.0f; *temp_a1 = temp_f8; } - *(&D_8018D620 + ((arg3 * 6) + (arg4 * 2))) = -arg0->unk2E - arg0->unkC0; - sp5C = arg4 * 2; - move_s16_towards((arg3 * 6) + (arg4 * 2) + &D_8018D890, arg0->unk94 * 182.0f, 0x3DCCCCCD); - phi_t0 = arg4 * 2; - phi_f12_2 = arg0->unk94; + *(&D_8018D620 + ((arg3 * 6) + var_t0)) = -player->unk_02C[1] - player->unk_0C0; + sp5C = var_t0; + move_s16_towards((arg3 * 6) + var_t0 + &D_8018D890, (s16) (s32) (player->unk_094 * 182.0f), 0.1f); + var_f12 = player->unk_094; } - temp_t9 = (arg3 * 6) + phi_t0; - temp_a2 = temp_t9 + &D_8018D830; + temp_a2 = (arg3 * 6) + var_t0 + &D_8018D830; temp_t8 = arg4 * 4; - temp_t6 = (arg3 * 0xC) + temp_t8; - sp50 = (arg3 * 6) + phi_t0 + &D_8018D620; + var_t1 = temp_t8; + sp50 = (arg3 * 6) + var_t0 + &D_8018D620; + var_t2 = (arg3 * 0xC) + temp_t8 + &D_8018D710; if (*temp_a2 == 1) { - temp_a1_2 = (arg3 * 6) + phi_t0 + &D_8018D800; - temp_v0 = (arg3 * 6) + phi_t0 + &D_8018D770; - *temp_v0 = *temp_v0 + (*temp_a1_2 - phi_f12_2); - phi_v0 = temp_v0; - phi_a1 = temp_a1_2; + var_a1 = (arg3 * 6) + var_t0 + &D_8018D800; + var_v0 = (arg3 * 6) + var_t0 + &D_8018D770; + *var_v0 = (s16) (s32) ((f32) *var_v0 + ((f32) *var_a1 - var_f12)); } else { - temp_a1_3 = (arg3 * 6) + phi_t0 + &D_8018D800; - temp_v0_2 = (arg3 * 6) + phi_t0 + &D_8018D770; - *temp_v0_2 = *temp_v0_2 + (*temp_a1_3 + phi_f12_2); - phi_v0 = temp_v0_2; - phi_a1 = temp_a1_3; - } - if (*phi_v0 >= 0xB) { - *phi_v0 = 0xB; - } - phi_v1 = *phi_v0; - if (*phi_v0 < -0xA) { - *phi_v0 = -0xB; - phi_v1 = *phi_v0; - } - temp_v0_3 = (arg3 * 6) + phi_t0 + &D_8018D7A0; - *temp_v0_3 = *temp_v0_3 + phi_v1; - temp_t3 = (arg3 * 6) + phi_t0; - if (*temp_v0_3 >= 0x29) { - *temp_v0_3 = 0x29; - } - phi_a0 = *temp_v0_3; - if (*temp_v0_3 < -0x28) { - *temp_v0_3 = -0x29; - phi_a0 = *temp_v0_3; - } - temp_v1_2 = temp_t3 + &D_8018D7D0; - *temp_v1_2 = *temp_v1_2 + phi_a0; + var_a1 = (arg3 * 6) + var_t0 + &D_8018D800; + var_v0 = (arg3 * 6) + var_t0 + &D_8018D770; + *var_v0 = (s16) (s32) ((f32) *var_v0 + ((f32) *var_a1 + var_f12)); + } + if (*var_v0 >= 0xB) { + *var_v0 = 0x000B; + } + if (*var_v0 < -0xA) { + *var_v0 = -0x000B; + } + temp_v0 = (arg3 * 6) + var_t0 + &D_8018D7A0; + *temp_v0 += *var_v0; + if (*temp_v0 >= 0x29) { + *temp_v0 = 0x0029; + } + if (*temp_v0 < -0x28) { + *temp_v0 = -0x0029; + } + temp_v1_2 = (arg3 * 6) + var_t0 + &D_8018D7D0; + *temp_v1_2 = (s16) (*temp_v1_2 + *temp_v0); if (*temp_v1_2 >= 0x38E) { sp60 = temp_v1_2; - sp34 = phi_a1; + sp34 = var_a1; sp3C = temp_a2; - sp5C = phi_t0; - sp54 = temp_t8; - sp4C = temp_t6 + &D_8018D710; - *phi_a1 = -random_int(8); + sp5C = var_t0; + sp54 = var_t1; + sp4C = var_t2; + *var_a1 = -random_int(8U); if (*temp_a2 != 1) { *temp_a2 = 1; } } - if (*(temp_t3 + &D_8018D7D0) < -0x38D) { - sp34 = phi_a1; - sp3C = temp_t9 + &D_8018D830; - sp5C = phi_t0; - sp54 = arg4 * 4; - sp4C = temp_t6 + &D_8018D710; - *phi_a1 = random_int(8); - if (*(temp_t9 + &D_8018D830) != -1) { - *(temp_t9 + &D_8018D830) = -1; + if (*temp_v1_2 < -0x38D) { + sp34 = var_a1; + sp3C = temp_a2; + sp5C = var_t0; + sp54 = var_t1; + sp4C = var_t2; + *var_a1 = random_int(8U); + if (*temp_a2 != -1) { + *temp_a2 = -1; } } - sp54 = arg4 * 4; - sp5C = phi_t0; - func_80062B18(&sp78, &sp74, &sp70, arg1, (sp + (arg0->unk254 * 4))->unk80 - *(temp_t6 + &D_8018D710), arg2 + D_800EE830 + (sp6C * 1.0f), -*sp50, arg0->unk206 * -2); + sp54 = var_t1; + sp5C = var_t0; + func_80062B18(&sp78, &sp74, &sp70, arg1, (sp + (player->characterId * 4))->unk80 - *var_t2, (f32) ((f64) arg2 + -3.2 + (f64) (sp6C * 1.0f)), (u16) (s32) -*sp50, (u16) (player->unk_206 * -2)); if ((*sp58 & 2) != 2) { - *(&D_8018D530 + ((arg3 * 0xC) + (arg4 * 4))) = (arg0->unk18 - arg0->unk70) + sp74; - *(&D_8018D4D0 + ((arg3 * 0xC) + (arg4 * 4))) = arg0->unk14 + sp78; - *(&D_8018D590 + ((arg3 * 0xC) + (arg4 * 4))) = arg0->unk1C + sp70; - *(&D_8018D8D0 + ((arg3 * 6) + phi_t0)) = 0; + *(&D_8018D530 + ((arg3 * 0xC) + sp54)) = (player->pos[1] - player->boundingBoxSize) + sp74; + *(&D_8018D4D0 + ((arg3 * 0xC) + sp54)) = player->pos[0] + sp78; + *(&D_8018D590 + ((arg3 * 0xC) + sp54)) = player->pos[2] + sp70; + *(&D_8018D8D0 + ((arg3 * 6) + sp5C)) = 0; return; } - temp_v0_4 = (arg3 * 0xC) + (arg4 * 4) + &D_8018D530; - temp_v1_3 = (arg3 * 6) + phi_t0 + &D_8018D8D0; - *temp_v0_4 = *temp_v0_4 + D_800EE838; - *temp_v1_3 = *temp_v1_3 + 1; + temp_v0_2 = (arg3 * 0xC) + sp54 + &D_8018D530; + temp_v1_3 = (arg3 * 6) + sp5C + &D_8018D8D0; + *temp_v0_2 = (f32) ((f64) *temp_v0_2 + 0.2); + *temp_v1_3 = (s16) (*temp_v1_3 + 1); + temp_a0 = (arg3 * 6) + sp5C + &D_8018D890; sp60 = temp_v1_3; - sp5C = phi_t0; - move_s16_towards((arg3 * 6) + phi_t0 + &D_8018D890, 0, 0x3DCCCCCD); - move_s16_towards((arg3 * 6) + phi_t0 + &D_8018D860, 0, 0x3DCCCCCD); + sp5C = sp5C; + move_s16_towards(temp_a0, 0, 0.1f); + move_s16_towards((arg3 * 6) + sp5C + &D_8018D860, 0, 0.1f); if (*temp_v1_3 >= 0x78) { - func_8006B974(arg0, arg3, arg4); + func_8006B974((s32) player, arg3, arg4); } } #else @@ -9859,28 +8874,8 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006A7C0.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_80021E10(? *, f32 *, s16 *); // extern -void func_80021F84(? *, f32); // extern -void func_80022180(void *, ? *); // extern -void func_8004B614(s16, s16, s16, s16, s32, s32, s32); // extern -f32 sins(u16); // extern -f32 coss(s32); // extern -extern Gfx D_0D008C78; -extern Gfx D_0D008DB8; -extern ? D_800E4934; -extern ? D_800E4954; -extern ? D_800E5250; -extern ? D_800E5290; -extern ? D_800E52D0; -extern f32 D_800EE840; -extern f64 D_800EE848; -extern f32 D_800EE850; -extern f64 D_800EE858; -extern f32 D_800EE860; -extern Camera cameras; -extern s16 D_80164AF0; -extern s32 D_8018D4BC; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +extern u32 D_8018D4BC; extern s32 D_8018D4C0; extern ? D_8018D4D0; extern ? D_8018D530; @@ -9888,10 +8883,13 @@ extern ? D_8018D590; extern ? D_8018D7D0; extern ? D_8018D860; extern ? D_8018D890; -extern s32 *gDisplayListHead; +static ? D_800E4934; /* unable to generate initializer */ +static ? D_800E4954; /* unable to generate initializer */ +static ? D_800E5250; /* unable to generate initializer */ +static ? D_800E5290; /* unable to generate initializer */ +static ? D_800E52D0; /* unable to generate initializer */ -void func_8006AFD0(void *arg0, s8 arg1, s16 arg2, s8 arg3) { - ? sp140; +void func_8006AFD0(Player *player, s16 arg1, s8 arg2, s8 arg3) { f32 sp13C; f32 sp138; f32 sp134; @@ -9905,257 +8903,242 @@ void func_8006AFD0(void *arg0, s8 arg1, s16 arg2, s8 arg3) { s16 sp120; s16 sp11E; s16 sp11C; - ? spF0; - ? spD0; - s32 *spB0; - s32 *spAC; + Gfx *spB0; + Gfx *spAC; f32 sp58; void *sp54; s32 sp44; s32 sp40; s16 *sp3C; + Camera *temp_v0_2; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_14; + Gfx *temp_v0_15; + Gfx *temp_v0_16; + Gfx *temp_v0_17; + Gfx *temp_v0_18; + Gfx *temp_v0_19; + Gfx *temp_v0_20; + Gfx *temp_v0_21; + Gfx *temp_v0_22; + Gfx *temp_v0_23; + Gfx *temp_v0_24; + Gfx *temp_v0_25; + Gfx *temp_v0_26; + Gfx *temp_v0_27; + Gfx *temp_v0_28; + Gfx *temp_v0_29; + Gfx *temp_v0_30; + Gfx *temp_v0_31; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; f32 temp_f0; f32 temp_f20; - f32 temp_f20_2; - f64 temp_f0_2; + f32 var_f20; + f64 var_f0; s16 *temp_v1_2; - 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_16; - s32 *temp_v0_17; - s32 *temp_v0_18; - s32 *temp_v0_19; - s32 *temp_v0_20; - s32 *temp_v0_21; - s32 *temp_v0_22; - s32 *temp_v0_23; - s32 *temp_v0_24; - s32 *temp_v0_25; - s32 *temp_v0_26; - s32 *temp_v0_27; - s32 *temp_v0_28; - s32 *temp_v0_29; - s32 *temp_v0_30; - s32 *temp_v0_31; - 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; + s16 temp_t1; s32 temp_a0; - s32 temp_t1; s32 temp_t6; - s32 temp_t6_2; - s32 temp_t7_2; - s32 temp_t9; + s32 temp_t7; s32 temp_v0; s32 temp_v1; - void *temp_t7; - void *temp_v0_2; - f32 phi_f20; - f64 phi_f0; - s32 phi_t1; - f32 phi_f20_2; - - spF0.unk0 = D_800E4934.unk0; - spF0.unk4 = D_800E4934.unk4; - spF0.unk8 = D_800E4934.unk8; - spF0.unkC = D_800E4934.unkC; - spF0.unk10 = D_800E4934.unk10; - spF0.unk14 = D_800E4934.unk14; - spF0.unk18 = D_800E4934.unk18; - spF0.unk1C = D_800E4934.unk1C; - spD0.unk0 = D_800E4954.unk0; - spD0.unk4 = D_800E4954.unk4; - spD0.unk8 = D_800E4954.unk8; - spD0.unkC = D_800E4954.unkC; - spD0.unk10 = D_800E4954.unk10; - spD0.unk14 = D_800E4954.unk14; - spD0.unk18 = D_800E4954.unk18; - spD0.unk1C = D_800E4954.unk1C; - temp_t9 = arg0->unk254 * 4; - temp_v0 = *(&spF0 + temp_t9); + u16 temp_t0; + + spF0[0].unk0 = D_800E4934.unk0; + spF0[0].unk4 = (s32) D_800E4934.unk4; + spF0[0].unk8 = (s32) D_800E4934.unk8; + spF0[0].unkC = (s32) D_800E4934.unkC; + spF0[0].unk10 = (s32) D_800E4934.unk10; + spF0[0].unk14 = (s32) D_800E4934.unk14; + spF0[0].unk18 = (s32) D_800E4934.unk18; + spF0[0].unk1C = (s32) D_800E4934.unk1C; + spD0[0].unk0 = D_800E4954.unk0; + spD0[0].unk4 = (s32) D_800E4954.unk4; + spD0[0].unk8 = (s32) D_800E4954.unk8; + spD0[0].unkC = (s32) D_800E4954.unkC; + spD0[0].unk10 = (s32) D_800E4954.unk10; + spD0[0].unk14 = (s32) D_800E4954.unk14; + spD0[0].unk18 = (s32) D_800E4954.unk18; + spD0[0].unk1C = (s32) D_800E4954.unk1C; + temp_t0 = player->characterId; + temp_v0 = (&spF0[0])[temp_t0]; sp128 = (temp_v0 >> 0x10) & 0xFF; sp126 = (temp_v0 >> 8) & 0xFF; sp124 = temp_v0 & 0xFF; - temp_v1 = *(&spD0 + temp_t9); + temp_v1 = (&spD0[0])[temp_t0]; sp122 = (temp_v1 >> 0x10) & 0xFF; - temp_t7 = arg0 + (arg3 * 2); sp120 = (temp_v1 >> 8) & 0xFF; sp11E = temp_v1 & 0xFF; - sp54 = temp_t7; - temp_t6 = (((arg0->unk2E + temp_t7->unk48 + arg0->unkC0) & 0xFFFF) / 0x80) << 0x17; - temp_t1 = temp_t6 >> 0x10; - phi_t1 = temp_t1; - if (arg3 == arg1) { - phi_f20_2 = D_800EE840; + sp54 = player + (arg3 * 2); + temp_t1 = ((s32) ((player->unk_02C[1] + player->unk_048[arg3] + player->unk_0C0) & 0xFFFF) / 128) << 7; + if (arg3 == (s8) arg1) { + var_f20 = 0.3f; } else { - temp_v0_2 = (arg3 * 0xB8) + &cameras; - temp_f20 = arg0->unk14 - temp_v0_2->unk0; - temp_f0 = arg0->unk1C - temp_v0_2->unk8; - if (gActiveScreenMode != SCREEN_MODE_3P_4P_SPLITSCREEN) { + temp_v0_2 = &cameras[arg3]; + temp_f20 = player->pos[0] - temp_v0_2->pos[0]; + temp_f0 = player->pos[2] - temp_v0_2->pos[2]; + if (gActiveScreenMode != 3) { sp11C = temp_t1; - phi_f20 = sqrtf((temp_f20 * temp_f20) + (temp_f0 * temp_f0)) / 300.0f; + var_f20 = sqrtf((temp_f20 * temp_f20) + (temp_f0 * temp_f0)) / 300.0f; } else { sp11C = temp_t1; - phi_f20 = sqrtf((temp_f20 * temp_f20) + (temp_f0 * temp_f0)) / 200.0f; + var_f20 = sqrtf((temp_f20 * temp_f20) + (temp_f0 * temp_f0)) / 200.0f; } - temp_f0_2 = phi_f20; - phi_f0 = temp_f0_2; - phi_t1 = temp_t6 >> 0x10; - phi_f20_2 = phi_f20; - if (D_800EE848 <= temp_f0_2) { - temp_f20_2 = D_800EE850; - phi_f0 = temp_f20_2; - phi_f20_2 = temp_f20_2; + var_f0 = (f64) var_f20; + if (var_f0 >= 1.8) { + var_f20 = 1.8f; + var_f0 = (f64) 1.8f; } - if (phi_f0 <= D_800EE858) { - phi_f20_2 = D_800EE860; + if (var_f0 <= 0.3) { + var_f20 = 0.3f; } } - temp_t7_2 = arg2 * 4; - temp_a0 = phi_t1 & 0xFFFF; + temp_t7 = (s16) arg2 * 4; + temp_a0 = temp_t1 & 0xFFFF; sp44 = temp_a0; - sp134 = *(&D_8018D4D0 + ((arg1 * 0xC) + temp_t7_2)); - sp138 = *(&D_8018D530 + ((arg1 * 0xC) + temp_t7_2)); - sp13C = *(&D_8018D590 + ((arg1 * 0xC) + temp_t7_2)); - temp_t6_2 = arg2 * 2; - temp_v1_2 = (arg1 * 6) + temp_t6_2 + &D_8018D890; - sp12C = -(coss(temp_a0) * (*temp_v1_2 * 4)); + sp134 = *(&D_8018D4D0 + (((s8) arg1 * 0xC) + temp_t7)); + sp138 = *(&D_8018D530 + (((s8) arg1 * 0xC) + temp_t7)); + sp13C = *(&D_8018D590 + (((s8) arg1 * 0xC) + temp_t7)); + temp_t6 = (s16) arg2 * 2; + temp_v1_2 = ((s8) arg1 * 6) + temp_t6 + &D_8018D890; + sp12C = (s16) (s32) -(coss((u16) temp_a0) * (f32) (*temp_v1_2 * 4)); sp3C = temp_v1_2; - sp40 = temp_t6_2; + sp40 = temp_t6; sp12E = sp54->unk48; - sp58 = coss(sp46); - sp130 = (*(&D_8018D7D0 + ((arg1 * 6) + temp_t6_2)) - (*(&D_8018D860 + ((arg1 * 6) + temp_t6_2)) * sp58)) - (sins(sp46) * (*sp3C * 8)); - func_80021E10(&sp140, &sp134, &sp12C); - func_80021F84(&sp140, phi_f20_2); - func_80022180(gGfxPool + (D_80164AF0 << 6) + 0xFAC0, &sp140); + sp58 = coss(unksp46); + sp130 = (s16) (s32) (((f32) *(&D_8018D7D0 + (((s8) arg1 * 6) + temp_t6)) - ((f32) *(&D_8018D860 + (((s8) arg1 * 6) + temp_t6)) * sp58)) - (sins(unksp46) * (f32) (*sp3C * 8))); + func_80021E10((f32 (*)[4]) &sp140[0], &sp134, &sp12C); + func_80021F84((f32 (*)[4]) &sp140[0], var_f20); + func_80022180(&gGfxPool->mtxPool[D_80164AF0] + 0xFAC0, (f32 (*)[4]) &sp140[0]); temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0x1020040; - temp_v0_3->unk4 = (gGfxPool + (D_80164AF0 << 6) + 0xFAC0) & 0x1FFFFFFF; + temp_v0_3->words.w0 = 0x01020040; + temp_v0_3->words.w1 = (s32) (&gGfxPool->mtxPool[D_80164AF0] + 0xFAC0) & 0x1FFFFFFF; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk4 = &D_0D008DB8; - temp_v0_4->unk0 = 0x6000000; + temp_v0_4->words.w1 = (u32) D_0D008DB8; + temp_v0_4->words.w0 = 0x06000000; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk0 = 0xFD100000; - temp_v0_5->unk4 = &D_800E52D0; + temp_v0_5->words.w0 = 0xFD100000; + temp_v0_5->words.w1 = (u32) &D_800E52D0; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk0 = 0xE8000000; - temp_v0_6->unk4 = 0; + temp_v0_6->words.w0 = 0xE8000000; + temp_v0_6->words.w1 = 0; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk0 = 0xF5000100; - temp_v0_7->unk4 = 0x7000000; + temp_v0_7->words.w0 = 0xF5000100; + temp_v0_7->words.w1 = 0x07000000; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk0 = 0xE6000000; - temp_v0_8->unk4 = 0; + temp_v0_8->words.w0 = 0xE6000000; + temp_v0_8->words.w1 = 0; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; - temp_v0_9->unk0 = 0xF0000000; - temp_v0_9->unk4 = 0x73FC000; + temp_v0_9->words.w0 = 0xF0000000; + temp_v0_9->words.w1 = 0x073FC000; temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; spB0 = temp_v0_10; - temp_v0_10->unk0 = 0xE7000000; - temp_v0_10->unk4 = 0; + temp_v0_10->words.w0 = 0xE7000000; + temp_v0_10->words.w1 = 0; temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; spAC = temp_v0_11; - temp_v0_11->unk0 = 0xBA000E02; - spAC->unk4 = 0x8000; - func_8004B614(sp128, sp126, sp124, sp122, sp120, sp11E, 0xD8); + temp_v0_11->words.w0 = 0xBA000E02; + spAC->words.w1 = 0x00008000; + func_8004B614((s32) sp128, (s32) sp126, (s32) sp124, (s32) sp122, (s32) sp120, (s32) sp11E, 0x000000D8); temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk0 = 0xB900031D; - temp_v0_12->unk4 = 0x505978; + temp_v0_12->words.w0 = 0xB900031D; + temp_v0_12->words.w1 = 0x00505978; temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk0 = 0xFD500000; - temp_v0_13->unk4 = D_8018D4BC; + temp_v0_13->words.w0 = 0xFD500000; + temp_v0_13->words.w1 = D_8018D4BC; temp_v0_14 = gDisplayListHead; gDisplayListHead = temp_v0_14 + 8; - temp_v0_14->unk4 = 0x7080200; - temp_v0_14->unk0 = 0xF5500000; + temp_v0_14->words.w1 = 0x07080200; + temp_v0_14->words.w0 = 0xF5500000; temp_v0_15 = gDisplayListHead; gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk4 = 0; - temp_v0_15->unk0 = 0xE6000000; + temp_v0_15->words.w1 = 0; + temp_v0_15->words.w0 = 0xE6000000; temp_v0_16 = gDisplayListHead; gDisplayListHead = temp_v0_16 + 8; - temp_v0_16->unk4 = 0x73FF100; - temp_v0_16->unk0 = 0xF3000000; + temp_v0_16->words.w1 = 0x073FF100; + temp_v0_16->words.w0 = 0xF3000000; temp_v0_17 = gDisplayListHead; gDisplayListHead = temp_v0_17 + 8; - temp_v0_17->unk4 = 0; - temp_v0_17->unk0 = 0xE7000000; + temp_v0_17->words.w1 = 0; + temp_v0_17->words.w0 = 0xE7000000; temp_v0_18 = gDisplayListHead; gDisplayListHead = temp_v0_18 + 8; - temp_v0_18->unk0 = 0xF5481000; - temp_v0_18->unk4 = 0x80200; + temp_v0_18->words.w0 = 0xF5481000; + temp_v0_18->words.w1 = 0x00080200; temp_v0_19 = gDisplayListHead; gDisplayListHead = temp_v0_19 + 8; - temp_v0_19->unk0 = 0xF2000000; - temp_v0_19->unk4 = 0xFC07C; + temp_v0_19->words.w0 = 0xF2000000; + temp_v0_19->words.w1 = 0x000FC07C; temp_v0_20 = gDisplayListHead; gDisplayListHead = temp_v0_20 + 8; - temp_v0_20->unk4 = &D_800E5250; - temp_v0_20->unk0 = 0x400103F; + temp_v0_20->words.w1 = (u32) &D_800E5250; + temp_v0_20->words.w0 = 0x0400103F; temp_v0_21 = gDisplayListHead; gDisplayListHead = temp_v0_21 + 8; - temp_v0_21->unk4 = &D_0D008C78; - temp_v0_21->unk0 = 0x6000000; + temp_v0_21->words.w1 = (u32) D_0D008C78; + temp_v0_21->words.w0 = 0x06000000; temp_v0_22 = gDisplayListHead; gDisplayListHead = temp_v0_22 + 8; - temp_v0_22->unk0 = 0xFD500000; - temp_v0_22->unk4 = D_8018D4C0 - 0x40; + temp_v0_22->words.w0 = 0xFD500000; + temp_v0_22->words.w1 = D_8018D4C0 - 0x40; temp_v0_23 = gDisplayListHead; gDisplayListHead = temp_v0_23 + 8; - temp_v0_23->unk4 = 0x7080200; - temp_v0_23->unk0 = 0xF5500000; + temp_v0_23->words.w1 = 0x07080200; + temp_v0_23->words.w0 = 0xF5500000; temp_v0_24 = gDisplayListHead; gDisplayListHead = temp_v0_24 + 8; - temp_v0_24->unk4 = 0; - temp_v0_24->unk0 = 0xE6000000; + temp_v0_24->words.w1 = 0; + temp_v0_24->words.w0 = 0xE6000000; temp_v0_25 = gDisplayListHead; gDisplayListHead = temp_v0_25 + 8; - temp_v0_25->unk4 = 0x73FF100; - temp_v0_25->unk0 = 0xF3000000; + temp_v0_25->words.w1 = 0x073FF100; + temp_v0_25->words.w0 = 0xF3000000; temp_v0_26 = gDisplayListHead; gDisplayListHead = temp_v0_26 + 8; - temp_v0_26->unk4 = 0; - temp_v0_26->unk0 = 0xE7000000; + temp_v0_26->words.w1 = 0; + temp_v0_26->words.w0 = 0xE7000000; temp_v0_27 = gDisplayListHead; gDisplayListHead = temp_v0_27 + 8; - temp_v0_27->unk0 = 0xF5481000; - temp_v0_27->unk4 = 0x80200; + temp_v0_27->words.w0 = 0xF5481000; + temp_v0_27->words.w1 = 0x00080200; temp_v0_28 = gDisplayListHead; gDisplayListHead = temp_v0_28 + 8; - temp_v0_28->unk0 = 0xF2000000; - temp_v0_28->unk4 = 0xFC07C; + temp_v0_28->words.w0 = 0xF2000000; + temp_v0_28->words.w1 = 0x000FC07C; temp_v0_29 = gDisplayListHead; gDisplayListHead = temp_v0_29 + 8; - temp_v0_29->unk4 = &D_800E5290; - temp_v0_29->unk0 = 0x400103F; + temp_v0_29->words.w1 = (u32) &D_800E5290; + temp_v0_29->words.w0 = 0x0400103F; temp_v0_30 = gDisplayListHead; gDisplayListHead = temp_v0_30 + 8; - temp_v0_30->unk4 = &D_0D008C78; - temp_v0_30->unk0 = 0x6000000; + temp_v0_30->words.w1 = (u32) D_0D008C78; + temp_v0_30->words.w0 = 0x06000000; temp_v0_31 = gDisplayListHead; gDisplayListHead = temp_v0_31 + 8; - temp_v0_31->unk4 = 0x10001; - temp_v0_31->unk0 = 0xBB000000; - D_80164AF0 = D_80164AF0 + 1; + temp_v0_31->words.w1 = 0x00010001; + temp_v0_31->words.w0 = 0xBB000000; + D_80164AF0 += 1; } #else GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006AFD0.s") @@ -10183,36 +9166,29 @@ void func_8006B87C(UNUSED Player *player, s8 playerIndex) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_8008FD4C(s32, s8, s8); // extern -void func_800C9060(s32, ?, s8, s16); // extern -extern u16 gPlayerBalloonStatus; -extern s16 gPlayerBalloonCount; - -void func_8006B8B4(s32 arg0, s8 playerIndex) { +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +void func_8006B8B4(Player *player, s8 playerIndex) { s16 *sp1C; - s16 *currentPlayerBalloonCount; - s16 playerBalloonCountValue; - s32 temp_a0; - s8 playerIndexTemp; + s16 *temp_v1; + s16 temp_a3; u16 *temp_v0; u16 temp_t5; + u8 temp_a0; - currentPlayerBalloonCount = (playerIndex * 2) + &gPlayerBalloonCount; - playerBalloonCountValue = *currentPlayerBalloonCount; - playerIndexTemp = playerIndex; - if (playerBalloonCountValue >= 0) { - temp_v0 = (playerIndex * 6) + (playerBalloonCountValue * 2) + &gPlayerBalloonStatus; + temp_v1 = &gPlayerBalloonCount[playerIndex]; + temp_a3 = *temp_v1; + if (temp_a3 >= 0) { + temp_v0 = (playerIndex * 6) + (temp_a3 * 2) + gPlayerBalloonStatus; temp_t5 = *temp_v0 & 0xFFFE; *temp_v0 = temp_t5; *temp_v0 = temp_t5 | 2; - *currentPlayerBalloonCount = playerBalloonCountValue - 1; - temp_a0 = playerIndexTemp & 0xFF; - sp1C = currentPlayerBalloonCount; - playerIndex = playerIndexTemp; - func_800C9060(temp_a0, 0x19009051, playerIndexTemp, playerBalloonCountValue); - if (*currentPlayerBalloonCount < 0) { - func_8008FD4C(arg0, playerIndex, playerIndex); + *temp_v1 = temp_a3 - 1; + temp_a0 = playerIndex & 0xFF; + sp1C = temp_v1; + playerIndex = playerIndex; + func_800C9060(temp_a0, 0x19009051U); + if (*temp_v1 < 0) { + func_8008FD4C(player, playerIndex); } } } @@ -10254,28 +9230,19 @@ void func_8006BA94(Player* player, s8 playerIndex, s8 arg2) { } #ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_80021E10(? *, f32 *, s16 *, s16); // extern -void func_80021F84(? *, s32); // extern -void func_80022180(void *, ? *); // extern -void func_8004B614(s16, s16, s16, s16, s32, s32, s32); // extern -extern Gfx D_0D008C78; -extern Gfx D_0D008DB8; -extern ? D_800E4974; -extern ? D_800E4994; -extern ? D_800E5250; -extern ? D_800E5290; -extern ? D_800E52D0; -extern s16 D_80164AF0; -extern s32 D_8018D4BC; +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +extern u32 D_8018D4BC; extern s32 D_8018D4C0; -extern s32 *gDisplayListHead; +static ? D_800E4974; /* unable to generate initializer */ +static ? D_800E4994; /* unable to generate initializer */ +static ? D_800E5250; /* unable to generate initializer */ +static ? D_800E5290; /* unable to generate initializer */ +static ? D_800E52D0; /* unable to generate initializer */ -void func_8006BB34(struct UnkStruct_8028088C arg0*, s32 arg1, s16 arg2, s16 arg3) { - ? sp108; +void func_8006BB34(struct UnkStruct_8028088C *arg0, f32 arg1, s16 arg2, s16 arg3) { f32 sp104; f32 sp100; - f32 spFC; + s32 spFC; s16 spF8; s16 spF6; s16 spF4; @@ -10285,69 +9252,61 @@ void func_8006BB34(struct UnkStruct_8028088C arg0*, s32 arg1, s16 arg2, s16 arg3 s16 spEA; s16 spE8; s16 spE6; - ? spC4; - ? spA4; - s32 *sp84; - s32 *sp80; - f32 *temp_a1; - s16 *temp_a2; - 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_16; - s32 *temp_v0_17; - s32 *temp_v0_18; - s32 *temp_v0_19; - s32 *temp_v0_20; - s32 *temp_v0_21; - s32 *temp_v0_22; - s32 *temp_v0_23; - s32 *temp_v0_24; - s32 *temp_v0_25; - s32 *temp_v0_26; - s32 *temp_v0_27; - s32 *temp_v0_28; - s32 *temp_v0_29; - s32 *temp_v0_2; - s32 *temp_v0_30; - 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; - s32 temp_t0; + Gfx *sp84; + Gfx *sp80; + Gfx *temp_v0_10; + Gfx *temp_v0_11; + Gfx *temp_v0_12; + Gfx *temp_v0_13; + Gfx *temp_v0_14; + Gfx *temp_v0_15; + Gfx *temp_v0_16; + Gfx *temp_v0_17; + Gfx *temp_v0_18; + Gfx *temp_v0_19; + Gfx *temp_v0_20; + Gfx *temp_v0_21; + Gfx *temp_v0_22; + Gfx *temp_v0_23; + Gfx *temp_v0_24; + Gfx *temp_v0_25; + Gfx *temp_v0_26; + Gfx *temp_v0_27; + Gfx *temp_v0_28; + Gfx *temp_v0_29; + Gfx *temp_v0_2; + Gfx *temp_v0_30; + Gfx *temp_v0_3; + Gfx *temp_v0_4; + Gfx *temp_v0_5; + Gfx *temp_v0_6; + Gfx *temp_v0_7; + Gfx *temp_v0_8; + Gfx *temp_v0_9; s32 temp_v0; s32 temp_v1; - spC4.unk0 = D_800E4974.unk0; - spC4.unk4 = D_800E4974.unk4; - spC4.unk8 = D_800E4974.unk8; - temp_t0 = arg3 * 4; - temp_a2 = &spF4; - spC4.unkC = D_800E4974.unkC; - temp_a1 = &spFC; - spC4.unk10 = D_800E4974.unk10; - spC4.unk14 = D_800E4974.unk14; - spC4.unk18 = D_800E4974.unk18; - spC4.unk1C = D_800E4974.unk1C; - temp_v0 = *(&spC4 + temp_t0); - spA4.unk0 = D_800E4994.unk0; - spA4.unk4 = D_800E4994.unk4; - spA4.unk8 = D_800E4994.unk8; - spA4.unkC = D_800E4994.unkC; - spA4.unk10 = D_800E4994.unk10; - spA4.unk14 = D_800E4994.unk14; - spA4.unk18 = D_800E4994.unk18; - spA4.unk1C = D_800E4994.unk1C; + spC4[0].unk0 = D_800E4974.unk0; + spC4[0].unk4 = (s32) D_800E4974.unk4; + spC4[0].unk8 = (s32) D_800E4974.unk8; + spC4[0].unkC = (s32) D_800E4974.unkC; + spC4[0].unk10 = (s32) D_800E4974.unk10; + spC4[0].unk14 = (s32) D_800E4974.unk14; + spC4[0].unk18 = (s32) D_800E4974.unk18; + spC4[0].unk1C = (s32) D_800E4974.unk1C; + temp_v0 = (&spC4[0])[arg3]; + spA4[0].unk0 = D_800E4994.unk0; + spA4[0].unk4 = (s32) D_800E4994.unk4; + spA4[0].unk8 = (s32) D_800E4994.unk8; + spA4[0].unkC = (s32) D_800E4994.unkC; + spA4[0].unk10 = (s32) D_800E4994.unk10; + spA4[0].unk14 = (s32) D_800E4994.unk14; + spA4[0].unk18 = (s32) D_800E4994.unk18; + spA4[0].unk1C = (s32) D_800E4994.unk1C; spF0 = (temp_v0 >> 0x10) & 0xFF; spEE = (temp_v0 >> 8) & 0xFF; spEC = temp_v0 & 0xFF; - temp_v1 = *(&spA4 + temp_t0); + temp_v1 = (&spA4[0])[arg3]; spEA = (temp_v1 >> 0x10) & 0xFF; spE8 = (temp_v1 >> 8) & 0xFF; spE6 = temp_v1 & 0xFF; @@ -10356,130 +9315,130 @@ void func_8006BB34(struct UnkStruct_8028088C arg0*, s32 arg1, s16 arg2, s16 arg3 spF4 = 0; sp104 = arg0->unk8; spF8 = arg2; - spF6 = camera1->unk26; - func_80021E10(&sp108, temp_a1, temp_a2, arg3); - func_80021F84(&sp108, arg1); - func_80022180(gGfxPool + (D_80164AF0 << 6) + 0xFAC0, &sp108); + spF6 = camera1->rot[1]; + func_80021E10((f32 (*)[4]) &sp108[0], (f32 *) &spFC, &spF4); + func_80021F84((f32 (*)[4]) &sp108[0], arg1); + func_80022180(&gGfxPool->mtxPool[D_80164AF0] + 0xFAC0, (f32 (*)[4]) &sp108[0]); temp_v0_2 = gDisplayListHead; gDisplayListHead = temp_v0_2 + 8; - temp_v0_2->unk0 = 0x1020040; - temp_v0_2->unk4 = (gGfxPool + (D_80164AF0 << 6) + 0xFAC0) & 0x1FFFFFFF; + temp_v0_2->words.w0 = 0x01020040; + temp_v0_2->words.w1 = (s32) (&gGfxPool->mtxPool[D_80164AF0] + 0xFAC0) & 0x1FFFFFFF; temp_v0_3 = gDisplayListHead; gDisplayListHead = temp_v0_3 + 8; - temp_v0_3->unk0 = 0x6000000; - temp_v0_3->unk4 = &D_0D008DB8; + temp_v0_3->words.w0 = 0x06000000; + temp_v0_3->words.w1 = (u32) D_0D008DB8; temp_v0_4 = gDisplayListHead; gDisplayListHead = temp_v0_4 + 8; - temp_v0_4->unk0 = 0xFD100000; - temp_v0_4->unk4 = &D_800E52D0; + temp_v0_4->words.w0 = 0xFD100000; + temp_v0_4->words.w1 = (u32) &D_800E52D0; temp_v0_5 = gDisplayListHead; gDisplayListHead = temp_v0_5 + 8; - temp_v0_5->unk0 = 0xE8000000; - temp_v0_5->unk4 = 0; + temp_v0_5->words.w0 = 0xE8000000; + temp_v0_5->words.w1 = 0; temp_v0_6 = gDisplayListHead; gDisplayListHead = temp_v0_6 + 8; - temp_v0_6->unk0 = 0xF5000100; - temp_v0_6->unk4 = 0x7000000; + temp_v0_6->words.w0 = 0xF5000100; + temp_v0_6->words.w1 = 0x07000000; temp_v0_7 = gDisplayListHead; gDisplayListHead = temp_v0_7 + 8; - temp_v0_7->unk0 = 0xE6000000; - temp_v0_7->unk4 = 0; + temp_v0_7->words.w0 = 0xE6000000; + temp_v0_7->words.w1 = 0; temp_v0_8 = gDisplayListHead; gDisplayListHead = temp_v0_8 + 8; - temp_v0_8->unk0 = 0xF0000000; - temp_v0_8->unk4 = 0x73FC000; + temp_v0_8->words.w0 = 0xF0000000; + temp_v0_8->words.w1 = 0x073FC000; temp_v0_9 = gDisplayListHead; gDisplayListHead = temp_v0_9 + 8; sp84 = temp_v0_9; - temp_v0_9->unk0 = 0xE7000000; - sp84->unk4 = 0; + temp_v0_9->words.w0 = 0xE7000000; + sp84->words.w1 = 0; temp_v0_10 = gDisplayListHead; gDisplayListHead = temp_v0_10 + 8; sp80 = temp_v0_10; - temp_v0_10->unk0 = 0xBA000E02; - sp80->unk4 = 0x8000; - func_8004B614(spF0, spEE, spEC, spEA, spE8, spE6, 0xD8); + temp_v0_10->words.w0 = 0xBA000E02; + sp80->words.w1 = 0x00008000; + func_8004B614((s32) spF0, (s32) spEE, (s32) spEC, (s32) spEA, (s32) spE8, (s32) spE6, 0x000000D8); temp_v0_11 = gDisplayListHead; gDisplayListHead = temp_v0_11 + 8; - temp_v0_11->unk0 = 0xB900031D; - temp_v0_11->unk4 = 0x505978; + temp_v0_11->words.w0 = 0xB900031D; + temp_v0_11->words.w1 = 0x00505978; temp_v0_12 = gDisplayListHead; gDisplayListHead = temp_v0_12 + 8; - temp_v0_12->unk0 = 0xFD500000; - temp_v0_12->unk4 = D_8018D4BC; + temp_v0_12->words.w0 = 0xFD500000; + temp_v0_12->words.w1 = D_8018D4BC; temp_v0_13 = gDisplayListHead; gDisplayListHead = temp_v0_13 + 8; - temp_v0_13->unk4 = 0x7080200; - temp_v0_13->unk0 = 0xF5500000; + temp_v0_13->words.w1 = 0x07080200; + temp_v0_13->words.w0 = 0xF5500000; temp_v0_14 = gDisplayListHead; gDisplayListHead = temp_v0_14 + 8; - temp_v0_14->unk4 = 0; - temp_v0_14->unk0 = 0xE6000000; + temp_v0_14->words.w1 = 0; + temp_v0_14->words.w0 = 0xE6000000; temp_v0_15 = gDisplayListHead; gDisplayListHead = temp_v0_15 + 8; - temp_v0_15->unk4 = 0x73FF100; - temp_v0_15->unk0 = 0xF3000000; + temp_v0_15->words.w1 = 0x073FF100; + temp_v0_15->words.w0 = 0xF3000000; temp_v0_16 = gDisplayListHead; gDisplayListHead = temp_v0_16 + 8; - temp_v0_16->unk4 = 0; - temp_v0_16->unk0 = 0xE7000000; + temp_v0_16->words.w1 = 0; + temp_v0_16->words.w0 = 0xE7000000; temp_v0_17 = gDisplayListHead; gDisplayListHead = temp_v0_17 + 8; - temp_v0_17->unk0 = 0xF5481000; - temp_v0_17->unk4 = 0x80200; + temp_v0_17->words.w0 = 0xF5481000; + temp_v0_17->words.w1 = 0x00080200; temp_v0_18 = gDisplayListHead; gDisplayListHead = temp_v0_18 + 8; - temp_v0_18->unk0 = 0xF2000000; - temp_v0_18->unk4 = 0xFC07C; + temp_v0_18->words.w0 = 0xF2000000; + temp_v0_18->words.w1 = 0x000FC07C; temp_v0_19 = gDisplayListHead; gDisplayListHead = temp_v0_19 + 8; - temp_v0_19->unk4 = &D_800E5250; - temp_v0_19->unk0 = 0x400103F; + temp_v0_19->words.w1 = (u32) &D_800E5250; + temp_v0_19->words.w0 = 0x0400103F; temp_v0_20 = gDisplayListHead; gDisplayListHead = temp_v0_20 + 8; - temp_v0_20->unk4 = &D_0D008C78; - temp_v0_20->unk0 = 0x6000000; + temp_v0_20->words.w1 = (u32) D_0D008C78; + temp_v0_20->words.w0 = 0x06000000; temp_v0_21 = gDisplayListHead; gDisplayListHead = temp_v0_21 + 8; - temp_v0_21->unk0 = 0xFD500000; - temp_v0_21->unk4 = D_8018D4C0 - 0x40; + temp_v0_21->words.w0 = 0xFD500000; + temp_v0_21->words.w1 = D_8018D4C0 - 0x40; temp_v0_22 = gDisplayListHead; gDisplayListHead = temp_v0_22 + 8; - temp_v0_22->unk4 = 0x7080200; - temp_v0_22->unk0 = 0xF5500000; + temp_v0_22->words.w1 = 0x07080200; + temp_v0_22->words.w0 = 0xF5500000; temp_v0_23 = gDisplayListHead; gDisplayListHead = temp_v0_23 + 8; - temp_v0_23->unk4 = 0; - temp_v0_23->unk0 = 0xE6000000; + temp_v0_23->words.w1 = 0; + temp_v0_23->words.w0 = 0xE6000000; temp_v0_24 = gDisplayListHead; gDisplayListHead = temp_v0_24 + 8; - temp_v0_24->unk4 = 0x73FF100; - temp_v0_24->unk0 = 0xF3000000; + temp_v0_24->words.w1 = 0x073FF100; + temp_v0_24->words.w0 = 0xF3000000; temp_v0_25 = gDisplayListHead; gDisplayListHead = temp_v0_25 + 8; - temp_v0_25->unk4 = 0; - temp_v0_25->unk0 = 0xE7000000; + temp_v0_25->words.w1 = 0; + temp_v0_25->words.w0 = 0xE7000000; temp_v0_26 = gDisplayListHead; gDisplayListHead = temp_v0_26 + 8; - temp_v0_26->unk0 = 0xF5481000; - temp_v0_26->unk4 = 0x80200; + temp_v0_26->words.w0 = 0xF5481000; + temp_v0_26->words.w1 = 0x00080200; temp_v0_27 = gDisplayListHead; gDisplayListHead = temp_v0_27 + 8; - temp_v0_27->unk0 = 0xF2000000; - temp_v0_27->unk4 = 0xFC07C; + temp_v0_27->words.w0 = 0xF2000000; + temp_v0_27->words.w1 = 0x000FC07C; temp_v0_28 = gDisplayListHead; gDisplayListHead = temp_v0_28 + 8; - temp_v0_28->unk4 = &D_800E5290; - temp_v0_28->unk0 = 0x400103F; + temp_v0_28->words.w1 = (u32) &D_800E5290; + temp_v0_28->words.w0 = 0x0400103F; temp_v0_29 = gDisplayListHead; gDisplayListHead = temp_v0_29 + 8; - temp_v0_29->unk4 = &D_0D008C78; - temp_v0_29->unk0 = 0x6000000; + temp_v0_29->words.w1 = (u32) D_0D008C78; + temp_v0_29->words.w0 = 0x06000000; temp_v0_30 = gDisplayListHead; gDisplayListHead = temp_v0_30 + 8; - temp_v0_30->unk4 = 0x10001; - temp_v0_30->unk0 = 0xBB000000; - D_80164AF0 = D_80164AF0 + 1; + temp_v0_30->words.w1 = 0x00010001; + temp_v0_30->words.w0 = 0xBB000000; + D_80164AF0 += 1; } #else GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006BB34.s") @@ -10714,23 +9673,13 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006C4D4.s") #ifdef MIPS_TO_C -//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 -void func_8005DA30(s16, s32, s8, s32); /* extern */ -void func_8005DAF4(s16, s32, s8, s32); /* extern */ -void func_8005EA94(s16, s32, s8, s32); /* extern */ -void func_8005ED48(s16, s32, s8, s32); /* extern */ -void func_8005F90C(s16, s32, s8, s32); /* extern */ -void func_80060BCC(s16, s32, s8, s32); /* extern */ -void func_80062F98(s16, s8, s8); /* extern */ -void func_80063408(s16, s8, s8); /* extern */ -void func_800635D4(s16, s8, s8); /* extern */ -void func_800639DC(s16, s8, s8); /* extern */ -void func_80063BD4(s16, s8, s8); /* extern */ -void func_80063D58(s16, s8, s8); /* extern */ -void func_800643A8(s16, s8, s8); /* extern */ -extern f32 D_801652A0; - -void func_8006C6AC(void *arg0, s16 arg1, s8 arg2, s8 arg3) { +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_8005DAF4(s16, s32, s8, s32); /* extern */ +? func_8005EA94(s16, s32, s8, s32); /* extern */ +? func_8005ED48(s16, s32, s8, s32); /* extern */ +? func_8005F90C(s16, s32, s8, s32); /* extern */ + +void func_8006C6AC(Player *player, s16 arg1, s8 arg2, s8 arg3) { s32 sp28; f32 temp_f0; s32 temp_v0; @@ -10743,61 +9692,60 @@ void func_8006C6AC(void *arg0, s16 arg1, s8 arg2, s8 arg3) { if (temp_v0 < 0) { sp28 = 9; } - temp_v0_2 = arg0 + (arg1 * 0x48); + temp_v0_2 = player + (arg1 * 0x48); if (temp_v0_2->unk544 == 1) { temp_t2 = temp_v0_2->unk53A; switch (temp_t2) { case 1: - func_80063408(arg1, arg2, arg3); + func_80063408(player, arg1, arg2, arg3); return; case 2: - func_800635D4(arg1, arg2, arg3); + func_800635D4(player, arg1, arg2, arg3); return; case 3: - func_80063BD4(arg1, arg2, arg3); + func_80063BD4(player, arg1, arg2, arg3); return; case 4: - func_800643A8(arg1, arg2, arg3); + func_800643A8(player, arg1, arg2, arg3); return; case 5: - func_800639DC(arg1, arg2, arg3); + func_800639DC(player, arg1, arg2, arg3); return; case 9: - func_80063D58(arg1, arg2, arg3); + func_80063D58(player, arg1, arg2, arg3); return; case 11: - func_80062F98(arg1, arg2, arg3); + func_80062F98(player, arg1, arg2, arg3); return; } } else { - if ((arg0->unkDE & 1) != 0) { - func_80060BCC(arg1, sp28, arg2, arg3); + if (player->unk_0DE & 1) { + func_80060BCC(player, arg1, sp28, (s32) arg2, /* extra? */ (s32) arg3); return; } - temp_v0_3 = arg0->unkBC; - if (((temp_v0_3 & 8) == 0) && ((temp_v0_3 & 2) == 0)) { - if (((temp_v0_3 & 0x10) == 0x10) && ((arg0->unk0 & 0x4000) == 0x4000)) { - func_8005DA30(arg1, sp28, arg2, arg3); + temp_v0_3 = player->unk_0BC; + if (!(temp_v0_3 & 8) && !(temp_v0_3 & 2)) { + if (((temp_v0_3 & 0x10) == 0x10) && ((player->unk_000 & 0x4000) == 0x4000)) { + func_8005DA30(player, arg1, sp28, arg2, (s8) (s32) arg3); return; } - temp_f0 = *(&D_801652A0 + (arg2 * 4)); - if (((temp_f0 - arg0->unk1F0) >= 3.5) || ((temp_f0 - arg0->unk1D8) >= 3.5)) { - func_8005EA94(arg1, sp28, arg2, arg3); + temp_f0 = D_801652A0[arg2]; + if (((f64) (temp_f0 - player->boundingBoxCorners[3].cornerGroundY) >= 3.5) || ((f64) (temp_f0 - player->boundingBoxCorners[2].cornerGroundY) >= 3.5)) { + func_8005EA94(arg1, sp28, arg2, (s32) arg3); return; } if (((temp_v0_3 & 0x80) == 0x80) || ((temp_v0_3 & 0x40) == 0x40)) { - func_8005F90C(arg1, sp28, arg2, arg3); + func_8005F90C(arg1, sp28, arg2, (s32) arg3); return; } - if ((((temp_v0_3 & 0x4000) != 0) && ((arg0->unk0 & 0x2000) == 0)) || ((temp_v0_3 & 0x800) != 0) || ((temp_v0_3 & 0x20) != 0) || ((arg0->unk44 & 0x4000) != 0)) { - func_8005ED48(arg1, sp28, arg2, arg3); + if (((temp_v0_3 & 0x4000) && !(player->unk_000 & 0x2000)) || (temp_v0_3 & 0x800) || (temp_v0_3 & 0x20) || (player->unk_044 & 0x4000)) { + func_8005ED48(arg1, sp28, arg2, (s32) arg3); return; } - func_8005DAF4(arg1, sp28, arg2, arg3); - /* Duplicate return node #32. Try simplifying control flow for better match */ - return; + func_8005DAF4(arg1, sp28, arg2, (s32) arg3); + } else { + default: } - default: } } #else @@ -10805,27 +9753,10 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006C6AC.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 -void func_800612F8(s16, s32, s8, s32); /* extern */ -void func_80061430(s16, s32, s8, s32); /* extern */ -void func_800615AC(s16, s32, s8, s32); /* extern */ -void func_8006199C(s16, s32, s8, s32); /* extern */ -void func_80061A34(s16, s32, s8, s32); /* extern */ -void func_80061D4C(s16, s32, s8, s32); /* extern */ -void func_80061EF4(s16, s32, s8, s32); /* extern */ -void func_800621BC(s16, s32, s8, s32); /* extern */ -void func_800624D8(s16, s32, s8, s32); /* extern */ -void func_800644E8(s16, s8, s8); /* extern */ -void func_80064664(s16, s8, s8); /* extern */ -void func_800647C8(s16, s8, s8); /* extern */ -void func_800648E4(s16, s8, s8); /* extern */ -void func_80064988(s16, s8, s8); /* extern */ -void func_800649F4(s16, s8, s8); /* extern */ -void func_80064B30(s16, s8, s8); /* extern */ -void func_80064C74(s16, s8, s8); /* extern */ -extern s32 D_8018D930; - -void func_8006C9B8(void *arg0, s16 arg1, s8 arg2, s8 arg3) { +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +extern ? D_8018D930; + +void func_8006C9B8(Player *player, s16 arg1, s8 arg2, s8 arg3) { s32 sp28; s16 temp_a2; s16 temp_a3; @@ -10841,89 +9772,89 @@ void func_8006C9B8(void *arg0, s16 arg1, s8 arg2, s8 arg3) { if (temp_v0 < 0) { sp28 = 9; } - temp_v0_2 = arg0 + (arg1 * 0x48); + temp_v0_2 = player + (arg1 * 0x48); if (temp_v0_2->unkAE4 == 1) { temp_t3 = temp_v0_2->unkADA; switch (temp_t3) { case 1: - func_800644E8(arg1, arg2, arg3); + func_800644E8(player, arg1, (s32) arg2, (s32) arg3); return; case 2: - func_800649F4(arg1, arg2, arg3); + func_800649F4(player, arg1, arg2, arg3); return; case 3: - func_80064C74(arg1, arg2, arg3); + func_80064C74(player, arg1, arg2, arg3); return; case 4: - func_800647C8(arg1, arg2, arg3); + func_800647C8(player, arg1, arg2, arg3); return; case 5: - func_80064B30(arg1, arg2, arg3); + func_80064B30(player, arg1, arg2, arg3); return; case 6: - func_800648E4(arg1, arg2, arg3); + func_800648E4(player, arg1, arg2, arg3); return; case 7: - func_80064988(arg1, arg2, arg3); + func_80064988(player, arg1, arg2, arg3); return; case 8: - func_80064C74(arg1, arg2, arg3); + func_80064C74(player, arg1, arg2, arg3); return; case 9: - func_80064664(arg1, arg2, arg3); + func_80064664(player, arg1, (s32) arg2, (s32) arg3); return; } } else { - temp_a3 = arg0->unk44; - if ((temp_a3 & 0x1000) != 0) { - func_80061430(arg1, sp28, arg2, arg3); - arg0->unk44 = arg0->unk44 & 0xFEFF; + temp_a3 = player->unk_044; + if (temp_a3 & 0x1000) { + func_80061430(player, (s32) arg1, sp28, (s32) arg2, /* extra? */ (s32) arg3); + player->unk_044 &= 0xFEFF; return; } - temp_a2 = arg0->unkCA; - if (((temp_a2 & 0x1000) == 0x1000) || ((temp_v0_3 = arg0->unkE0, ((temp_v0_3 < 2) != 0)) && ((arg0->unkBC << 7) < 0)) || ((temp_v1 = arg0->unkBC, ((temp_v0_3 < 2) != 0)) && ((temp_v1 << 6) < 0)) || ((temp_v1 & 0x400) != 0)) { - func_8006199C(arg1, sp28, arg2, arg3); - arg0->unk46 = arg0->unk46 & 0xFFF7; - arg0->unk44 = arg0->unk44 & 0xFEFF; + temp_a2 = player->unk_0CA; + if (((temp_a2 & 0x1000) == 0x1000) || ((temp_v0_3 = player->unk_0E0, ((temp_v0_3 < 2) != 0)) && (player->unk_0BC & 0x01000000)) || ((temp_v1 = player->unk_0BC, ((temp_v0_3 < 2) != 0)) && (temp_v1 & 0x02000000)) || (temp_v1 & 0x400)) { + func_8006199C(player, arg1, sp28, arg2, (s8) (s32) arg3); + player->unk_046 &= 0xFFF7; + player->unk_044 &= 0xFEFF; return; } if ((temp_a2 & 0x2000) == 0x2000) { - func_80061A34(arg1, sp28, arg2, arg3); - arg0->unk46 = arg0->unk46 & 0xFFF7; - arg0->unk44 = arg0->unk44 & 0xFEFF; + func_80061A34(player, arg1, sp28, (s32) arg2, /* extra? */ (s32) arg3); + player->unk_046 &= 0xFFF7; + player->unk_044 &= 0xFEFF; return; } - if (((temp_v1 & 0x200) != 0) && ((gCourseTimer - *(&D_8018D930 + (arg2 * 4))) < 9)) { - func_800615AC(arg1, sp28, arg2, arg3); - arg0->unk46 = arg0->unk46 & 0xFFF7; - arg0->unk44 = arg0->unk44 & 0xFEFF; + if ((temp_v1 & 0x200) && (((s32) gCourseTimer - *(&D_8018D930 + (arg2 * 4))) < 9)) { + func_800615AC(player, arg1, sp28, (s32) arg2, /* extra? */ (s32) arg3); + player->unk_046 &= 0xFFF7; + player->unk_044 &= 0xFEFF; return; } - temp_v0_4 = arg0->unk46; + temp_v0_4 = player->unk_046; if ((temp_v0_4 & 8) == 8) { - func_800612F8(arg1, sp28, arg2, arg3); - arg0->unk44 = arg0->unk44 & 0xFEFF; + func_800612F8(player, (s32) arg1, sp28, (s32) arg2, /* extra? */ (s32) arg3); + player->unk_044 &= 0xFEFF; return; } - if (((temp_v0_4 & 0x20) == 0x20) && (((arg0->unk94 / 18.0f) * 216.0f) >= 20.0f)) { - func_80061D4C(arg1, sp28, arg2, arg3); - arg0->unk46 = arg0->unk46 & 0xFFF7; - arg0->unk44 = arg0->unk44 & 0xFEFF; + if (((temp_v0_4 & 0x20) == 0x20) && (((player->unk_094 / 18.0f) * 216.0f) >= 20.0f)) { + func_80061D4C(player, arg1, sp28, (s32) arg2, /* extra? */ (s32) arg3); + player->unk_046 &= 0xFFF7; + player->unk_044 &= 0xFEFF; return; } - if (((temp_v1 & 0x2000) != 0) && ((arg0->unk0 & 0x4000) != 0)) { - func_800621BC(arg1, sp28, arg2, arg3); + if ((temp_v1 & 0x2000) && (player->unk_000 & 0x4000)) { + func_800621BC(player, arg1, sp28, arg2, /* extra? */ (s32) arg3); return; } - if ((((temp_v1 << 0xA) < 0) || (temp_v1 & 0x100000)) && ((arg0->unk0 & 0x4000) == 0x4000)) { - func_80061EF4(arg1, sp28, arg2, arg3); - arg0->unk46 = arg0->unk46 & 0xFFF7; - arg0->unk44 = arg0->unk44 & 0xFEFF; + if (((temp_v1 & 0x200000) || (temp_v1 & 0x100000)) && ((player->unk_000 & 0x4000) == 0x4000)) { + func_80061EF4(player, arg1, sp28, (s32) arg2, /* extra? */ (s32) arg3); + player->unk_046 &= 0xFFF7; + player->unk_044 &= 0xFEFF; return; } if ((temp_a3 & 0x100) == 0x100) { - func_800624D8(arg1, sp28, arg2, arg3); - arg0->unk46 = arg0->unk46 & 0xFFF7; + func_800624D8(player, (s32) arg1, sp28, (s32) arg2, /* extra? */ (s32) arg3); + player->unk_046 &= 0xFFF7; } default: } @@ -10933,177 +9864,147 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006C9B8.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 -void func_80060504(s16, s32, s8, s32); /* extern */ -void func_80060B14(s16, s32, s8, s32); /* extern */ -void func_80060F50(s16, s32, s8, s32); /* extern */ -void func_80061094(s16, s32, s8, s32); /* extern */ -void func_80061224(s16, s32, s8, s32); /* extern */ -void func_80062C74(s16, s8, s8); /* extern */ -void func_800630C0(s16, s8, s8); /* extern */ -void func_800631A8(s16, s8, s8); /* extern */ -void func_80063268(s16, s8, s8); /* extern */ -void func_80064184(s16, s8, s8); /* extern */ - -void func_8006CEC0(void *arg0, s16 arg1, s8 arg2, s8 arg3) { +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_80060504(s16, s32, s8, s32); /* extern */ +? func_80060B14(s16, s32, s8, s32); /* extern */ +? func_80061224(s16, s32, s8, s32); /* extern */ +? func_80062C74(s16, s8, s8); /* extern */ + +void func_8006CEC0(Player *player, s16 arg1, s8 arg2, s8 arg3) { s32 sp20; + s16 temp_v0_4; s16 temp_v0_5; - s16 temp_v0_6; s32 temp_t1_2; s32 temp_v0; - s32 temp_v0_4; + s32 temp_v0_3; s32 temp_v1; u16 temp_t1; - u16 temp_v0_3; - void *temp_v0_2; + u16 temp_v0_2; temp_v0 = arg1 - 1; sp20 = temp_v0; if (temp_v0 < 0) { sp20 = 9; } - temp_v0_2 = arg0 + (arg1 * 0x48); - if (temp_v0_2->unk274 == 1) { - temp_t1 = temp_v0_2->unk26A; + if (player->unk_258[arg1].unk_01C == 1) { + temp_t1 = player->unk_258[arg1].unk_012; switch (temp_t1) { case 1: func_80062C74(arg1, arg2, arg3); return; case 3: - func_80064184(arg1, arg2, arg3); + func_80064184(player, arg1, arg2, arg3); return; case 5: - func_800630C0(arg1, arg2, arg3); + func_800630C0(player, arg1, arg2, arg3); return; case 6: - func_800631A8(arg1, arg2, arg3); + func_800631A8(player, arg1, arg2, arg3); return; case 7: - func_80063268(arg1, arg2, arg3); + func_80063268(player, arg1, arg2, arg3); return; } } else { - if (((arg0->unk44 & 0x200) != 0) && ((arg0->unk0 & 0x4000) != 0)) { - func_80061224(arg1, sp20, arg2, arg3); + if ((player->unk_044 & 0x200) && (player->unk_000 & 0x4000)) { + func_80061224(arg1, sp20, arg2, (s32) arg3); return; } - temp_v1 = arg0->unkBC; - if (((temp_v1 & 0x40000000) == 0x40000000) && (arg0->unkB0 < 0x32)) { - func_80061094(arg1, sp20, arg2, arg3); + temp_v1 = player->unk_0BC; + if (((temp_v1 & 0x40000000) == 0x40000000) && (player->unk_0B0 < 0x32)) { + func_80061094(player, arg1, (s8) sp20, arg2, /* extra? */ (s32) arg3); return; } - temp_t1_2 = arg0->unk0 & 0x4000; + temp_t1_2 = player->unk_000 & 0x4000; if (temp_t1_2 == 0x4000) { - temp_v0_3 = arg0->unkDE; - if ((temp_v0_3 & 8) == 8) { - func_80060F50(arg1, sp20, arg2, arg3); + temp_v0_2 = player->unk_0DE; + if ((temp_v0_2 & 8) == 8) { + func_80060F50(player, arg1, (s8) sp20, arg2, /* extra? */ (s32) arg3); return; } - if (((temp_v0_3 & 2) != 0) || ((temp_v0_3 & 1) != 0)) { - func_80060B14(arg1, sp20, arg2, arg3); + if ((temp_v0_2 & 2) || (temp_v0_2 & 1)) { + func_80060B14(arg1, sp20, arg2, (s32) arg3); return; } goto block_22; } block_22: - temp_v0_4 = gActiveScreenMode; - if (temp_v0_4 != SCREEN_MODE_1P) { - if ((temp_v0_4 != SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL) && (temp_v0_4 != SCREEN_MODE_2P_SPLITSCREEN_VERTICAL) && (temp_v0_4 != SCREEN_MODE_3P_4P_SPLITSCREEN)) { - return; - } - if ((temp_t1_2 != 0) && ((temp_v1 & 0x4000000) != 0x4000000) && ((temp_v1 & 0x400) != 0x400) && ((temp_v1 & 0x1000000) != 0x1000000)) { - temp_v0_5 = arg0->unkCA; - if (((temp_v0_5 & 2) != 2) && ((temp_v0_5 & 0x10) != 0x10) && ((temp_v0_5 & 0x100) == 0)) { - func_80060504(arg1, sp20, arg2, arg3); + temp_v0_3 = gActiveScreenMode; + switch (temp_v0_3) { /* switch 1; irregular */ + case 0: /* switch 1 */ + if (((temp_v1 & 0x04000000) != 0x04000000) && ((temp_v1 & 0x400) != 0x400) && ((temp_v1 & 0x01000000) != 0x01000000)) { + temp_v0_4 = player->unk_0CA; + if (((temp_v0_4 & 2) != 2) && ((temp_v0_4 & 0x10) != 0x10) && !(temp_v0_4 & 0x100)) { + func_80060504(arg1, sp20, arg2, (s32) arg3); + return; } } - /* Duplicate return node #42. Try simplifying control flow for better match */ - return; - } - if (((temp_v1 & 0x4000000) != 0x4000000) && ((temp_v1 & 0x400) != 0x400) && ((temp_v1 & 0x1000000) != 0x1000000) && (temp_v0_6 = arg0->unkCA, ((temp_v0_6 & 2) != 2)) && ((temp_v0_6 & 0x10) != 0x10) && ((temp_v0_6 & 0x100) == 0)) { - func_80060504(arg1, sp20, arg2, arg3); + default: return; + case 1: /* switch 1 */ + case 2: /* switch 1 */ + case 3: /* switch 1 */ + if ((temp_t1_2 != 0) && ((temp_v1 & 0x04000000) != 0x04000000) && ((temp_v1 & 0x400) != 0x400) && ((temp_v1 & 0x01000000) != 0x01000000)) { + temp_v0_5 = player->unk_0CA; + if (((temp_v0_5 & 2) != 2) && ((temp_v0_5 & 0x10) != 0x10) && !(temp_v0_5 & 0x100)) { + func_80060504(arg1, sp20, arg2, (s32) arg3); + } + } + break; } - default: } } #else GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006CEC0.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 -void func_800628C0(void *, s8, s8, ?); /* extern */ -void func_80062914(void *, s8, s8, ?); /* extern */ -void func_80062968(void *, s8, s8, ?); /* extern */ -void func_800629BC(void *, s8, s8, ?); /* extern */ -void func_80062A18(void *, s8, s8, ?); /* extern */ -void func_80062AA8(void *, s8, s8, ?); /* extern */ -void func_80064DEC(void *, s8, s8, ?); /* extern */ -void func_80064EA4(void *, s8, s8, ?); /* extern */ -void func_80064F88(void *, s8, s8, ?); /* extern */ -void func_80065030(void *, s8, s8, ?); /* extern */ -void func_800650FC(void *, s8, s8, ?); /* extern */ -void func_800651F4(void *, s8, s8, ?); /* extern */ - -void func_8006D194(void *arg0, s8 arg1, s8 arg2) { - u16 temp_t9; - u16 phi_v0; - u16 phi_v0_2; - u16 phi_v0_3; - - if (arg0->unk814 == 1) { - temp_t9 = arg0->unk80A; - switch (temp_t9) { +#ifdef NON_MATCHING +// So, a lot of the functions called by this function have their argument types +// slightly wrong. +// For example, func_80064DEC, arg1 is currently marked as an s16 but based on +// this function it ought to be an s8 +void func_8006D194(Player *player, s8 arg1, s8 arg2) { + if (player->unk_258[0x14].unk_01C == 1) { + switch (player->unk_258[0x14].unk_012) { case 2: - func_80064DEC(arg0, arg1, arg2, 0); + func_80064DEC(player, arg1, arg2, 0); break; case 3: - func_800650FC(arg0, arg1, arg2, 0); + func_800650FC(player, arg1, arg2, 0); break; case 4: - func_80064EA4(arg0, arg1, arg2, 0); + func_80064EA4(player, arg1, arg2, 0); break; case 5: - func_80064F88(arg0, arg1, arg2, 0); + func_80064F88(player, arg1, arg2, 0); break; case 6: - func_80065030(arg0, arg1, arg2, 0); + func_80065030(player, arg1, arg2, 0); break; } } else { - if ((arg0->unkB6 & 0x40) == 0x40) { - func_800628C0(arg0, arg1, arg2, 0); + if ((player->unk_0B6 & 0x40) == 0x40) { + func_800628C0(player, arg1, arg2, 0); } - phi_v0 = arg0->unkB6; - if ((arg0->unkB6 & 0x800) == 0x800) { - func_80062968(arg0, arg1, arg2, 0); - phi_v0 = arg0->unkB6; + if ((player->unk_0B6 & 0x800) == 0x800) { + func_80062968(player, arg1, arg2, 0); } - phi_v0_2 = phi_v0; - if ((phi_v0 & 0x1000) == 0x1000) { - func_80062914(arg0, arg1, arg2, 0); - phi_v0_2 = arg0->unkB6; + if ((player->unk_0B6 & 0x1000) == 0x1000) { + func_80062914(player, arg1, arg2, 0); } - phi_v0_3 = phi_v0_2; - if ((phi_v0_2 & 0x80) == 0x80) { - func_80062A18(arg0, arg1, arg2, 0); - phi_v0_3 = arg0->unkB6; + if ((player->unk_0B6 & 0x80) == 0x80) { + func_80062A18(player, arg1, arg2, 0); } - if ((phi_v0_3 & 0x100) == 0x100) { - func_800629BC(arg0, arg1, arg2, 0); + if ((player->unk_0B6 & 0x100) == 0x100) { + func_800629BC(player, arg1, arg2, 0); } } - if (arg0->unk85C == 1) { - if (arg0->unk852 == 5) { - func_800651F4(arg0, arg1, arg2, 1); - return; + if (player->unk_258[0x15].unk_01C == 1) { + if (player->unk_258[0x15].unk_012 == 5) { + func_800651F4(player, arg1, arg2, 1); } - /* Duplicate return node #23. Try simplifying control flow for better match */ - return; - } - if ((arg0->unkB6 & 0x20) == 0x20) { - func_80062AA8(arg0, arg1, arg2, 1); + } else if ((player->unk_0B6 & 0x20) == 0x20) { + func_80062AA8(player, arg1, arg2, 1); } } #else @@ -11111,167 +10012,167 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006D194.s") #endif #ifdef MIPS_TO_C -//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 -void func_8006538C(void *, s8, s16, s8); /* extern */ -void func_80065AB0(void *, s8, s16, s8); /* extern */ -void func_80065F0C(void *, s8, s16, s8); /* extern */ -void func_800664E0(void *, s8, s16, s8); /* extern */ -void func_80066BAC(void *, s8, s16, s8); /* extern */ -void func_80067280(void *, s8, s16, s8); /* extern */ -void func_80067604(void *, s8, s16, s8); /* extern */ -void func_800691B8(void *, s8, s16, s8); /* extern */ -void func_80069444(void *, s8, s16, s8); /* extern */ -void func_800696CC(void *, s8, s16, s8, f32); /* extern */ -void func_80069938(void *, s8, s16, s8); /* extern */ -void func_80069BA8(void *, s8, s16, s8); /* extern */ -void func_80069DB8(void *, s8, s16, s8); /* extern */ -void func_8006A01C(void *, s8, s16, s8); /* extern */ -void func_8006BA94(void *, s8, s8); /* extern */ - -void func_8006D474(void *arg0, s8 arg1, s8 arg2) { +//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b +? func_8006538C(Player *, s8, s16, s8); /* extern */ +? func_80065AB0(Player *, s8, s16, s8); /* extern */ +? func_80065F0C(Player *, s8, s16, s8); /* extern */ +? func_800664E0(Player *, s8, s16, s8); /* extern */ +? func_80066BAC(Player *, s8, s16, s8); /* extern */ +? func_80067280(Player *, s8, s16, s8); /* extern */ +? func_80067604(Player *, s8, s16, s8); /* extern */ +? func_800691B8(Player *, s8, s16, s8); /* extern */ +? func_80069444(Player *, s8, s16, s8); /* extern */ +? func_800696CC(Player *, s8, s16, s8, f32); /* extern */ +? func_80069938(Player *, s8, s16, s8); /* extern */ +? func_80069BA8(Player *, s8, s16, s8); /* extern */ +? func_80069DB8(Player *, s8, s16, s8); /* extern */ +? func_8006A01C(Player *, s8, s16, s8); /* extern */ + +void func_8006D474(Player *player, s8 arg1, s8 arg2) { s32 sp44; - s16 temp_s2; + s16 var_s2; s32 temp_t8; s32 temp_v0; u16 temp_t6; u16 temp_t8_2; u16 temp_v0_2; void *temp_s5; - s16 phi_s2; temp_t8 = arg2 * 4; sp44 = temp_t8; temp_v0 = 8 << temp_t8; - if (temp_v0 == (arg0->unk2 & temp_v0)) { - phi_s2 = 0; + if (temp_v0 == (player->unk_002 & temp_v0)) { + var_s2 = 0; do { - temp_s5 = arg0 + (phi_s2 * 0x48); - temp_v0_2 = temp_s5->unk26A; - if (temp_v0_2 != 1) { - if (temp_v0_2 != 6) { - - } else if (gActiveScreenMode == SCREEN_MODE_3P_4P_SPLITSCREEN) { + temp_s5 = player + (var_s2 * 0x48); + temp_v0_2 = player->unk_258[var_s2].unk_012; + switch (temp_v0_2) { /* switch 3; irregular */ + case 1: /* switch 3 */ + if (gActiveScreenMode == 3) { if (arg2 == arg1) { - func_80066BAC(arg0, arg1, phi_s2, arg2); + func_8006538C(player, arg1, var_s2, arg2); } - } else if (arg2 == arg1) { - func_80066BAC(arg0, arg1, phi_s2, arg2); + } else { + func_8006538C(player, arg1, var_s2, arg2); } - } else if (gActiveScreenMode == SCREEN_MODE_3P_4P_SPLITSCREEN) { - if (arg2 == arg1) { - func_8006538C(arg0, arg1, phi_s2, arg2); + break; + case 6: /* switch 3 */ + if (gActiveScreenMode == 3) { + if (arg2 == arg1) { + func_80066BAC(player, arg1, var_s2, arg2); + } + } else if (arg2 == arg1) { + func_80066BAC(player, arg1, var_s2, arg2); } - } else { - func_8006538C(arg0, arg1, phi_s2, arg2); + break; } temp_t8_2 = temp_s5->unkADA; switch (temp_t8_2) { /* switch 1 */ case 1: /* switch 1 */ case 9: /* switch 1 */ - if (gActiveScreenMode == SCREEN_MODE_1P) { - func_800691B8(arg0, arg1, phi_s2, arg2); + if (gActiveScreenMode == 0) { + func_800691B8(player, arg1, var_s2, arg2); } else if (arg2 == arg1) { - func_800691B8(arg0, arg1, phi_s2, arg2); + func_800691B8(player, arg1, var_s2, arg2); } break; case 2: /* switch 1 */ - if (gActiveScreenMode == SCREEN_MODE_1P) { - func_800696CC(arg0, arg1, phi_s2, arg2, temp_s5->unkAD4); + if (gActiveScreenMode == 0) { + func_800696CC(player, arg1, var_s2, arg2, temp_s5->unkAD4); } else if (arg2 == arg1) { - func_800696CC(arg0, arg1, phi_s2, arg2, temp_s5->unkAD4); + func_800696CC(player, arg1, var_s2, arg2, temp_s5->unkAD4); } break; case 3: /* switch 1 */ - if (gActiveScreenMode == SCREEN_MODE_1P) { - func_80067280(arg0, arg1, phi_s2, arg2); + if (gActiveScreenMode == 0) { + func_80067280(player, arg1, var_s2, arg2); } else if (arg2 == arg1) { - func_80067280(arg0, arg1, phi_s2, arg2); + func_80067280(player, arg1, var_s2, arg2); } break; case 4: /* switch 1 */ - if (gActiveScreenMode == SCREEN_MODE_1P) { - func_80069444(arg0, arg1, phi_s2, arg2); + if (gActiveScreenMode == 0) { + func_80069444(player, arg1, var_s2, arg2); } else if (arg2 == arg1) { - func_80069444(arg0, arg1, phi_s2, arg2); + func_80069444(player, arg1, var_s2, arg2); } break; case 5: /* switch 1 */ - if (gActiveScreenMode == SCREEN_MODE_1P) { - func_80069938(arg0, arg1, phi_s2, arg2); + if (gActiveScreenMode == 0) { + func_80069938(player, arg1, var_s2, arg2); } else if (arg2 == arg1) { - func_80069938(arg0, arg1, phi_s2, arg2); + func_80069938(player, arg1, var_s2, arg2); } break; case 6: /* switch 1 */ - if (gActiveScreenMode == SCREEN_MODE_1P) { - func_80069BA8(arg0, arg1, phi_s2, arg2); + if (gActiveScreenMode == 0) { + func_80069BA8(player, arg1, var_s2, arg2); } else if (arg2 == arg1) { - func_80069BA8(arg0, arg1, phi_s2, arg2); + func_80069BA8(player, arg1, var_s2, arg2); } break; case 7: /* switch 1 */ - if (gActiveScreenMode == SCREEN_MODE_1P) { - func_80069DB8(arg0, arg1, phi_s2, arg2); + if (gActiveScreenMode == 0) { + func_80069DB8(player, arg1, var_s2, arg2); } else if (arg2 == arg1) { - func_80069DB8(arg0, arg1, phi_s2, arg2); + func_80069DB8(player, arg1, var_s2, arg2); } break; case 8: /* switch 1 */ - if (gActiveScreenMode == SCREEN_MODE_1P) { - func_80067604(arg0, arg1, phi_s2, arg2); + if (gActiveScreenMode == 0) { + func_80067604(player, arg1, var_s2, arg2); } else if (arg2 == arg1) { - func_80067604(arg0, arg1, phi_s2, arg2); + func_80067604(player, arg1, var_s2, arg2); } break; } temp_t6 = temp_s5->unk53A; switch (temp_t6) { /* switch 2 */ case 1: /* switch 2 */ - if (gActiveScreenMode == SCREEN_MODE_3P_4P_SPLITSCREEN) { + if (gActiveScreenMode == 3) { if (arg2 == arg1) { - func_80065AB0(arg0, arg1, phi_s2, arg2); + func_80065AB0(player, arg1, var_s2, arg2); } } else { - func_80065AB0(arg0, arg1, phi_s2, arg2); + func_80065AB0(player, arg1, var_s2, arg2); } break; case 2: /* switch 2 */ case 3: /* switch 2 */ case 4: /* switch 2 */ case 5: /* switch 2 */ - if (gActiveScreenMode == SCREEN_MODE_3P_4P_SPLITSCREEN) { + if (gActiveScreenMode == 3) { if (arg2 == arg1) { - func_80065F0C(arg0, arg1, phi_s2, arg2); + func_80065F0C(player, arg1, var_s2, arg2); } } else { - func_80065F0C(arg0, arg1, phi_s2, arg2); + func_80065F0C(player, arg1, var_s2, arg2); } break; case 9: /* switch 2 */ - if (gActiveScreenMode == SCREEN_MODE_3P_4P_SPLITSCREEN) { + if (gActiveScreenMode == 3) { if (arg2 == arg1) { - func_800664E0(arg0, arg1, phi_s2, arg2); + func_800664E0(player, arg1, var_s2, arg2); } } else { - func_800664E0(arg0, arg1, phi_s2, arg2); + func_800664E0(player, arg1, var_s2, arg2); } break; case 11: /* switch 2 */ - if (gActiveScreenMode == SCREEN_MODE_3P_4P_SPLITSCREEN) { + if (gActiveScreenMode == 3) { if (arg2 == arg1) { - func_8006A01C(arg0, arg1, phi_s2, arg2); + func_8006A01C(player, arg1, var_s2, arg2); } } else if (arg2 == arg1) { - func_8006A01C(arg0, arg1, phi_s2, arg2); + func_8006A01C(player, arg1, var_s2, arg2); } break; } - temp_s2 = phi_s2 + 1; - phi_s2 = temp_s2; - } while (temp_s2 < 0xA); + var_s2 += 1; + } while (var_s2 < 0xA); } - if ((gModeSelection == BATTLE) && ((arg0->unk2 & (2 << sp44)) != 0)) { - func_8006BA94(arg0, arg1, arg2); + if ((gModeSelection == 3) && (player->unk_002 & (2 << sp44))) { + func_8006BA94(player, arg1, arg2); } } #else diff --git a/src/code_80057C60.h b/src/code_80057C60.h index d3ae7feef..eb6c209af 100644 --- a/src/code_80057C60.h +++ b/src/code_80057C60.h @@ -91,14 +91,29 @@ void func_8005D794(Player*, UnkPlayerStruct258*, f32, f32, f32, s8, s8); void func_8005D7D8(UnkPlayerStruct258*, s8, f32); void func_8005D800(UnkPlayerStruct258*, s32, s16); void func_8005D82C(UnkPlayerStruct258*, s32, s16); -void func_8005D898(Player*, s16, s8, s8); +void func_8005D898(Player*, s16, s32, s8, s8); +void func_8005DA30(Player*, s16, s32, s8, s8); void func_8005DAD0(); void func_8005DAD8(UnkPlayerStruct258*, s16, s16, s16); + +void func_80060BCC(Player*, s16, s32, s32); void func_80060F50(Player*, s16, s8, s8); + void func_80061094(Player*, s16, s8, s8); -void func_80061130(Player*, s16, s8, s8); +void func_80061130(Player*, s16, s32, s8, s8); +void func_80061224(Player*, s16, s32, s8, s8); +void func_800612F8(Player*, s32, s32, s32); +void func_80061430(Player*, s32, s32, s32); +void func_800615AC(Player*, s16, s32, s32); +void func_80061754(Player*, s16, s32, s32, s32); +void func_8006199C(Player*, s16, s32, s8, s8); +void func_80061A34(Player*, s16, s32, s32); +void func_80061D4C(Player*, s16, s32, s32); +void func_80061EF4(Player*, s16, s32, s32); + void func_800621BC(Player*, s16, s32, s8); void func_80062484(Player*, UnkPlayerStruct258*, s32); +void func_800624D8(Player*, s32, s32, s32); void func_800628C0(Player*, s8, s8, s8); void func_80062914(Player*, s8, s8, s8); void func_80062968(Player*, s8, s8, s8); @@ -106,6 +121,7 @@ void func_800629BC(Player*, s8, s8, s8); void func_80062A18(Player*, s8, s8, s8); void func_80062AA8(Player*, s8, s8, s8); void func_80062B18(f32*, f32*, f32*, f32, f32, f32, u16, u16); +void func_80062C74(Player*, s16, s32, s32); void func_80062F98(Player*, s16, s8, s8); void func_800630C0(Player*, s16, s8, s8); @@ -116,9 +132,12 @@ void func_800635D4(Player*, s16, s8, s8); void func_800639DC(Player*, s16, s8, s8); void func_80063BD4(Player*, s16, s8, s8); void func_80063D58(Player*, s16, s8, s8); +void func_80063FBC(Player*, s16, s32, s32); void func_80064184(Player*, s16, s8, s8); void func_800643A8(Player*, s16, s8, s8); +void func_800644E8(Player*, s16, s32, s32); +void func_80064664(Player*, s16, s32, s32); void func_800647C8(Player*, s16, s8, s8); void func_800648E4(Player*, s16, s8, s8); void func_80064988(Player*, s16, s8, s8); @@ -132,6 +151,7 @@ void func_80064F88(Player*, s16, s8, s8); void func_80065030(Player*, s16, s8, s8); void func_800650FC(Player*, s16, s8, s8); void func_800651F4(Player*, s16, s8, s8); +void func_800652D4(Vec3f, Vec3s, f32); void func_800658A0(Player*, s8, s16, s8); void func_80066998(Player*, s8, s16, s8); @@ -199,6 +219,7 @@ extern u8 D_801658FF; extern struct Controller *gControllerOne; extern s32 D_8018D214; extern s32 D_8018D2C8[]; +extern uintptr_t D_8018D48C; // Some kind of pointer to some decoded texture(s) extern u16 gPlayerBalloonStatus[8][3]; // D_8018D5F0 extern s16 gPlayerBalloonCount[]; // D_8018D8C0 diff --git a/src/common_textures.h b/src/common_textures.h index d57132d55..61d118a11 100644 --- a/src/common_textures.h +++ b/src/common_textures.h @@ -207,7 +207,8 @@ extern Gfx D_0D008DF8[]; extern Gfx D_0D008E20[]; extern Gfx D_0D008E48[]; extern Gfx D_0D008E70[]; -extern Vtx D_0D008E98[]; +extern Mtx D_0D008E98; +extern Vtx D_0D008EA8[]; extern f32 D_0D009418[]; extern f32 D_0D009568[]; extern f32 D_0D0096B8[]; diff --git a/src/common_textures.inc.c b/src/common_textures.inc.c index ee4ac13dd..97c9245b9 100644 --- a/src/common_textures.inc.c +++ b/src/common_textures.inc.c @@ -1893,92 +1893,123 @@ Gfx D_0D008E70[] = { gsSPEndDisplayList(), }; -static Vtx D_0D008E98[] = { +static Mtx D_0D008E98 = { + {{65536, 0, 1, 0}, + { 0, 65536, 0, 1}, + { 0, 0, 0, 0}, + { 0, 0, 0, 0}}, +}; + +static Vtx D_0D008EA8[] = { + + // I think these 4 Vtx's are really the rows of a Mtx (D_0D008E98), based on the usage of D_0D008E98 throughout the code base + // {{{ 1, 0, 0}, 0, {0, 1}, {0x00, 0x00, 0x00, 0x00}}}, + // {{{ 0, 0, 1}, 0, {0, 0}, {0x00, 0x00, 0x00, 0x01}}}, + // {{{ 0, 0, 0}, 0, {0, 0}, {0x00, 0x00, 0x00, 0x00}}}, + // {{{ 0, 0, 0}, 0, {0, 0}, {0x00, 0x00, 0x00, 0x00}}}, - {{{ 1, 0, 0}, 0, {0, 1}, {0x00, 0x00, 0x00, 0x00}}}, - {{{ 0, 0, 1}, 0, {0, 0}, {0x00, 0x00, 0x00, 0x01}}}, - {{{ 0, 0, 0}, 0, {0, 0}, {0x00, 0x00, 0x00, 0x00}}}, - {{{ 0, 0, 0}, 0, {0, 0}, {0x00, 0x00, 0x00, 0x00}}}, + // These 4 Vtx's MAY be a Mtx too, its hard to say though as I can't find any references + // to any of them in the code base {{{ 0, 410, 0}, 0, {0, 0}, {0x00, 0x00, 0x00, 0x00}}}, {{{ 0, 0, 0}, 546, {0, 0}, {0x00, 0x00, 0x00, 0x00}}}, {{{ 0, 0, 0}, 0, {65535, 3}, {0x00, 0x00, 0x00, 0x00}}}, {{{ -1, 3, -1}, 3, {65535, 3}, {0x00, 0x01, 0x00, 0x00}}}, + {{{ 1, 3, 0}, 2, {65535, 65535}, {0x00, 0x00, 0x00, 0x00}}}, {{{ 1, 2, 0}, 6, {11, 30}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 55, 74, 0}, 1, {90, 105}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 139, 155, 0}, 1, {177, 205}, {0x00, 0x00, 0x00, 0x01}}}, + {{{ 225, 242, 0}, 1, {292, 313}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 352, 373, 0}, 1, {452, 465}, {0x00, 0x00, 0x00, 0x01}}}, {{{ -1, -1, 0}, 0, {1, 2}, {0x00, 0x00, 0x00, 0x06}}}, {{{ 10, 25, 0}, 1, {190, 210}, {0x00, 0x00, 0x00, 0x01}}}, + {{{ 270, 290, 0}, 1, {410, 440}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 540, 550, 0}, 1, {65535, 65535}, {0x00, 0x00, 0x00, 0x00}}}, {{{ 1, 2, 0}, 6, {60, 80}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 125, 140, 0}, 1, {170, 185}, {0x00, 0x00, 0x00, 0x01}}}, + {{{ 230, 240, 0}, 1, {275, 285}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 310, 320, 0}, 1, {321, 349}, {0x00, 0x00, 0x00, 0x03}}}, {{{ 350, 360, 0}, 1, {385, 415}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 450, 468, 0}, 1, {470, 477}, {0x00, 0x00, 0x00, 0x09}}}, + {{{ 480, 485, 0}, 11, {543, 546}, {0x00, 0x00, 0x00, 0x09}}}, {{{ 548, 550, 0}, 11, {565, 568}, {0x00, 0x00, 0x00, 0x02}}}, {{{ 630, 631, 0}, 6, {635, 640}, {0x00, 0x00, 0x00, 0x0a}}}, {{{ 645, 655, 0}, 1, {65535, 65535}, {0x00, 0x00, 0x00, 0x00}}}, + {{{ 1, 2, 0}, 6, {15, 30}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 55, 65, 0}, 1, {125, 150}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 265, 270, 0}, 1, {275, 285}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 305, 320, 0}, 2, {330, 340}, {0x00, 0x00, 0x00, 0x01}}}, + {{{ 375, 385, 0}, 1, {547, 570}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 582, 600, 0}, 1, {65535, 65535}, {0x00, 0x00, 0x00, 0x00}}}, {{{ 1, 2, 0}, 6, {70, 94}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 120, 133, 0}, 1, {150, 170}, {0x00, 0x00, 0x00, 0x01}}}, + {{{ 249, 265, 0}, 1, {360, 395}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 635, 655, 0}, 1, {65535, 65535}, {0x00, 0x00, 0x00, 0x00}}}, {{{ 1, 2, 0}, 6, {15, 30}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 41, 63, 0}, 1, {115, 155}, {0x00, 0x00, 0x00, 0x01}}}, + {{{ 200, 215, 0}, 1, {240, 241}, {0x00, 0x00, 0x00, 0x09}}}, {{{ 264, 265, 0}, 10, {270, 290}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 345, 375, 0}, 1, {493, 544}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 583, 605, 0}, 1, {65535, 65535}, {0x00, 0x00, 0x00, 0x00}}}, + {{{ 1, 2, 0}, 6, {75, 100}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 135, 150, 0}, 1, {355, 390}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 505, 525, 0}, 1, {65535, 65535}, {0x00, 0x00, 0x00, 0x00}}}, {{{ 1, 2, 0}, 6, {65, 80}, {0x00, 0x00, 0x00, 0x01}}}, + {{{ 165, 166, 0}, 9, {180, 210}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 220, 221, 0}, 10, {250, 275}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 360, 380, 0}, 1, {440, 480}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 600, 601, 0}, 9, {689, 690}, {0x00, 0x00, 0x00, 0x0a}}}, + {{{ 695, 725, 0}, 1, {65535, 65535}, {0x00, 0x00, 0x00, 0x00}}}, {{{ 1, 2, 0}, 6, {128, 275}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 320, 345, 0}, 1, {465, 565}, {0x00, 0x00, 0x00, 0x01}}}, {{{ -1, -1, 0}, 0, {1, 2}, {0x00, 0x00, 0x00, 0x06}}}, + {{{ 75, 100, 0}, 1, {175, 210}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 275, 300, 0}, 1, {65535, 65535}, {0x00, 0x00, 0x00, 0x00}}}, {{{ 1, 2, 0}, 6, {106, 188}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 220, 386, 0}, 1, {583, 765}, {0x00, 0x00, 0x00, 0x01}}}, + {{{ -1, -1, 0}, 0, {1, 2}, {0x00, 0x00, 0x00, 0x06}}}, {{{ 245, 262, 0}, 1, {585, 606}, {0x00, 0x00, 0x00, 0x01}}}, {{{ -1, -1, 0}, 0, {1, 2}, {0x00, 0x00, 0x00, 0x06}}}, {{{ 7, 38, 0}, 1, {36, 54}, {0x00, 0x00, 0x00, 0x01}}}, + {{{ 129, 150, 0}, 1, {380, 410}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 425, 445, 0}, 1, {456, 500}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 594, 625, 0}, 1, {65535, 65535}, {0x00, 0x00, 0x00, 0x00}}}, {{{ 1, 2, 0}, 6, {4, 5}, {0x00, 0x00, 0x00, 0x09}}}, + {{{ 129, 130, 0}, 10, {555, 560}, {0x00, 0x00, 0x00, 0x09}}}, {{{ 827, 832, 0}, 10, {810, 845}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 910, 993, 0}, 1, {1390, 1600}, {0x00, 0x00, 0x00, 0x01}}}, {{{ -1, -1, 0}, 0, {1, 2}, {0x00, 0x00, 0x00, 0x06}}}, + {{{ 80, 120, 0}, 1, {200, 250}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 252, 253, 0}, 9, {273, 295}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 300, 315, 0}, 1, {333, 384}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 400, 401, 0}, 10, {405, 435}, {0x00, 0x00, 0x00, 0x01}}}, + {{{ 445, 475, 0}, 1, {485, 525}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 585, 615, 0}, 1, {685, 735}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 783, 820, 0}, 1, {956, 984}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 1005, 1050, 0}, 1, {1063, 1088}, {0x00, 0x00, 0x00, 0x01}}}, + {{{ 1130, 1131, 0}, 9, {1169, 1170}, {0x00, 0x00, 0x00, 0x0a}}}, {{{ 1195, 1240, 0}, 1, {1262, 1300}, {0x00, 0x00, 0x00, 0x01}}}, {{{ -1, -1, 0}, 0, {1, 2}, {0x00, 0x00, 0x00, 0x06}}}, {{{ 20, 40, 0}, 1, {190, 191}, {0x00, 0x00, 0x00, 0x09}}}, + {{{ 259, 260, 0}, 10, {315, 335}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 353, 370, 0}, 1, {398, 430}, {0x00, 0x00, 0x00, 0x01}}}, {{{ 458, 485, 0}, 1, {510, 535}, {0x00, 0x00, 0x00, 0x01}}}, diff --git a/src/skybox_and_splitscreen.c b/src/skybox_and_splitscreen.c index 0778f45ea..30291fabb 100644 --- a/src/skybox_and_splitscreen.c +++ b/src/skybox_and_splitscreen.c @@ -7,6 +7,7 @@ #include <variables.h> #include <config.h> #include "camera.h" +#include "common_textures.h" #include "skybox_and_splitscreen.h" Vp D_802B8880[] = { diff --git a/src/skybox_and_splitscreen.h b/src/skybox_and_splitscreen.h index f5e3cae36..8cd0a20ca 100644 --- a/src/skybox_and_splitscreen.h +++ b/src/skybox_and_splitscreen.h @@ -73,7 +73,6 @@ extern s32 D_801625EC; extern s32 D_801625F0; extern s32 D_801625F4; extern u16 D_800DC5BC; -extern Mtx *D_0D008E98; extern struct GfxPool *gGfxPool; extern f32 D_80150130[]; extern u16 D_800DC5B4; |
