diff --git a/include/common_structs.h b/include/common_structs.h index b8218e136..f55e6e0d8 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -118,7 +118,7 @@ typedef struct { /* 0x0C */ Vec3f unk3C; /* 0x18 */ Vec3f unk48; /* 0x24 */ Vec3f unk54; - /* 0x30 */ Vec3f unk60; + /* 0x30 */ Vec3f orientationVector; /* 0x3C */ f32 unk6C; } Collision; diff --git a/src/actors/falling_rocks.inc.c b/src/actors/falling_rocks.inc.c index ec3ecfbbd..95b6599aa 100644 --- a/src/actors/falling_rocks.inc.c +++ b/src/actors/falling_rocks.inc.c @@ -63,9 +63,9 @@ void update_actor_falling_rocks(struct FallingRock *rock) { func_802ADDC8(&rock->unk30, 10.0f, rock->pos[0], rock->pos[1], rock->pos[2]); pad0 = rock->unk30.unk3C[2]; if (pad0 < 0.0f) { - unkVec[0] = -rock->unk30.unk60[0]; - unkVec[1] = -rock->unk30.unk60[1]; - unkVec[2] = -rock->unk30.unk60[2]; + unkVec[0] = -rock->unk30.orientationVector[0]; + unkVec[1] = -rock->unk30.orientationVector[1]; + unkVec[2] = -rock->unk30.orientationVector[2]; rock->pos[0] += unkVec[0] * rock->unk30.unk3C[2]; rock->pos[1] += unkVec[1] * rock->unk30.unk3C[2]; rock->pos[2] += unkVec[2] * rock->unk30.unk3C[2]; diff --git a/src/camera.c b/src/camera.c index f0fb12b63..75859d733 100644 --- a/src/camera.c +++ b/src/camera.c @@ -642,9 +642,9 @@ void func_8001E0C4(Camera *camera, Player *player, s8 arg2) { camera->someBitFlags &= ~0x0004; temp_t7 = func_802ADDC8(&camera->unk_54, test, sp74, sp70, sp6C); if (camera->unk_54.unk3C[2] < 0.0f) { - sp74 += -camera->unk_54.unk60[0] * camera->unk_54.unk3C[2] * 1; - sp70 += -camera->unk_54.unk60[1] * camera->unk_54.unk3C[2] * 0.5; - sp6C += -camera->unk_54.unk60[2] * camera->unk_54.unk3C[2] * 1; + sp74 += -camera->unk_54.orientationVector[0] * camera->unk_54.unk3C[2] * 1; + sp70 += -camera->unk_54.orientationVector[1] * camera->unk_54.unk3C[2] * 0.5; + sp6C += -camera->unk_54.orientationVector[2] * camera->unk_54.unk3C[2] * 1; } if (camera->unk_54.unk3C[0] < 0.0f) { camera->someBitFlags = camera->someBitFlags | 4 | 2; diff --git a/src/code_80005FD0.c b/src/code_80005FD0.c index 3ae925ae0..c81a336a0 100644 --- a/src/code_80005FD0.c +++ b/src/code_80005FD0.c @@ -8188,14 +8188,14 @@ void func_8001C14C(void) { } } -void func_8001C3C4(s32 arg0) { +void func_8001C3C4(s32 cameraId) { if (gCurrentCourseId == COURSE_AWARD_CEREMONY) { if (gBombKarts[0].waypointIndex >= 16) { func_80057114(3); } } else { if (gModeSelection == VERSUS) { - func_80057114(arg0); + func_80057114(cameraId); } } } diff --git a/src/code_8003DC40.c b/src/code_8003DC40.c index a14b8fb7f..24047d504 100644 --- a/src/code_8003DC40.c +++ b/src/code_8003DC40.c @@ -63,7 +63,7 @@ void func_8003E048(Player *player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32 *arg4 *arg6 += arg1[1] * player->unk_110.unk3C[2] * 0.1; *arg7 += arg1[2] * player->unk_110.unk3C[2] * 1; func_8002A5F4(arg1, *arg4, arg2, 1, 2); - if (player->unk_110.unk60[1] <= 0.8829f) { + if (player->unk_110.orientationVector[1] <= 0.8829f) { arg3[0] = ((player->unk_206 / 182) * 0xB4); arg3[2] = (-(player->slopeAccel / 182) * 0xB4); func_80031F48(player, 4.0f); @@ -89,7 +89,7 @@ void func_8003E37C(Player *player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32 *arg4 *arg6 += arg1[1] * player->unk_110.unk3C[2] * 0.2; *arg7 += arg1[2] * player->unk_110.unk3C[2] * 1; func_8002A5F4(arg1, *arg4, arg2, 0.5f, 2); - if ((player->unk_110.unk60[1] <= 0.7318f) || (player->unk_0F8 == 0x000C)) { + if ((player->unk_110.orientationVector[1] <= 0.7318f) || (player->unk_0F8 == 0x000C)) { arg3[0] = ((player->unk_206 / 182) * 0xB4); arg3[2] = (-(player->slopeAccel / 182) * 0xB4); if (((player->unk_094 / 18.0f) * 216.0f) >= 8.0f) { @@ -117,7 +117,7 @@ void func_8003E6EC(Player *player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32 *arg4 *arg6 += arg1[1] * player->unk_110.unk3C[2] * 0.1; *arg7 += arg1[2] * player->unk_110.unk3C[2] * 1; func_8002A5F4(arg1, *arg4, arg2, 0.5f, 2); - if (player->unk_110.unk60[1] <= 0.8829f) { + if (player->unk_110.orientationVector[1] <= 0.8829f) { arg3[0] = ((player->unk_206 / 182) * 0xB4); arg3[2] = (-(player->slopeAccel / 182) * 0xB4); func_80031F48(player, 4.0f); @@ -138,7 +138,7 @@ void func_8003E9EC(Player *player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32 *arg4 *arg6 += arg1[1] * player->unk_110.unk3C[2] * 0.1; *arg7 += arg1[2] * player->unk_110.unk3C[2] * 1; func_8002A5F4(arg1, *arg4, arg2, 1.2f, 2); - if (player->unk_110.unk60[1] <= 0.8357f) { + if (player->unk_110.orientationVector[1] <= 0.8357f) { arg3[0] = ((player->unk_206 / 182) * 0x78); arg3[2] = (-(player->slopeAccel / 182) * 0xB4); func_80031F48(player, 4.0f); @@ -169,7 +169,7 @@ void func_8003EE2C(Player *player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32 *arg4 *arg6 += arg1[1] * player->unk_110.unk3C[2] * 0.1; *arg7 += arg1[2] * player->unk_110.unk3C[2] * 1; func_8002A5F4(arg1, *arg4, arg2, 0.5f, 2); - if (player->unk_110.unk60[1] <= 0.8357f) { + if (player->unk_110.orientationVector[1] <= 0.8357f) { arg3[0] = ((player->unk_206 / 182) * 0x78); arg3[2] = (-(player->slopeAccel / 182) * 0xB4); func_80031F48(player, 4.0f); @@ -193,7 +193,7 @@ void func_8003F138(Player *player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32 *arg4 if (player->unk_0F8 == 8) { player->unk_044 &= ~1; } - if (player->unk_110.unk60[1] <= 0.8357f) { + if (player->unk_110.orientationVector[1] <= 0.8357f) { arg3[0] = ((player->unk_206 / 182) * 0xC8); arg3[2] = (-(player->slopeAccel / 182) * 0xC8); func_80031F48(player, 4.0f); @@ -213,10 +213,10 @@ void func_8003F138(Player *player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32 *arg4 } void func_8003F46C(Player *player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32 *arg4, f32 *arg5, f32 *arg6, f32 *arg7) { - arg1[0] = -player->unk_110.unk60[0]; - arg1[1] = -player->unk_110.unk60[1]; - arg1[2] = -player->unk_110.unk60[2]; - if ((player->unk_110.unk60[1] < 0.0f) && ((player->unk_0CA & 2) == 0)) { + arg1[0] = -player->unk_110.orientationVector[0]; + arg1[1] = -player->unk_110.orientationVector[1]; + arg1[2] = -player->unk_110.orientationVector[2]; + if ((player->unk_110.orientationVector[1] < 0.0f) && ((player->unk_0CA & 2) == 0)) { *arg5 += arg1[0] * player->unk_110.unk3C[2] * 1; *arg6 += arg1[1] * player->unk_110.unk3C[2] * 1; *arg7 += arg1[2] * player->unk_110.unk3C[2] * 1; diff --git a/src/code_80057C60.c b/src/code_80057C60.c index c9407aeda..4f78f2317 100644 --- a/src/code_80057C60.c +++ b/src/code_80057C60.c @@ -1,3 +1,8 @@ +/** + * @file code_80057C60.c + * @warning there are too many variables here +*/ + #include #include #include @@ -32,8 +37,6 @@ //! @warning this macro is undef'd at the end of this file #define MAKE_RGB(r,g,b) (((r) << 0x10) | ((g) << 0x08) | (b << 0x00)) -//! @warning there is to many variable here - s32 D_80165590; s32 D_80165594; s32 D_80165598; @@ -128,6 +131,7 @@ UNUSED s32 D_801657A4; UNUSED s16 D_801657A8[3]; s8 D_801657AE; UNUSED s8 D_801657AF; +//! HUD related s8 D_801657B0; UNUSED s8 D_801657B1; s8 D_801657B2; @@ -981,19 +985,19 @@ void func_8005902C(void) { if (D_8018D2AC != 0) { switch(gPlayerCountSelection1) { case 2: - func_8004EB30(0); - func_8004EB30(1); + func_8004EB30(PLAYER_ONE); + func_8004EB30(PLAYER_TWO); break; case 3: - func_8004EB30(0); - func_8004EB30(1); - func_8004EB30(2); + func_8004EB30(PLAYER_ONE); + func_8004EB30(PLAYER_TWO); + func_8004EB30(PLAYER_THREE); break; case 4: - func_8004EB30(0); - func_8004EB30(1); - func_8004EB30(2); - func_8004EB30(3); + func_8004EB30(PLAYER_ONE); + func_8004EB30(PLAYER_TWO); + func_8004EB30(PLAYER_THREE); + func_8004EB30(PLAYER_FOUR); break; } } @@ -1005,24 +1009,24 @@ void func_800590D4(void) { switch (gPlayerCountSelection1) { case 1: if (gModeSelection != TIME_TRIALS) { - func_8004E800(0); + func_8004E800(PLAYER_ONE); break; } break; case 2: - func_8004E800(0); - func_8004E800(1); + func_8004E800(PLAYER_ONE); + func_8004E800(PLAYER_TWO); break; case 3: - func_8004E998(0); - func_8004E998(1); - func_8004E998(2); + func_8004E998(PLAYER_ONE); + func_8004E998(PLAYER_TWO); + func_8004E998(PLAYER_THREE); break; case 4: - func_8004E998(0); - func_8004E998(1); - func_8004E998(2); - func_8004E998(3); + func_8004E998(PLAYER_ONE); + func_8004E998(PLAYER_TWO); + func_8004E998(PLAYER_THREE); + func_8004E998(PLAYER_FOUR); break; } } @@ -1126,19 +1130,19 @@ void func_80059530(void) { } } -void func_80059560(s32 arg0) { +void func_80059560(s32 playerId) { if (gModeSelection != BATTLE) { if (D_801657F8 && gIsHUDVisible) { - func_8004CB60(playerHUD[arg0].lapX, playerHUD[arg0].lapY, D_0D00A958); - func_8004FC78(playerHUD[arg0].lapX - 12, playerHUD[arg0].lapY + 4, playerHUD[arg0].alsoLapCount); + func_8004CB60(playerHUD[playerId].lapX, playerHUD[playerId].lapY, D_0D00A958); + func_8004FC78(playerHUD[playerId].lapX - 12, playerHUD[playerId].lapY + 4, playerHUD[playerId].alsoLapCount); } if (D_801657E4 == 2) { - if (playerHUD[arg0].unk_74 && D_80165608) { - func_80047910(playerHUD[arg0].unk_6C, playerHUD[arg0].unk_6E, 0, 1.0f, gTLUTPortraitBombKartAndQuestionMark, gTexturePortraitBombKart, D_0D005AE0, 0x20, 0x20, 0x20, 0x20); + if (playerHUD[playerId].unk_74 && D_80165608) { + func_80047910(playerHUD[playerId].unk_6C, playerHUD[playerId].unk_6E, 0, 1.0f, gTLUTPortraitBombKartAndQuestionMark, gTexturePortraitBombKart, D_0D005AE0, 0x20, 0x20, 0x20, 0x20); } } } - func_8004E6C4(arg0); + func_8004E6C4(playerId); } void func_800596A8(void) { @@ -1251,7 +1255,7 @@ void func_80059A88(s32 playerId) { void func_80059AC8(void) { s32 i; - if (gIsGamePaused == 0) { + if (gIsGamePaused == FALSE) { func_8008C1D8(&D_80165678); gRaceFrameCounter++; for (i = 0; i < NUM_PLAYERS; i++) { @@ -1261,27 +1265,27 @@ void func_80059AC8(void) { switch (gScreenModeSelection) { case SCREEN_MODE_1P: if (gGamestate != 9) { - func_80059A88(0); + func_80059A88(PLAYER_ONE); if (gModeSelection == TIME_TRIALS) { func_8005995C(); } } else { - func_80059820(0); + func_80059820(PLAYER_ONE); } break; case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: - func_80059A88(0); - func_80059A88(1); + func_80059A88(PLAYER_ONE); + func_80059A88(PLAYER_TWO); break; case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: - func_80059A88(0); - func_80059A88(1); + func_80059A88(PLAYER_ONE); + func_80059A88(PLAYER_TWO); break; case SCREEN_MODE_3P_4P_SPLITSCREEN: - func_80059A88(0); - func_80059A88(1); - func_80059A88(2); - func_80059A88(3); + func_80059A88(PLAYER_ONE); + func_80059A88(PLAYER_TWO); + func_80059A88(PLAYER_THREE); + func_80059A88(PLAYER_FOUR); break; } func_8005A71C(); @@ -1312,9 +1316,9 @@ void func_80059D00(void) { if (D_801657AE == 0) { switch (gScreenModeSelection) { case SCREEN_MODE_1P: - randomize_seed_from_controller(0); + randomize_seed_from_controller(PLAYER_ONE); if (D_8018D214 == FALSE) { - func_80059820(0); + func_80059820(PLAYER_ONE); func_8005B914(); if (!gDemoMode) { func_8007AA44(0); @@ -1323,27 +1327,27 @@ void func_80059D00(void) { if (playerHUD[PLAYER_ONE].raceCompleteBool == 0) { func_8005C360((gPlayerOneCopy->unk_094 / 18.0f) * 216.0f); } - func_8005D0FC(0); + func_8005D0FC(PLAYER_ONE); } else { - func_80059820(0); + func_80059820(PLAYER_ONE); func_80078C70(1); - func_80059820(1); + func_80059820(PLAYER_TWO); func_80078C70(2); } func_8005A74C(); break; case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: - randomize_seed_from_controller(0); - randomize_seed_from_controller(1); - func_80059820(0); - func_8005D0FC(0); + randomize_seed_from_controller(PLAYER_ONE); + randomize_seed_from_controller(PLAYER_TWO); + func_80059820(PLAYER_ONE); + func_8005D0FC(PLAYER_ONE); if (!gDemoMode) { func_8007AA44(0); } func_80078C70(1); func_8005D1F4(0); - func_80059820(1); - func_8005D0FC(1); + func_80059820(PLAYER_TWO); + func_8005D0FC(PLAYER_TWO); if (!gDemoMode) { func_8007AA44(1); } @@ -1352,17 +1356,17 @@ void func_80059D00(void) { func_8005A74C(); break; case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: - randomize_seed_from_controller(0); - randomize_seed_from_controller(1); - func_80059820(0); - func_8005D0FC(0); + randomize_seed_from_controller(PLAYER_ONE); + randomize_seed_from_controller(PLAYER_TWO); + func_80059820(PLAYER_ONE); + func_8005D0FC(PLAYER_ONE); if (!gDemoMode) { func_8007AA44(0); } func_80078C70(3); func_8005D1F4(0); - func_80059820(1); - func_8005D0FC(1); + func_80059820(PLAYER_TWO); + func_8005D0FC(PLAYER_TWO); if (!gDemoMode) { func_8007AA44(1); } @@ -1371,31 +1375,31 @@ void func_80059D00(void) { func_8005A74C(); break; case SCREEN_MODE_3P_4P_SPLITSCREEN: - randomize_seed_from_controller(0); - randomize_seed_from_controller(1); - randomize_seed_from_controller(2); - randomize_seed_from_controller(3); - func_80059820(0); - func_8005D0FC(0); + randomize_seed_from_controller(PLAYER_ONE); + randomize_seed_from_controller(PLAYER_TWO); + randomize_seed_from_controller(PLAYER_THREE); + randomize_seed_from_controller(PLAYER_FOUR); + func_80059820(PLAYER_ONE); + func_8005D0FC(PLAYER_ONE); if (!gDemoMode) { func_8007AA44(0); } func_8005D1F4(0); - func_80059820(1); - func_8005D0FC(1); + func_80059820(PLAYER_TWO); + func_8005D0FC(PLAYER_TWO); if (!gDemoMode) { func_8007AA44(1); } func_8005D1F4(1); - func_80059820(2); - func_8005D0FC(2); + func_80059820(PLAYER_THREE); + func_8005D0FC(PLAYER_THREE); if (!gDemoMode) { func_8007AA44(2); } func_8005D1F4(2); if (gPlayerCountSelection1 == 4) { - func_80059820(3); - func_8005D0FC(3); + func_80059820(PLAYER_FOUR); + func_8005D0FC(PLAYER_FOUR); if ((!gDemoMode) && (gPlayerCountSelection1 == 4)) { func_8007AA44(3); } @@ -1413,7 +1417,7 @@ void func_8005A070(void) { gMatrixHudCount = 0; D_801655C0 = 0; func_80041D34(); - if (gIsGamePaused == 0) { + if (gIsGamePaused == FALSE) { func_8005C728(); if (gGamestate == ENDING_SEQUENCE) { func_80086604(); @@ -1421,7 +1425,7 @@ void func_8005A070(void) { func_8007C2F8(1); func_80077640(); } else if (gGamestate == CREDITS_SEQUENCE) { - func_80059820(0); + func_80059820(PLAYER_ONE); func_80078C70(0); func_8005A74C(); } else { @@ -1436,7 +1440,7 @@ void func_8005A14C(s32 playerId) { s32 objectIndex; s32 lapCount; Player *player; - s32 stackPadding; + UNUSED s32 stackPadding; player = &gPlayerOne[playerId]; objectIndex = D_8018CE10[playerId].objectIndex; @@ -1716,54 +1720,54 @@ void func_8005AB20(void) { void func_8005AB60(void) { switch (playerHUD[PLAYER_ONE].unk_78) { - case 0: - break; - case 1: - s16_step_towards(&playerHUD[PLAYER_ONE].speedometerX, 0x106, 0x10); - if (s16_step_towards(&playerHUD[PLAYER_ONE].speedometerY, 0xB6, 0x10) != 0) { - playerHUD[PLAYER_ONE].unk_78++; - playerHUD[PLAYER_ONE].unk_79 = 1; - } - break; - case 2: - s16_step_towards(&playerHUD[PLAYER_ONE].speedometerX, 0x116, 4); - if (s16_step_towards(&playerHUD[PLAYER_ONE].speedometerY, 0xC6, 4) != 0) { - playerHUD[PLAYER_ONE].unk_78++; - } - break; - case 3: - s16_step_towards(&playerHUD[PLAYER_ONE].speedometerX, 0x106, 4); - if (s16_step_towards(&playerHUD[PLAYER_ONE].speedometerY, 0xB6, 4) != 0) { - playerHUD[PLAYER_ONE].unk_78++; - } - break; - case 4: - s16_step_towards(&playerHUD[PLAYER_ONE].speedometerX, 0x10E, 4); - if (s16_step_towards(&playerHUD[PLAYER_ONE].speedometerY, 0xBE, 4) != 0) { - playerHUD[PLAYER_ONE].unk_78++; - } - break; - case 5: - s16_step_towards(&playerHUD[PLAYER_ONE].speedometerX, 0x106, 4); - if (s16_step_towards(&playerHUD[PLAYER_ONE].speedometerY, 0xB6, 4) != 0) { - playerHUD[PLAYER_ONE].unk_78++; - } - break; - case 6: - s16_step_towards(&playerHUD[PLAYER_ONE].speedometerX, 0x10A, 2); - if (s16_step_towards(&playerHUD[PLAYER_ONE].speedometerY, 0xBA, 2) != 0) { - playerHUD[PLAYER_ONE].unk_78++; - } - break; - case 7: - s16_step_towards(&playerHUD[PLAYER_ONE].speedometerX, 0x106, 2); - if (s16_step_towards(&playerHUD[PLAYER_ONE].speedometerY, 0xB6, 2) != 0) { - playerHUD[PLAYER_ONE].unk_78++; - } - break; - case 8: - playerHUD[PLAYER_ONE].unk_78 = 0; - break; + case 0: + break; + case 1: + s16_step_towards(&playerHUD[PLAYER_ONE].speedometerX, 0x106, 0x10); + if (s16_step_towards(&playerHUD[PLAYER_ONE].speedometerY, 0xB6, 0x10) != 0) { + playerHUD[PLAYER_ONE].unk_78++; + playerHUD[PLAYER_ONE].unk_79 = 1; + } + break; + case 2: + s16_step_towards(&playerHUD[PLAYER_ONE].speedometerX, 0x116, 4); + if (s16_step_towards(&playerHUD[PLAYER_ONE].speedometerY, 0xC6, 4) != 0) { + playerHUD[PLAYER_ONE].unk_78++; + } + break; + case 3: + s16_step_towards(&playerHUD[PLAYER_ONE].speedometerX, 0x106, 4); + if (s16_step_towards(&playerHUD[PLAYER_ONE].speedometerY, 0xB6, 4) != 0) { + playerHUD[PLAYER_ONE].unk_78++; + } + break; + case 4: + s16_step_towards(&playerHUD[PLAYER_ONE].speedometerX, 0x10E, 4); + if (s16_step_towards(&playerHUD[PLAYER_ONE].speedometerY, 0xBE, 4) != 0) { + playerHUD[PLAYER_ONE].unk_78++; + } + break; + case 5: + s16_step_towards(&playerHUD[PLAYER_ONE].speedometerX, 0x106, 4); + if (s16_step_towards(&playerHUD[PLAYER_ONE].speedometerY, 0xB6, 4) != 0) { + playerHUD[PLAYER_ONE].unk_78++; + } + break; + case 6: + s16_step_towards(&playerHUD[PLAYER_ONE].speedometerX, 0x10A, 2); + if (s16_step_towards(&playerHUD[PLAYER_ONE].speedometerY, 0xBA, 2) != 0) { + playerHUD[PLAYER_ONE].unk_78++; + } + break; + case 7: + s16_step_towards(&playerHUD[PLAYER_ONE].speedometerX, 0x106, 2); + if (s16_step_towards(&playerHUD[PLAYER_ONE].speedometerY, 0xB6, 2) != 0) { + playerHUD[PLAYER_ONE].unk_78++; + } + break; + case 8: + playerHUD[PLAYER_ONE].unk_78 = 0; + break; } if ((playerHUD[PLAYER_ONE].unk_79 != 0) && (playerHUD[PLAYER_ONE].unk_79 == 1)) { if (++D_801657E7 >= 0x10) { @@ -1775,300 +1779,300 @@ void func_8005AB60(void) { } } switch (playerHUD[PLAYER_ONE].unk_80) { - case 0: - break; - case 1: - if (s16_step_towards(&playerHUD[PLAYER_ONE].slideItemBoxY, 0x40, 8) != 0) { - playerHUD[PLAYER_ONE].unk_80++; - } - break; - case 2: - if (s16_step_towards(&playerHUD[PLAYER_ONE].slideItemBoxY, 0x38, 8) != 0) { - playerHUD[PLAYER_ONE].unk_80++; - } - break; - case 3: - if (s16_step_towards(&playerHUD[PLAYER_ONE].slideItemBoxY, 0x40, 8) != 0) { - playerHUD[PLAYER_ONE].unk_80++; - } - break; - case 4: - if (s16_step_towards(&playerHUD[PLAYER_ONE].slideItemBoxY, 0x38, 8) != 0) { - playerHUD[PLAYER_ONE].unk_80++; - } - break; - case 5: - if (s16_step_towards(&playerHUD[PLAYER_ONE].slideItemBoxY, 0x40, 8) != 0) { - playerHUD[PLAYER_ONE].unk_80++; - } - break; - case 6: - if (s16_step_towards(&playerHUD[PLAYER_ONE].slideItemBoxY, 0x38, 4) != 0) { - playerHUD[PLAYER_ONE].unk_80++; - } - break; - case 7: - if (s16_step_towards(&playerHUD[PLAYER_ONE].slideItemBoxY, 0x40, 4) != 0) { - playerHUD[PLAYER_ONE].unk_80++; - } - break; - case 8: - playerHUD[PLAYER_ONE].unk_80 = 0; - break; + case 0: + break; + case 1: + if (s16_step_towards(&playerHUD[PLAYER_ONE].slideItemBoxY, 0x40, 8) != 0) { + playerHUD[PLAYER_ONE].unk_80++; + } + break; + case 2: + if (s16_step_towards(&playerHUD[PLAYER_ONE].slideItemBoxY, 0x38, 8) != 0) { + playerHUD[PLAYER_ONE].unk_80++; + } + break; + case 3: + if (s16_step_towards(&playerHUD[PLAYER_ONE].slideItemBoxY, 0x40, 8) != 0) { + playerHUD[PLAYER_ONE].unk_80++; + } + break; + case 4: + if (s16_step_towards(&playerHUD[PLAYER_ONE].slideItemBoxY, 0x38, 8) != 0) { + playerHUD[PLAYER_ONE].unk_80++; + } + break; + case 5: + if (s16_step_towards(&playerHUD[PLAYER_ONE].slideItemBoxY, 0x40, 8) != 0) { + playerHUD[PLAYER_ONE].unk_80++; + } + break; + case 6: + if (s16_step_towards(&playerHUD[PLAYER_ONE].slideItemBoxY, 0x38, 4) != 0) { + playerHUD[PLAYER_ONE].unk_80++; + } + break; + case 7: + if (s16_step_towards(&playerHUD[PLAYER_ONE].slideItemBoxY, 0x40, 4) != 0) { + playerHUD[PLAYER_ONE].unk_80++; + } + break; + case 8: + playerHUD[PLAYER_ONE].unk_80 = 0; + break; } switch (playerHUD[PLAYER_ONE].unk_7A) { - case 0: - break; - case 1: - if (s16_step_towards(&playerHUD[PLAYER_ONE].timerX, 0xE4, 0x10) != 0) { - playerHUD[PLAYER_ONE].unk_7A++; - } - break; - case 2: - if (s16_step_towards(&playerHUD[PLAYER_ONE].timerX, 0xF4, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7A++; - } - break; - case 3: - if (s16_step_towards(&playerHUD[PLAYER_ONE].timerX, 0xE4, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7A++; - } - break; - case 4: - if (s16_step_towards(&playerHUD[PLAYER_ONE].timerX, 0xEC, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7A++; - } - break; - case 5: - if (s16_step_towards(&playerHUD[PLAYER_ONE].timerX, 0xE4, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7A++; - } - break; - case 6: - if (s16_step_towards(&playerHUD[PLAYER_ONE].timerX, 0xE8, 2) != 0) { - playerHUD[PLAYER_ONE].unk_7A++; - } - break; - case 7: - if (s16_step_towards(&playerHUD[PLAYER_ONE].timerX, 0xE4, 2) != 0) { - playerHUD[PLAYER_ONE].unk_7A++; - } - break; - case 8: - playerHUD[PLAYER_ONE].unk_7A = 0; - break; + case 0: + break; + case 1: + if (s16_step_towards(&playerHUD[PLAYER_ONE].timerX, 0xE4, 0x10) != 0) { + playerHUD[PLAYER_ONE].unk_7A++; + } + break; + case 2: + if (s16_step_towards(&playerHUD[PLAYER_ONE].timerX, 0xF4, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7A++; + } + break; + case 3: + if (s16_step_towards(&playerHUD[PLAYER_ONE].timerX, 0xE4, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7A++; + } + break; + case 4: + if (s16_step_towards(&playerHUD[PLAYER_ONE].timerX, 0xEC, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7A++; + } + break; + case 5: + if (s16_step_towards(&playerHUD[PLAYER_ONE].timerX, 0xE4, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7A++; + } + break; + case 6: + if (s16_step_towards(&playerHUD[PLAYER_ONE].timerX, 0xE8, 2) != 0) { + playerHUD[PLAYER_ONE].unk_7A++; + } + break; + case 7: + if (s16_step_towards(&playerHUD[PLAYER_ONE].timerX, 0xE4, 2) != 0) { + playerHUD[PLAYER_ONE].unk_7A++; + } + break; + case 8: + playerHUD[PLAYER_ONE].unk_7A = 0; + break; } switch (playerHUD[PLAYER_ONE].unk_7D) { - case 0: - break; - case 1: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lapX, 0x53, 0x10) != 0) { - playerHUD[PLAYER_ONE].unk_7D++; - } - break; - case 2: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lapX, 0x43, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7D++; - } - break; - case 3: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lapX, 0x53, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7D++; - } - break; - case 4: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lapX, 0x4B, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7D++; - } - break; - case 5: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lapX, 0x53, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7D++; - } - break; - case 6: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lapX, 0x4F, 2) != 0) { - playerHUD[PLAYER_ONE].unk_7D++; - } - break; - case 7: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lapX, 0x53, 2) != 0) { - playerHUD[PLAYER_ONE].unk_7D++; - } - break; - case 8: - playerHUD[PLAYER_ONE].unk_7D = 0; - break; + case 0: + break; + case 1: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lapX, 0x53, 0x10) != 0) { + playerHUD[PLAYER_ONE].unk_7D++; + } + break; + case 2: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lapX, 0x43, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7D++; + } + break; + case 3: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lapX, 0x53, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7D++; + } + break; + case 4: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lapX, 0x4B, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7D++; + } + break; + case 5: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lapX, 0x53, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7D++; + } + break; + case 6: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lapX, 0x4F, 2) != 0) { + playerHUD[PLAYER_ONE].unk_7D++; + } + break; + case 7: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lapX, 0x53, 2) != 0) { + playerHUD[PLAYER_ONE].unk_7D++; + } + break; + case 8: + playerHUD[PLAYER_ONE].unk_7D = 0; + break; } D_8018CFEC = (f32) (playerHUD[PLAYER_ONE].speedometerX + 0x18); D_8018CFF4 = (f32) (playerHUD[PLAYER_ONE].speedometerY + 6); switch (playerHUD[PLAYER_ONE].unk_7B) { - case 0: - break; - case 1: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lap1CompletionTimeX, 0xE4, 0x10) != 0) { - playerHUD[PLAYER_ONE].unk_7B++; - } - break; - case 2: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lap1CompletionTimeX, 0xF4, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7B++; - } - break; - case 3: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lap1CompletionTimeX, 0xE4, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7B++; - } - break; - case 4: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lap1CompletionTimeX, 0xEC, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7B++; - } - break; - case 5: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lap1CompletionTimeX, 0xE4, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7B++; - } - break; - case 6: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lap1CompletionTimeX, 0xE8, 2) != 0) { - playerHUD[PLAYER_ONE].unk_7B++; - } - break; - case 7: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lap1CompletionTimeX, 0xE4, 2) != 0) { - playerHUD[PLAYER_ONE].unk_7B++; - } - break; - case 8: - playerHUD[PLAYER_ONE].unk_7B = 0; - break; + case 0: + break; + case 1: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lap1CompletionTimeX, 0xE4, 0x10) != 0) { + playerHUD[PLAYER_ONE].unk_7B++; + } + break; + case 2: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lap1CompletionTimeX, 0xF4, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7B++; + } + break; + case 3: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lap1CompletionTimeX, 0xE4, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7B++; + } + break; + case 4: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lap1CompletionTimeX, 0xEC, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7B++; + } + break; + case 5: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lap1CompletionTimeX, 0xE4, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7B++; + } + break; + case 6: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lap1CompletionTimeX, 0xE8, 2) != 0) { + playerHUD[PLAYER_ONE].unk_7B++; + } + break; + case 7: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lap1CompletionTimeX, 0xE4, 2) != 0) { + playerHUD[PLAYER_ONE].unk_7B++; + } + break; + case 8: + playerHUD[PLAYER_ONE].unk_7B = 0; + break; } switch (playerHUD[PLAYER_ONE].unk_7E) { - case 0: - break; - case 1: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage1X, 0x53, 0x10) != 0) { - playerHUD[PLAYER_ONE].unk_7E++; - } - break; - case 2: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage1X, 0x43, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7E++; - } - break; - case 3: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage1X, 0x53, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7E++; - } - break; - case 4: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage1X, 0x4B, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7E++; - } - break; - case 5: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage1X, 0x53, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7E++; - } - break; - case 6: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage1X, 0x4F, 2) != 0) { - playerHUD[PLAYER_ONE].unk_7E++; - } - break; - case 7: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage1X, 0x53, 2) != 0) { - playerHUD[PLAYER_ONE].unk_7E++; - } - break; - case 8: - playerHUD[PLAYER_ONE].unk_7E = 0; - break; + case 0: + break; + case 1: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage1X, 0x53, 0x10) != 0) { + playerHUD[PLAYER_ONE].unk_7E++; + } + break; + case 2: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage1X, 0x43, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7E++; + } + break; + case 3: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage1X, 0x53, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7E++; + } + break; + case 4: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage1X, 0x4B, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7E++; + } + break; + case 5: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage1X, 0x53, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7E++; + } + break; + case 6: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage1X, 0x4F, 2) != 0) { + playerHUD[PLAYER_ONE].unk_7E++; + } + break; + case 7: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage1X, 0x53, 2) != 0) { + playerHUD[PLAYER_ONE].unk_7E++; + } + break; + case 8: + playerHUD[PLAYER_ONE].unk_7E = 0; + break; } switch (playerHUD[PLAYER_ONE].unk_7C) { - case 0: - break; - case 1: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lap2CompletionTimeX, 0xE4, 0x10) != 0) { - playerHUD[PLAYER_ONE].unk_7C++; - } - break; - case 2: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lap2CompletionTimeX, 0xF4, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7C++; - } - break; - case 3: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lap2CompletionTimeX, 0xE4, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7C++; - } - break; - case 4: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lap2CompletionTimeX, 0xEC, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7C++; - } - break; - case 5: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lap2CompletionTimeX, 0xE4, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7C++; - } - break; - case 6: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lap2CompletionTimeX, 0xE8, 2) != 0) { - playerHUD[PLAYER_ONE].unk_7C++; - } - break; - case 7: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lap2CompletionTimeX, 0xE4, 2) != 0) { - playerHUD[PLAYER_ONE].unk_7C++; - } - break; - case 8: - playerHUD[PLAYER_ONE].unk_7C = 0; - break; + case 0: + break; + case 1: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lap2CompletionTimeX, 0xE4, 0x10) != 0) { + playerHUD[PLAYER_ONE].unk_7C++; + } + break; + case 2: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lap2CompletionTimeX, 0xF4, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7C++; + } + break; + case 3: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lap2CompletionTimeX, 0xE4, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7C++; + } + break; + case 4: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lap2CompletionTimeX, 0xEC, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7C++; + } + break; + case 5: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lap2CompletionTimeX, 0xE4, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7C++; + } + break; + case 6: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lap2CompletionTimeX, 0xE8, 2) != 0) { + playerHUD[PLAYER_ONE].unk_7C++; + } + break; + case 7: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lap2CompletionTimeX, 0xE4, 2) != 0) { + playerHUD[PLAYER_ONE].unk_7C++; + } + break; + case 8: + playerHUD[PLAYER_ONE].unk_7C = 0; + break; } switch (playerHUD[PLAYER_ONE].unk_7F) { - case 0: - break; - case 1: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage2X, 0x53, 0x10) != 0) { - playerHUD[PLAYER_ONE].unk_7F++; - } - break; - case 2: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage2X, 0x43, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7F++; - } - break; - case 3: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage2X, 0x53, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7F++; - } - break; - case 4: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage2X, 0x4B, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7F++; - } - break; - case 5: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage2X, 0x53, 4) != 0) { - playerHUD[PLAYER_ONE].unk_7F++; - } - break; - case 6: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage2X, 0x4F, 2) != 0) { - playerHUD[PLAYER_ONE].unk_7F++; - } - break; - case 7: - if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage2X, 0x53, 2) != 0) { - playerHUD[PLAYER_ONE].unk_7F++; - } - break; - case 8: - playerHUD[PLAYER_ONE].unk_7F = 0; - break; + case 0: + break; + case 1: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage2X, 0x53, 0x10) != 0) { + playerHUD[PLAYER_ONE].unk_7F++; + } + break; + case 2: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage2X, 0x43, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7F++; + } + break; + case 3: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage2X, 0x53, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7F++; + } + break; + case 4: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage2X, 0x4B, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7F++; + } + break; + case 5: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage2X, 0x53, 4) != 0) { + playerHUD[PLAYER_ONE].unk_7F++; + } + break; + case 6: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage2X, 0x4F, 2) != 0) { + playerHUD[PLAYER_ONE].unk_7F++; + } + break; + case 7: + if (s16_step_towards(&playerHUD[PLAYER_ONE].lapAfterImage2X, 0x53, 2) != 0) { + playerHUD[PLAYER_ONE].unk_7F++; + } + break; + case 8: + playerHUD[PLAYER_ONE].unk_7F = 0; + break; } } @@ -2077,7 +2081,7 @@ void func_8005B7A0(void) { f32* temp_s2; f32* temp_s3; f32* temp_s4; - f32* var_s1; + UNUSED f32* var_s1; s32 var_s0; s16_step_towards(&playerHUD[PLAYER_ONE].lap1CompletionTimeX, 0xE4, 0x10); @@ -2459,18 +2463,18 @@ void func_8005C6B4(s8 arg0, s16* arg1, s16* arg2, s16* arg3) { } void func_8005C728(void) { - s16 sp26; - s16 sp24; - s16 sp22; + s16 x; + s16 y; + s16 z; s32 temp_t7; temp_t7 = ++D_8018D400; - D_8018D40C = temp_t7 & 0x3F; - 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; + D_8018D40C = temp_t7 & 0x3F; // temp_t7 % 64 + D_8018D410 = temp_t7 & 0x1F; // temp_t7 % 32 + D_80165590 = temp_t7 & 0xF; // temp_t7 % 16 + D_80165594 = temp_t7 & 7; // temp_t7 % 8 + D_80165598 = temp_t7 & 3; // temp_t7 % 4 + D_8016559C = temp_t7 & 1; // temp_t7 % 2 if (D_8018D40C == 0) { D_801655A4 += 1; D_801655D8 ^= 1; @@ -2502,10 +2506,10 @@ void func_8005C728(void) { 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; + func_8005C674(D_801658A8, &x, &y, &z); + D_801656C0 = x / 2; + D_801656D0 = y / 2; + D_801656E0 = z / 2; func_8005C980(); } @@ -2545,7 +2549,7 @@ void func_8005C980(void) { void func_8005CB60(s32 playerId, s32 lapCount) { s32 temp_a0_2; - s32 stackPadding; + UNUSED s32 stackPadding; s8 *huh; s8 *huhthedeuce; Player *player; @@ -2682,21 +2686,21 @@ void func_8005CB60(s32 playerId, s32 lapCount) { } } -void func_8005D0FC(s32 arg0) { +void func_8005D0FC(s32 playerId) { if (gModeSelection != BATTLE) { - switch (arg0) { /* irregular */ - case 0: - func_8005CB60(arg0, gLapCountByPlayerId[0]); - break; - case 1: - func_8005CB60(arg0, gLapCountByPlayerId[1]); - break; - case 2: - func_8005CB60(arg0, gLapCountByPlayerId[2]); - break; - case 3: - func_8005CB60(arg0, gLapCountByPlayerId[3]); - break; + switch (playerId) { /* irregular */ + case PLAYER_ONE: + func_8005CB60(playerId, gLapCountByPlayerId[PLAYER_ONE]); + break; + case PLAYER_TWO: + func_8005CB60(playerId, gLapCountByPlayerId[PLAYER_TWO]); + break; + case PLAYER_THREE: + func_8005CB60(playerId, gLapCountByPlayerId[PLAYER_THREE]); + break; + case PLAYER_FOUR: + func_8005CB60(playerId, gLapCountByPlayerId[PLAYER_FOUR]); + break; } } } @@ -2714,8 +2718,7 @@ void func_8005D18C(void) { } } -void func_8005D1F4(s32 arg0) -{ +void func_8005D1F4(s32 arg0) { s32 playerWaypoint; s32 bombWaypoint; s32 var_a2; @@ -2780,29 +2783,25 @@ void func_8005D290(void) { void func_8005D6C0(Player* player) { s32 temp_v0; - for (temp_v0 = 0; temp_v0 < 10; ++temp_v0) - { + for (temp_v0 = 0; temp_v0 < 10; ++temp_v0) { player->unk_258[temp_v0].unk_01C = 0; player->unk_258[temp_v0].unk_01E = 0; player->unk_258[temp_v0].unk_012 = 0; } - for (temp_v0 = 0; temp_v0 < 10; ++temp_v0) - { + for (temp_v0 = 0; temp_v0 < 10; ++temp_v0) { player->unk_258[30 + temp_v0].unk_01C = 0; player->unk_258[30 + temp_v0].unk_01E = 0; player->unk_258[30 + temp_v0].unk_012 = 0; } - for (temp_v0 = 0; temp_v0 < 10; ++temp_v0) - { + for (temp_v0 = 0; temp_v0 < 10; ++temp_v0) { player->unk_258[10 + temp_v0].unk_01C = 0; player->unk_258[10 + temp_v0].unk_01E = 0; player->unk_258[10 + temp_v0].unk_012 = 0; } - for (temp_v0 = 0; temp_v0 < 10; ++temp_v0) - { + for (temp_v0 = 0; temp_v0 < 10; ++temp_v0) { player->unk_258[20 + temp_v0].unk_01C = 0; player->unk_258[20 + temp_v0].unk_01E = 0; player->unk_258[20 + temp_v0].unk_012 = 0; @@ -2895,8 +2894,8 @@ void func_8005DAD8(UnkPlayerStruct258* arg0, s16 arg1, s16 arg2, s16 arg3) { arg0->unk_040 = arg2; } -void func_8005DAF4(Player *player, s16 arg1, s32 arg2, s32 arg3) { - s32 stackPadding; +void func_8005DAF4(Player *player, s16 arg1, s32 arg2, UNUSED s32 arg3) { + UNUSED s32 stackPadding; s32 var_t1; s32 var_t3; f32 var_f2; @@ -3135,7 +3134,7 @@ void func_8005EA94(Player *player, s16 arg1, s32 arg2, s8 arg3) { } } -void func_8005ED48(Player *player, s16 arg1, s32 arg2, s32 arg3) { +void func_8005ED48(Player *player, s16 arg1, s32 arg2, UNUSED s32 arg3) { s32 temp_v0; s32 var_t2; s32 var_t3; @@ -3317,7 +3316,7 @@ void func_8005ED48(Player *player, s16 arg1, s32 arg2, s32 arg3) { // Permuter hasn't found anything // https://decomp.me/scratch/WjMqd -void func_8005F90C(Player *player, s16 arg1, s32 arg2, s32 arg3) { +void func_8005F90C(Player *player, s16 arg1, s32 arg2, UNUSED s32 arg3) { s32 var_t1; u8 var_v0; f32 var_f0; @@ -3493,16 +3492,16 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8005F90C.s") #endif void func_80060504(Player *player, s16 arg1, s32 arg2, s32 arg3) { - s32 thing1; + UNUSED s32 thing1; s16 thing2; - s32 thing3; + UNUSED s32 thing3; f32 sp50; f32 sp4C; f32 sp48; f32 var_f0; s32 var_v0; s32 temp_v0; - s32 test; + UNUSED s32 test; if ((player->unk_044 & 0x20) == 0x20) { var_v0 = 5; @@ -3722,10 +3721,10 @@ void func_80061430(Player *player, UNUSED s32 arg1, UNUSED s32 arg2, UNUSED s8 a player->unk_044 &= ~0x1000; } -void func_800615AC(Player *player, s16 arg1, s32 arg2, s8 arg3) { +void func_800615AC(Player *player, s16 arg1, UNUSED s32 arg2, UNUSED s8 arg3) { s32 test = 2; - s32 stackPadding0; - s32 stackPadding1; + UNUSED s32 stackPadding0; + UNUSED s32 stackPadding1; f32 temp_f0; f32 sp28[10] = { -182.0f, 182.0f, 364.0f, -364.0f, 546.0f, -546.0f, 728.0f, -728.0f, 910.0f, -910.0f }; @@ -3817,11 +3816,11 @@ void func_80061A34(Player *player, s16 arg1, s32 arg2, UNUSED s8 arg3) { } } -void func_80061D4C(Player *player, s16 arg1, s32 arg2, s8 arg3) { +void func_80061D4C(Player *player, s16 arg1, UNUSED s32 arg2, UNUSED s8 arg3) { s32 test = 2; s32 stackPadding0; - s32 stackPadding1; - s32 stackPadding2; + UNUSED s32 stackPadding1; + UNUSED 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) { @@ -4139,7 +4138,7 @@ 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)); } -void func_80062C74(Player *player, s16 arg1, s32 arg2, s32 arg3) { +void func_80062C74(Player *player, s16 arg1, UNUSED 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; @@ -4894,7 +4893,7 @@ void func_800658A0(Player *player, UNUSED s8 arg1, s16 arg2, s8 arg3) { #ifdef NON_MATCHING // Something about the handling of the prim/env colors is off, // its causing a huge diff. Can't figure out what's up. -void func_80065AB0(Player *player, s8 arg1, s16 arg2, s8 arg3) { +void func_80065AB0(Player *player, UNUSED s8 arg1, s16 arg2, s8 arg3) { Vec3f spB4; Vec3s spAC; s32 var_s0; @@ -4950,7 +4949,7 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80065AB0.s") #ifdef NON_MATCHING //https://decomp.me/scratch/KEz08 // Something is very wrong with the handling of prim/evn colors, but I can't figuer out what. -void func_80065F0C(Player *player, s8 arg1, s16 arg2, s8 arg3) { +void func_80065F0C(Player *player, UNUSED s8 arg1, s16 arg2, s8 arg3) { Vec3f spDC; Vec3s spD4; s16 primRed; @@ -5009,7 +5008,7 @@ void func_80065F0C(Player *player, s8 arg1, s16 arg2, s8 arg3) { GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80065F0C.s") #endif -void func_800664E0(Player *player, s8 arg1, s16 arg2, s8 arg3) { +void func_800664E0(Player *player, UNUSED s8 arg1, s16 arg2, s8 arg3) { Vec3f sp54; Vec3s sp4C; s16 red; @@ -5038,7 +5037,7 @@ void func_800664E0(Player *player, s8 arg1, s16 arg2, s8 arg3) { } } -void func_80066714(Player *player, s32 arg1, s16 arg2, s8 arg3) { +void func_80066714(Player *player, UNUSED s32 arg1, s16 arg2, s8 arg3) { Vec3f sp5C; Vec3s sp54; s16 red; @@ -5069,7 +5068,7 @@ void func_80066714(Player *player, s32 arg1, s16 arg2, s8 arg3) { } } -void func_80066998(Player *player, s8 arg1, s16 arg2, s8 arg3) { +void func_80066998(Player *player, UNUSED s8 arg1, s16 arg2, s8 arg3) { Vec3f sp54; Vec3s sp4C; s16 red; @@ -5097,10 +5096,10 @@ void func_80066998(Player *player, s8 arg1, s16 arg2, s8 arg3) { } } -void func_80066BAC(Player *player, s8 arg1, s16 arg2, s8 arg3) { +void func_80066BAC(Player *player, UNUSED s8 arg1, s16 arg2, s8 arg3) { Vec3f spDC; Vec3s spD4; - s32 stackPadding; + UNUSED s32 stackPadding; if ((player->unk_258[arg2].unk_01C == 1) && (player->unk_258[arg2].unk_038 != 0x00FF)) { if (player->unk_110.unk3C[2] >= 300.0f) { @@ -5143,7 +5142,7 @@ void func_80066BAC(Player *player, s8 arg1, s16 arg2, s8 arg3) { } } -void func_80067280(Player *player, s8 arg1, s16 arg2, s8 arg3) { +void func_80067280(Player *player, UNUSED s8 arg1, s16 arg2, s8 arg3) { Vec3f sp7C; Vec3s sp74; s16 red; @@ -5180,10 +5179,10 @@ void func_80067280(Player *player, s8 arg1, s16 arg2, s8 arg3) { } } -void func_80067604(Player *player, s8 arg1, s16 arg2, s8 arg3) { +void func_80067604(Player *player, UNUSED s8 arg1, s16 arg2, s8 arg3) { Vec3f sp8C; Vec3s sp84; - s32 stackPadding[4]; + UNUSED s32 stackPadding[4]; if (player->unk_258[30 + arg2].unk_01C == 1) { sp8C[0] = player->unk_258[30 + arg2].unk_000[0]; @@ -5208,10 +5207,10 @@ void func_80067604(Player *player, s8 arg1, s16 arg2, s8 arg3) { } } -void func_80067964(Player *player, s8 arg1, f32 arg2, s8 arg3, s8 arg4) { +void func_80067964(Player *player, UNUSED s8 arg1, f32 arg2, UNUSED s8 arg3, s8 arg4) { Vec3f sp9C; Vec3s sp94; - s32 stackPadding[2]; + UNUSED s32 stackPadding[2]; if (player->unk_258[20 + arg4].unk_01C == 1) { sp9C[0] = player->unk_258[20 + arg4].unk_000[0]; @@ -5289,8 +5288,8 @@ void func_8006801C(Player *player, s8 arg1, u8 *texture, s8 arg3, f32 arg4, s32 } } -void func_80068310(Player *player, s8 arg1, f32 arg2, s8 arg3, s8 arg4) { - s32 stackPadding[16]; // huh? +void func_80068310(Player *player, UNUSED s8 arg1, UNUSED f32 arg2, s8 arg3, s8 arg4) { + UNUSED s32 stackPadding[16]; // huh? Vec3f sp9C; Vec3s sp94; @@ -5315,8 +5314,8 @@ void func_80068310(Player *player, s8 arg1, f32 arg2, s8 arg3, s8 arg4) { } } -void func_80068724(Player *player, s8 arg1, f32 arg2, s8 arg3, s8 arg4) { - s32 stackPadding[16]; // huh? +void func_80068724(Player *player, UNUSED s8 arg1, UNUSED f32 arg2, s8 arg3, s8 arg4) { + UNUSED s32 stackPadding[16]; // huh? Vec3f sp84; Vec3s sp7C; @@ -5341,7 +5340,7 @@ void func_80068724(Player *player, s8 arg1, f32 arg2, s8 arg3, s8 arg4) { } } -void func_80068AA4(Player *player, s8 arg1, f32 arg2, s8 arg3, s8 arg4) { +void func_80068AA4(Player *player, UNUSED s8 arg1, UNUSED f32 arg2, s8 arg3, s8 arg4) { Vec3f sp64; Vec3s sp5C; @@ -5364,7 +5363,7 @@ void func_80068AA4(Player *player, s8 arg1, f32 arg2, s8 arg3, s8 arg4) { } } -void func_80068DA0(Player *player, s8 arg1, f32 arg2, s8 arg3, s8 arg4) { +void func_80068DA0(Player *player, UNUSED s8 arg1, UNUSED f32 arg2, s8 arg3, s8 arg4) { Vec3f sp9C; Vec3s sp94; @@ -5389,7 +5388,7 @@ void func_80068DA0(Player *player, s8 arg1, f32 arg2, s8 arg3, s8 arg4) { } } -void func_800691B8(Player *player, s8 arg1, s16 arg2, s8 arg3) { +void func_800691B8(Player *player, UNUSED s8 arg1, s16 arg2, s8 arg3) { Vec3f sp5C; Vec3s sp54; s16 alpha; @@ -5415,7 +5414,7 @@ void func_800691B8(Player *player, s8 arg1, s16 arg2, s8 arg3) { } } -void func_80069444(Player *player, s8 arg1, s16 arg2, s8 arg3) { +void func_80069444(Player *player, UNUSED s8 arg1, s16 arg2, s8 arg3) { Vec3f sp74; Vec3s sp6C; s16 primRed; @@ -5456,7 +5455,7 @@ void func_80069444(Player *player, s8 arg1, s16 arg2, s8 arg3) { } } -void func_800696CC(Player *player, s8 arg1, s16 arg2, s8 arg3, f32 arg4) { +void func_800696CC(Player *player, UNUSED s8 arg1, s16 arg2, s8 arg3, f32 arg4) { Vec3f sp5C; Vec3s sp54; s16 alpha; @@ -5481,7 +5480,7 @@ void func_800696CC(Player *player, s8 arg1, s16 arg2, s8 arg3, f32 arg4) { } } -void func_80069938(Player *player, s8 arg1, s16 arg2, s8 arg3) { +void func_80069938(Player *player, UNUSED s8 arg1, s16 arg2, s8 arg3) { Vec3f sp5C; Vec3s sp54; s16 alpha; @@ -5506,7 +5505,7 @@ void func_80069938(Player *player, s8 arg1, s16 arg2, s8 arg3) { } } -void func_80069BA8(Player *player, s8 arg1, s16 arg2, s8 arg3) { +void func_80069BA8(Player *player, UNUSED s8 arg1, s16 arg2, s8 arg3) { Vec3f sp54; Vec3s sp4C; s16 red; @@ -5534,10 +5533,10 @@ void func_80069BA8(Player *player, s8 arg1, s16 arg2, s8 arg3) { } } -void func_80069DB8(Player *player, s8 arg1, s16 arg2, s8 arg3) { +void func_80069DB8(Player *player, UNUSED s8 arg1, s16 arg2, s8 arg3) { Vec3f sp5C; Vec3s sp54; - s32 stackPadding[2]; + UNUSED s32 stackPadding[2]; if (player->unk_258[30 + arg2].unk_01C == 1) { sp5C[0] = player->unk_258[30 + arg2].unk_000[0]; @@ -5558,7 +5557,7 @@ void func_80069DB8(Player *player, s8 arg1, s16 arg2, s8 arg3) { } } -void func_8006A01C(Player *player, s8 arg1, s16 arg2, s8 arg3) { +void func_8006A01C(Player *player, UNUSED s8 arg1, s16 arg2, s8 arg3) { Vec3f sp54; Vec3s sp4C; @@ -5582,7 +5581,7 @@ void func_8006A01C(Player *player, s8 arg1, s16 arg2, s8 arg3) { } } -void func_8006A280(Player *player, s8 arg1, s16 arg2, s8 arg3) { +void func_8006A280(Player *player, UNUSED s8 arg1, s16 arg2, s8 arg3) { Vec3f sp5C; Vec3s sp54; s16 red; @@ -5640,13 +5639,13 @@ void func_8006A7C0(Player *player, f32 arg1, f32 arg2, s8 arg3, s8 arg4) { 9.0f, 10.0f, 9.0f, 8.0f, 10.0f, 9.5f, 9.5f, 11.0f, }; - s32 stackPadding0; + UNUSED s32 stackPadding0; f32 someX; f32 someY; f32 someZ; f32 sp6C; - s32 stackPadding1; - s32 stackPadding2; + UNUSED s32 stackPadding1; + UNUSED s32 stackPadding2; sp6C = (-(player->unk_094 / 18.0f) * 216.0f) / 10.0f; if ((gPlayerBalloonStatus[arg3][arg4] & 2) != 2) { @@ -5725,7 +5724,7 @@ void func_8006AFD0(Player *player, s8 arg1, s16 arg2, s8 arg3) { Mat4 sp140; Vec3f sp134; Vec3s sp12C; - s16 stackPadding; + UNUSED s16 stackPadding; s16 primRed; s16 primGreen; s16 primBlue; @@ -5861,7 +5860,7 @@ void render_balloon(Vec3f arg0, f32 arg1, s16 arg2, s16 arg3) { Mat4 sp108; Vec3f spFC; Vec3s spF4; - s16 stackPadding; + UNUSED s16 stackPadding; s16 primRed; s16 primGreen; s16 primBlue; @@ -6061,7 +6060,7 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006C6AC.s") * I don't know what's going on. **/ void func_8006C9B8(Player *player, s16 arg1, s8 arg2, s8 arg3) { - s32 stackPadding; + UNUSED s32 stackPadding; s32 sp28; sp28 = arg1 - 1; if (sp28 < 0) { @@ -6176,14 +6175,13 @@ extern s32 gActiveScreenMode; // Replacing arg3 with 0 seems to make the percentage higher. // func_80060504 args could be wrong as well. void func_8006CEC0(Player *arg0, s16 arg1, s8 arg2, s8 arg3) { - u16 temp_v0_3; + UNUSED u16 temp_v0_3; s32 sp20 = arg1; if (--sp20 < 0) { sp20 = 9; } if (arg0->unk_258[arg1].unk_01C == 1) { - switch (arg0->unk_258[arg1].unk_012) - { + switch (arg0->unk_258[arg1].unk_012) { case 1: func_80062C74(arg0, arg1, arg2, arg3); break; @@ -6595,8 +6593,7 @@ void func_8006E420(Player* player, s8 arg1, s8 arg2) { func_8006D194(player, arg1, arg2); } - for (temp_s0 = 0; temp_s0 < 10; ++temp_s0) - { + for (temp_s0 = 0; temp_s0 < 10; ++temp_s0) { func_8006CEC0(player, temp_s0, arg1, arg2); if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) || (gGamestate == ENDING_SEQUENCE)) { func_8006C9B8(player, temp_s0, arg1, arg2); diff --git a/src/code_80057C60.h b/src/code_80057C60.h index 9d58dd5bc..1605de574 100644 --- a/src/code_80057C60.h +++ b/src/code_80057C60.h @@ -15,7 +15,9 @@ typedef struct { char unk_18[0x8]; } struct_D_8018CE10; // size = 0x20 -void func_8005C674(s8 arg0, s16 *arg1, s16 *arg2, s16 *arg3); +/** @cond */ + +void func_8005C674(s8, s16 *, s16 *, s16 *); void func_80057C60(void); void func_80057CE4(void); void func_80057DD0(void); @@ -649,4 +651,6 @@ extern Vec3s D_8018D890[]; extern s16 gPlayerBalloonCount[]; // D_8018D8C0 extern Vec3s D_8018D8D0[]; +/** @endcond */ + #endif diff --git a/src/code_8006E9C0.c b/src/code_8006E9C0.c index 3b21ea0e4..73d24e70e 100644 --- a/src/code_8006E9C0.c +++ b/src/code_8006E9C0.c @@ -46,19 +46,19 @@ void init_object_list(void) { } void reset_object_variable(void) { - s32 thing; - s32 thing2; + s32 i; + s32 j; func_8006EB10(); clear_object_list(); bzero(playerHUD, HUD_PLAYERS_SIZE * sizeof(hud_player)); - for (thing = 0; thing < HUD_PLAYERS_SIZE; thing++) { - playerHUD[thing].lapCount = 0; - playerHUD[thing].alsoLapCount = 0; - playerHUD[thing].unk_81 = 0; + for (i = 0; i < HUD_PLAYERS_SIZE; i++) { + playerHUD[i].lapCount = 0; + playerHUD[i].alsoLapCount = 0; + playerHUD[i].unk_81 = 0; } - for (thing2 = 0; thing2 < HUD_PLAYERS_SIZE; thing2++) { - playerHUD[thing2].raceCompleteBool = 0; + for (j = 0; j < HUD_PLAYERS_SIZE; j++) { + playerHUD[j].raceCompleteBool = 0; } } @@ -1114,28 +1114,28 @@ void init_hud_one_player(void) { func_8007055C(); func_8007055C(); init_course_object(); - playerHUD[0].speedometerX = 0x0156; - playerHUD[0].speedometerY = 0x0106; - D_8018CFEC = playerHUD[0].speedometerX + 0x18; - D_8018CFF4 = playerHUD[0].speedometerY + 6; + playerHUD[PLAYER_ONE].speedometerX = 0x0156; + playerHUD[PLAYER_ONE].speedometerY = 0x0106; + D_8018CFEC = playerHUD[PLAYER_ONE].speedometerX + 0x18; + D_8018CFF4 = playerHUD[PLAYER_ONE].speedometerY + 6; D_8016579E = 0xDD00; - playerHUD[0].rankX = 0x0034; - playerHUD[0].rankY = 0x00C8; - playerHUD[0].slideRankX = 0; - playerHUD[0].slideRankY = 0; - playerHUD[0].stagingPosition = gGPCurrentRaceRankByPlayerId[0]; - playerHUD[0].timerX = 0x012C; - playerHUD[0].lapCompletionTimeXs[0] = 0x012C; - playerHUD[0].lapCompletionTimeXs[1] = 0x012C; - playerHUD[0].timerY = 0x0011; - playerHUD[0].lapX = -0x0028; - playerHUD[0].lapAfterImage1X = -0x0028; - playerHUD[0].lapAfterImage2X = -0x0028; - playerHUD[0].lapY = 0x0019; - playerHUD[0].itemBoxX = 0x00A0; - playerHUD[0].itemBoxY = -0x0020; - playerHUD[0].slideItemBoxX = 0; - playerHUD[0].slideItemBoxY = 0; + playerHUD[PLAYER_ONE].rankX = 0x0034; + playerHUD[PLAYER_ONE].rankY = 0x00C8; + playerHUD[PLAYER_ONE].slideRankX = 0; + playerHUD[PLAYER_ONE].slideRankY = 0; + playerHUD[PLAYER_ONE].stagingPosition = gGPCurrentRaceRankByPlayerId[0]; + playerHUD[PLAYER_ONE].timerX = 0x012C; + playerHUD[PLAYER_ONE].lapCompletionTimeXs[0] = 0x012C; + playerHUD[PLAYER_ONE].lapCompletionTimeXs[1] = 0x012C; + playerHUD[PLAYER_ONE].timerY = 0x0011; + playerHUD[PLAYER_ONE].lapX = -0x0028; + playerHUD[PLAYER_ONE].lapAfterImage1X = -0x0028; + playerHUD[PLAYER_ONE].lapAfterImage2X = -0x0028; + playerHUD[PLAYER_ONE].lapY = 0x0019; + playerHUD[PLAYER_ONE].itemBoxX = 0x00A0; + playerHUD[PLAYER_ONE].itemBoxY = -0x0020; + playerHUD[PLAYER_ONE].slideItemBoxX = 0; + playerHUD[PLAYER_ONE].slideItemBoxY = 0; // permuter magic why = 0x000000A0; init_item_window(gItemWindowObjectByPlayerId[0]); @@ -1155,9 +1155,9 @@ void init_hud_one_player(void) { D_8018D3EC = 0x000000FF; D_8018D3F0 = 0x000000FF; D_8018D3F4 = one; - playerHUD[0].unk_4C = 0x0078; - playerHUD[0].unk_4A = 0x00A0; - playerHUD[0].rankScaling = 0.5f; + playerHUD[PLAYER_ONE].unk_4C = 0x0078; + playerHUD[PLAYER_ONE].unk_4A = 0x00A0; + playerHUD[PLAYER_ONE].rankScaling = 0.5f; D_801656B0 = 0; D_80165708 = 0x0028; D_8018D00C = 5.0f; diff --git a/src/code_80086E70.c b/src/code_80086E70.c index 5859a3292..d2ee56aca 100644 --- a/src/code_80086E70.c +++ b/src/code_80086E70.c @@ -531,8 +531,8 @@ s32 func_80088538(s32 objectIndex) { set_object_flag_unk_054_true(objectIndex, 0x00800000); } gObjectList[objectIndex].unk_044 = func_802ABE30(gObjectList[objectIndex].pos[0], 0.0f, gObjectList[objectIndex].pos[2], D_8018C3B0.unk3A); - gObjectList[objectIndex].unk_0B8[0] = atan2s(D_8018C3B0.unk60[2], D_8018C3B0.unk60[1]) + 0x4000; - gObjectList[objectIndex].unk_0B8[2] = atan2s(D_8018C3B0.unk60[0], D_8018C3B0.unk60[1]); + gObjectList[objectIndex].unk_0B8[0] = atan2s(D_8018C3B0.orientationVector[2], D_8018C3B0.orientationVector[1]) + 0x4000; + gObjectList[objectIndex].unk_0B8[2] = atan2s(D_8018C3B0.orientationVector[0], D_8018C3B0.orientationVector[1]); } return sp2C; } @@ -549,9 +549,9 @@ s32 func_8008861C(s32 objectIndex) { set_object_flag_unk_054_true(objectIndex, 0x00800000); } gObjectList[objectIndex].unk_044 = func_802ABE30(gObjectList[objectIndex].pos[0], 0.0f, gObjectList[objectIndex].pos[2], D_8018C3B0.unk3A); - gObjectList[objectIndex].unk_01C[0] = D_8018C3B0.unk60[0]; - gObjectList[objectIndex].unk_01C[1] = D_8018C3B0.unk60[1]; - gObjectList[objectIndex].unk_01C[2] = D_8018C3B0.unk60[2]; + gObjectList[objectIndex].unk_01C[0] = D_8018C3B0.orientationVector[0]; + gObjectList[objectIndex].unk_01C[1] = D_8018C3B0.orientationVector[1]; + gObjectList[objectIndex].unk_01C[2] = D_8018C3B0.orientationVector[2]; } return sp2C; } @@ -561,8 +561,8 @@ void func_800886F4(s32 objectIndex) { if (D_8018C3B0.unk34 == 1) { set_object_flag_unk_054_true(objectIndex, 0x00800000); gObjectList[objectIndex].unk_044 = func_802ABE30(gObjectList[objectIndex].pos[0], 0.0f, gObjectList[objectIndex].pos[2], D_8018C3B0.unk3A); - gObjectList[objectIndex].unk_0B8[0] = atan2s(D_8018C3B0.unk60[2], D_8018C3B0.unk60[1]) + 0x4000; - gObjectList[objectIndex].unk_0B8[2] = atan2s(D_8018C3B0.unk60[0], D_8018C3B0.unk60[1]); + gObjectList[objectIndex].unk_0B8[0] = atan2s(D_8018C3B0.orientationVector[2], D_8018C3B0.orientationVector[1]) + 0x4000; + gObjectList[objectIndex].unk_0B8[2] = atan2s(D_8018C3B0.orientationVector[0], D_8018C3B0.orientationVector[1]); return; } set_object_flag_unk_054_false(objectIndex, 0x00800000); @@ -573,9 +573,9 @@ void func_800887C0(s32 objectIndex) { if (D_8018C3B0.unk34 == 1) { set_object_flag_unk_054_true(objectIndex, 0x00800000); gObjectList[objectIndex].unk_044 = func_802ABE30(gObjectList[objectIndex].pos[0], 0.0f, gObjectList[objectIndex].pos[2], D_8018C3B0.unk3A); - gObjectList[objectIndex].unk_038[0] = D_8018C3B0.unk60[0]; - gObjectList[objectIndex].unk_038[1] = D_8018C3B0.unk60[1]; - gObjectList[objectIndex].unk_038[2] = D_8018C3B0.unk60[2]; + gObjectList[objectIndex].unk_038[0] = D_8018C3B0.orientationVector[0]; + gObjectList[objectIndex].unk_038[1] = D_8018C3B0.orientationVector[1]; + gObjectList[objectIndex].unk_038[2] = D_8018C3B0.orientationVector[2]; return; } set_object_flag_unk_054_false(objectIndex, 0x00800000); diff --git a/src/code_80091750.c b/src/code_80091750.c index 142977218..3736d9840 100644 --- a/src/code_80091750.c +++ b/src/code_80091750.c @@ -9085,10 +9085,10 @@ void func_800A4550(s32 lapNumber, s32 column, s32 row) { struct_8018D9E0_entry *temp_v0_2; if (lapNumber < 3) { - sp40 = playerHUD[0].lapDurations[lapNumber]; + sp40 = playerHUD[PLAYER_ONE].lapDurations[lapNumber]; set_text_color(2); } else { - sp40 = playerHUD[0].someTimer; + sp40 = playerHUD[PLAYER_ONE].someTimer; set_text_color(1); } func_800936B8(column + 0x21, row, D_800E7734[lapNumber], 0, 0.7f, 0.7f); diff --git a/src/ending/camera_junk.c b/src/ending/camera_junk.c index 517aa01e7..ec709d0ff 100644 --- a/src/ending/camera_junk.c +++ b/src/ending/camera_junk.c @@ -37,7 +37,7 @@ void func_802816B8(void) { cameras[0].up[1] = 1.0f; cameras[0].up[2] = 0.0f; gCameraZoom[0] = 40.0f; - D_80150148 = 1.33333333f; + gScreenAspect = 1.33333333f; D_80150150 = 3.0f; D_8015014C = 6800.0f; init_cinematic_camera(); diff --git a/src/ending/code_80280000.c b/src/ending/code_80280000.c index 8b1f00bb8..ddc307833 100644 --- a/src/ending/code_80280000.c +++ b/src/ending/code_80280000.c @@ -52,7 +52,7 @@ void func_80280038(void) { func_80057FC4(0); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], gScreenAspect, D_80150150, D_8015014C, 1.0f); gSPPerspNormalize(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt(&gGfxPool->mtxLookAt[0], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); diff --git a/src/ending/code_80281C40.c b/src/ending/code_80281C40.c index b64d4ffa4..2f6d2d1e6 100644 --- a/src/ending/code_80281C40.c +++ b/src/ending/code_80281C40.c @@ -68,7 +68,7 @@ void func_80281D00(void) { } func_8028150C(); gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); - guPerspective((Mtx*) &gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective((Mtx*) &gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], gScreenAspect, D_80150150, D_8015014C, 1.0f); gSPPerspNormalize(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); guLookAt((Mtx*) &gGfxPool->mtxLookAt[0], camera->pos[0], camera->pos[1], camera->pos[2], camera->lookAt[0], camera->lookAt[1], camera->lookAt[2], camera->up[0], camera->up[1], camera->up[2]); diff --git a/src/hud_renderer.c b/src/hud_renderer.c index 061177879..708c5d7b6 100644 --- a/src/hud_renderer.c +++ b/src/hud_renderer.c @@ -1195,7 +1195,7 @@ void func_8004A630(Collision *arg0, Vec3f arg1, f32 arg2) { D_80183E50[0] = arg1[0]; D_80183E50[1] = func_802ABE30(arg1[0], 0.0f, arg1[2], arg0->unk3A) + 0.8; D_80183E50[2] = arg1[2]; - rsp_set_matrix_transl_rot_scale(D_80183E50, arg0->unk60, arg2); + rsp_set_matrix_transl_rot_scale(D_80183E50, arg0->orientationVector, arg2); gSPDisplayList(gDisplayListHead++, D_0D007B98); } } @@ -4239,7 +4239,7 @@ void func_800568A0(s32 objectIndex, s32 playerId) { D_80183E50[0] = gObjectList[objectIndex].pos[0]; D_80183E50[1] = gObjectList[objectIndex].unk_044 + 0.8; D_80183E50[2] = gObjectList[objectIndex].pos[2]; - set_transform_matrix(sp30, player->unk_110.unk60, D_80183E50, 0U, 0.5f); + set_transform_matrix(sp30, player->unk_110.orientationVector, D_80183E50, 0U, 0.5f); convert_to_fixed_point_matrix(&gGfxPool->mtxHud[gMatrixHudCount], sp30); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gDisplayListHead++, D_0D007B98); @@ -4338,15 +4338,15 @@ void func_80056E24(s32 bombIndex, Vec3f arg1) { } void func_80056FCC(s32 bombIndex) { - Mat4 sp30; + Mat4 mat; BombKart *temp_v0; temp_v0 = &gBombKarts[bombIndex]; D_80183E50[0] = temp_v0->bombPos[0]; D_80183E50[1] = temp_v0->yPos + 1.0; D_80183E50[2] = temp_v0->bombPos[2]; - set_transform_matrix(sp30, D_80164038[bombIndex].unk60, D_80183E50, 0U, 0.5f); - convert_to_fixed_point_matrix(&gGfxPool->mtxHud[gMatrixHudCount], sp30); + set_transform_matrix(mat, D_80164038[bombIndex].orientationVector, D_80183E50, 0U, 0.5f); + convert_to_fixed_point_matrix(&gGfxPool->mtxHud[gMatrixHudCount], mat); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]), G_MTX_LOAD | G_MTX_NOPUSH| G_MTX_MODELVIEW); gSPDisplayList(gDisplayListHead++, D_0D007B98); } diff --git a/src/hud_renderer.h b/src/hud_renderer.h index 46e99ca46..c38a553a8 100644 --- a/src/hud_renderer.h +++ b/src/hud_renderer.h @@ -445,7 +445,6 @@ extern f32 D_8018CFF4; extern s16 D_8018D2E0; extern s16 D_8018D2E8; -extern s32 D_8018D400; extern u8* D_8018D4BC; extern u8* D_8018D4C0; diff --git a/src/main.c b/src/main.c index 8af6eb580..c7594763b 100644 --- a/src/main.c +++ b/src/main.c @@ -125,7 +125,7 @@ f32 gCameraZoom[4]; // look like to be the fov of each character //f32 D_8015013C; UNUSED s32 D_80150140; UNUSED s32 D_80150144; -f32 D_80150148; +f32 gScreenAspect; f32 D_8015014C; f32 D_80150150; UNUSED f32 D_80150154; diff --git a/src/main.h b/src/main.h index 2028d6f76..6c715d9dd 100644 --- a/src/main.h +++ b/src/main.h @@ -171,7 +171,7 @@ extern s32 D_80150120; extern s32 gMenuSelectionFromQuit; extern f32 gCameraZoom[]; -extern f32 D_80150148; +extern f32 gScreenAspect; extern f32 D_8015014C; extern f32 D_80150150; diff --git a/src/player_controller.c b/src/player_controller.c index 1c7b45c98..a973dd3b1 100644 --- a/src/player_controller.c +++ b/src/player_controller.c @@ -2249,18 +2249,18 @@ void func_8002D268(Player *player, UNUSED Camera *camera, s8 arg2, s8 playerId) player->unk_064[2] *= -1.0f; } if ((player->boundingBoxCorners[2].surfaceType == 1) && (player->boundingBoxCorners[3].surfaceType == 1)) { - spB4 = (-1 * (player->unk_064[0] + sp16C[0])) + ((-player->unk_110.unk60[0] * player->kartGravity) * 0.925); - spB0 = (-player->unk_110.unk60[1] * player->kartGravity); - spAC = (-1 * (player->unk_064[2] + sp16C[2])) + ((-player->unk_110.unk60[2] * player->kartGravity) * 0.925); + spB4 = (-1 * (player->unk_064[0] + sp16C[0])) + ((-player->unk_110.orientationVector[0] * player->kartGravity) * 0.925); + spB0 = (-player->unk_110.orientationVector[1] * player->kartGravity); + spAC = (-1 * (player->unk_064[2] + sp16C[2])) + ((-player->unk_110.orientationVector[2] * player->kartGravity) * 0.925); } else { temp3 = (((player->unk_094 / 18.0f) * 216.0f) / 10.0f); if (temp3 >= 10) { temp3 = 10; } - spB4 = -1 * (player->unk_064[0] + sp16C[0]) + ((-player->unk_110.unk60[0] * player->kartGravity) * sp104[temp3]); - spB0 = (-player->unk_110.unk60[1] * player->kartGravity); - spAC = -1 * (player->unk_064[2] + sp16C[2]) + ((-player->unk_110.unk60[2] * player->kartGravity) * sp104[temp3]); + spB4 = -1 * (player->unk_064[0] + sp16C[0]) + ((-player->unk_110.orientationVector[0] * player->kartGravity) * sp104[temp3]); + spB0 = (-player->unk_110.orientationVector[1] * player->kartGravity); + spAC = -1 * (player->unk_064[2] + sp16C[2]) + ((-player->unk_110.orientationVector[2] * player->kartGravity) * sp104[temp3]); } if (((player->effects & 8) != 8) && ((player->effects & 0x20) == 0x20)) { spB4 = 0 * (player->unk_064[0] + sp16C[0]); @@ -2548,9 +2548,9 @@ void func_8002E594(Player *player, UNUSED Camera *camera, s8 arg2, s8 arg3) { if ((((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40)) || ((player->effects & 0x20000) == 0x20000)) { - sp80 = -1 * (player->unk_064[0]) + (((-player->unk_110.unk60[0]) * player->kartGravity) * 0.1); - sp7C = (-player->unk_110.unk60[1]) * player->kartGravity; - sp78 = -1 * (player->unk_064[2]) + (((-player->unk_110.unk60[2]) * player->kartGravity) * 0.1); + sp80 = -1 * (player->unk_064[0]) + (((-player->unk_110.orientationVector[0]) * player->kartGravity) * 0.1); + sp7C = (-player->unk_110.orientationVector[1]) * player->kartGravity; + sp78 = -1 * (player->unk_064[2]) + (((-player->unk_110.orientationVector[2]) * player->kartGravity) * 0.1); } else { sp80 = -1 * player->unk_064[0]; sp7C = -1 * player->kartGravity; diff --git a/src/racing/actors.c b/src/racing/actors.c index 49a65aa5c..805ac6751 100644 --- a/src/racing/actors.c +++ b/src/racing/actors.c @@ -359,9 +359,9 @@ void func_802976EC(Collision *arg0, Vec3s arg1) { } //sp1C = arg0->unk30; - x = arg0->unk60[0]; - y = arg0->unk60[1]; - z = arg0->unk60[2]; + x = arg0->orientationVector[0]; + y = arg0->orientationVector[1]; + z = arg0->orientationVector[2]; arg1[0] = atan2s(z, y) + 0x4000; arg1[1] = 0; diff --git a/src/racing/actors_extended.c b/src/racing/actors_extended.c index de5920df5..c7ae6b26a 100644 --- a/src/racing/actors_extended.c +++ b/src/racing/actors_extended.c @@ -28,7 +28,7 @@ void func_802B0210(Collision *arg0, Collision *arg1) { vec3f_copy_return(arg1->unk48, arg0->unk48); vec3f_copy_return(arg1->unk54, arg0->unk54); - vec3f_copy_return(arg1->unk60, arg0->unk60); + vec3f_copy_return(arg1->orientationVector, arg0->orientationVector); } void func_802B02B4(struct ShellActor *shell, s32 shellType) { @@ -769,9 +769,9 @@ void update_actor_banana(struct BananaActor *banana) { func_802ADDC8(&banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]); banana->unk30.unk34 = 1; if ((banana->unk30.unk34 != 0) && (banana->unk30.unk3C[2] < 0.0f)) { - someOtherVelocity[0] = -banana->unk30.unk60[0]; - someOtherVelocity[1] = -banana->unk30.unk60[1]; - someOtherVelocity[2] = -banana->unk30.unk60[2]; + someOtherVelocity[0] = -banana->unk30.orientationVector[0]; + someOtherVelocity[1] = -banana->unk30.orientationVector[1]; + someOtherVelocity[2] = -banana->unk30.orientationVector[2]; banana->pos[0] += someOtherVelocity[0] * banana->unk30.unk3C[2]; banana->pos[1] += someOtherVelocity[1] * banana->unk30.unk3C[2]; banana->pos[2] += someOtherVelocity[2] * banana->unk30.unk3C[2]; @@ -1770,9 +1770,9 @@ void update_actor_red_blue_shell(struct ShellActor *shell) { void func_802B4E30(struct Actor *arg0) { if ((arg0->unk30.unk3C[2] < 0.0f) && (arg0->unk30.unk34 == 1)) { - arg0->pos[0] -= (arg0->unk30.unk60[0] * arg0->unk30.unk3C[2]); - arg0->pos[1] -= (arg0->unk30.unk60[1] * arg0->unk30.unk3C[2]); - arg0->pos[2] -= (arg0->unk30.unk60[2] * arg0->unk30.unk3C[2]); + arg0->pos[0] -= (arg0->unk30.orientationVector[0] * arg0->unk30.unk3C[2]); + arg0->pos[1] -= (arg0->unk30.orientationVector[1] * arg0->unk30.unk3C[2]); + arg0->pos[2] -= (arg0->unk30.orientationVector[2] * arg0->unk30.unk3C[2]); } if ((arg0->unk30.unk3C[0] < 0.0f) && (arg0->unk30.unk30 == 1)) { arg0->pos[0] -= (arg0->unk30.unk48[0] * arg0->unk30.unk3C[0]); diff --git a/src/racing/collision.c b/src/racing/collision.c index 0a7025a87..0411c3172 100644 --- a/src/racing/collision.c +++ b/src/racing/collision.c @@ -36,7 +36,7 @@ void func_802AAAAC(Collision *collision) { collision->unk3C[2] = 0; vec3f_set(collision->unk48, 0.0f, 0.0f, 1.0f); vec3f_set(collision->unk54, 1.0f, 0.0f, 0.0f); - vec3f_set(collision->unk60, 0.0f, 1.0f, 0.0f); + vec3f_set(collision->orientationVector, 0.0f, 1.0f, 0.0f); } f32 func_802AAB4C(Player *player) { @@ -196,9 +196,9 @@ s32 func_802AAE4C(Collision *collision, f32 boundingBoxSize, f32 posX, f32 posY, collision->unk34 = 1; collision->unk3A = index; collision->unk3C[2] = temp_f0_5; - collision->unk60[0] = surfaceMap->height; - collision->unk60[1] = surfaceMap->gravity; - collision->unk60[2] = surfaceMap->rotation; + collision->orientationVector[0] = surfaceMap->height; + collision->orientationVector[1] = surfaceMap->gravity; + collision->orientationVector[2] = surfaceMap->rotation; } return 0; } @@ -207,9 +207,9 @@ s32 func_802AAE4C(Collision *collision, f32 boundingBoxSize, f32 posX, f32 posY, collision->unk34 = 1; collision->unk3A = index; collision->unk3C[2] = temp_f0_5; - collision->unk60[0] = surfaceMap->height; - collision->unk60[1] = surfaceMap->gravity; - collision->unk60[2] = surfaceMap->rotation; + collision->orientationVector[0] = surfaceMap->height; + collision->orientationVector[1] = surfaceMap->gravity; + collision->orientationVector[2] = surfaceMap->rotation; return 1; } return 0; @@ -848,9 +848,9 @@ s32 is_colliding_with_drivable_surface(Collision *collision, f32 boundingBoxSize collision->unk34 = 1; collision->unk3A = index; collision->unk3C[2] = temp_f0_4 - boundingBoxSize; - collision->unk60[0] = tile->height; - collision->unk60[1] = tile->gravity; - collision->unk60[2] = tile->rotation; + collision->orientationVector[0] = tile->height; + collision->orientationVector[1] = tile->gravity; + collision->orientationVector[2] = tile->rotation; } return 0; } @@ -863,9 +863,9 @@ s32 is_colliding_with_drivable_surface(Collision *collision, f32 boundingBoxSize collision->unk34 = 1; collision->unk3A = index; collision->unk3C[2] = temp_f0_4 - boundingBoxSize; - collision->unk60[0] = tile->height; - collision->unk60[1] = tile->gravity; - collision->unk60[2] = tile->rotation; + collision->orientationVector[0] = tile->height; + collision->orientationVector[1] = tile->gravity; + collision->orientationVector[2] = tile->rotation; return 1; } @@ -2197,7 +2197,7 @@ u16 process_collision(Player *player, KartBoundingBoxCorner *corner, f32 cornerP temp_f0 = func_802ABE30(cornerPos1, cornerPos2, cornerPos3, corner->surfaceMapIndex); if (!(player->pos[1] < temp_f0) && !((2 * boundingBoxSize) < (player->pos[1] - temp_f0))) { corner->cornerGroundY = temp_f0; - subtract_scaled_vector(collision->unk60, collision->unk3C[2], corner->cornerPos); + subtract_scaled_vector(collision->orientationVector, collision->unk3C[2], corner->cornerPos); return 1; } } @@ -2249,7 +2249,7 @@ u16 process_collision(Player *player, KartBoundingBoxCorner *corner, f32 cornerP temp_f0 = func_802ABE30(cornerPos1, cornerPos2, cornerPos3, surfaceMapIndex); if (!(player->pos[1] < temp_f0) && !((2 * boundingBoxSize) < (player->pos[1] - temp_f0))) { - subtract_scaled_vector(collision->unk60, collision->unk3C[2], corner->cornerPos); + subtract_scaled_vector(collision->orientationVector, collision->unk3C[2], corner->cornerPos); corner->cornerGroundY = temp_f0; corner->surfaceType = (u8) gSurfaceMap[surfaceMapIndex].surfaceType; corner->surfaceFlags = 0x40; diff --git a/src/racing/race_logic.c b/src/racing/race_logic.c index 1d0ce9b50..f4ddc1a33 100644 --- a/src/racing/race_logic.c +++ b/src/racing/race_logic.c @@ -210,7 +210,7 @@ void func_8028E438(void) { if (temp_v0->screenStartX == 160) { phi_v1_4++; } - D_80150148 = (f32) ((f32) temp_v0->screenWidth / (f32) temp_v0->screenHeight); + gScreenAspect = (f32) ((f32) temp_v0->screenWidth / (f32) temp_v0->screenHeight); if (phi_v1_4 == 4) { D_8015F894 = 2; gActiveScreenMode = SCREEN_MODE_1P; @@ -292,7 +292,7 @@ void func_8028E678(void) { phi_a0_10++; } - D_80150148 = (f32) ((f32) D_800DC5EC->screenWidth / (f32) D_800DC5EC->screenHeight); + gScreenAspect = (f32) ((f32) D_800DC5EC->screenWidth / (f32) D_800DC5EC->screenHeight); if (phi_a0_10 == 4) { D_8015F894 = 3; func_80092500(); @@ -326,7 +326,7 @@ void func_8028E678(void) { phi_a0_10++; } - D_80150148 = (f32) ((f32) D_800DC5EC->screenWidth / (f32) D_800DC5EC->screenHeight); + gScreenAspect = (f32) ((f32) D_800DC5EC->screenWidth / (f32) D_800DC5EC->screenHeight); if (phi_a0_10 == 4) { D_8015F894 = 3; func_80092500(); @@ -349,7 +349,7 @@ void func_8028E678(void) { D_800DC5F0->screenStartY = D_800DC5EC->screenStartY; gActiveScreenMode = SCREEN_MODE_2P_SPLITSCREEN_VERTICAL; - D_80150148 = 1.33333337; + gScreenAspect = 1.33333337; gPlayerCountSelection1 = 2; func_8003DB5C(); func_8005994C(); diff --git a/src/racing/skybox_and_splitscreen.c b/src/racing/skybox_and_splitscreen.c index da7a184fc..094a11e16 100644 --- a/src/racing/skybox_and_splitscreen.c +++ b/src/racing/skybox_and_splitscreen.c @@ -462,7 +462,7 @@ void func_802A4A0C(Vtx *vtx, struct UnkStruct_800DC5EC *arg1, UNUSED s32 arg2, U sp5C[0] = 0.0f; sp5C[1] = 0.0f; sp5C[2] = 30000.0f; - func_802B5564(matrix1, &sp128, camera->unk_B4, D_80150148, D_80150150, D_8015014C, 1.0f); + func_802B5564(matrix1, &sp128, camera->unk_B4, gScreenAspect, D_80150150, D_8015014C, 1.0f); func_802B5794(matrix2, camera->pos, camera->lookAt); mtxf_multiplication(matrix3, matrix1, matrix2); @@ -551,16 +551,16 @@ void func_802A4D18(void) { } switch (gScreenModeSelection) { /* switch 1; irregular */ case SCREEN_MODE_1P: /* switch 1 */ - D_80150148 = 1.33333334f; + gScreenAspect = 1.33333334f; return; case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: /* switch 1 */ - D_80150148 = 0.66666667f; + gScreenAspect = 0.66666667f; return; case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: /* switch 1 */ - D_80150148 = 2.66666667f; + gScreenAspect = 2.66666667f; return; case SCREEN_MODE_3P_4P_SPLITSCREEN: /* switch 1 */ - D_80150148 = 1.33333334f; + gScreenAspect = 1.33333334f; return; } } @@ -778,7 +778,7 @@ void func_802A59A4(void) { Mat4 matrix; #ifdef VERSION_EU - sp9C = D_80150148 * 1.2f; + sp9C = gScreenAspect * 1.2f; #endif func_802A53A4(); init_rdp(); @@ -788,7 +788,7 @@ void func_802A59A4(void) { #ifdef VERSION_EU guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], sp9C, D_80150150, D_8015014C, 1.0f); #else - guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], gScreenAspect, D_80150150, D_8015014C, 1.0f); #endif gSPPerspNormalize(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); @@ -835,7 +835,7 @@ void func_802A5CB4(void) { func_802A50EC(); #ifdef VERSION_EU - sp9C = D_80150148 * 1.2f; + sp9C = gScreenAspect * 1.2f; #endif init_rdp(); func_802A3730(D_800DC5EC); @@ -843,7 +843,7 @@ void func_802A5CB4(void) { #ifdef VERSION_EU guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], sp9C, D_80150150, D_8015014C, 1.0f); #else - guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], gScreenAspect, D_80150150, D_8015014C, 1.0f); #endif gSPPerspNormalize(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); @@ -894,13 +894,13 @@ void func_802A5FAC(void) { init_rdp(); func_802A3730(D_800DC5F0); #ifdef VERSION_EU - sp9C = D_80150148 * 1.2f; + sp9C = gScreenAspect * 1.2f; #endif gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); #ifdef VERSION_EU guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, gCameraZoom[1], sp9C, D_80150150, D_8015014C, 1.0f); #else - guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, gCameraZoom[1], D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, gCameraZoom[1], gScreenAspect, D_80150150, D_8015014C, 1.0f); #endif gSPPerspNormalize(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); @@ -951,13 +951,13 @@ void func_802A62A4(void) { init_rdp(); func_802A3730(D_800DC5EC); #ifdef VERSION_EU - sp9C = D_80150148 * 1.2f; + sp9C = gScreenAspect * 1.2f; #endif gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); #ifdef VERSION_EU guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], sp9C, D_80150150, D_8015014C, 1.0f); #else - guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], gScreenAspect, D_80150150, D_8015014C, 1.0f); #endif gSPPerspNormalize(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); @@ -1009,13 +1009,13 @@ void func_802A65B8(void) { init_rdp(); func_802A3730(D_800DC5F0); #ifdef VERSION_EU - sp9C = D_80150148 * 1.2f; + sp9C = gScreenAspect * 1.2f; #endif gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); #ifdef VERSION_EU guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, gCameraZoom[1], sp9C, D_80150150, D_8015014C, 1.0f); #else - guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, gCameraZoom[1], D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, gCameraZoom[1], gScreenAspect, D_80150150, D_8015014C, 1.0f); #endif gSPPerspNormalize(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); @@ -1059,7 +1059,7 @@ void func_802A68CC(void) { Mat4 matrix; #ifdef VERSION_EU f32 sp9C; - sp9C = D_80150148 * 1.2f; + sp9C = gScreenAspect * 1.2f; #endif func_802A54A8(); @@ -1069,7 +1069,7 @@ void func_802A68CC(void) { #ifdef VERSION_EU guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], sp9C, D_80150150, D_8015014C, 1.0f); #else - guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[0], &perspNorm, gCameraZoom[0], gScreenAspect, D_80150150, D_8015014C, 1.0f); #endif gSPPerspNormalize(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); @@ -1113,7 +1113,7 @@ void func_802A6BB0(void) { Mat4 matrix; #ifdef VERSION_EU f32 sp9C; - sp9C = D_80150148 * 1.2f; + sp9C = gScreenAspect * 1.2f; #endif func_802A5590(); @@ -1123,7 +1123,7 @@ void func_802A6BB0(void) { #ifdef VERSION_EU guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, gCameraZoom[1], sp9C, D_80150150, D_8015014C, 1.0f); #else - guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, gCameraZoom[1], D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[1], &perspNorm, gCameraZoom[1], gScreenAspect, D_80150150, D_8015014C, 1.0f); #endif gSPPerspNormalize(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); @@ -1167,7 +1167,7 @@ void func_802A6E94(void) { Mat4 matrix; #ifdef VERSION_EU f32 sp9C; - sp9C = D_80150148 * 1.2f; + sp9C = gScreenAspect * 1.2f; #endif func_802A5678(); @@ -1178,7 +1178,7 @@ void func_802A6E94(void) { #ifdef VERSION_EU guPerspective(&gGfxPool->mtxPersp[2], &perspNorm, gCameraZoom[2], sp9C, D_80150150, D_8015014C, 1.0f); #else - guPerspective(&gGfxPool->mtxPersp[2], &perspNorm, gCameraZoom[2], D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[2], &perspNorm, gCameraZoom[2], gScreenAspect, D_80150150, D_8015014C, 1.0f); #endif gSPPerspNormalize(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[2]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); @@ -1222,7 +1222,7 @@ void func_802A7178(void) { Mat4 matrix; #ifdef VERSION_EU f32 sp9C; - sp9C = D_80150148 * 1.2f; + sp9C = gScreenAspect * 1.2f; #endif func_802A5760(); @@ -1242,7 +1242,7 @@ void func_802A7178(void) { #ifdef VERSION_EU guPerspective(&gGfxPool->mtxPersp[3], &perspNorm, gCameraZoom[3], sp9C, D_80150150, D_8015014C, 1.0f); #else - guPerspective(&gGfxPool->mtxPersp[3], &perspNorm, gCameraZoom[3], D_80150148, D_80150150, D_8015014C, 1.0f); + guPerspective(&gGfxPool->mtxPersp[3], &perspNorm, gCameraZoom[3], gScreenAspect, D_80150150, D_8015014C, 1.0f); #endif gSPPerspNormalize(gDisplayListHead++, perspNorm); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[3]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); diff --git a/src/render_player.c b/src/render_player.c index c55c5a30c..b4b75f5f5 100644 --- a/src/render_player.c +++ b/src/render_player.c @@ -1249,9 +1249,9 @@ void render_player_shadow(Player *player, s8 arg1, s8 arg2) { var_f2 = (f32) (1.0 - ((f64) player->unk_110.unk3C[2] * 0.02)); if (var_f2 < 0.0f) {var_f2 = 0.0f;} if (var_f2 > 1.0f) {var_f2 = 1.0f;} - spB4[0] = player->unk_110.unk60[0]; - spB4[2] = player->unk_110.unk60[2]; - spB4[1] = player->unk_110.unk60[1]; + spB4[0] = player->unk_110.orientationVector[0]; + spB4[2] = player->unk_110.orientationVector[2]; + spB4[1] = player->unk_110.orientationVector[1]; spCC[0] = player->pos[0] + ((spB0 * sins(spC0)) + (spAC * coss(spC0))); spCC[1] = player->unk_074 + 1.0f; diff --git a/src/spawn_players.c b/src/spawn_players.c index ca072c4ea..87bdd6d1c 100644 --- a/src/spawn_players.c +++ b/src/spawn_players.c @@ -346,9 +346,9 @@ void spawn_player(Player *player, s8 playerIndex, f32 startingRow, f32 startingC player->unk_110.unk54[0] = 0.0f; player->unk_110.unk54[1] = 0.0f; player->unk_110.unk54[2] = 0.0f; - player->unk_110.unk60[0] = 0.0f; - player->unk_110.unk60[1] = 0.0f; - player->unk_110.unk60[2] = 0.0f; + player->unk_110.orientationVector[0] = 0.0f; + player->unk_110.orientationVector[1] = 0.0f; + player->unk_110.orientationVector[2] = 0.0f; D_80165300[playerIndex] = 0; D_8018CE10[playerIndex].unk_04[0] = 0.0f; diff --git a/tools/doxygen_syms.md b/tools/doxygen_syms.md index 1eb0104bf..b0395a8d8 100644 --- a/tools/doxygen_syms.md +++ b/tools/doxygen_syms.md @@ -4006,7 +4006,7 @@ Variable Name | Memory Address [gCameraZoom](@ref gCameraZoom) | 0x80150130 [D_80150140](@ref D_80150140) | 0x80150140 [D_80150144](@ref D_80150144) | 0x80150144 -[D_80150148](@ref D_80150148) | 0x80150148 +[gScreenAspect](@ref gScreenAspect) | 0x80150148 [D_8015014C](@ref D_8015014C) | 0x8015014C [D_80150150](@ref D_80150150) | 0x80150150 [D_80150154](@ref D_80150154) | 0x80150154