Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -461,4 +461,4 @@ enum PLACE { FIRST_PLACE, SECOND_PLACE, THIRD_PLACE, FOURTH_PLACE };
*
*/
#define MIN_LAPS 0
#define MAX_LAPS 3
#define MAX_LAPS CVarGetInteger("gNumLaps", 3)
80 changes: 60 additions & 20 deletions src/code_80057C60.c
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ void func_80059358(void) {
void render_hud_2p_horizontal_player_two_horizontal_player_one(void) {
if (gHUDDisable == 0) {
render_hud_timer(PLAYER_ONE);
if (playerHUD[PLAYER_ONE].lapCount != 3) {
if (playerHUD[PLAYER_ONE].lapCount != MAX_LAPS) {
draw_hud_2d_texture_32x8(playerHUD[PLAYER_ONE].lapX, playerHUD[PLAYER_ONE].lapY,
(u8*) common_texture_hud_lap); // draw the lap word
draw_lap_count(playerHUD[PLAYER_ONE].lapX + 0xC, playerHUD[PLAYER_ONE].lapY - 4,
Expand All @@ -1082,7 +1082,7 @@ void func_800593F0(void) {
void render_hud_2p_horizontal_player_two(void) {
if (gHUDDisable == 0) {
render_hud_timer(PLAYER_TWO);
if (playerHUD[PLAYER_TWO].lapCount != 3) {
if (playerHUD[PLAYER_TWO].lapCount != MAX_LAPS) {
draw_hud_2d_texture_32x8(playerHUD[PLAYER_TWO].lapX, playerHUD[PLAYER_TWO].lapY,
(u8*) common_texture_hud_lap);
draw_lap_count(playerHUD[PLAYER_TWO].lapX + 0xC, playerHUD[PLAYER_TWO].lapY - 4,
Expand Down Expand Up @@ -2571,7 +2571,7 @@ void func_8005CB60(s32 playerId, s32 lapCount) {
}
playerHUD[playerId].someTimer1 = playerHUD[playerId].lapDurations[*huh];
playerHUD[playerId].blinkTimer = 0x003C;
if (lapCount == 3) {
if (lapCount == MAX_LAPS) {
playerHUD[playerId].someTimer = playerHUD[playerId].lapCompletionTimes[*huh];
}
if (gModeSelection == (s32) 1) {
Expand All @@ -2584,7 +2584,7 @@ void func_8005CB60(s32 playerId, s32 lapCount) {
D_80165658[lapCount - 1] = 1;
D_801657E3 = 1;
}
if ((lapCount == 3) && ((u32) playerHUD[playerId].someTimer < (u32) D_80165648)) {
if ((lapCount == MAX_LAPS) && ((u32) playerHUD[playerId].someTimer < (u32) D_80165648)) {
D_801657E5 = 1;
}
}
Expand All @@ -2594,21 +2594,17 @@ void func_8005CB60(s32 playerId, s32 lapCount) {
}
*huhthedeuce += 1;
if (1) {}
switch (*huhthedeuce) { /* switch 1; irregular */
case 0: /* switch 1 */
break;
case 1: /* switch 1 */
CM_ActivateSecondLapLakitu(playerId); // func_80079084(playerId);
func_800C9060(playerId, SOUND_ARG_LOAD(0x19, 0x00, 0xF0, 0x15));
if ((IsLuigiRaceway()) && (D_80165898 == 0) && (gModeSelection != (s32) TIME_TRIALS)) {
D_80165898 = 1;
}
break;
case 2: /* switch 1 */
CM_ActivateFinalLapLakitu(playerId); // func_800790B4(playerId);
break;
case 3: /* switch 1 */
if ((D_8018D114 == 0) || (D_8018D114 == 1)) {

if (*huhthedeuce == 1) {
Copy link
Copy Markdown
Contributor

@coco875 coco875 Jul 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe just replay the animation of lakitu for each lap to have an animation even if it's incorect

Copy link
Copy Markdown
Contributor Author

@MegaMech MegaMech Jul 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, nothing should happen between the extra laps which is kinda okay. This could be done. I'm not really sure what's best though.
Like do we really want lakitu to say "2nd" lap when it's wrong? Or "Final lap?" when it's wrong?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the best is just lakitu who say next lap. But do how you want

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps a 'next lap' function could be made. And it gets used if a next lap lakitu texture exists?

CM_ActivateSecondLapLakitu(playerId); // func_80079084(playerId);
func_800C9060(playerId, SOUND_ARG_LOAD(0x19, 0x00, 0xF0, 0x15));
if ((IsLuigiRaceway()) && (D_80165898 == 0) && (gModeSelection != (s32) TIME_TRIALS)) {
D_80165898 = 1;
}
} else if (*huhthedeuce == MAX_LAPS - 1) {
CM_ActivateFinalLapLakitu(playerId); // func_800790B4(playerId);
} else if (*huhthedeuce == MAX_LAPS) {
if ((D_8018D114 == 0) || (D_8018D114 == 1)) {
gHUDModes = 0;
D_801657E6 = 0;
D_801657F0 = 0;
Expand Down Expand Up @@ -2636,8 +2632,52 @@ void func_8005CB60(s32 playerId, s32 lapCount) {
D_8018D1CC = 0x00000064;
}
}
break;
}

// switch (*huhthedeuce) { /* switch 1; irregular */
// case 0: /* switch 1 */
// break;
// case 1: /* switch 1 */
// CM_ActivateSecondLapLakitu(playerId); // func_80079084(playerId);
// func_800C9060(playerId, SOUND_ARG_LOAD(0x19, 0x00, 0xF0, 0x15));
// if ((IsLuigiRaceway()) && (D_80165898 == 0) && (gModeSelection != (s32) TIME_TRIALS)) {
// D_80165898 = 1;
// }
// break;
// case 2: /* switch 1 */
// CM_ActivateFinalLapLakitu(playerId); // func_800790B4(playerId);
// break;
// case 3: /* switch 1 */
// if ((D_8018D114 == 0) || (D_8018D114 == 1)) {
// gHUDModes = 0;
// D_801657E6 = 0;
// D_801657F0 = 0;
// D_801657E8 = 1;
// D_80165800[0] = 1;
// D_80165800[1] = 1;
// D_8018D204 = (s32) 1;
// }
// playerHUD[playerId].raceCompleteBool = 1;
// if (D_8018D114 == 2) {
// D_80165800[playerId] = 0;
// }
// if (IsYoshiValley()) {
// playerHUD[playerId].unk_81 = 1;
// }
// playerHUD[playerId].lap1CompletionTimeX = 0x0140;
// playerHUD[playerId].lap2CompletionTimeX = 0x01E0;
// playerHUD[playerId].lap3CompletionTimeX = 0x0280;
// playerHUD[playerId].totalTimeX = 0x0320;
// D_8016587C = (s32) 1;
// if (D_8018D20C == 0) {
// CM_ActivateFinishLakitu(playerId); // func_80079054(playerId);
// D_8018D20C = 1;
// if (gPlayerCount == (s8) 1) {
// D_8018D1CC = 0x00000064;
// }
// }
// break;
// }
}
} else {
f32_step_towards(&playerHUD[playerId].rankScaling, 1.0f, 0.125f);
Expand Down
2 changes: 1 addition & 1 deletion src/code_8006E9C0.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ void func_8006FA94(void) {
gHUDDisable = D_8018D214;
D_801657AE = gHUDDisable;
D_8018D20C = 0;
D_8018D320 = 3;
D_8018D320 = MAX_LAPS;
D_8018D2AC = 0;
D_8018D2BC = 0;
D_8018D2B4 = D_8018D2BC;
Expand Down
6 changes: 3 additions & 3 deletions src/port/ui/PortMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,9 @@
AddSidebarEntry("Enhancements", "Rulesets", 3);

// Requires more testing
// AddWidget(path, "Number of Laps", WIDGET_CVAR_SLIDER_INT)
// .CVar("gNumLaps")
// .Options(UIWidgets::IntSliderOptions().Min().Max(20).Step(1).DefaultValue(3));
AddWidget(path, "Number of Laps", WIDGET_CVAR_SLIDER_INT)
.CVar("gNumLaps")
.Options(UIWidgets::IntSliderOptions().Min().Max(20).Step(1).DefaultValue(3));

Check failure on line 440 in src/port/ui/PortMenu.cpp

View workflow job for this annotation

GitHub Actions / build

too few arguments to function call, single argument 'min_' was not specified

AddWidget(path, "No Itemboxes", WIDGET_CVAR_CHECKBOX)
.CVar("gDisableItemboxes")
Expand Down
6 changes: 3 additions & 3 deletions src/racing/race_logic.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ void func_8028EF28(void) {
gPlayers[i].lapCount++;

if ((gPlayers[i].type & PLAYER_HUMAN) != 0) {
if (gPlayers[i].lapCount == 3) {
if (gPlayers[i].lapCount == MAX_LAPS) {
func_8028EEF0(i);

currentPosition = gPlayers[i].currentRank;
Expand Down Expand Up @@ -568,7 +568,7 @@ void func_8028EF28(void) {
}
}

} else if (gPlayers[i].lapCount == 2) {
} else if (gPlayers[i].lapCount == MAX_LAPS - 1) {
if ((gPlayers[i].type & 0x100) != 0) {
return;
}
Expand All @@ -577,7 +577,7 @@ void func_8028EF28(void) {
func_800CA49C((u8) i);
}
}
} else if (gPlayers[i].lapCount == 3) {
} else if (gPlayers[i].lapCount == MAX_LAPS) {
func_8028EEF0(i);
if (gModeSelection == TIME_TRIALS) {
func_80005AE8(player);
Expand Down
10 changes: 5 additions & 5 deletions src/render_objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -2630,13 +2630,13 @@ void func_8004E800(s32 playerId) {
// @port: Tag the transform.
FrameInterpolation_RecordOpenChild("Player place HUD", playerId);
if (playerHUD[playerId].unk_81 != 0) {
if (playerHUD[playerId].lapCount != 3) {
if (playerHUD[playerId].lapCount != MAX_LAPS) { // Not the final lap
func_8004A384(playerHUD[playerId].rankX + playerHUD[playerId].slideRankX,
playerHUD[playerId].rankY + playerHUD[playerId].slideRankY, 0U,
playerHUD[playerId].rankScaling, 0x000000FF, D_800E55F8[D_8018CF98[playerId]], 0, 0x000000FF,
common_texture_hud_place[D_8018CF98[playerId]], D_0D0068F0, 0x00000080, 0x00000040,
0x00000080, 0x00000040);
} else {
} else { // final lap
func_8004A384(playerHUD[playerId].rankX + playerHUD[playerId].slideRankX,
playerHUD[playerId].rankY + playerHUD[playerId].slideRankY, 0U,
playerHUD[playerId].rankScaling, 0x000000FF, D_800E55F8[D_80165594], 0, 0x000000FF,
Expand All @@ -2650,14 +2650,14 @@ void func_8004E800(s32 playerId) {

void func_8004E998(s32 playerId) {
if (playerHUD[playerId].unk_81 != 0) {
if (playerHUD[playerId].lapCount != 3) {
if (playerHUD[playerId].lapCount != MAX_LAPS) { // Not the final lap
func_8004A384(playerHUD[playerId].rankX + playerHUD[playerId].slideRankX,
playerHUD[playerId].rankY + playerHUD[playerId].slideRankY, 0U,
playerHUD[playerId].rankScaling, 0x000000FF,
D_800E5618[gGPCurrentRaceRankByPlayerId[playerId]], 0, 0x000000FF,
D_0D015258[gGPCurrentRaceRankByPlayerId[playerId]], D_0D006030, 0x00000040, 0x00000040,
0x00000040, 0x00000040);
} else {
} else { // The final lap
func_8004A384(playerHUD[playerId].rankX + playerHUD[playerId].slideRankX,
playerHUD[playerId].rankY + playerHUD[playerId].slideRankY, 0U,
playerHUD[playerId].rankScaling, 0x000000FF, D_800E5618[D_80165598], 0, 0x000000FF,
Expand Down Expand Up @@ -3332,7 +3332,7 @@ void func_80050E34(s32 playerId, s32 arg1) {
spB8 = 0;
}

if ((IsYoshiValley()) && (lapCount < 3)) {
if ((IsYoshiValley()) && (lapCount < MAX_LAPS)) {
gSPDisplayList(gDisplayListHead++, D_0D007DB8);
gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_portrait_bomb_kart_and_question_mark);
rsp_load_texture(common_texture_portrait_question_mark, 0x00000020, 0x00000020);
Expand Down
Loading