This commit is contained in:
github-actions[bot] 2025-07-19 23:27:18 +00:00 committed by GitHub
commit 43764f839f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
36 changed files with 613 additions and 499 deletions

View File

@ -822,7 +822,13 @@ typedef short ENVMIX_STATE[40];
/*
* See aEnvMixer for more info.
*/
#define aEnvSetup1Alt(pkt,initialVolReverb,rampReverbL,rampReverbR,rampLeft,rampRight) { Acmd *_a = (Acmd *)pkt; _a->words.w0 = (_SHIFTL(A_ENVSETUP1, 24, 8) | _SHIFTL(initialVolReverb, 16, 8) | (_SHIFTL(rampReverbL, 8, 8)) | _SHIFTL(rampReverbR, 0, 8)); _a->words.w1 = _SHIFTL(rampLeft, 16, 16) | _SHIFTL(rampRight, 0, 16); }
#define aEnvSetup1Alt(pkt, initialVolReverb, rampReverbL, rampReverbR, rampLeft, rampRight) \
{ \
Acmd* _a = (Acmd*) pkt; \
_a->words.w0 = (_SHIFTL(A_ENVSETUP1, 24, 8) | _SHIFTL(initialVolReverb, 16, 8) | \
(_SHIFTL(rampReverbL, 8, 8)) | _SHIFTL(rampReverbR, 0, 8)); \
_a->words.w1 = _SHIFTL(rampLeft, 16, 16) | _SHIFTL(rampRight, 0, 16); \
}
/*
* See aEnvMixer for more info.

View File

@ -172,8 +172,8 @@ s16 func_802B3FD0(Player* owner, struct ShellActor* shell) {
if (gPlayerBalloonCount[playerIndex] < 0) {
continue;
}
// dist_squared_bugged is not quite a 3D distance function, it doubles (rather than squares) the Z difference of the
// positions
// dist_squared_bugged is not quite a 3D distance function, it doubles (rather than squares) the Z difference of
// the positions
playerToShellDistance = dist_squared_bugged(player->pos, shell->pos);
if (playerToShellDistance < smallestDistance) {
smallestDistance = playerToShellDistance;

View File

@ -13,8 +13,7 @@
* @param arg2
*/
void render_actor_cow(Camera* camera, Mat4 arg1, struct Actor* arg2) {
if (distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1],
4000000.0f) < 0) {
if (distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f) < 0) {
return;
}

View File

@ -20,8 +20,8 @@ void render_actor_falling_rock(Camera* camera, struct FallingRock* rock) {
return;
}
height = distance_if_visible(camera->pos, rock->pos, camera->rot[1], 400.0f, gCameraZoom[camera - camera1],
4000000.0f);
height =
distance_if_visible(camera->pos, rock->pos, camera->rot[1], 400.0f, gCameraZoom[camera - camera1], 4000000.0f);
if (height < 0.0f) {
return;

View File

@ -28,8 +28,7 @@ void render_actor_paddle_boat(Camera* arg0, struct PaddleWheelBoat* boat, UNUSED
return;
}
temp =
distance_if_visible(arg0->pos, boat->pos, arg0->rot[1], 90000.0f, gCameraZoom[arg0 - camera1], 9000000.0f);
temp = distance_if_visible(arg0->pos, boat->pos, arg0->rot[1], 90000.0f, gCameraZoom[arg0 - camera1], 9000000.0f);
if (temp < 0.0f) {
return;

View File

@ -20,8 +20,7 @@ void render_actor_palm_tree(Camera* arg0, UNUSED Mat4 arg1, struct PalmTree* arg
return;
}
temp_f0 =
distance_if_visible(arg0->pos, arg2->pos, arg0->rot[1], 0.0f, gCameraZoom[arg0 - camera1], 4000000.0f);
temp_f0 = distance_if_visible(arg0->pos, arg2->pos, arg0->rot[1], 0.0f, gCameraZoom[arg0 - camera1], 4000000.0f);
if (!(temp_f0 < 0.0f)) {
if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {

View File

@ -13,8 +13,8 @@
void render_actor_railroad_crossing(Camera* arg0, struct RailroadCrossing* rr_crossing) {
UNUSED Vec3s sp80 = { 0, 0, 0 };
Mat4 sp40;
f32 unk = distance_if_visible(arg0->pos, rr_crossing->pos, arg0->rot[1], 0.0f, gCameraZoom[arg0 - camera1],
4000000.0f);
f32 unk =
distance_if_visible(arg0->pos, rr_crossing->pos, arg0->rot[1], 0.0f, gCameraZoom[arg0 - camera1], 4000000.0f);
if (!(unk < 0.0f)) {
mtxf_rotate_zxy_translate(sp40, rr_crossing->pos, rr_crossing->rot);

View File

@ -17,8 +17,7 @@ void render_actor_school_bus(Camera* arg0, struct Actor* arg1) {
UNUSED s32 pad2[32];
f32 temp_f0;
temp_f0 =
distance_if_visible(arg0->pos, arg1->pos, arg0->rot[1], 2500.0f, gCameraZoom[arg0 - camera1], 9000000.0f);
temp_f0 = distance_if_visible(arg0->pos, arg1->pos, arg0->rot[1], 2500.0f, gCameraZoom[arg0 - camera1], 9000000.0f);
if (temp_f0 < 0.0f) {
return;
}

View File

@ -14,8 +14,8 @@ void render_actor_tanker_truck(Camera* camera, struct Actor* arg1) {
UNUSED s32 pad[6];
Mat4 spC8;
UNUSED s32 pad2[32];
f32 temp_f0 = distance_if_visible(camera->pos, arg1->pos, camera->rot[1], 2500.0f,
gCameraZoom[camera - camera1], 9000000.0f);
f32 temp_f0 =
distance_if_visible(camera->pos, arg1->pos, camera->rot[1], 2500.0f, gCameraZoom[camera - camera1], 9000000.0f);
if (!(temp_f0 < 0.0f)) {

View File

@ -19,8 +19,8 @@ void render_actor_train_engine(Camera* camera, struct TrainCar* actor) {
Mat4 spE0;
Mat4 spA0;
f32 distance = distance_if_visible(camera->pos, actor->pos, camera->rot[1], 2500.0f,
gCameraZoom[camera - camera1], 9000000.0f);
f32 distance = distance_if_visible(camera->pos, actor->pos, camera->rot[1], 2500.0f, gCameraZoom[camera - camera1],
9000000.0f);
if (distance < 0.0f) {
return;
@ -166,8 +166,8 @@ void render_actor_train_tender(Camera* camera, struct TrainCar* actor) {
Mat4 spE0;
Mat4 spA0;
f32 temp_f0 = distance_if_visible(camera->pos, actor->pos, camera->rot[1], 625.0f,
gCameraZoom[camera - camera1], 9000000.0f);
f32 temp_f0 =
distance_if_visible(camera->pos, actor->pos, camera->rot[1], 625.0f, gCameraZoom[camera - camera1], 9000000.0f);
if (temp_f0 < 0.0f) {
return;
@ -251,8 +251,8 @@ void render_actor_train_passenger_car(Camera* camera, struct TrainCar* actor) {
Mat4 spE0;
Mat4 spA0;
f32 temp_f0 = distance_if_visible(camera->pos, actor->pos, camera->rot[1], 2025.0f,
gCameraZoom[camera - camera1], 9000000.0f);
f32 temp_f0 = distance_if_visible(camera->pos, actor->pos, camera->rot[1], 2025.0f, gCameraZoom[camera - camera1],
9000000.0f);
if (temp_f0 < 0.0f) {
return;

View File

@ -54,8 +54,7 @@ void render_actor_tree_yoshi_valley(Camera* camera, Mat4 arg1, struct Actor* arg
return;
}
temp_f0 =
distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
temp_f0 = distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
if (temp_f0 < 0.0f) {
return;
@ -89,8 +88,7 @@ void render_actor_tree_royal_raceway(Camera* camera, Mat4 arg1, struct Actor* ar
return;
}
temp_f0 =
distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
temp_f0 = distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
if (temp_f0 < 0.0f) {
return;
@ -124,8 +122,7 @@ void render_actor_tree_moo_moo_farm(Camera* camera, Mat4 arg1, struct Actor* arg
return;
}
temp_f0 =
distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 6250000.0f);
temp_f0 = distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 6250000.0f);
if (temp_f0 < 0.0f) {
return;
@ -153,8 +150,7 @@ void func_80299864(Camera* camera, Mat4 arg1, struct Actor* arg2) {
return;
}
temp_f0 =
distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
temp_f0 = distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
if (temp_f0 < 0.0f) {
return;
@ -192,8 +188,7 @@ void render_actor_tree_bowser_castle(Camera* camera, Mat4 arg1, struct Actor* ar
return;
}
temp_f0 =
distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
temp_f0 = distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
if (temp_f0 < 0.0f) {
return;
@ -227,8 +222,7 @@ void render_actor_bush_bowser_castle(Camera* camera, Mat4 arg1, struct Actor* ar
return;
}
temp_f0 =
distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 640000.0f);
temp_f0 = distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 640000.0f);
if (temp_f0 < 0.0f) {
return;
@ -262,8 +256,7 @@ void render_actor_tree_frappe_snowland(Camera* camera, Mat4 arg1, struct Actor*
return;
}
temp_f0 =
distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
temp_f0 = distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
if (temp_f0 < 0.0f) {
return;
@ -296,8 +289,7 @@ void render_actor_tree_cactus1_kalimari_desert(Camera* camera, Mat4 arg1, struct
return;
}
temp_f0 =
distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
temp_f0 = distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
if (temp_f0 < 0.0f) {
return;
@ -330,8 +322,7 @@ void render_actor_tree_cactus2_kalimari_desert(Camera* camera, Mat4 arg1, struct
return;
}
temp_f0 =
distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
temp_f0 = distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
if (temp_f0 < 0.0f) {
return;
@ -364,8 +355,7 @@ void render_actor_tree_cactus3_kalimari_desert(Camera* camera, Mat4 arg1, struct
return;
}
temp_f0 =
distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
temp_f0 = distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
if (temp_f0 < 0.0f) {
return;

View File

@ -20,8 +20,8 @@ void render_actor_yoshi_egg(Camera* arg0, Mat4 arg1, struct YoshiValleyEgg* egg,
f32 temp_f0;
if (gGamestate != CREDITS_SEQUENCE) {
temp_f0 = distance_if_visible(arg0->pos, egg->pos, arg0->rot[1], 200.0f, gCameraZoom[arg0 - camera1],
16000000.0f);
temp_f0 =
distance_if_visible(arg0->pos, egg->pos, arg0->rot[1], 200.0f, gCameraZoom[arg0 - camera1], 16000000.0f);
if (temp_f0 < 0.0f) {
return;
}

View File

@ -1399,7 +1399,8 @@ struct ActiveSfx {
u32 priority;
u8 soundIndex;
};
#define AUDIO_MK_CMD(b0,b1,b2,b3) ((((b0) & 0xFF) << 0x18) | (((b1) & 0xFF) << 0x10) | (((b2) & 0xFF) << 0x8) | (((b3) & 0xFF) << 0))
#define AUDIO_MK_CMD(b0, b1, b2, b3) \
((((b0) & 0xFF) << 0x18) | (((b1) & 0xFF) << 0x10) | (((b2) & 0xFF) << 0x8) | (((b3) & 0xFF) << 0))
void func_800C4888(u8 bankId) {
u8 j;
u8 numChannels;
@ -1425,7 +1426,8 @@ void func_800C4888(u8 bankId) {
soundIndex = sSoundBanks[bankId][0].next;
k = 0;
while (soundIndex != 0xFF) {
if ((sSoundBanks[bankId][soundIndex].soundStatus == 1) && ((sSoundBanks[bankId][soundIndex].soundBits & 0x08000000) == 0x08000000)) {
if ((sSoundBanks[bankId][soundIndex].soundStatus == 1) &&
((sSoundBanks[bankId][soundIndex].soundBits & 0x08000000) == 0x08000000)) {
sSoundBanks[bankId][soundIndex].freshness -= 1;
}
@ -1437,8 +1439,7 @@ void func_800C4888(u8 bankId) {
if (&D_800EA1C8 == entry[0].unk00) {
entry->distance = 0.0f;
} else {
entry->distance =
(*entry->unk00[0] * *entry->unk00[0]) + (*entry->unk08 * *entry->unk08);
entry->distance = (*entry->unk00[0] * *entry->unk00[0]) + (*entry->unk08 * *entry->unk08);
}
requestedPriority = (((u32) (entry->soundBits & 0xFF00)) >> 8);
if (entry->soundBits & 0x100000) {
@ -2399,8 +2400,9 @@ void func_800C70A8(u8 playerId) {
}
/*
Routine to tell the game which "finish" music to play depending on which mode the player is in (Grand Prix, Time Trials, etc),
whether the game is in multiplayer or not, and which position they ended up finishing in (1st, 2nd, 3rd, etc)
Routine to tell the game which "finish" music to play depending on which mode the player is in (Grand Prix, Time
Trials, etc), whether the game is in multiplayer or not, and which position they ended up finishing in (1st, 2nd,
3rd, etc)
Contains a LOT of inlined funcs.
Modify if you dare.
@ -2958,8 +2960,8 @@ void func_800C90F4(u8 playerId, u32 soundBits) {
}
void func_800C9250(u8 playerIndex) {
func_800C90F4(playerIndex,
(gPlayers[playerIndex].characterId * 0x10) + (gAudioRandom & 1) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x01));
func_800C90F4(playerIndex, (gPlayers[playerIndex].characterId * 0x10) + (gAudioRandom & 1) +
SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x01));
}
void func_800C92CC(u8 playerId, u32 soundBits) {
@ -3378,7 +3380,8 @@ void func_800CA730(u8 playerIndex) {
if (D_800EA0EC[playerIndex] == 0) {
if ((D_800EA108 == 0) && (D_800EA10C[playerIndex] != 0)) {
play_sound(gPlayers[playerIndex].characterId * 0x10 + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x08),
&D_800E9F7C[playerIndex].pos, playerIndex, &D_800EA1D4, &D_800EA1D4, (s8*) &D_800E9F7C[playerIndex].unk_14);
&D_800E9F7C[playerIndex].pos, playerIndex, &D_800EA1D4, &D_800EA1D4,
(s8*) &D_800E9F7C[playerIndex].unk_14);
if (D_800EA10C[playerIndex] != 0) {
if ((s32) D_800EA1C0 >= 2) {
func_800C9018(playerIndex, SOUND_ARG_LOAD(0x01, 0x00, 0xFF, 0x2C));
@ -3420,8 +3423,8 @@ void func_800CA984(u8 playerIndex) {
if ((D_800EA108 == 0) && (D_800EA0F0 == 0)) {
for (i = 0; i < D_800EA1C0 + 1; i++) {
temp_v0_2 =
func_800C1C88(playerIndex, gPlayers[playerIndex].pos, D_800EA1C8, &gPlayers[playerIndex].unk_098, (u8) i, SOUND_ITEM_STAR);
temp_v0_2 = func_800C1C88(playerIndex, gPlayers[playerIndex].pos, D_800EA1C8,
&gPlayers[playerIndex].unk_098, (u8) i, SOUND_ITEM_STAR);
if (temp_v0_2) {
play_sound(SOUND_ITEM_STAR, &temp_v0_2->unk18, i, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC);
}
@ -3499,8 +3502,8 @@ void func_800CADD0(u8 playerIndex, f32 arg1) {
arg1 = 0.0f;
}
D_800EA110[playerIndex] = arg1;
play_sound(0x1900A209U, &D_800E9F7C[playerIndex].pos, playerIndex, &D_800EA1D4, &D_800EA110[playerIndex],
(s8*) &D_800E9F7C[playerIndex].unk_14);
play_sound(0x1900A209U, &D_800E9F7C[playerIndex].pos, playerIndex, &D_800EA1D4,
&D_800EA110[playerIndex], (s8*) &D_800E9F7C[playerIndex].unk_14);
break;
default:
break;
@ -3553,7 +3556,8 @@ void func_800CB064(u8 playerIndex) {
if ((u8) D_800EA168 == 0) {
func_800C36C4(0, 1U, 0x7FU, 0x19);
}
func_800C90F4(playerIndex, gPlayers[playerIndex].characterId * 0x10 + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x08));
func_800C90F4(playerIndex,
gPlayers[playerIndex].characterId * 0x10 + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x08));
func_800C9018(playerIndex, SOUND_ARG_LOAD(0x01, 0x00, 0xFA, 0x4C));
D_800EA170[playerIndex] = 0;
}
@ -3574,18 +3578,23 @@ void begin_losing_ceremony_sequence() {
D_800EA174++;
if (D_800EA174 == 3) {
play_sequence(SEQ_EVENT_CEREMONY_PRESENTATION_PART1); // Begin with Part 1 of the ceremony presentation music --- "Everything seems normal..."
play_sequence(SEQ_EVENT_CEREMONY_PRESENTATION_PART1); // Begin with Part 1 of the ceremony presentation
// music --- "Everything seems normal..."
func_800C3448(0x4000007F);
}
if (D_800EA174 == 300) {
play_sequence(SEQ_EVENT_CEREMONY_PRESENTATION_PART2_WIN); // Follow up with Part 2 of the winning ceremony presentation music --- "Looks like I won...?"
play_sequence(SEQ_EVENT_CEREMONY_PRESENTATION_PART2_WIN); // Follow up with Part 2 of the winning ceremony
// presentation music --- "Looks like I won...?"
func_800C3448(0x4000007F);
play_sequence2(SEQ_EVENT_CEREMONY_PRESENTATION_PART2_LOSE); // Once it ends, begin the LOSING ceremony presentation music, which has a few notes changed to be off-tune --- "Uh oh..."
play_sequence2(SEQ_EVENT_CEREMONY_PRESENTATION_PART2_LOSE); // Once it ends, begin the LOSING ceremony
// presentation music, which has a few notes
// changed to be off-tune --- "Uh oh..."
func_800C3448(0x41000000);
}
if (D_800EA174 == 560) { // (Somewhere in this code it slows down the music, changes the pitch of it and completely breaks the music)
if (D_800EA174 == 560) { // (Somewhere in this code it slows down the music, changes the pitch of it and
// completely breaks the music)
func_800C3448(0x40640000);
func_800C3448(0xB0640073);
func_800C3448(0x4150007F);
@ -3605,11 +3614,13 @@ void begin_losing_ceremony_sequence() {
func_800C3448(0x41320000);
}
if (D_800EA174 == 1200) { // (Player gets hit by the bomb-omb car; play the "explosion" sound effect and the "hurt" voice for the current character)
if (D_800EA174 == 1200) { // (Player gets hit by the bomb-omb car; play the "explosion" sound effect and the
// "hurt" voice for the current character)
func_800C3448(0x110100FF);
}
if (D_800EA174 == 1230) { // Once the music is completely broken by this point, play the "No Trophy For You!" sequence --- "Aw man, I lost... :("
if (D_800EA174 == 1230) { // Once the music is completely broken by this point, play the "No Trophy For You!"
// sequence --- "Aw man, I lost... :("
play_sequence(SEQ_EVENT_CEREMONY_TROPHY_LOSE);
func_800C3448(0x4000007F); // (Play the "losing" voice for the current character, twice)
}

View File

@ -787,7 +787,10 @@ void audio_init(void) {
#ifdef TARGET_N64
// It seems boot.s doesn't clear the .bss area for audio, so do it here.
ptr64 = (u64*) ((u8*) gGfxSPTaskOutputBuffer + sizeof(gGfxSPTaskOutputBuffer));
for (k = ((uintptr_t) &gAudioGlobalsEndMarker - (uintptr_t) ((u64 *)((u8 *) gGfxSPTaskOutputBuffer + sizeof(gGfxSPTaskOutputBuffer))) ) / 8; k >= 0; k--) {
for (k = ((uintptr_t) &gAudioGlobalsEndMarker -
(uintptr_t) ((u64*) ((u8*) gGfxSPTaskOutputBuffer + sizeof(gGfxSPTaskOutputBuffer)))) /
8;
k >= 0; k--) {
*ptr64++ = 0;
}
#endif

View File

@ -567,7 +567,8 @@ Acmd* synthesis_process_note(s32 noteIndex, struct NoteSubEu* noteSubEu, struct
noteSubEu->needsInit = false;
}
cmd = final_resample(cmd, synthesisState, inBuf * 2, resamplingRateFixedPoint, noteSamplesDmemAddrBeforeResampling, flags);
cmd = final_resample(cmd, synthesisState, inBuf * 2, resamplingRateFixedPoint, noteSamplesDmemAddrBeforeResampling,
flags);
headsetPanRight = noteSubEu->headsetPanRight;
if ((headsetPanRight & 0xFFFF) || synthesisState->prevHeadsetPanRight) {
leftRight = 1;
@ -636,49 +637,26 @@ Acmd* func_800B86A0(Acmd* cmd, struct NoteSubEu* note, struct NoteSynthesisState
aEnvSetup1Alt(cmd++, note->reverbVol, sourceLeft, sourceRight, (u32) rampLeft, (u32) rampRight);
aEnvSetup2(cmd++, sourceLeft, sourceRight);
switch (headsetPanSettings) {;
switch (headsetPanSettings) {
;
case 1:
aEnvMixer(cmd++,
inBuf, nSamples,
0,
note->stereoStrongRight, note->stereoStrongLeft,
DMEM_ADDR_NOTE_PAN_TEMP,
DMEM_ADDR_RIGHT_CH,
DMEM_ADDR_WET_LEFT_CH,
DMEM_ADDR_WET_RIGHT_CH);
aEnvMixer(cmd++, inBuf, nSamples, 0, note->stereoStrongRight, note->stereoStrongLeft,
DMEM_ADDR_NOTE_PAN_TEMP, DMEM_ADDR_RIGHT_CH, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_WET_RIGHT_CH);
break;
case 2:
aEnvMixer(cmd++,
inBuf, nSamples,
0,
note->stereoStrongRight, note->stereoStrongLeft,
DMEM_ADDR_LEFT_CH,
DMEM_ADDR_NOTE_PAN_TEMP,
DMEM_ADDR_WET_LEFT_CH,
DMEM_ADDR_WET_RIGHT_CH);
aEnvMixer(cmd++, inBuf, nSamples, 0, note->stereoStrongRight, note->stereoStrongLeft, DMEM_ADDR_LEFT_CH,
DMEM_ADDR_NOTE_PAN_TEMP, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_WET_RIGHT_CH);
break;
default:
aEnvMixer(cmd++,
inBuf, nSamples,
0,
note->stereoStrongRight, note->stereoStrongLeft,
DMEM_ADDR_LEFT_CH,
DMEM_ADDR_RIGHT_CH,
DMEM_ADDR_WET_LEFT_CH,
DMEM_ADDR_WET_RIGHT_CH);
aEnvMixer(cmd++, inBuf, nSamples, 0, note->stereoStrongRight, note->stereoStrongLeft, DMEM_ADDR_LEFT_CH,
DMEM_ADDR_RIGHT_CH, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_WET_RIGHT_CH);
break;
}
} else {
aEnvSetup1Alt(cmd++, note->reverbVol, sourceLeft, sourceRight, (u32) rampLeft, (u32) rampRight);
aEnvSetup2(cmd++, sourceLeft, sourceRight);
aEnvMixer(cmd++,
inBuf, nSamples,
0,
note->stereoStrongRight, note->stereoStrongLeft,
DMEM_ADDR_LEFT_CH,
DMEM_ADDR_RIGHT_CH,
DMEM_ADDR_WET_LEFT_CH,
DMEM_ADDR_WET_RIGHT_CH);
aEnvMixer(cmd++, inBuf, nSamples, 0, note->stereoStrongRight, note->stereoStrongLeft, DMEM_ADDR_LEFT_CH,
DMEM_ADDR_RIGHT_CH, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_WET_RIGHT_CH);
}
return cmd;
}

View File

@ -2813,7 +2813,8 @@ void func_8005D6C0(Player* player) {
}
}
void set_particle_position_and_rotation(Player* player, Particle* particle, f32 x, f32 y, f32 z, s8 surfaceType, s8 arg6) {
void set_particle_position_and_rotation(Player* player, Particle* particle, f32 x, f32 y, f32 z, s8 surfaceType,
s8 arg6) {
particle->pos[2] = z;
particle->pos[0] = x;
particle->pos[1] = y;
@ -2855,8 +2856,8 @@ void set_drift_particles(Player* player, s16 arg1, UNUSED s32 arg2, UNUSED s8 ar
player->tyres[BACK_LEFT].surfaceType, 1);
} else {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], player->tyres[BACK_RIGHT].pos[0],
player->tyres[BACK_RIGHT].baseHeight + 2.0f, player->tyres[BACK_RIGHT].pos[2],
player->tyres[BACK_RIGHT].surfaceType, 0);
player->tyres[BACK_RIGHT].baseHeight + 2.0f,
player->tyres[BACK_RIGHT].pos[2], player->tyres[BACK_RIGHT].surfaceType, 0);
}
temp_lo = player->unk_0C0 / 182;
@ -2932,8 +2933,8 @@ void setup_tyre_particles(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UN
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
if (((player->speed / 18.0f) * 216.0f) >= 10.0f) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 2, 0.46f);
if ((gCurrentCourseId == COURSE_CHOCO_MOUNTAIN) || (gCurrentCourseId == COURSE_ROYAL_RACEWAY)) {
func_8005DAD8(&player->particles[10 + arg1], 1, 0, 0x0080);
@ -2956,8 +2957,8 @@ void setup_tyre_particles(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UN
player->particles[10 + arg1].green = random_int(0x0010U);
}
} else if ((player->particles[10 + arg2].timer > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 2, 0.46f);
if ((gCurrentCourseId == COURSE_CHOCO_MOUNTAIN) || (gCurrentCourseId == COURSE_ROYAL_RACEWAY)) {
func_8005DAD8(&player->particles[10 + arg1], 1, 0, 0x0080);
@ -2984,8 +2985,8 @@ void setup_tyre_particles(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UN
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
if (((player->speed / 18.0f) * 216.0f) >= 10.0f) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 3, 1.0f);
set_particle_colour(&player->particles[10 + arg1], 0x00FFFFFF, 0x00FF);
player->particles[10 + arg1].red -= arg1 * 8;
@ -2993,8 +2994,8 @@ void setup_tyre_particles(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UN
player->particles[10 + arg1].blue -= arg1 * 8;
}
} else if ((player->particles[10 + arg2].timer > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 3, 1.0f);
set_particle_colour(&player->particles[10 + arg1], 0x00FFFFFF, 0x00FF);
player->particles[10 + arg1].red -= arg1 * 8;
@ -3007,15 +3008,15 @@ void setup_tyre_particles(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UN
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
if (((player->speed / 18.0f) * 216.0f) >= 10.0f) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 2, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 2, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
}
} else if ((player->particles[10 + arg2].timer > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 2, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 2, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
@ -3025,15 +3026,15 @@ void setup_tyre_particles(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UN
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
if (((player->speed / 18.0f) * 216.0f) >= 10.0f) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 2, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 3, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
}
} else if ((player->particles[10 + arg2].timer > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 2, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 3, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
@ -3043,15 +3044,15 @@ void setup_tyre_particles(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UN
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
if (((player->speed / 18.0f) * 216.0f) >= 10.0f) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 2, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 4, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
}
} else if ((player->particles[10 + arg2].timer > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 2, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 4, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
@ -3061,15 +3062,15 @@ void setup_tyre_particles(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UN
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
if (((player->speed / 18.0f) * 216.0f) >= 10.0f) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 2, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 5, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
}
} else if ((player->particles[10 + arg2].timer > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 2, 0.46f);
set_particle_colour_randomly_varried(&player->particles[10 + arg1], 0x00FFA54F, 0x00AF);
func_8005DAD8(&player->particles[10 + arg1], 5, 1, 0x00A8);
@ -3081,15 +3082,15 @@ void setup_tyre_particles(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UN
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
if (((player->speed / 18.0f) * 216.0f) >= 10.0f) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 2, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 6, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
}
} else if ((player->particles[10 + arg2].timer > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 2, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 6, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
@ -3103,8 +3104,8 @@ void setup_tyre_particles(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UN
if (((((player->speed / 18.0f) * 216.0f) >= 30.0f) &&
((((player->unk_0C0 / 182) > 0x14) || ((player->unk_0C0 / 182) < (-0x14))))) ||
((player->previousSpeed - player->speed) >= 0.04)) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 2, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 0, 0, 0x0080);
player->particles[10 + arg1].green = random_int(0x0010U);
@ -3113,8 +3114,8 @@ void setup_tyre_particles(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UN
(((((player->speed / 18.0f) * 216.0f) >= 30.0f) &&
(((player->unk_0C0 / 182) >= 0x15) || ((player->unk_0C0 / 182) < -0x14))) ||
((player->previousSpeed - player->speed) >= 0.04))) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], tyre_x, tyre_y, tyre_z,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 2, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 0, 0, 0x0080);
player->particles[10 + arg1].green = random_int(0x0010U);
@ -3158,12 +3159,14 @@ void func_8005EA94(Player* player, s16 arg1, s32 arg2, s8 arg3, UNUSED s8 arg4)
if (var_t0 == 0) {
if ((arg1 == 0) && ((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
if (((player->speed / 18.0f) * 216.0f) >= 10.0f) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f2, var_f12, var_f14, var_t0, var_t1);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f2, var_f12, var_f14,
var_t0, var_t1);
init_new_particle_player(&player->particles[10 + arg1], 9, 0.8f);
set_particle_colour(&player->particles[10 + arg1], 0x00FFFFFF, 0x00AF);
}
} else if ((player->particles[10 + arg2].timer > 0) && (((player->speed / 18.0f) * 216.0f) >= 10.0f)) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f2, var_f12, var_f14, var_t0, var_t1);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f2, var_f12, var_f14, var_t0,
var_t1);
init_new_particle_player(&player->particles[10 + arg1], 9, 0.8f);
set_particle_colour(&player->particles[10 + arg1], 0x00FFFFFF, 0x00AF);
}
@ -3199,7 +3202,8 @@ void func_8005ED48(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
case DIRT:
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
surfaceType, var_t3);
init_new_particle_player(&player->particles[10 + arg1], 5, 0.46f);
if ((gCurrentCourseId == COURSE_CHOCO_MOUNTAIN) || (gCurrentCourseId == COURSE_ROYAL_RACEWAY)) {
func_8005DAD8(&player->particles[10 + arg1], 1, 0, 0x0080);
@ -3221,7 +3225,8 @@ void func_8005ED48(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
}
player->particles[10 + arg1].green = random_int(0x0010U);
} else if (player->particles[10 + arg2].timer > 0) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
surfaceType, var_t3);
init_new_particle_player(&player->particles[10 + arg1], 5, 0.46f);
if ((gCurrentCourseId == COURSE_CHOCO_MOUNTAIN) || (gCurrentCourseId == COURSE_ROYAL_RACEWAY)) {
func_8005DAD8(&player->particles[10 + arg1], 1, 0, 0x0080);
@ -3247,16 +3252,16 @@ void func_8005ED48(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
case GRASS:
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 5, 0.1f);
set_particle_colour(&player->particles[10 + arg1], 0x00FFFFFF, 0x00FF);
player->particles[10 + arg1].red -= arg1 * 8;
player->particles[10 + arg1].green -= arg1 * 8;
player->particles[10 + arg1].blue -= arg1 * 8;
} else if (player->particles[10 + arg2].timer > 0) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 5, 0.1f);
set_particle_colour(&player->particles[10 + arg1], 0x00FFFFFF, 0x00FF);
player->particles[10 + arg1].red -= arg1 * 8;
@ -3268,14 +3273,14 @@ void func_8005ED48(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
case SAND_OFFROAD:
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 5, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 2, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
} else if (player->particles[10 + arg2].timer > 0) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 5, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 2, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
@ -3284,14 +3289,14 @@ void func_8005ED48(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
case SAND:
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 5, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 3, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
} else if (player->particles[10 + arg2].timer > 0) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 5, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 3, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
@ -3300,14 +3305,14 @@ void func_8005ED48(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
case WET_SAND:
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 5, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 4, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
} else if (player->particles[10 + arg2].timer > 0) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 5, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 4, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
@ -3316,14 +3321,14 @@ void func_8005ED48(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
case DIRT_OFFROAD:
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 5, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 5, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
} else if (player->particles[10 + arg2].timer > 0) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 5, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 5, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
@ -3333,14 +3338,14 @@ void func_8005ED48(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
case SNOW_OFFROAD:
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 5, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 6, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
} else if (player->particles[10 + arg2].timer > 0) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 5, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 6, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
@ -3351,14 +3356,14 @@ void func_8005ED48(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
case BRIDGE:
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 5, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 0, 0, 0x0080);
player->particles[10 + arg1].green = random_int(0x0010U);
} else if (player->particles[10 + arg2].timer > 0) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, (s8) surfaceType,
(s8) var_t3);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
(s8) surfaceType, (s8) var_t3);
init_new_particle_player(&player->particles[10 + arg1], 5, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 0, 0, 0x0080);
player->particles[10 + arg1].green = random_int(0x0010U);
@ -3393,7 +3398,8 @@ void func_8005F90C(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
case DIRT:
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
surfaceType, var_t1);
init_new_particle_player(&player->particles[10 + arg1], 4, 0.46f);
if ((gCurrentCourseId == COURSE_CHOCO_MOUNTAIN) || (gCurrentCourseId == COURSE_ROYAL_RACEWAY)) {
func_8005DAD8(&player->particles[10 + arg1], 1, 0, 0x0080);
@ -3415,7 +3421,8 @@ void func_8005F90C(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
}
player->particles[10 + arg1].green = random_int(0x0010U);
} else if (player->particles[10 + arg2].timer > 0) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
surfaceType, var_t1);
init_new_particle_player(&player->particles[10 + arg1], 4, 0.46f);
if ((gCurrentCourseId == COURSE_CHOCO_MOUNTAIN) || (gCurrentCourseId == COURSE_ROYAL_RACEWAY)) {
func_8005DAD8(&player->particles[10 + arg1], 1, 0, 0x0080);
@ -3441,14 +3448,16 @@ void func_8005F90C(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
case GRASS:
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
surfaceType, var_t1);
init_new_particle_player(&player->particles[10 + arg1], 4, 0.1f);
set_particle_colour(&player->particles[10 + arg1], 0x00FFFFFF, 0x00FF);
player->particles[10 + arg1].red -= arg1 * 8;
player->particles[10 + arg1].green -= arg1 * 8;
player->particles[10 + arg1].blue -= arg1 * 8;
} else if (player->particles[10 + arg2].timer > 0) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
surfaceType, var_t1);
init_new_particle_player(&player->particles[10 + arg1], 4, 0.1f);
set_particle_colour(&player->particles[10 + arg1], 0x00FFFFFF, 0x00FF);
player->particles[10 + arg1].red -= arg1 * 8;
@ -3460,12 +3469,14 @@ void func_8005F90C(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
case SAND_OFFROAD:
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
surfaceType, var_t1);
init_new_particle_player(&player->particles[10 + arg1], 4, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 2, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
} else if (player->particles[10 + arg2].timer > 0) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
surfaceType, var_t1);
init_new_particle_player(&player->particles[10 + arg1], 4, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 2, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
@ -3474,12 +3485,14 @@ void func_8005F90C(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
case SAND:
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
surfaceType, var_t1);
init_new_particle_player(&player->particles[10 + arg1], 4, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 3, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
} else if (player->particles[10 + arg2].timer > 0) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
surfaceType, var_t1);
init_new_particle_player(&player->particles[10 + arg1], 4, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 3, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
@ -3488,12 +3501,14 @@ void func_8005F90C(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
case WET_SAND:
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
surfaceType, var_t1);
init_new_particle_player(&player->particles[10 + arg1], 4, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 4, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
} else if (player->particles[10 + arg2].timer > 0) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
surfaceType, var_t1);
init_new_particle_player(&player->particles[10 + arg1], 4, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 4, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
@ -3502,12 +3517,14 @@ void func_8005F90C(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
case DIRT_OFFROAD:
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
surfaceType, var_t1);
init_new_particle_player(&player->particles[10 + arg1], 4, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 5, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
} else if (player->particles[10 + arg2].timer > 0) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
surfaceType, var_t1);
init_new_particle_player(&player->particles[10 + arg1], 4, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 5, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
@ -3517,12 +3534,14 @@ void func_8005F90C(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
case SNOW_OFFROAD:
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
surfaceType, var_t1);
init_new_particle_player(&player->particles[10 + arg1], 4, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 6, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
} else if (player->particles[10 + arg2].timer > 0) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
surfaceType, var_t1);
init_new_particle_player(&player->particles[10 + arg1], 4, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 6, 1, 0x00A8);
player->particles[10 + arg1].green = random_int(0x0010U);
@ -3533,12 +3552,14 @@ void func_8005F90C(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
case BRIDGE:
if ((arg1 == 0) &&
((player->particles[10 + arg2].timer > 0) || (player->particles[10 + arg2].IsAlive == 0))) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
surfaceType, var_t1);
init_new_particle_player(&player->particles[10 + arg1], 4, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 0, 0, 0x0080);
player->particles[10 + arg1].green = random_int(0x0010U);
} else if (player->particles[10 + arg2].timer > 0) {
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12, surfaceType, var_t1);
set_particle_position_and_rotation(player, &player->particles[10 + arg1], var_f0, var_f2, var_f12,
surfaceType, var_t1);
init_new_particle_player(&player->particles[10 + arg1], 4, 0.46f);
func_8005DAD8(&player->particles[10 + arg1], 0, 0, 0x0080);
player->particles[10 + arg1].green = random_int(0x0010U);
@ -3928,7 +3949,8 @@ void func_80061EF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
if (var_t0 == 0) {
if ((arg1 == 0) &&
((player->particles[0x1E + arg2].timer > 0) || (player->particles[0x1E + arg2].IsAlive == 0))) {
set_particle_position_and_rotation(player, &player->particles[0x1E + arg1], 0.0f, var_f2, 0.0f, (s8) var_t0, (s8) var_t1);
set_particle_position_and_rotation(player, &player->particles[0x1E + arg1], 0.0f, var_f2, 0.0f, (s8) var_t0,
(s8) var_t1);
init_new_particle_player(&player->particles[0x1E + arg1], 3, 0.5f);
set_particle_colour(&player->particles[0x1E + arg1], 0x00FFFFFF, 0x0060);
player->particles[0x1E + arg1].rotation = 0;
@ -3944,7 +3966,8 @@ void func_80061EF4(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
player->pos[0] +
(sins(player->particles[0x1E + arg1].rotation - player->rotation[1] - player->unk_0C0) * 5.0f);
} else if (player->particles[0x1E + arg2].timer > 0) {
set_particle_position_and_rotation(player, &player->particles[0x1E + arg1], 0.0f, var_f2, 0.0f, (s8) var_t0, (s8) var_t1);
set_particle_position_and_rotation(player, &player->particles[0x1E + arg1], 0.0f, var_f2, 0.0f, (s8) var_t0,
(s8) var_t1);
init_new_particle_player(&player->particles[0x1E + arg1], 3, 0.5f);
set_particle_colour(&player->particles[0x1E + arg1], 0x00FFFFFF, 0x0060);
player->particles[0x1E + arg1].rotation = 0;
@ -3989,7 +4012,8 @@ void func_800621BC(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
if (phi_t0 == 0) {
if ((arg1 == 0) && ((player->particles[30 + arg2].timer > 0) || (player->particles[30 + arg2].IsAlive == 0))) {
set_particle_position_and_rotation(player, &player->particles[30 + arg1], 0.0f, phi_f2, 0.0f, phi_t0, phi_t1);
set_particle_position_and_rotation(player, &player->particles[30 + arg1], 0.0f, phi_f2, 0.0f, phi_t0,
phi_t1);
init_new_particle_player(&player->particles[30 + arg1], 8, 1.0f);
set_particle_colour(&player->particles[30 + arg1], 0xFFFF20, 0xFF);
@ -4011,7 +4035,8 @@ void func_800621BC(Player* player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8
new_var2 = player;
if (new_var2->particles[30 + arg2].timer > 0) {
set_particle_position_and_rotation(new_var2, &new_var2->particles[30 + arg1], 0.0f, phi_f2, 0.0f, phi_t0, phi_t1);
set_particle_position_and_rotation(new_var2, &new_var2->particles[30 + arg1], 0.0f, phi_f2, 0.0f, phi_t0,
phi_t1);
init_new_particle_player(&new_var2->particles[30 + arg1], 8, 1.0f);
set_particle_colour(&new_var2->particles[30 + arg1], 0xFFFF20, 0xFF);
new_var2->particles[30 + arg1].rotation = 0;
@ -4779,10 +4804,10 @@ void func_800649F4(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) {
f32 temp;
temp = player->particles[30 + arg1].unk_018;
player->particles[30 + arg1].pos[2] =
player->unk_21C + (((-temp) * player->particles[30 + arg1].timer) * coss(player->particles[30 + arg1].rotation));
player->particles[30 + arg1].pos[0] =
player->unk_218 + (((-temp) * player->particles[30 + arg1].timer) * sins(player->particles[30 + arg1].rotation));
player->particles[30 + arg1].pos[2] = player->unk_21C + (((-temp) * player->particles[30 + arg1].timer) *
coss(player->particles[30 + arg1].rotation));
player->particles[30 + arg1].pos[0] = player->unk_218 + (((-temp) * player->particles[30 + arg1].timer) *
sins(player->particles[30 + arg1].rotation));
player->particles[30 + arg1].pos[1] = player->pos[1] + player->particles[30 + arg1].unk_014;
player->particles[30 + arg1].scale += 0.04;
@ -5134,21 +5159,31 @@ void func_80065F0C(Player* player, UNUSED s8 playerIndex, s16 arg2, s8 arg3) {
spD4[2] = 0;
func_800652D4(&spDC[0], &spD4[0], player->particles[10 + arg2].scale * player->size);
if (((s32) player->particles[10 + arg2].unk_014) != 8) {
primRed = ((D_800E47DC[player->particles[10 + arg2].red] >> 0x10) & 0xFF) - player->particles[10 + arg2].green;
primGreen = ((D_800E47DC[player->particles[10 + arg2].red] >> 0x08) & 0xFF) - player->particles[10 + arg2].green;
primBlue = ((D_800E47DC[player->particles[10 + arg2].red] >> 0x00) & 0xFF) - player->particles[10 + arg2].green;
envRed = ((D_800E480C[player->particles[10 + arg2].red] >> 0x10) & 0xFF) - player->particles[10 + arg2].green;
envGreen = ((D_800E480C[player->particles[10 + arg2].red] >> 0x08) & 0xFF) - player->particles[10 + arg2].green;
envBlue = ((D_800E480C[player->particles[10 + arg2].red] >> 0x00) & 0xFF) - player->particles[10 + arg2].green;
primRed =
((D_800E47DC[player->particles[10 + arg2].red] >> 0x10) & 0xFF) - player->particles[10 + arg2].green;
primGreen =
((D_800E47DC[player->particles[10 + arg2].red] >> 0x08) & 0xFF) - player->particles[10 + arg2].green;
primBlue =
((D_800E47DC[player->particles[10 + arg2].red] >> 0x00) & 0xFF) - player->particles[10 + arg2].green;
envRed =
((D_800E480C[player->particles[10 + arg2].red] >> 0x10) & 0xFF) - player->particles[10 + arg2].green;
envGreen =
((D_800E480C[player->particles[10 + arg2].red] >> 0x08) & 0xFF) - player->particles[10 + arg2].green;
envBlue =
((D_800E480C[player->particles[10 + arg2].red] >> 0x00) & 0xFF) - player->particles[10 + arg2].green;
primAlpha = player->particles[10 + arg2].alpha;
if (player->particles[10 + arg2].unk_040 == 0) {
gSPDisplayList(gDisplayListHead++, D_0D008DB8);
gDPLoadTextureBlock(gDisplayListHead++, D_8018D494, 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);
gDPLoadTextureBlock(gDisplayListHead++, D_8018D494, 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(primRed, primGreen, primBlue, envRed, envGreen, envBlue, primAlpha);
gSPDisplayList(gDisplayListHead++, D_0D008E48);
} else {
gSPDisplayList(gDisplayListHead++, D_0D008DB8);
gDPLoadTextureBlock(gDisplayListHead++, D_8018D494, 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);
gDPLoadTextureBlock(gDisplayListHead++, D_8018D494, 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(primRed, primGreen, primBlue, envRed, envGreen, envBlue, primAlpha);
gDPSetAlphaCompare(gDisplayListHead++, G_AC_DITHER);
gSPDisplayList(gDisplayListHead++, D_0D008E48);
@ -5159,7 +5194,9 @@ void func_80065F0C(Player* player, UNUSED s8 playerIndex, s16 arg2, s8 arg3) {
primBlue = player->particles[10 + arg2].blue;
gSPDisplayList(gDisplayListHead++, D_0D008C90);
gDPSetTextureLUT(gDisplayListHead++, G_TT_NONE);
gDPLoadTextureBlock(gDisplayListHead++, D_8018D498, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 64, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gDPLoadTextureBlock(gDisplayListHead++, D_8018D498, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 64, 0,
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK,
G_TX_NOLOD, G_TX_NOLOD);
func_8004B35C(primRed, primGreen, primBlue, 0x000000FF);
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2);
gSPVertex(gDisplayListHead++, D_800E8C00, 4, 0);
@ -5995,7 +6032,8 @@ void render_battle_balloon(Player* player, s8 playerIndex, s16 balloonIndex, s8
sp134[2] = gPlayerBalloonPosZ[playerIndex][balloonIndex];
sp12C[0] = -((D_8018D890[playerIndex][balloonIndex] * 4) * coss(temp_t1));
sp12C[1] = player->unk_048[screenId];
sp12C[2] = D_8018D7D0[playerIndex][balloonIndex] - (gPlayerBalloonRotation[playerIndex][balloonIndex] * coss(temp_t1)) -
sp12C[2] = D_8018D7D0[playerIndex][balloonIndex] -
(gPlayerBalloonRotation[playerIndex][balloonIndex] * coss(temp_t1)) -
((D_8018D890[playerIndex][balloonIndex] * 8) * sins(temp_t1));
mtxf_translate_rotate(sp140, sp134, sp12C);
mtxf_scale2(sp140, var_f20);
@ -6539,9 +6577,11 @@ void func_8006D474(Player* player, s8 playerId, s8 screenId) {
break;
case 2:
if (gActiveScreenMode == SCREEN_MODE_1P) {
render_wall_bonk_star_particles(player, playerId, var_s2, screenId, player->particles[var_s2 + 30].scale);
render_wall_bonk_star_particles(player, playerId, var_s2, screenId,
player->particles[var_s2 + 30].scale);
} else if (screenId == playerId) {
render_wall_bonk_star_particles(player, playerId, var_s2, screenId, player->particles[var_s2 + 30].scale);
render_wall_bonk_star_particles(player, playerId, var_s2, screenId,
player->particles[var_s2 + 30].scale);
}
break;
case 3:

View File

@ -176,7 +176,8 @@ void func_800B0004(void) {
gSPLight(gDisplayListHead++, VIRTUAL_TO_PHYSICAL2(&D_800E8680), LIGHT_2);
gSPNumLights(gDisplayListHead++, NUMLIGHTS_1);
gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH);
gDPSetCombineLERP(gDisplayListHead++, PRIMITIVE, 0, SHADE, 0, 0, 0, 0, SHADE, PRIMITIVE, 0, SHADE, 0, 0, 0, 0, SHADE);
gDPSetCombineLERP(gDisplayListHead++, PRIMITIVE, 0, SHADE, 0, 0, 0, 0, SHADE, PRIMITIVE, 0, SHADE, 0, 0, 0, 0,
SHADE);
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING);
vtxs = (D_8018EDB4 % 2) ? (D_8018EDB8) : (D_8018EDBC);

View File

@ -1405,7 +1405,6 @@ void update_player(s32 playerId) {
s16 angle;
s16 steeringSensitivity;
s32 maxAngle;
Player* player;
UNUSED s32 pad3[10];
@ -1639,7 +1638,12 @@ void update_player(s32 playerId) {
pathIndex %= gSelectedPathCount;
set_track_offset_position(pathIndex, -0.7f, gPlayerPathIndex);
}
if (1) { } if (1) { } if (1) { } if (1) { } if (1) { } if (1) { }
if (1) {}
if (1) {}
if (1) {}
if (1) {}
if (1) {}
if (1) {}
if (gPlayerPathIndex == 0) {
func_8000B140(playerId);
if (D_80162FF8[playerId] > 0) {
@ -1845,7 +1849,6 @@ void func_8000B140(s32 playerId) {
sp74[j] = temp_f2 - temp_f0_2;
j++;
}
}
}
}
@ -2854,12 +2857,14 @@ void func_80017054(Camera* camera, UNUSED Player* player, UNUSED s32 index, s32
sp58 = gPathCountByPathIndex[pathIndex];
D_80163238 = playerId;
sp56 = gNearestPathPointByCameraId[cameraId];
gNearestPathPointByCameraId[cameraId] = func_8000D33C(camera->pos[0], camera->pos[1], camera->pos[2], gNearestPathPointByCameraId[cameraId], pathIndex);
gNearestPathPointByCameraId[cameraId] =
func_8000D33C(camera->pos[0], camera->pos[1], camera->pos[2], gNearestPathPointByCameraId[cameraId], pathIndex);
if (gCurrentCourseId == 4) {
if ((sp56 != gNearestPathPointByCameraId[cameraId]) && (gNearestPathPointByCameraId[cameraId] == 1)) {
D_80163DD8[cameraId] = random_int(4);
pathIndex = D_80163DD8[cameraId];
gNearestPathPointByCameraId[cameraId] = func_8000D33C(camera->pos[0], camera->pos[1], camera->pos[2], gNearestPathPointByCameraId[cameraId], pathIndex);
gNearestPathPointByCameraId[cameraId] = func_8000D33C(camera->pos[0], camera->pos[1], camera->pos[2],
gNearestPathPointByCameraId[cameraId], pathIndex);
}
}
sp6E = (gNearestPathPointByCameraId[cameraId] + 0xA) % sp58;
@ -3905,9 +3910,9 @@ void cpu_use_item_strategy(s32 playerId) {
cpuStrategy->actorIndex = -1;
if ((((playerId * 20) + 100) < gNumPathPointsTraversed[playerId]) && (cpuStrategy->timer >= 0x259) &&
(cpuStrategy->numItemUse < 3) && (gLapCountByPlayerId[playerId] < 3)) {
cpu_decisions_branch_item(playerId, &cpuStrategy->branch,
cpu_gen_random_item((s16) gLapCountByPlayerId[playerId],
gGPCurrentRaceRankByPlayerId[playerId]));
cpu_decisions_branch_item(
playerId, &cpuStrategy->branch,
cpu_gen_random_item((s16) gLapCountByPlayerId[playerId], gGPCurrentRaceRankByPlayerId[playerId]));
} else {
func_8001ABE0(playerId, cpuStrategy);
}
@ -3915,7 +3920,9 @@ void cpu_use_item_strategy(s32 playerId) {
case CPU_STRATEGY_ITEM_BANANA:
// never true
if ((gLapCountByPlayerId[playerId] > 0) && (gGPCurrentRaceRankByPlayerId[playerId] > gGPCurrentRaceRankByPlayerId[gBestRankedHumanPlayer]) && (gGPCurrentRaceRankByPlayerId[gBestRankedHumanPlayer] == FIRST_PLACE)) {
if ((gLapCountByPlayerId[playerId] > 0) &&
(gGPCurrentRaceRankByPlayerId[playerId] > gGPCurrentRaceRankByPlayerId[gBestRankedHumanPlayer]) &&
(gGPCurrentRaceRankByPlayerId[gBestRankedHumanPlayer] == FIRST_PLACE)) {
switch (player->characterId) {
case DK:
if (is_path_point_in_range(gNearestPathPointByPlayerId[playerId],
@ -3958,8 +3965,8 @@ void cpu_use_item_strategy(s32 playerId) {
case CPU_STRATEGY_HOLD_BANANA:
actor = &gActorList[cpuStrategy->actorIndex];
if ((!(BANANA_ACTOR(actor)->flags & 0x8000)) || (BANANA_ACTOR(actor)->type != ACTOR_BANANA) || (BANANA_ACTOR(actor)->state != HELD_BANANA) ||
(playerId != BANANA_ACTOR(actor)->playerId)) {
if ((!(BANANA_ACTOR(actor)->flags & 0x8000)) || (BANANA_ACTOR(actor)->type != ACTOR_BANANA) ||
(BANANA_ACTOR(actor)->state != HELD_BANANA) || (playerId != BANANA_ACTOR(actor)->playerId)) {
// FAKE
if (!(BANANA_ACTOR(actor)->flags & 0x8000)) {}
@ -4071,7 +4078,8 @@ void cpu_use_item_strategy(s32 playerId) {
BANANA_ACTOR(actor)->velocity[1] = 0.0f;
BANANA_ACTOR(actor)->velocity[2] = 0.0f;
BANANA_ACTOR(actor)->pos[1] =
get_surface_height(BANANA_ACTOR(actor)->pos[0], BANANA_ACTOR(actor)->pos[1] + 30.0, BANANA_ACTOR(actor)->pos[2]) +
get_surface_height(BANANA_ACTOR(actor)->pos[0], BANANA_ACTOR(actor)->pos[1] + 30.0,
BANANA_ACTOR(actor)->pos[2]) +
(BANANA_ACTOR(actor)->boundingBoxSize + 1.0f);
}
player->soundEffects &= ~HOLD_BANANA_SOUND_EFFECT;
@ -4097,8 +4105,7 @@ void cpu_use_item_strategy(s32 playerId) {
case CPU_STRATEGY_HOLD_GREEN_SHELL:
actor = &gActorList[cpuStrategy->actorIndex];
if ((((!(actor->flags & 0x8000)) || (actor->type != ACTOR_GREEN_SHELL)) ||
(actor->state != HELD_SHELL)) ||
if ((((!(actor->flags & 0x8000)) || (actor->type != ACTOR_GREEN_SHELL)) || (actor->state != HELD_SHELL)) ||
(playerId != actor->rot[2])) {
// FAKE
@ -4117,8 +4124,7 @@ void cpu_use_item_strategy(s32 playerId) {
case CPU_STRATEGY_THROW_GREEN_SHELL:
actor = &gActorList[cpuStrategy->actorIndex];
if ((((!(actor->flags & 0x8000)) || (actor->type != ACTOR_GREEN_SHELL)) ||
(actor->state != HELD_SHELL)) ||
if ((((!(actor->flags & 0x8000)) || (actor->type != ACTOR_GREEN_SHELL)) || (actor->state != HELD_SHELL)) ||
(playerId != actor->rot[2])) {
// FAKE
@ -4283,7 +4289,8 @@ void cpu_use_item_strategy(s32 playerId) {
break;
}
if (((BANANA_BUNCH_ACTOR(actor)->type == ACTOR_BANANA_BUNCH) && (BANANA_BUNCH_ACTOR(actor)->state == 6)) &&
if (((BANANA_BUNCH_ACTOR(actor)->type == ACTOR_BANANA_BUNCH) &&
(BANANA_BUNCH_ACTOR(actor)->state == 6)) &&
(isValidBanana1 == true)) {
drop_banana_in_banana_bunch((struct BananaBunchParent*) actor);
}
@ -4309,7 +4316,8 @@ void cpu_use_item_strategy(s32 playerId) {
case CPU_STRATEGY_HOLD_FAKE_ITEM_BOX:
actor = &gActorList[cpuStrategy->actorIndex];
if ((((!(FAKE_ITEMBOX_ACTOR(actor)->flags & 0x8000)) || (FAKE_ITEMBOX_ACTOR(actor)->type != ACTOR_FAKE_ITEM_BOX)) ||
if ((((!(FAKE_ITEMBOX_ACTOR(actor)->flags & 0x8000)) ||
(FAKE_ITEMBOX_ACTOR(actor)->type != ACTOR_FAKE_ITEM_BOX)) ||
(FAKE_ITEMBOX_ACTOR(actor)->state != 0)) ||
(playerId != ((s32) FAKE_ITEMBOX_ACTOR(actor)->playerId))) {
@ -4328,7 +4336,8 @@ void cpu_use_item_strategy(s32 playerId) {
case CPU_STRATEGY_THROW_FAKE_ITEM_BOX:
actor = &gActorList[cpuStrategy->actorIndex];
if ((((!(FAKE_ITEMBOX_ACTOR(actor)->flags & 0x8000)) || (FAKE_ITEMBOX_ACTOR(actor)->type != ACTOR_FAKE_ITEM_BOX)) ||
if ((((!(FAKE_ITEMBOX_ACTOR(actor)->flags & 0x8000)) ||
(FAKE_ITEMBOX_ACTOR(actor)->type != ACTOR_FAKE_ITEM_BOX)) ||
(FAKE_ITEMBOX_ACTOR(actor)->state != 0)) ||
(playerId != ((s32) FAKE_ITEMBOX_ACTOR(actor)->playerId))) {
@ -4342,7 +4351,8 @@ void cpu_use_item_strategy(s32 playerId) {
func_802A1064((struct FakeItemBox*) actor);
if (D_801631E0[playerId] == true) {
FAKE_ITEMBOX_ACTOR(actor)->pos[1] =
get_surface_height(FAKE_ITEMBOX_ACTOR(actor)->pos[0], FAKE_ITEMBOX_ACTOR(actor)->pos[1] + 30.0, FAKE_ITEMBOX_ACTOR(actor)->pos[2]) +
get_surface_height(FAKE_ITEMBOX_ACTOR(actor)->pos[0], FAKE_ITEMBOX_ACTOR(actor)->pos[1] + 30.0,
FAKE_ITEMBOX_ACTOR(actor)->pos[2]) +
FAKE_ITEMBOX_ACTOR(actor)->boundingBoxSize;
}
}

View File

@ -119,7 +119,8 @@ void func_80007FA4(s32 playerId, Player* player, f32 arg2) {
(arg2 < ((test * 18.0) / 216.0)) ? func_80038BE4(player, 6) : player_decelerate_alternative(player, 1.0f);
} else if (D_80163410[playerId] == 0) {
test = 35;
(arg2 < (((test ^ 0) * 18.0) / 216.0)) ? func_80038BE4(player, 2) : player_decelerate_alternative(player, 1.0f);
(arg2 < (((test ^ 0) * 18.0) / 216.0)) ? func_80038BE4(player, 2)
: player_decelerate_alternative(player, 1.0f);
} else {
player_decelerate_alternative(player, 1.0f);
}

View File

@ -302,13 +302,19 @@ ThwompSpawn gThomwpSpawns150CC[] = {
};
f32 D_800E594C[] = {
-8.0, 8.0,
8.0, 8.0,
0.0, 0.0,
8.0, -8.0,
-8.0, -8.0,
-8.0,
8.0,
8.0,
8.0,
0.0,
0.0,
8.0,
-8.0,
-8.0,
-8.0,
// This feels super fake, but it matches
-0.0, 0.0,
-0.0,
0.0,
};
s16 D_800E597C[] = { 0x0000, 0x0000, 0x4000, 0x8000, 0x8000, 0xc000 };
@ -446,10 +452,8 @@ s8 D_800E5DB4[] = {
};
s16 D_800E5DF4[] = {
0xfc7a, 0x0046, 0xfa82, 0x3800,
0xfc4c, 0x0046, 0xfa03, 0x3800,
0xf786, 0x0000, 0x02d3, 0x0400,
0xf76f, 0x0000, 0x02f9, 0x0400,
0xfc7a, 0x0046, 0xfa82, 0x3800, 0xfc4c, 0x0046, 0xfa03, 0x3800,
0xf786, 0x0000, 0x02d3, 0x0400, 0xf76f, 0x0000, 0x02f9, 0x0400,
};
HegdehogSpawn gHedgehogSpawns[] = {
@ -667,13 +671,8 @@ SplineData* D_800E672C[] = { &D_800E659C, &D_800E6668 };
// Positions of the neon signs in rainbow road
float D_800E6734[] = {
1443.0, 1044.0, -5478.0,
1678.0, 1012.0, -4840.0,
-3924.0, 921.0, 2566.0,
-3311.0, 790.0, 3524.0,
-1284.0, 1341.0, 4527.0,
2268.0, 1041.0, 4456.0,
2820.0, 1109.0, 1985.0,
1443.0, 1044.0, -5478.0, 1678.0, 1012.0, -4840.0, -3924.0, 921.0, 2566.0, -3311.0, 790.0,
3524.0, -1284.0, 1341.0, 4527.0, 2268.0, 1041.0, 4456.0, 2820.0, 1109.0, 1985.0,
};
// This should really be `extern Vec3s gTorchSpawns[];`

View File

@ -2994,8 +2994,9 @@ Gfx* func_80096CD8(Gfx* displayListHead, s32 xPos, s32 yPos, u32 width, u32 heig
if (rectXoffset == 0) {
break;
}
} else
} else {
rectXoffset = tileWidth;
}
gDPLoadTextureTile(displayListHead++, (D_0B002A00 + random_int(128) * 2), G_IM_FMT_IA, G_IM_SIZ_16b, width,
height, x, y, x + rectXoffset, y + rectYoffset, 0, G_TX_WRAP, G_TX_WRAP, masks, maskt,
@ -3714,8 +3715,9 @@ void func_80099EC4(void) {
var_s1 = D_8018E0E8;
temp_s2 = var_s1->mk64Texture;
if (temp_s2 == NULL)
if (temp_s2 == NULL) {
return;
}
huh = temp_s2->size;
if (huh != 0) {
@ -3753,8 +3755,9 @@ void func_80099EC4(void) {
D_802BFB80.arraySize4[var_s1->unk6][var_s1->unk4 / 2][(var_s1->unk4 % 2) + 2].pixel_index_array);
var_s1->mk64Texture = NULL;
var_s1++;
if (var_s4 != 0)
if (var_s4 != 0) {
break;
}
osRecvMesg(&gDmaMesgQueue, &sp64, 1);
if ((var_s1 + 1)->mk64Texture == NULL) {
var_s4 += 1;
@ -3777,8 +3780,9 @@ void func_80099EC4(void) {
D_802BFB80.arraySize4[var_s1->unk6][var_s1->unk4 / 2][(var_s1->unk4 % 2) + 2].pixel_index_array);
var_s1->mk64Texture = NULL;
var_s1++;
if (var_s4 != 0)
if (var_s4 != 0) {
break;
}
osRecvMesg(&gDmaMesgQueue, &sp64, 1);
}
}
@ -10975,7 +10979,8 @@ void func_800ACF40(MenuItem* arg0) {
break;
case 3:
if (D_8018DEE0[arg0->D_8018DEE0_index].sequenceIndex >= D_800E8440[temp_a1]) {
func_8009A640(arg0->D_8018DEE0_index, 0, somePlayerIndex, segmented_to_virtual_dupe_2(D_800E83A0[temp_a1]));
func_8009A640(arg0->D_8018DEE0_index, 0, somePlayerIndex,
segmented_to_virtual_dupe_2(D_800E83A0[temp_a1]));
arg0->state = 4;
}
break;

View File

@ -1407,11 +1407,13 @@ void main_menu_act(struct Controller* controller, u16 controllerIdx) {
if (btnAndStick & D_JPAD) {
cursorMoved = false;
if (has_unlocked_extra_mode()) {
if (subMode < sGameModePlayerColumnExtra[gPlayerCount - 1][gGameModeMenuColumn[gPlayerCount - 1]]) {
if (subMode <
sGameModePlayerColumnExtra[gPlayerCount - 1][gGameModeMenuColumn[gPlayerCount - 1]]) {
cursorMoved = true;
}
} else {
if (subMode < sGameModePlayerColumnDefault[gPlayerCount - 1][gGameModeMenuColumn[gPlayerCount - 1]]) {
if (subMode <
sGameModePlayerColumnDefault[gPlayerCount - 1][gGameModeMenuColumn[gPlayerCount - 1]]) {
cursorMoved = true;
}
}
@ -1536,7 +1538,9 @@ void player_select_menu_act(struct Controller* controller, u16 controllerIdx) {
if ((btnAndStick & A_BUTTON) && (gCharacterGridIsSelected[controllerIdx] == 0)) {
gCharacterGridIsSelected[controllerIdx] = true;
func_800C90F4(controllerIdx, ((sCharacterGridOrder - 1)[gCharacterGridSelections[controllerIdx]] * 0x10) + 0x2900800E);
func_800C90F4(controllerIdx,
((sCharacterGridOrder - 1)[gCharacterGridSelections[controllerIdx]] * 0x10) +
0x2900800E);
}
selected = false;
@ -1558,7 +1562,9 @@ void player_select_menu_act(struct Controller* controller, u16 controllerIdx) {
}
j = gCharacterGridSelections[controllerIdx];
if ((btnAndStick & R_JPAD) && (btnAndStick & D_JPAD)) {
if ((gCharacterGridSelections[controllerIdx] == 1U) || (gCharacterGridSelections[controllerIdx] == 2U) || (gCharacterGridSelections[controllerIdx] == 3U)) {
if ((gCharacterGridSelections[controllerIdx] == 1U) ||
(gCharacterGridSelections[controllerIdx] == 2U) ||
(gCharacterGridSelections[controllerIdx] == 3U)) {
j = gCharacterGridSelections[controllerIdx] + 5;
if (is_character_spot_free(j)) {
gCharacterGridSelections[controllerIdx] = j;
@ -1568,7 +1574,9 @@ void player_select_menu_act(struct Controller* controller, u16 controllerIdx) {
return;
}
if ((btnAndStick & L_JPAD) && (btnAndStick & D_JPAD)) {
if ((gCharacterGridSelections[controllerIdx] == 2U) || (gCharacterGridSelections[controllerIdx] == 3U) || (gCharacterGridSelections[controllerIdx] == 4U)) {
if ((gCharacterGridSelections[controllerIdx] == 2U) ||
(gCharacterGridSelections[controllerIdx] == 3U) ||
(gCharacterGridSelections[controllerIdx] == 4U)) {
j = gCharacterGridSelections[controllerIdx] + 3;
if (is_character_spot_free(j)) {
gCharacterGridSelections[controllerIdx] = j;
@ -1578,7 +1586,9 @@ void player_select_menu_act(struct Controller* controller, u16 controllerIdx) {
return;
}
if ((btnAndStick & R_JPAD) && (btnAndStick & U_JPAD)) {
if ((gCharacterGridSelections[controllerIdx] == 5U) || (gCharacterGridSelections[controllerIdx] == 6U) || (gCharacterGridSelections[controllerIdx] == 7U)) {
if ((gCharacterGridSelections[controllerIdx] == 5U) ||
(gCharacterGridSelections[controllerIdx] == 6U) ||
(gCharacterGridSelections[controllerIdx] == 7U)) {
j = gCharacterGridSelections[controllerIdx] - 3;
if (is_character_spot_free(j)) {
gCharacterGridSelections[controllerIdx] = j;
@ -1589,7 +1599,9 @@ void player_select_menu_act(struct Controller* controller, u16 controllerIdx) {
}
if ((btnAndStick & L_JPAD) && (btnAndStick & U_JPAD)) {
if ((gCharacterGridSelections[controllerIdx] == 6U) || (gCharacterGridSelections[controllerIdx] == 7U) || (gCharacterGridSelections[controllerIdx] == 8U)) {
if ((gCharacterGridSelections[controllerIdx] == 6U) ||
(gCharacterGridSelections[controllerIdx] == 7U) ||
(gCharacterGridSelections[controllerIdx] == 8U)) {
j = gCharacterGridSelections[controllerIdx] - 5;
if (is_character_spot_free(j)) {
gCharacterGridSelections[controllerIdx] = j;
@ -1597,10 +1609,10 @@ void player_select_menu_act(struct Controller* controller, u16 controllerIdx) {
}
}
return;
}
if (btnAndStick & R_JPAD) {
if ((gCharacterGridSelections[controllerIdx] != 4U) && (gCharacterGridSelections[controllerIdx] != 8U)) {
if ((gCharacterGridSelections[controllerIdx] != 4U) &&
(gCharacterGridSelections[controllerIdx] != 8U)) {
j = gCharacterGridSelections[controllerIdx] + 1;
do {
if (is_character_spot_free(j)) {
@ -1618,7 +1630,8 @@ void player_select_menu_act(struct Controller* controller, u16 controllerIdx) {
return;
}
if (btnAndStick & L_JPAD) {
if ((gCharacterGridSelections[controllerIdx] != 1U) && (gCharacterGridSelections[controllerIdx] != 5U)) {
if ((gCharacterGridSelections[controllerIdx] != 1U) &&
(gCharacterGridSelections[controllerIdx] != 5U)) {
j = gCharacterGridSelections[controllerIdx] - 1;
do {
if (is_character_spot_free(j)) {

View File

@ -176,11 +176,7 @@ enum DebugGotoSceneTypes {
/**
* @brief Options for gFadeModeSelection
*/
enum FadeModeSelectionTypes {
FADE_MODE_NONE,
FADE_MODE_MAIN,
FADE_MODE_LOGO
};
enum FadeModeSelectionTypes { FADE_MODE_NONE, FADE_MODE_MAIN, FADE_MODE_LOGO };
/**
* @brief Options for gControllerPakScrollDirection
@ -191,7 +187,6 @@ enum ControllerPakScrollDirectionTypes {
CONTROLLER_PAK_SCROLL_DIR_UP
};
/* functions */
void update_menus(void);
void options_menu_act(struct Controller*, u16);

View File

@ -2450,7 +2450,8 @@ void func_8002E594(Player* player, UNUSED Camera* camera, s8 screenId, s8 player
gravityX =
-1 * (player->unk_064[0]) + (((-player->collision.orientationVector[0]) * player->kartGravity) * 0.1);
gravityY = (-player->collision.orientationVector[1]) * player->kartGravity;
gravityZ = -1 * (player->unk_064[2]) + (((-player->collision.orientationVector[2]) * player->kartGravity) * 0.1);
gravityZ =
-1 * (player->unk_064[2]) + (((-player->collision.orientationVector[2]) * player->kartGravity) * 0.1);
} else {
gravityX = -1 * player->unk_064[0];
gravityY = -1 * player->kartGravity;
@ -2479,17 +2480,22 @@ void func_8002E594(Player* player, UNUSED Camera* camera, s8 screenId, s8 player
((player->effects & HIT_BY_GREEN_SHELL_EFFECT) != HIT_BY_GREEN_SHELL_EFFECT) &&
((player->effects & EXPLOSION_CRASH_EFFECT) != EXPLOSION_CRASH_EFFECT) &&
((player->effects & HIT_BY_STAR_EFFECT) != HIT_BY_STAR_EFFECT)) {
newVelocity[0] += (((((spEC[0] + gravityX) + spD4[0])) - (newVelocity[0] * (0.12 * player->kartFriction))) / 6000) /
newVelocity[0] +=
(((((spEC[0] + gravityX) + spD4[0])) - (newVelocity[0] * (0.12 * player->kartFriction))) / 6000) /
((player->unk_20C * 5.0f) + 1.0f);
newVelocity[2] += (((((spEC[2] + gravityZ) + spD4[2])) - (newVelocity[2] * (0.12 * player->kartFriction))) / 6000) /
newVelocity[2] +=
(((((spEC[2] + gravityZ) + spD4[2])) - (newVelocity[2] * (0.12 * player->kartFriction))) / 6000) /
((player->unk_20C * 5.0f) + 1.0f);
} else {
newVelocity[0] +=
((((f64) (spEC[0] + gravityX + spD4[0]) - (newVelocity[0] * (0.2 * (f64) player->kartFriction))) / 6000) * 0.08);
((((f64) (spEC[0] + gravityX + spD4[0]) - (newVelocity[0] * (0.2 * (f64) player->kartFriction))) / 6000) *
0.08);
newVelocity[2] +=
((((f64) (spEC[2] + gravityZ + spD4[2]) - (newVelocity[2] * (0.2 * (f64) player->kartFriction))) / 6000) * 0.08);
((((f64) (spEC[2] + gravityZ + spD4[2]) - (newVelocity[2] * (0.2 * (f64) player->kartFriction))) / 6000) *
0.08);
}
newVelocity[1] += (((((spEC[1] + gravityY) + spD4[1])) - (newVelocity[1] * (0.12 * player->kartFriction))) / 6000) / player->unk_DAC;
newVelocity[1] += (((((spEC[1] + gravityY) + spD4[1])) - (newVelocity[1] * (0.12 * player->kartFriction))) / 6000) /
player->unk_DAC;
if (((player->unk_0CA & 2) == 2) || ((player->unk_0CA & 8) == 8)) {
newVelocity[0] = 0.0f;
@ -3703,10 +3709,12 @@ void player_decelerate(Player* player, f32 speedReduction) {
}
void player_accelerate_global(Player* player, s32 playerIndex) {
if ((gPlayerCurrentSpeed[playerIndex] >= 0.0) && (gPlayerCurrentSpeed[playerIndex] < ((f64) player->topSpeed * 0.1))) {
if ((gPlayerCurrentSpeed[playerIndex] >= 0.0) &&
(gPlayerCurrentSpeed[playerIndex] < ((f64) player->topSpeed * 0.1))) {
gPlayerCurrentSpeed[playerIndex] += gKartAccelerationTables[player->characterId][0] * 3.2;
}
if (((player->topSpeed * 0.1) <= gPlayerCurrentSpeed[playerIndex]) && (gPlayerCurrentSpeed[playerIndex] < (player->topSpeed * 0.2))) {
if (((player->topSpeed * 0.1) <= gPlayerCurrentSpeed[playerIndex]) &&
(gPlayerCurrentSpeed[playerIndex] < (player->topSpeed * 0.2))) {
gPlayerCurrentSpeed[playerIndex] += gKartAccelerationTables[player->characterId][1] * 3.2;
}
if (((player->topSpeed * 0.2) <= gPlayerCurrentSpeed[playerIndex]) &&
@ -3721,19 +3729,24 @@ void player_accelerate_global(Player* player, s32 playerIndex) {
(gPlayerCurrentSpeed[playerIndex] < (player->topSpeed * 0.5))) {
gPlayerCurrentSpeed[playerIndex] += gKartAccelerationTables[player->characterId][4] * 3.2;
}
if (((player->topSpeed * 0.5) <= gPlayerCurrentSpeed[playerIndex]) && (gPlayerCurrentSpeed[playerIndex] < (player->topSpeed * 0.6))) {
if (((player->topSpeed * 0.5) <= gPlayerCurrentSpeed[playerIndex]) &&
(gPlayerCurrentSpeed[playerIndex] < (player->topSpeed * 0.6))) {
gPlayerCurrentSpeed[playerIndex] += gKartAccelerationTables[player->characterId][5] * 3.2;
}
if (((player->topSpeed * 0.6) <= gPlayerCurrentSpeed[playerIndex]) && (gPlayerCurrentSpeed[playerIndex] < (player->topSpeed * 0.7))) {
if (((player->topSpeed * 0.6) <= gPlayerCurrentSpeed[playerIndex]) &&
(gPlayerCurrentSpeed[playerIndex] < (player->topSpeed * 0.7))) {
gPlayerCurrentSpeed[playerIndex] += gKartAccelerationTables[player->characterId][6] * 3.2;
}
if (((player->topSpeed * 0.7) <= gPlayerCurrentSpeed[playerIndex]) && (gPlayerCurrentSpeed[playerIndex] < (player->topSpeed * 0.8))) {
if (((player->topSpeed * 0.7) <= gPlayerCurrentSpeed[playerIndex]) &&
(gPlayerCurrentSpeed[playerIndex] < (player->topSpeed * 0.8))) {
gPlayerCurrentSpeed[playerIndex] += gKartAccelerationTables[player->characterId][7] * 2.8;
}
if (((player->topSpeed * 0.8) <= gPlayerCurrentSpeed[playerIndex]) && (gPlayerCurrentSpeed[playerIndex] < (player->topSpeed * 0.9))) {
if (((player->topSpeed * 0.8) <= gPlayerCurrentSpeed[playerIndex]) &&
(gPlayerCurrentSpeed[playerIndex] < (player->topSpeed * 0.9))) {
gPlayerCurrentSpeed[playerIndex] += gKartAccelerationTables[player->characterId][8] * 2.8;
}
if (((player->topSpeed * 0.9) <= gPlayerCurrentSpeed[playerIndex]) && (gPlayerCurrentSpeed[playerIndex] <= (player->topSpeed * 1.0))) {
if (((player->topSpeed * 0.9) <= gPlayerCurrentSpeed[playerIndex]) &&
(gPlayerCurrentSpeed[playerIndex] <= (player->topSpeed * 1.0))) {
gPlayerCurrentSpeed[playerIndex] += gKartAccelerationTables[player->characterId][9] * 2.8;
}
player->unk_044 |= 0x20;
@ -4230,8 +4243,10 @@ void apply_cpu_turn(Player* player, s16 targetAngle) {
}
player->unk_078 = var_v0 * var_f0;
}
if ((((player->effects & HOP_EFFECT) != HOP_EFFECT) && (player->unk_0C0 < 0x3D) && (player->unk_0C0 > -0x3D)) ||
(((player->speed / 18.0f) * 216.0f) <= 20.0f) || ((player->effects & ENEMY_BONK_EFFECT) == ENEMY_BONK_EFFECT)) {
if ((((player->effects & HOP_EFFECT) != HOP_EFFECT) && (player->unk_0C0 < 0x3D) &&
(player->unk_0C0 > -0x3D)) ||
(((player->speed / 18.0f) * 216.0f) <= 20.0f) ||
((player->effects & ENEMY_BONK_EFFECT) == ENEMY_BONK_EFFECT)) {
func_80036CB4(player);
}
}
@ -4421,7 +4436,6 @@ void func_80037614(Player* player, Vec3f arg1, Vec3f arg2) {
arg2[2] = arg1[2];
}
void func_8003777C(Player* player, Vec3f arg1, Vec3f arg2) {
f32 var_f12;
f32 var_f2;
@ -4605,7 +4619,8 @@ void func_80037CFC(Player* player, struct Controller* controller, s8 playerIndex
}
}
if ((!(player->effects & BOOST_RAMP_ASPHALT_EFFECT)) && (!(player->effects & BOOST_RAMP_WOOD_EFFECT))) {
if (((get_clamped_stickY_with_deadzone(controller) < (-0x31)) && (((player->speed / 18.0f) * 216.0f) <= 5.0f)) &&
if (((get_clamped_stickY_with_deadzone(controller) < (-0x31)) &&
(((player->speed / 18.0f) * 216.0f) <= 5.0f)) &&
(controller->button & B_BUTTON)) {
player->currentSpeed = 140.0f;
player->unk_044 |= 1;
@ -4901,9 +4916,12 @@ void func_80038C6C(Player* player, UNUSED Camera* camera, s8 screenId, s8 player
newVelocity[1] = player->velocity[1];
newVelocity[2] = player->velocity[2];
newVelocity[0] += ((((((sp114[0] + spA4) + spF0[0])) - (newVelocity[0] * (0.12 * (player->kartFriction)))) / 6000.0) / 1);
newVelocity[2] += ((((((sp114[2] + sp9C) + spF0[2])) - (newVelocity[2] * (0.12 * (player->kartFriction)))) / 6000.0) / 1);
newVelocity[1] += ((((((sp114[1] + spA0) + spF0[1])) - (newVelocity[1] * (0.12 * (player->kartFriction)))) / 6000.0) / 1);
newVelocity[0] +=
((((((sp114[0] + spA4) + spF0[0])) - (newVelocity[0] * (0.12 * (player->kartFriction)))) / 6000.0) / 1);
newVelocity[2] +=
((((((sp114[2] + sp9C) + spF0[2])) - (newVelocity[2] * (0.12 * (player->kartFriction)))) / 6000.0) / 1);
newVelocity[1] +=
((((((sp114[1] + spA0) + spF0[1])) - (newVelocity[1] * (0.12 * (player->kartFriction)))) / 6000.0) / 1);
if ((player->unk_044 & 0x10) == 0x10) {
player->unk_044 &= 0xFFEF;
}

View File

@ -755,8 +755,7 @@ UNUSED void func_8029ABD4(f32* pos, s16 state) {
}
void func_8029AC18(Camera* camera, Mat4 arg1, struct Actor* arg2) {
if (distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f) <
0) {
if (distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f) < 0) {
return;
}

View File

@ -1354,12 +1354,12 @@ s32 is_between_angle(u16 angleCCW, u16 angleCW, u16 angleToCheck) {
* @param preloadDistanceSquared Consider an object within this distance of viweable area as renderable
* @param fovDegrees The field of view (FOV) of the camera (degrees).
* @param maxDistanceSquared The maximum render distance.
* @return The xz-distance squared between the camera and the object if it's within render distance
of the camera's vision, or -1.0f if it exceeds the render distance.
* @return The xz-distance squared between the camera and the object if it's within render
distance of the camera's vision, or -1.0f if it exceeds the render distance.
*/
f32 distance_if_visible(Vec3f cameraPos, Vec3f objectPos, u16 orientationY, f32 preloadDistanceSquared,
f32 fovDegrees, f32 maxDistanceSquared) {
f32 distance_if_visible(Vec3f cameraPos, Vec3f objectPos, u16 orientationY, f32 preloadDistanceSquared, f32 fovDegrees,
f32 maxDistanceSquared) {
u16 angleObject;
UNUSED u16 pad;
u16 preloadAngle;

View File

@ -916,7 +916,8 @@ void func_8028FCBC(void) {
}
switch (D_800DC510) {
case 0:
if (!gDemoMode) { // If we're not in the demo mode, play the starting fanfare for the current mode (Grand Prix / Time Trials / VS / Battle)
if (!gDemoMode) { // If we're not in the demo mode, play the starting fanfare for the current mode (Grand
// Prix / Time Trials / VS / Battle)
if (gModeSelection == GRAND_PRIX) {
play_sequence2(SEQ_EVENT_RACE_STARTING);
play_sound2(SOUND_ACTION_REV_ENGINE);

View File

@ -1798,7 +1798,6 @@ void render_texture_tile_rgba32_block(s16 x, s16 y, u8* texture, u32 width, u32
texSize -= (width * heightDiv * 4);
}
centerY += heightDiv;
}
@ -2480,9 +2479,13 @@ void draw_minimap_character(s32 arg0, s32 playerId, s32 characterId) {
// huh?
if (characterId != 8) {
if ((gGPCurrentRaceRankByPlayerId[playerId] == 0) && (gModeSelection != 3) && (gModeSelection != 1)) {
func_80046424(x, y, player->rotation[1] + 0x8000, 1.0f, (u8*)&common_texture_minimap_kart_mario[characterId * 64], common_vtx_player_minimap_icon, 8, 8, 8, 8);
func_80046424(x, y, player->rotation[1] + 0x8000, 1.0f,
(u8*) &common_texture_minimap_kart_mario[characterId * 64],
common_vtx_player_minimap_icon, 8, 8, 8, 8);
} else {
func_800463B0(x, y, player->rotation[1] + 0x8000, 1.0f, (u8*)&common_texture_minimap_kart_mario[characterId * 64], common_vtx_player_minimap_icon, 8, 8, 8, 8);
func_800463B0(x, y, player->rotation[1] + 0x8000, 1.0f,
(u8*) &common_texture_minimap_kart_mario[characterId * 64],
common_vtx_player_minimap_icon, 8, 8, 8, 8);
}
} else {
if (gGPCurrentRaceRankByPlayerId[playerId] == 0) {

View File

@ -483,7 +483,8 @@ void render_players_on_screen_one(void) {
s32 junk[] = { 0, 0, 0 };
Vtx* gPlayerVtx[] = { gPlayerOneVtx, gPlayerTwoVtx, gPlayerThreeVtx, gPlayerFourVtx, gPlayerFiveVtx, gPlayerSixVtx, gPlayerSevenVtx, gPlayerEightVtx };
Vtx* gPlayerVtx[] = { gPlayerOneVtx, gPlayerTwoVtx, gPlayerThreeVtx, gPlayerFourVtx,
gPlayerFiveVtx, gPlayerSixVtx, gPlayerSevenVtx, gPlayerEightVtx };
f32 gCharacterSize[] = { MARIO_SIZE, LUIGI_SIZE, YOSHI_SIZE, TOAD_SIZE, DK_SIZE, WARIO_SIZE, PEACH_SIZE, BOWSER_SIZE };
@ -956,7 +957,8 @@ void func_80022A98(Player* player, s8 playerIndex) {
if ((player->type & PLAYER_EXISTS) == PLAYER_EXISTS) {
func_80026A48(player, playerIndex);
func_800235AC(player, playerIndex);
if (((player->effects & SQUISH_EFFECT) == SQUISH_EFFECT) || ((player->effects & POST_SQUISH_EFFECT) == POST_SQUISH_EFFECT)) {
if (((player->effects & SQUISH_EFFECT) == SQUISH_EFFECT) ||
((player->effects & POST_SQUISH_EFFECT) == POST_SQUISH_EFFECT)) {
if ((player->effects & SQUISH_EFFECT) == SQUISH_EFFECT) {
func_80022B50(player, playerIndex);
}
@ -1073,8 +1075,8 @@ void change_player_color_effect_rgb(UNUSED Player* player, s8 playerIndex, s32 a
gPlayerRedEffect[playerIndex] =
(s16) ((f32) gPlayerRedEffect[playerIndex] - ((gPlayerRedEffect[playerIndex] - ((arg2 >> 16) & 0xFF)) * alpha));
gPlayerGreenEffect[playerIndex] =
(s16) ((f32) gPlayerGreenEffect[playerIndex] - ((gPlayerGreenEffect[playerIndex] - ((arg2 >> 8) & 0xFF)) * alpha));
gPlayerGreenEffect[playerIndex] = (s16) ((f32) gPlayerGreenEffect[playerIndex] -
((gPlayerGreenEffect[playerIndex] - ((arg2 >> 8) & 0xFF)) * alpha));
gPlayerBlueEffect[playerIndex] =
(s16) ((f32) gPlayerBlueEffect[playerIndex] - ((gPlayerBlueEffect[playerIndex] - (arg2 & 0xFF)) * alpha));
@ -1093,10 +1095,14 @@ void change_player_color_effect_cmy(UNUSED Player* player, s8 playerIndex, s32 a
bool is_player_under_light_luigi_raceway(Player* player, s8 playerIndex) {
switch (gCurrentCourseId) {
case COURSE_LUIGI_RACEWAY:
if (((gNearestPathPointByPlayerId[playerIndex] >= 0x14F) && (gNearestPathPointByPlayerId[playerIndex] < 0x158)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x15E) && (gNearestPathPointByPlayerId[playerIndex] < 0x164)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x169) && (gNearestPathPointByPlayerId[playerIndex] < 0x170)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x174) && (gNearestPathPointByPlayerId[playerIndex] < 0x17A)) ||
if (((gNearestPathPointByPlayerId[playerIndex] >= 0x14F) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x158)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x15E) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x164)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x169) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x170)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x174) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x17A)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x17E) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x184))) { // under a light in the tunnel
change_player_color_effect_rgb(player, playerIndex, COLOR_LIGHT, 0.3f);
@ -1114,18 +1120,26 @@ bool is_player_under_light_luigi_raceway(Player* player, s8 playerIndex) {
void render_light_environment_on_player(Player* player, s8 playerIndex) {
switch (gCurrentCourseId) {
case COURSE_BOWSER_CASTLE:
if (((gNearestPathPointByPlayerId[playerIndex] >= 0x15) && (gNearestPathPointByPlayerId[playerIndex] < 0x2A)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x14D) && (gNearestPathPointByPlayerId[playerIndex] < 0x15C)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x1D1) && (gNearestPathPointByPlayerId[playerIndex] < 0x1E4)) ||
if (((gNearestPathPointByPlayerId[playerIndex] >= 0x15) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x2A)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x14D) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x15C)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x1D1) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x1E4)) ||
(player->collision.surfaceDistance[2] >= 500.0f)) { // over lava
change_player_color_effect_rgb(player, playerIndex, COLOR_LAVA, 0.3f);
change_player_color_effect_cmy(player, playerIndex, 0x004040, 0.3f);
D_80164B80[playerIndex] = 0;
} else if (((gNearestPathPointByPlayerId[playerIndex] >= 0xF1) && (gNearestPathPointByPlayerId[playerIndex] < 0xF5)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0xFB) && (gNearestPathPointByPlayerId[playerIndex] < 0xFF)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x105) && (gNearestPathPointByPlayerId[playerIndex] < 0x109)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x10F) && (gNearestPathPointByPlayerId[playerIndex] < 0x113)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x145) && (gNearestPathPointByPlayerId[playerIndex] < 0x14A)) ||
} else if (((gNearestPathPointByPlayerId[playerIndex] >= 0xF1) &&
(gNearestPathPointByPlayerId[playerIndex] < 0xF5)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0xFB) &&
(gNearestPathPointByPlayerId[playerIndex] < 0xFF)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x105) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x109)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x10F) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x113)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x145) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x14A)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x15E) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x163))) { // under a lamp
change_player_color_effect_rgb(player, playerIndex, COLOR_LIGHT, 0.3f);
@ -1138,23 +1152,40 @@ void render_light_environment_on_player(Player* player, s8 playerIndex) {
}
break;
case COURSE_BANSHEE_BOARDWALK:
if (((gNearestPathPointByPlayerId[playerIndex] >= 0xD) && (gNearestPathPointByPlayerId[playerIndex] < 0x15)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x29) && (gNearestPathPointByPlayerId[playerIndex] < 0x39)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x46) && (gNearestPathPointByPlayerId[playerIndex] < 0x4E)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x5F) && (gNearestPathPointByPlayerId[playerIndex] < 0x67)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x7B) && (gNearestPathPointByPlayerId[playerIndex] < 0x86)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x9D) && (gNearestPathPointByPlayerId[playerIndex] < 0xA6)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0xB9) && (gNearestPathPointByPlayerId[playerIndex] < 0xC3)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0xB9) && (gNearestPathPointByPlayerId[playerIndex] < 0xC3)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0xD7) && (gNearestPathPointByPlayerId[playerIndex] < 0xE1)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x10E) && (gNearestPathPointByPlayerId[playerIndex] < 0x119)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x154) && (gNearestPathPointByPlayerId[playerIndex] < 0x15F)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x1EF) && (gNearestPathPointByPlayerId[playerIndex] < 0x1F7)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x202) && (gNearestPathPointByPlayerId[playerIndex] < 0x209)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x216) && (gNearestPathPointByPlayerId[playerIndex] < 0x21D)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x230) && (gNearestPathPointByPlayerId[playerIndex] < 0x23A)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x24C) && (gNearestPathPointByPlayerId[playerIndex] < 0x256)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x288) && (gNearestPathPointByPlayerId[playerIndex] < 0x269)) ||
if (((gNearestPathPointByPlayerId[playerIndex] >= 0xD) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x15)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x29) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x39)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x46) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x4E)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x5F) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x67)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x7B) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x86)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x9D) &&
(gNearestPathPointByPlayerId[playerIndex] < 0xA6)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0xB9) &&
(gNearestPathPointByPlayerId[playerIndex] < 0xC3)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0xB9) &&
(gNearestPathPointByPlayerId[playerIndex] < 0xC3)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0xD7) &&
(gNearestPathPointByPlayerId[playerIndex] < 0xE1)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x10E) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x119)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x154) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x15F)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x1EF) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x1F7)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x202) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x209)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x216) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x21D)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x230) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x23A)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x24C) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x256)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x288) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x269)) ||
((gNearestPathPointByPlayerId[playerIndex] >= 0x274) &&
(gNearestPathPointByPlayerId[playerIndex] < 0x27E))) { // under a lamp
change_player_color_effect_rgb(player, playerIndex, COLOR_LIGHT, 0.3f);
@ -1271,7 +1302,8 @@ void func_800235AC(Player* player, s8 playerIndex) {
}
void func_80023BF0(Player* player, s8 playerId, s8 screenId, s8 arg3) {
if (((player->effects & SQUISH_EFFECT) == SQUISH_EFFECT) || ((player->effects & POST_SQUISH_EFFECT) == POST_SQUISH_EFFECT)) {
if (((player->effects & SQUISH_EFFECT) == SQUISH_EFFECT) ||
((player->effects & POST_SQUISH_EFFECT) == POST_SQUISH_EFFECT)) {
func_80022CA8(player, playerId, screenId, arg3);
} else {
func_80022E84(player, playerId, screenId, arg3);
@ -1301,10 +1333,13 @@ void render_player_shadow(Player* player, s8 playerId, s8 screenId) {
spAC = -sins(temp_t9 << 7) * 2;
if (((player->effects & EXPLOSION_CRASH_EFFECT) == EXPLOSION_CRASH_EFFECT) ||
((player->effects & HIT_BY_GREEN_SHELL_EFFECT) == HIT_BY_GREEN_SHELL_EFFECT) || ((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) ||
((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) || ((player->effects & HIT_BY_GREEN_SHELL_EFFECT) == HIT_BY_GREEN_SHELL_EFFECT) ||
((player->unk_0CA & 2) == 2) || ((player->effects & HIT_BY_STAR_EFFECT) == HIT_BY_STAR_EFFECT) ||
((player->effects & TERRAIN_TUMBLE_EFFECT) == TERRAIN_TUMBLE_EFFECT) || ((player->effects & MIDAIR_EFFECT) == MIDAIR_EFFECT)) {
((player->effects & HIT_BY_GREEN_SHELL_EFFECT) == HIT_BY_GREEN_SHELL_EFFECT) ||
((player->effects & UNKNOWN_EFFECT_0x80000) == UNKNOWN_EFFECT_0x80000) ||
((player->effects & UNKNOWN_EFFECT_0x800000) == UNKNOWN_EFFECT_0x800000) ||
((player->effects & HIT_BY_GREEN_SHELL_EFFECT) == HIT_BY_GREEN_SHELL_EFFECT) || ((player->unk_0CA & 2) == 2) ||
((player->effects & HIT_BY_STAR_EFFECT) == HIT_BY_STAR_EFFECT) ||
((player->effects & TERRAIN_TUMBLE_EFFECT) == TERRAIN_TUMBLE_EFFECT) ||
((player->effects & MIDAIR_EFFECT) == MIDAIR_EFFECT)) {
var_f2 = (f32) (1.0 - ((f64) player->collision.surfaceDistance[2] * 0.02));
if (var_f2 < 0.0f) {
@ -1747,7 +1782,8 @@ void render_player(Player* player, s8 playerId, s8 screenId) {
void func_80026A48(Player* player, s8 playerIndex) {
f32 temp_f0;
if (((player->effects & EARLY_START_SPINOUT_EFFECT) == EARLY_START_SPINOUT_EFFECT) && ((player->type & PLAYER_START_SEQUENCE) == 0)) {
if (((player->effects & EARLY_START_SPINOUT_EFFECT) == EARLY_START_SPINOUT_EFFECT) &&
((player->type & PLAYER_START_SEQUENCE) == 0)) {
player->tyreSpeed += D_800DDE74[8];
if (player->tyreSpeed >= 0x400) {
player->tyreSpeed = 0;
@ -1779,10 +1815,14 @@ void update_wheel_palette(Player* player, s8 playerId, s8 screenId, s8 arg3) {
s16 temp_t2 = player->tyreSpeed;
s16 temp_num = 0x40; // setting this as a variable gets rid of regalloc
if (((player->effects & EARLY_START_SPINOUT_EFFECT) == EARLY_START_SPINOUT_EFFECT) && ((player->type & PLAYER_START_SEQUENCE) == 0)) {
if (((player->effects & BANANA_SPINOUT_EFFECT) != BANANA_SPINOUT_EFFECT) && ((player->effects & DRIVING_SPINOUT_EFFECT) != DRIVING_SPINOUT_EFFECT) &&
((player->effects & LIGHTNING_STRIKE_EFFECT) != LIGHTNING_STRIKE_EFFECT) && ((player->effects & UNKNOWN_EFFECT_0x80000) != UNKNOWN_EFFECT_0x80000) &&
((player->effects & UNKNOWN_EFFECT_0x800000) != UNKNOWN_EFFECT_0x800000) && ((player->unk_044 & 0x800) == 0)) {
if (((player->effects & EARLY_START_SPINOUT_EFFECT) == EARLY_START_SPINOUT_EFFECT) &&
((player->type & PLAYER_START_SEQUENCE) == 0)) {
if (((player->effects & BANANA_SPINOUT_EFFECT) != BANANA_SPINOUT_EFFECT) &&
((player->effects & DRIVING_SPINOUT_EFFECT) != DRIVING_SPINOUT_EFFECT) &&
((player->effects & LIGHTNING_STRIKE_EFFECT) != LIGHTNING_STRIKE_EFFECT) &&
((player->effects & UNKNOWN_EFFECT_0x80000) != UNKNOWN_EFFECT_0x80000) &&
((player->effects & UNKNOWN_EFFECT_0x800000) != UNKNOWN_EFFECT_0x800000) &&
((player->unk_044 & 0x800) == 0)) {
if (frameId <= 20) {
load_player_data_non_blocking(player,
@ -1809,9 +1849,12 @@ void update_wheel_palette(Player* player, s8 playerId, s8 screenId, s8 arg3) {
}
}
} else {
if (((player->effects & BANANA_SPINOUT_EFFECT) != BANANA_SPINOUT_EFFECT) && ((player->effects & DRIVING_SPINOUT_EFFECT) != DRIVING_SPINOUT_EFFECT) &&
((player->effects & UNKNOWN_EFFECT_0x80000) != UNKNOWN_EFFECT_0x80000) && ((player->effects & UNKNOWN_EFFECT_0x800000) != UNKNOWN_EFFECT_0x800000) &&
((player->effects & LIGHTNING_STRIKE_EFFECT) != LIGHTNING_STRIKE_EFFECT) && ((player->unk_044 & 0x800) == 0)) {
if (((player->effects & BANANA_SPINOUT_EFFECT) != BANANA_SPINOUT_EFFECT) &&
((player->effects & DRIVING_SPINOUT_EFFECT) != DRIVING_SPINOUT_EFFECT) &&
((player->effects & UNKNOWN_EFFECT_0x80000) != UNKNOWN_EFFECT_0x80000) &&
((player->effects & UNKNOWN_EFFECT_0x800000) != UNKNOWN_EFFECT_0x800000) &&
((player->effects & LIGHTNING_STRIKE_EFFECT) != LIGHTNING_STRIKE_EFFECT) &&
((player->unk_044 & 0x800) == 0)) {
if (frameId <= 20) {
load_player_data_non_blocking(player,

View File

@ -6741,7 +6741,8 @@ void func_80082F1C(s32 objectIndex, s32 arg1) {
gObjectList[objectIndex].vertex = (Vtx*) d_course_yoshi_valley_unk4;
gObjectList[objectIndex].sizeScaling = 0.027f;
object_next_state(objectIndex);
set_obj_origin_pos(objectIndex, D_800E5DF4[arg1 * 4 + 0] * xOrientation, D_800E5DF4[arg1 * 4 + 1], D_800E5DF4[arg1 * 4 + 2]);
set_obj_origin_pos(objectIndex, D_800E5DF4[arg1 * 4 + 0] * xOrientation, D_800E5DF4[arg1 * 4 + 1],
D_800E5DF4[arg1 * 4 + 2]);
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
set_obj_direction_angle(objectIndex, 0U, D_800E5DF4[arg1 * 4 + 3], 0U);
}
@ -7806,7 +7807,8 @@ void func_80085F74(s32 objectIndex) {
}
void func_80086074(s32 objectIndex, s32 arg1) {
set_obj_origin_pos(objectIndex, D_800E6734[arg1 * 3 + 0] * xOrientation, D_800E6734[arg1 * 3 + 1], D_800E6734[arg1 * 3 + 2]);
set_obj_origin_pos(objectIndex, D_800E6734[arg1 * 3 + 0] * xOrientation, D_800E6734[arg1 * 3 + 1],
D_800E6734[arg1 * 3 + 2]);
init_texture_object(objectIndex, &d_course_rainbow_road_static_tluts[arg1 * 256],
&d_course_rainbow_road_static_textures[arg1], 64, 64);
func_80085BB4(objectIndex);