Assorted, unrelated matches (#267)

* Assorted matches

Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
This commit is contained in:
Tyler McGavran
2022-11-01 17:07:35 -04:00
committed by GitHub
parent 1483ddaa03
commit 4647cdcd7e
34 changed files with 1877 additions and 3697 deletions
+215 -270
View File
@@ -3474,10 +3474,7 @@ s16 func_8000CC88(f32 posX, f32 posY, f32 posZ, Player *player, s32 playerId, s3
}
#ifdef MIPS_TO_C
//generated by m2c commit bece1d6db17040749f77dbbd090363cc6fb926f9
extern s16 D_801631E0;
extern s32 D_80163488;
//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c
s16 func_8000CD24(f32 posX, f32 posY, f32 posZ, s16 wayPointIndex, Player *player, s32 playerId, s32 pathIndex) {
s16 sp5E;
s32 sp48;
@@ -3494,20 +3491,14 @@ s16 func_8000CD24(f32 posX, f32 posY, f32 posZ, s16 wayPointIndex, Player *playe
s16 temp_v0_6;
s16 temp_v0_7;
s16 var_v0;
s32 temp_t0;
s32 temp_t2;
s32 temp_t4;
s32 temp_t8;
struct TrackWayPoint *temp_v1;
u16 temp_v0;
void *temp_v1_3;
void *temp_v1_4;
struct TrackWayPoint *temp_v1_3;
struct TrackWayPoint *temp_v1_4;
temp_v0 = player->unk_000;
var_f24 = posZ;
var_f20 = posX;
var_f22 = posY;
if (((temp_v0 & 0x4000) != 0) && ((temp_v0 & 0x1000) == 0)) {
if ((player->unk_000 & 0x4000) && !(player->unk_000 & 0x1000)) {
temp_v0_2 = func_8000C884(var_f20, var_f22, var_f24, wayPointIndex, pathIndex, (u16) func_802ABD40(player->unk_110.unk3A));
sp5E = temp_v0_2;
if (temp_v0_2 == -1) {
@@ -3515,11 +3506,10 @@ s16 func_8000CD24(f32 posX, f32 posY, f32 posZ, s16 wayPointIndex, Player *playe
}
goto block_17;
}
temp_t0 = playerId * 2;
sp48 = temp_t0;
if (*(&D_801631E0 + temp_t0) == 1) {
sp48 = playerId * 2;
if (D_801631E0[playerId] == 1) {
temp_a0 = player->unk_0CA;
if ((temp_a0 & 1) != 0) {
if (temp_a0 & 1) {
temp_v1 = &D_80164550[pathIndex][wayPointIndex];
player->pos[0] = (f32) temp_v1->wayPointX;
player->pos[1] = (f32) temp_v1->wayPointY;
@@ -3530,11 +3520,10 @@ s16 func_8000CD24(f32 posX, f32 posY, f32 posZ, s16 wayPointIndex, Player *playe
if (playerId == ((s32) D_80163488 % 8)) {
func_802ADDC8(&player->unk_110, 10.0f, var_f20, var_f22, var_f24);
temp_v0_3 = func_802ABD40(player->unk_110.unk3A);
temp_t8 = temp_v0_3 & 0xFFFF;
temp_v1_2 = sp48 + D_80163318;
*temp_v1_2 = temp_v0_3;
sp44 = temp_v1_2;
var_v0 = func_8000C884(var_f20, var_f22, var_f24, wayPointIndex, pathIndex, (u16) temp_t8);
var_v0 = func_8000C884(var_f20, var_f22, var_f24, wayPointIndex, pathIndex, (u16) (temp_v0_3 & 0xFFFF));
sp5E = var_v0;
if (var_v0 == -1) {
sp44 = temp_v1_2;
@@ -3543,25 +3532,23 @@ s16 func_8000CD24(f32 posX, f32 posY, f32 posZ, s16 wayPointIndex, Player *playe
}
if (var_v0 == -1) {
temp_v0_4 = func_8000C0BC(var_f20, var_f22, var_f24, (u16) *temp_v1_2, &pathIndex);
temp_t4 = temp_v0_4 * 8;
sp5E = temp_v0_4;
temp_v1_3 = D_80164550[pathIndex] + temp_t4;
player->pos[0] = (f32) temp_v1_3->unk0;
player->pos[1] = (f32) temp_v1_3->unk2;
player->pos[2] = (f32) temp_v1_3->unk4;
temp_v1_3 = &D_80164550[pathIndex][temp_v0_4];
player->pos[0] = (f32) temp_v1_3->wayPointX;
player->pos[1] = (f32) temp_v1_3->wayPointY;
player->pos[2] = (f32) temp_v1_3->wayPointZ;
}
} else {
temp_v0_5 = func_8000C9DC(var_f20, var_f22, var_f24, wayPointIndex, pathIndex);
sp5E = temp_v0_5;
if (temp_v0_5 == -1) {
temp_v0_6 = func_8000BD94(var_f20, var_f22, var_f24, pathIndex);
temp_t2 = temp_v0_6 * 8;
sp5E = temp_v0_6;
temp_v1_4 = D_80164550[pathIndex] + temp_t2;
var_f20 = (f32) temp_v1_4->unk0;
var_f22 = (f32) temp_v1_4->unk2;
temp_v1_4 = &D_80164550[pathIndex][temp_v0_6];
var_f20 = (f32) temp_v1_4->wayPointX;
var_f22 = (f32) temp_v1_4->wayPointY;
player->pos[0] = var_f20;
var_f24 = (f32) temp_v1_4->unk4;
var_f24 = (f32) temp_v1_4->wayPointZ;
player->pos[1] = var_f22;
player->pos[2] = var_f24;
func_802ADDC8(&player->unk_110, 10.0f, var_f20, var_f22, var_f24);
@@ -6697,79 +6684,55 @@ loop_13:
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80012AC0.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc
extern s16 D_801631E0;
void func_80012DC0(s32 playerId, Player *player) {
f32 sp84;
TrainCarStuff *temp_v0;
TrainCarStuff *temp_v0_2;
TrainStuff *var_s0;
TrainStuff *var_s6;
TrainStuff *var_s7;
f32 temp_f14;
f32 temp_f16;
f32 temp_f24;
f32 temp_f26;
f64 temp_f0;
f64 temp_f0_2;
f64 temp_f0_3;
f64 temp_f0_4;
s32 var_s1;
TrainCarStuff *trainCar;
f32 playerPosX;
f32 playerPosZ;
f32 x_dist;
f32 z_dist;
s32 trainIndex;
s32 passengerCarIndex;
if (*(&D_801631E0 + (playerId * 2)) != 1) {
var_s7 = D_801635A0;
var_s6 = D_801635A0;
if ((player->unk_0BC << 7) >= 0) {
temp_f24 = player->pos[0];
temp_f26 = player->pos[2];
do {
temp_f16 = var_s6->locomotive.position[0];
temp_f14 = var_s6->locomotive.position[2];
sp84 = temp_f16;
temp_f0 = (f64) (temp_f24 - temp_f16);
if ((temp_f0 > -100.0) && (temp_f0 < 100.0)) {
temp_f0_2 = (f64) (temp_f26 - temp_f14);
if ((temp_f0_2 > -100.0) && (temp_f0_2 < 100.0)) {
if (func_80006018(sp84, temp_f14, var_s6->locomotive.velocity[0], var_s6->locomotive.velocity[2], 60.0f, 20.0f, temp_f24, temp_f26) == (s32) 1U) {
if (D_801631E0[playerId] != 1) {
if (!(player->unk_0BC & 0x01000000)) {
playerPosX = player->pos[0];
playerPosZ = player->pos[2];
for (trainIndex = 0; trainIndex < NUM_TRAINS; trainIndex++) {
trainCar = &D_801635A0[trainIndex].locomotive;
x_dist = playerPosX - trainCar->position[0];
z_dist = playerPosZ - trainCar->position[2];
if ((x_dist > -100.0) && (x_dist < 100.0)) {
if ((z_dist > -100.0) && (z_dist < 100.0)) {
if (func_80006018(trainCar->position[0], trainCar->position[2], trainCar->velocity[0], trainCar->velocity[2], 60.0f, 20.0f, playerPosX, playerPosZ) == 1) {
player->statusEffects |= 0x400000;
}
temp_v0 = &var_s6->tender;
if ((var_s6->tender.isActive == (s16) 1U) && (func_80006018(temp_v0->position[0], temp_v0->position[2], temp_v0->velocity[0], temp_v0->velocity[2], 30.0f, 20.0f, temp_f24, temp_f26) == (s32) 1U)) {
player->statusEffects |= 0x400000;
}
}
}
var_s1 = 0;
var_s0 = var_s7;
loop_13:
if (var_s0->passengerCars[0].isActive == (s16) 1U) {
temp_f0_3 = (f64) (temp_f24 - var_s0->passengerCars[0].position[0]);
if ((temp_f0_3 > -100.0) && (temp_f0_3 < 100.0)) {
temp_f0_4 = (f64) (temp_f26 - var_s0->passengerCars[0].position[2]);
if (temp_f0_4 > -100.0) {
temp_v0_2 = var_s0->passengerCars;
if ((temp_f0_4 < 100.0) && (func_80006018(temp_v0_2->position[0], temp_v0_2->position[2], temp_v0_2->velocity[0], temp_v0_2->velocity[2], 30.0f, 20.0f, temp_f24, temp_f26) == (s32) 1U)) {
trainCar = &D_801635A0[trainIndex].tender;
if (trainCar->isActive == 1) {
if (func_80006018(trainCar->position[0], trainCar->position[2], trainCar->velocity[0], trainCar->velocity[2], 30.0f, 20.0f, playerPosX, playerPosZ) == 1) {
player->statusEffects |= 0x400000;
}
}
}
}
var_s1 += 0x24;
var_s0 += 0x24;
if (var_s1 != 0xB4) {
goto loop_13;
for (passengerCarIndex = 0; passengerCarIndex < NUM_PASSENGER_CAR_ENTRIES; passengerCarIndex++) {
trainCar = &D_801635A0[trainIndex].passengerCars[passengerCarIndex];
x_dist = playerPosX - trainCar->position[0];
z_dist = playerPosZ - trainCar->position[2];
if (trainCar->isActive == 1) {
if ((x_dist > -100.0) && (x_dist < 100.0)) {
if ((z_dist > -100.0) && (z_dist < 100.0)) {
if (func_80006018(trainCar->position[0], trainCar->position[2], trainCar->velocity[0], trainCar->velocity[2], 30.0f, 20.0f, playerPosX, playerPosZ) == 1) {
player->statusEffects |= 0x400000;
}
}
}
}
}
var_s7 += 0x10C;
var_s6 += 0x10C;
} while (var_s7 != D_801637B8);
}
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80012DC0.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc
@@ -7030,47 +6993,40 @@ void func_800133C4(void) {
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800133C4.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc
extern ? D_801637EC;
#ifdef NEEDS_RODATA
// data_0DD0A0_3.s
extern f64 D_800ED158;// = 300.0;
extern f64 D_800ED160;// = -300.0;
void func_80013854(Player *player) {
f32 sp70;
PaddleWheelBoatStuff *var_s0;
f32 temp_f12;
f32 temp_f14;
f32 temp_f24;
f32 temp_f26;
f32 temp_f28;
f32 var_f18;
f64 temp_f0;
f64 temp_f0_2;
s32 temp_v0;
s32 someIndex;
PaddleWheelBoatStuff *tempPaddleWheelBoat;
f32 x_diff;
f32 y_diff;
f32 z_diff;
f32 playerX;
f32 playerZ;
f32 playerY;
temp_v0 = player->unk_0BC;
if (((temp_v0 << 7) >= 0) && ((temp_v0 << 6) >= 0)) {
temp_f26 = player->pos[0];
var_f18 = player->pos[1];
temp_f28 = player->pos[2];
var_s0 = D_801637C0;
do {
if (var_s0->isActive == 1) {
temp_f12 = var_s0->position[0];
temp_f14 = var_s0->position[2];
temp_f24 = var_f18 - var_s0->position[1];
temp_f0 = (f64) (temp_f26 - temp_f12);
if ((temp_f0 > -300.0) && (temp_f0 < 300.0)) {
temp_f0_2 = (f64) (temp_f28 - temp_f14);
if ((temp_f0_2 > -300.0) && (temp_f0_2 < 300.0)) {
sp70 = var_f18;
if ((func_80006018(temp_f12, temp_f14, var_s0->velocity[0], var_s0->velocity[2], 200.0f, 60.0f, temp_f26, temp_f28) == (s32) 1) && ((f64) temp_f24 < 60.0)) {
if (((player->unk_0BC << 7) >= 0) && ((player->unk_0BC << 6) >= 0)) {
playerX = player->pos[0];
playerY = player->pos[1];
playerZ = player->pos[2];
for (someIndex = 0; someIndex < NUM_PADDLE_WHEEL_BOATS; someIndex++) {
tempPaddleWheelBoat = &D_801637C0[someIndex];
if (tempPaddleWheelBoat->isActive == 1) {
x_diff = playerX - tempPaddleWheelBoat->position[0];
y_diff = playerY - tempPaddleWheelBoat->position[1];
z_diff = playerZ - tempPaddleWheelBoat->position[2];
if ((x_diff > -300.0) && (x_diff < 300.0)) {
if ((z_diff > -300.0) && (z_diff < 300.0)) {
if ((func_80006018(tempPaddleWheelBoat->position[0], tempPaddleWheelBoat->position[2], tempPaddleWheelBoat->velocity[0], tempPaddleWheelBoat->velocity[2], 200.0f, 60.0f, playerX, playerZ) == 1) && (y_diff < 60.0)) {
player->statusEffects |= 0x80000;
}
}
}
}
var_s0 += 0x2C;
} while (var_s0 != &D_801637EC);
}
}
}
#else
@@ -7892,75 +7848,69 @@ UNUSED void func_8001530C(void) {
}
#ifdef NON_MATCHING
//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de
//void func_80015390(Camera *, Player *, ?, s32); /* extern */
void func_80015390(Camera*, Player*, s32,s32);
void func_80015314(s32 playerId, s32 arg1, s32 cameraId) {
Camera *temp_a0 = &camera1[cameraId];
Player *player = &gPlayerOne[playerId];
Camera *temp_a0;
Player *temp_a1;
//temp_a1 = &gPlayerOne[playerId];
//temp_a0 = &camera1[cameraId];
temp_a0->unk_2C = player->unk_02C[1];
func_80015390(temp_a0, player, 0, playerId);
// wtf is up with the pointer accesses here?
// What aren't they just doing thing = &some_pointer[some_index]?
temp_a1 = gPlayerOne;
temp_a0 = camera1;
temp_a1 += playerId;
temp_a0 += cameraId;
temp_a0->unk_2C = temp_a1->unk_02C[1];
func_80015390(temp_a0, temp_a1, 0);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80015314.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de
void func_8001D794(Player *, Camera *, f32 *, f32 *, f32 *, f32 *, s32); /* extern */
void func_80015390(Camera *camera, s32 arg1, s32 arg2) {
f32 sp94;
void func_80015390(Camera *camera, Player *player, s32 arg2) {
s32 stackPadding0[3];
s32 stackPadding1[3];
f32 temp_f12;
f32 sp90;
f32 sp8C;
f32 temp_f14;
Player *temp_s1;
f32 sp84;
f32 sp80;
f32 sp7C;
f32 sp64;
Player *temp_s1;
f32 temp_f12;
f32 temp_f14;
s16 temp_v0;
s32 stackPadding2[3];
Vec3f sp64;
s32 stackPadding3[3];
s32 stackPadding4[3];
s32 stackPadding5[3];
s16 var_a2;
s32 temp_v0_2;
/*
Doing the more sensible:
temp_s1 = &gPlayerOne[camera->playerId];
temp_v0 = temp_s1->unk_078;
if (temp_v0 == 0) {
leads to some regalloc differences
*/
temp_s1 = gPlayerOne;
temp_s1 += camera->playerId;
if (temp_s1->unk_078 == 0) {
var_a2 = 0x0064;
} else if (temp_v0 < 0) {
var_a2 = 0xA0 - (temp_v0 / 16);
} else if (temp_s1->unk_078 < 0) {
var_a2 = 0xA0 - (temp_s1->unk_078 / 16);
} else {
var_a2 = (temp_v0 / 16) + 0xA0;
var_a2 = 0xA0 + (temp_s1->unk_078 / 16);
}
temp_v0_2 = temp_s1->unk_0BC;
if (!(temp_v0_2 & 0x80) && !(temp_v0_2 & 0x40)) {
if (!((temp_s1->unk_0BC & 0x80) || (temp_s1->unk_0BC & 0x40))) {
func_800224F0(&camera->unk_2C, temp_s1->unk_02C[1], var_a2);
}
func_8001D794(temp_s1, camera, &sp64, &sp84, &sp80, &sp7C, (s32) camera->unk_2C);
func_8001D794(temp_s1, camera, sp64, &sp84, &sp80, &sp7C, camera->unk_2C);
func_802ADDC8(&camera->unk_54, 10.0f, sp84, sp80, sp7C);
camera->lookAt[0] = sp64;
camera->lookAt[1] = sp68;
camera->lookAt[2] = sp6C;
camera->lookAt[0] = sp64[0];
camera->lookAt[1] = sp64[1];
camera->lookAt[2] = sp64[2];
camera->pos[0] = sp84;
camera->pos[1] = sp80;
temp_f12 = camera->lookAt[0] - camera->pos[0];
camera->pos[2] = sp7C;
sp90 = camera->lookAt[1] - camera->pos[1];
sp94 = temp_f12;
temp_f12 = camera->lookAt[0] - camera->pos[0];
sp90 = camera->lookAt[1] - camera->pos[1];
temp_f14 = camera->lookAt[2] - camera->pos[2];
sp8C = temp_f14;
camera->rot[1] = atan2s(temp_f12, temp_f14);
camera->rot[0] = atan2s(sqrtf((sp94 * sp94) + (temp_f14 * temp_f14)), sp90);
camera->rot[0] = atan2s(sqrtf((temp_f12 * temp_f12) + (temp_f14 * temp_f14)), sp90);
camera->rot[2] = 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80015390.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de
@@ -10727,20 +10677,17 @@ void func_8001ABEC(struct struct_801642D8 *arg0) {
}
#ifdef MIPS_TO_C
//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de
void func_8001AB74(s32, void *, s32); /* extern */
void func_8001ABE0(s32, void *, s32 *); /* extern */
void func_8001ABEC(void *, s16); /* extern */
s32 func_8007AF78(s16, s16, s32 *); /* extern */
void func_800C92CC(s32, ?, s32, struct Actor *); /* extern */
void func_800CAC60(s32); /* extern */
void func_800CAD40(u8, s16); /* extern */
extern s16 D_801631E0;
//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c
? func_8001AB74(s32, struct struct_801642D8 *, u8); /* extern */
? func_800C92CC(s32, ?, s32, struct Actor *); /* extern */
? func_800CAC60(s32); /* extern */
? func_800CAD40(u8, s16); /* extern */
extern ? D_801631E0;
extern s16 D_80163478;
extern ? D_801642D8;
extern u16 D_801646CC;
void func_8001AC10(s32 playerId, s32 arg1, s32 *arg2) {
void func_8001AC10(s32 playerId) {
Player *sp2C;
struct Actor *sp28;
Player *temp_t9;
@@ -10755,7 +10702,6 @@ void func_8001AC10(s32 playerId, s32 arg1, s32 *arg2) {
s16 temp_v1_8;
s16 temp_v1_9;
s16 var_v0;
s32 *var_a2;
s32 temp_a0;
s32 temp_v1;
s32 var_v1;
@@ -10773,22 +10719,21 @@ void func_8001AC10(s32 playerId, s32 arg1, s32 *arg2) {
struct Actor *temp_a3_8;
struct Actor *temp_a3_9;
struct TrackWayPoint *temp_v0_2;
struct struct_801642D8 *temp_s0;
u16 temp_v0;
void *temp_s0;
var_a2 = arg2;
temp_t9 = &gPlayerOne[playerId];
sp2C = temp_t9;
if ((gModeSelection != (s32) TIME_TRIALS) && (D_801646CC != (u16) 1) && !(temp_t9->unk_000 & 0x800)) {
if ((gModeSelection != (s32) 1) && (D_801646CC != (u16) 1) && !(temp_t9->unk_000 & 0x800)) {
temp_s0 = (playerId * 0x10) + &D_801642D8;
temp_a1 = temp_s0->unk0;
switch (temp_a1) { /* switch 1 */
case 0: /* switch 1 */
temp_s0->unk2 = -1;
if ((((playerId * 0x14) + 0x64) < D_80164450[playerId]) && (temp_s0->unk4 >= 0x259) && (temp_s0->unk6 < 3) && (temp_v1 = gLapCountByPlayerId[playerId], var_a2 = gPlayerPositions, ((temp_v1 < 3) != 0))) {
func_8001AB74(playerId, temp_s0, func_8007AF78((s16) temp_v1, gPlayerPositions[playerId].unk2, gPlayerPositions));
temp_s0->ffff = -1;
if ((((playerId * 0x14) + 0x64) < D_80164450[playerId]) && (temp_s0->timer >= 0x259) && (temp_s0->laps < 3) && (temp_v1 = gLapCountByPlayerId[playerId], ((temp_v1 < 3) != 0))) {
func_8001AB74(playerId, temp_s0, func_8007AF78((s32) (s16) temp_v1, gPlayerPositions[playerId].unk2));
} else {
func_8001ABE0(playerId, temp_s0, var_a2);
func_8001ABE0(playerId, (s32) temp_s0);
}
default: /* switch 1 */
break;
@@ -10813,32 +10758,32 @@ void func_8001AC10(s32 playerId, s32 arg1, s32 *arg2) {
break;
}
} else if (temp_a1 == 1) {
temp_s0->unk2 = func_802B2D70(sp2C);
temp_v1_3 = temp_s0->unk2;
temp_s0->ffff = func_802B2D70(sp2C);
temp_v1_3 = temp_s0->ffff;
if ((temp_v1_3 >= 0) && (temp_v1_3 < 0x64)) {
sp2C->statusEffects |= 0x40000;
temp_s0->unk0 = 2;
temp_s0->unk4 = 0;
temp_s0->unk6 = (s16) (temp_s0->unk6 + 1);
temp_s0->timer = 0;
temp_s0->laps += 1;
temp_s0->unkE = (s16) ((random_int(3U) * 0x14) + 0xA);
} else {
temp_s0->unk0 = 0;
temp_s0->unk4 = 0;
temp_s0->timer = 0;
}
}
break;
case 2: /* switch 1 */
temp_a3 = &gActorList[temp_s0->unk2];
temp_a3 = &gActorList[temp_s0->ffff];
if (!(temp_a3->flags & 0x8000) || (temp_a3->type != 6) || (temp_a3->state != 0) || (playerId != temp_a3->rot[0])) {
temp_s0->unk0 = 0;
temp_s0->unk4 = 0;
temp_s0->timer = 0;
sp2C->statusEffects &= 0xFFFBFFFF;
} else if (temp_s0->unkE < temp_s0->unk4) {
} else if (temp_s0->unkE < temp_s0->timer) {
temp_s0->unk0 = 3;
}
break;
case 3: /* switch 1 */
temp_a3_2 = &gActorList[temp_s0->unk2];
temp_a3_2 = &gActorList[temp_s0->ffff];
if (!(temp_a3_2->flags & 0x8000) || (temp_a3_2->type != 6) || (temp_a3_2->state != 0) || (playerId != temp_a3_2->rot[0])) {
if (playerId != temp_a3_2->rot[0]) {
@@ -10854,19 +10799,19 @@ void func_8001AC10(s32 playerId, s32 arg1, s32 *arg2) {
}
}
sp2C->statusEffects &= 0xFFFBFFFF;
temp_s0->unk4 = 0;
temp_s0->timer = 0;
temp_s0->unk0 = 0;
break;
case 34: /* switch 1 */
temp_s0->unk2 = func_802B2D70(sp2C);
temp_v1_4 = temp_s0->unk2;
temp_s0->ffff = func_802B2D70(sp2C);
temp_v1_4 = temp_s0->ffff;
if ((temp_v1_4 >= 0) && (temp_v1_4 < 0x64)) {
temp_a3_3 = &gActorList[temp_v1_4];
temp_a3_3->state = 4;
sp2C->statusEffects |= 0x40000;
temp_s0->unk0 = 0x0023;
temp_s0->unk4 = 0;
temp_s0->unk6 = (s16) (temp_s0->unk6 + 1);
temp_s0->timer = 0;
temp_s0->laps += 1;
temp_a2 = D_80163478;
temp_v0_2 = &D_80164550[*gPathIndexByPlayerId][(s32) (gNearestWaypointByPlayerId[temp_a2] + 0x1E) % (s32) gWaypointCountByPathIndex[gPathIndexByPlayerId[temp_a2]]];
temp_a3_3->velocity[0] = (f32) ((f64) ((f32) temp_v0_2->wayPointX - sp2C->pos[0]) / 20.0);
@@ -10876,14 +10821,14 @@ void func_8001AC10(s32 playerId, s32 arg1, s32 *arg2) {
func_800C92CC(playerId & 0xFF, 0x29008009, temp_a2 * 2, temp_a3_3);
func_800C98B8(sp2C->pos, sp2C->unk_034, 0x19018014U);
} else {
temp_s0->unk4 = 0;
temp_s0->timer = 0;
temp_s0->unk0 = 0;
}
break;
case 35: /* switch 1 */
temp_a3_4 = &gActorList[temp_s0->unk2];
temp_a3_4 = &gActorList[temp_s0->ffff];
if (!(temp_a3_4->flags & 0x8000) || (temp_a3_4->type != 6) || (temp_a3_4->state != 4) || (playerId != temp_a3_4->rot[0])) {
temp_s0->unk4 = 0;
temp_s0->timer = 0;
temp_s0->unk0 = 0;
sp2C->statusEffects &= 0xFFFBFFFF;
} else {
@@ -10891,13 +10836,13 @@ void func_8001AC10(s32 playerId, s32 arg1, s32 *arg2) {
temp_a3_4->velocity[1] = (f32) ((f64) temp_a3_4->velocity[1] - 0.4);
temp_a3_4->pos[2] += temp_a3_4->velocity[2];
temp_a3_4->pos[1] += temp_a3_4->velocity[1];
if (temp_s0->unk4 >= 0x15) {
if (temp_s0->timer >= 0x15) {
temp_s0->unk0 = 0x0024;
}
}
break;
case 36: /* switch 1 */
temp_a3_5 = &gActorList[temp_s0->unk2];
temp_a3_5 = &gActorList[temp_s0->ffff];
if (!(temp_a3_5->flags & 0x8000) || (temp_a3_5->type != 6) || (temp_a3_5->state != 4) || (playerId != temp_a3_5->rot[0])) {
if (playerId != temp_a3_5->rot[0]) {
@@ -10911,17 +10856,17 @@ void func_8001AC10(s32 playerId, s32 arg1, s32 *arg2) {
temp_a3_5->pos[1] = func_802AE1C0(temp_a3_5->pos[0], (f32) ((f64) temp_a3_5->pos[1] + 30.0), temp_a3_5->pos[2]) + (temp_a3_5->boundingBoxSize + 1.0f);
}
sp2C->statusEffects &= 0xFFFBFFFF;
temp_s0->unk4 = 0;
temp_s0->timer = 0;
temp_s0->unk0 = 0;
break;
case 4: /* switch 1 */
if ((s32) gNumActors < 0x50) {
temp_s0->unk2 = func_802B1C9C(sp2C);
temp_v1_5 = temp_s0->unk2;
temp_s0->ffff = func_802B1C9C(sp2C);
temp_v1_5 = temp_s0->ffff;
if ((temp_v1_5 >= 0) && (temp_v1_5 < 0x64)) {
temp_s0->unk0 = 5;
temp_s0->unk4 = 0;
temp_s0->unk6 = (s16) (temp_s0->unk6 + 1);
temp_s0->timer = 0;
temp_s0->laps += 1;
temp_s0->unkE = (s16) ((random_int(3U) * 0x14) + 0xA);
} else {
goto block_71;
@@ -10932,34 +10877,34 @@ block_71:
}
break;
case 5: /* switch 1 */
temp_a3_6 = &gActorList[temp_s0->unk2];
temp_a3_6 = &gActorList[temp_s0->ffff];
if (!(temp_a3_6->flags & 0x8000) || (temp_a3_6->type != 7) || (temp_a3_6->state != 0) || (playerId != temp_a3_6->rot[2])) {
temp_s0->unk4 = 0;
temp_s0->timer = 0;
temp_s0->unk0 = 0;
} else if (temp_s0->unkE < temp_s0->unk4) {
temp_s0->unk4 = 0;
} else if (temp_s0->unkE < temp_s0->timer) {
temp_s0->timer = 0;
temp_s0->unk0 = 6;
}
break;
case 6: /* switch 1 */
temp_a3_7 = &gActorList[temp_s0->unk2];
temp_a3_7 = &gActorList[temp_s0->ffff];
if (!(temp_a3_7->flags & 0x8000) || (temp_a3_7->type != 7) || (temp_a3_7->state != 0) || (playerId != temp_a3_7->rot[2])) {
temp_s0->unk0 = 0;
temp_s0->unk4 = 0;
temp_s0->timer = 0;
} else {
temp_a3_7->state = 1;
temp_s0->unk4 = 0;
temp_s0->timer = 0;
temp_s0->unk0 = 0;
}
break;
case 7: /* switch 1 */
if ((s32) gNumActors < 0x50) {
temp_s0->unk2 = func_802B1E48(sp2C);
temp_v1_6 = temp_s0->unk2;
temp_s0->ffff = func_802B1E48(sp2C);
temp_v1_6 = temp_s0->ffff;
if ((temp_v1_6 >= 0) && (temp_v1_6 < 0x64)) {
temp_s0->unk0 = 8;
temp_s0->unk4 = 0;
temp_s0->unk6 = (s16) (temp_s0->unk6 + 1);
temp_s0->timer = 0;
temp_s0->laps += 1;
temp_s0->unkE = (s16) ((random_int(3U) * 0x14) + 0xA);
} else {
goto block_92;
@@ -10970,34 +10915,34 @@ block_92:
}
break;
case 8: /* switch 1 */
temp_a3_8 = &gActorList[temp_s0->unk2];
temp_a3_8 = &gActorList[temp_s0->ffff];
if (!(temp_a3_8->flags & 0x8000) || (temp_a3_8->type != 8) || (temp_a3_8->state != 0) || (playerId != temp_a3_8->rot[2])) {
temp_s0->unk4 = 0;
temp_s0->timer = 0;
temp_s0->unk0 = 0;
} else if (temp_s0->unkE < temp_s0->unk4) {
} else if (temp_s0->unkE < temp_s0->timer) {
temp_s0->unk0 = 9;
}
break;
case 9: /* switch 1 */
func_8001ABEC(temp_s0, temp_a1);
temp_a3_9 = &gActorList[temp_s0->unk2];
func_8001ABEC(temp_s0);
temp_a3_9 = &gActorList[temp_s0->ffff];
if (!(temp_a3_9->flags & 0x8000) || (temp_a3_9->type != 8) || (temp_a3_9->state != 0) || (playerId != temp_a3_9->rot[2])) {
temp_s0->unk0 = 0;
temp_s0->unk4 = 0;
temp_s0->timer = 0;
} else {
temp_a3_9->state = 1;
temp_s0->unk4 = 0;
temp_s0->timer = 0;
temp_s0->unk0 = 0;
}
break;
case 10: /* switch 1 */
if ((s32) gNumActors < 0x50) {
temp_s0->unk2 = func_802B17F4(sp2C);
temp_v1_7 = temp_s0->unk2;
temp_s0->ffff = func_802B17F4(sp2C);
temp_v1_7 = temp_s0->ffff;
if ((temp_v1_7 >= 0) && (temp_v1_7 < 0x64)) {
temp_s0->unk0 = 0x000B;
temp_s0->unk4 = 0;
temp_s0->unk6 = (s16) (temp_s0->unk6 + 1);
temp_s0->timer = 0;
temp_s0->laps += 1;
temp_s0->unkE = (s16) ((random_int(3U) * 0x14) + 0x3C);
} else {
goto block_113;
@@ -11008,7 +10953,7 @@ block_113:
}
break;
case 11: /* switch 1 */
temp_a3_10 = &gActorList[temp_s0->unk2];
temp_a3_10 = &gActorList[temp_s0->ffff];
if (temp_a3_10->state == 6) {
var_v1 = 0;
if (temp_a3_10->unk1A != -1) {
@@ -11030,20 +10975,20 @@ block_113:
temp_s0->unk0 = 0;
goto block_131;
}
if (temp_s0->unkE < temp_s0->unk4) {
if (temp_s0->unkE < temp_s0->timer) {
temp_s0->unk0 = 0x000C;
temp_s0->unk8 = 0;
block_131:
temp_s0->unk4 = 0;
temp_s0->timer = 0;
}
}
break;
case 12: /* switch 1 */
if (((s16) temp_s0->unk4 % 10) == 0) {
if (((s16) temp_s0->timer % 10) == 0) {
temp_v1_8 = temp_s0->unk8;
if (temp_v1_8 < 5) {
var_v0 = 0;
temp_a3_11 = &gActorList[temp_s0->unk2];
temp_a3_11 = &gActorList[temp_s0->ffff];
switch (temp_v1_8) { /* switch 2 */
case 0: /* switch 2 */
if (temp_a3_11->unk1A != -1) {
@@ -11077,34 +11022,34 @@ block_146:
}
temp_s0->unk8 = (s16) (temp_s0->unk8 + 1);
} else {
temp_s0->unk4 = 0;
temp_s0->timer = 0;
temp_s0->unk0 = 0;
}
}
break;
case 13: /* switch 1 */
temp_s0->unk2 = func_802B2C40(sp2C);
temp_v1_9 = temp_s0->unk2;
temp_s0->ffff = func_802B2C40(sp2C);
temp_v1_9 = temp_s0->ffff;
if ((temp_v1_9 >= 0) && (temp_v1_9 < 0x64)) {
temp_s0->unk0 = 0x000E;
temp_s0->unk4 = 0;
temp_s0->unk6 = (s16) (temp_s0->unk6 + 1);
temp_s0->timer = 0;
temp_s0->laps += 1;
temp_s0->unkE = (s16) ((random_int(3U) * 0x14) + 0xA);
} else {
temp_s0->unk0 = 0;
}
break;
case 14: /* switch 1 */
temp_a3_12 = &gActorList[temp_s0->unk2];
temp_a3_12 = &gActorList[temp_s0->ffff];
if (!(temp_a3_12->flags & 0x8000) || (temp_a3_12->type != 0x000D) || (temp_a3_12->state != 0) || (playerId != (s32) temp_a3_12->velocity[0])) {
temp_s0->unk4 = 0;
temp_s0->timer = 0;
temp_s0->unk0 = 0;
} else if (temp_s0->unkE < temp_s0->unk4) {
} else if (temp_s0->unkE < temp_s0->timer) {
temp_s0->unk0 = 0x000F;
}
break;
case 15: /* switch 1 */
temp_a3_13 = &gActorList[temp_s0->unk2];
temp_a3_13 = &gActorList[temp_s0->ffff];
if (!(temp_a3_13->flags & 0x8000) || (temp_a3_13->type != 0x000D) || (temp_a3_13->state != 0) || (playerId != (s32) temp_a3_13->velocity[0])) {
if (playerId != temp_a3_13->rot[0]) {
@@ -11117,88 +11062,88 @@ block_146:
temp_a3_13->pos[1] = func_802AE1C0(temp_a3_13->pos[0], (f32) ((f64) temp_a3_13->pos[1] + 30.0), temp_a3_13->pos[2]) + temp_a3_13->boundingBoxSize;
}
}
temp_s0->unk4 = 0;
temp_s0->timer = 0;
temp_s0->unk0 = 0;
break;
case 22: /* switch 1 */
func_802B2EBC(sp2C);
func_800CAC60(playerId & 0xFF);
func_8009E5BC();
temp_s0->unk4 = 0;
temp_s0->timer = 0;
temp_s0->unk0 = 0x0017;
temp_s0->unk6 = (s16) (temp_s0->unk6 + 1);
temp_s0->laps += 1;
break;
case 23: /* switch 1 */
if (temp_s0->unk4 >= 0xF1) {
if (temp_s0->timer >= 0xF1) {
func_800CAD40((u8) playerId, temp_a1);
temp_s0->unk4 = 0;
temp_s0->timer = 0;
temp_s0->unk0 = 0;
}
break;
case 25: /* switch 1 */
sp2C->statusEffects |= 0x2000;
temp_s0->unk4 = 0;
temp_s0->timer = 0;
temp_s0->unk0 = 0x001A;
temp_s0->unk6 = (s16) (temp_s0->unk6 + 1);
temp_s0->laps += 1;
break;
case 26: /* switch 1 */
if (!(sp2C->unk_0BC & 0x200)) {
temp_s0->unk0 = 0;
}
temp_s0->unk4 = 0;
temp_s0->timer = 0;
break;
case 27: /* switch 1 */
sp2C->statusEffects |= 0x800;
temp_s0->unk4 = 0;
temp_s0->timer = 0;
temp_s0->unk0 = 0x001C;
temp_s0->unk6 = (s16) (temp_s0->unk6 + 1);
temp_s0->laps += 1;
break;
case 28: /* switch 1 */
if ((sp2C->unk_0BC << 0) >= 0) {
if (!(sp2C->unk_0BC & 0x80000000)) {
temp_s0->unk0 = 0;
}
temp_s0->unk4 = 0;
temp_s0->timer = 0;
break;
case 29: /* switch 1 */
sp2C->statusEffects |= 0x200;
temp_s0->unk4 = 0;
temp_s0->timer = 0;
temp_s0->unk0 = 0;
temp_s0->unk6 = (s16) (temp_s0->unk6 + 1);
temp_s0->laps += 1;
break;
case 30: /* switch 1 */
if (temp_s0->unk4 >= 0x3D) {
if (temp_s0->timer >= 0x3D) {
sp2C->statusEffects |= 0x200;
temp_s0->unk4 = 0;
temp_s0->timer = 0;
temp_s0->unk0 = 0x001D;
}
break;
case 31: /* switch 1 */
if (temp_s0->unk4 >= 0x3D) {
if (temp_s0->timer >= 0x3D) {
sp2C->statusEffects |= 0x200;
temp_s0->unk4 = 0;
temp_s0->timer = 0;
temp_s0->unk0 = 0x001E;
}
break;
case 32: /* switch 1 */
temp_s0->unk4 = 0;
temp_s0->timer = 0;
temp_s0->unk0 = 0x0021;
temp_s0->unkE = 0x0258;
break;
case 33: /* switch 1 */
if (((s16) temp_s0->unk4 % 60) == 0) {
if (((s16) temp_s0->timer % 60) == 0) {
sp2C->statusEffects |= 0x200;
if (temp_s0->unkE < temp_s0->unk4) {
temp_s0->unk4 = 0;
if (temp_s0->unkE < temp_s0->timer) {
temp_s0->timer = 0;
temp_s0->unk0 = 0;
}
}
break;
}
if (temp_s0->unk4 < 0x2710) {
temp_s0->unk4 = (s16) (temp_s0->unk4 + 1);
if (temp_s0->timer < 0x2710) {
temp_s0->timer += 1;
}
if (sp2C->unk_0BC & 0x80002200) {
temp_s0->unk4 = 0;
temp_s0->timer = 0;
}
}
}