Some assorted matches (#289)

Also renamed a couple variables

Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
This commit is contained in:
Tyler McGavran
2023-01-31 09:02:40 -05:00
committed by GitHub
parent d1ebe06b29
commit 533d035875
53 changed files with 392 additions and 930 deletions
+72 -95
View File
@@ -9,6 +9,7 @@
#include "code_80005FD0.h"
#include "code_8001F980.h"
#include "code_80027D00.h"
#include "code_80071F00.h"
#include "variables.h"
#include <actor_types.h>
#include "vehicles.h"
@@ -478,7 +479,7 @@ block_34:
var_t1_3 += 1;
} while (var_t1_3 != sp30);
}
var_v1_5 = gPlayerPositions;
var_v1_5 = gGPCurrentRaceRankByPlayerId;
var_v0_5 = &D_801643E0;
do {
temp_t9 = *var_v1_5;
@@ -497,7 +498,7 @@ block_34:
temp_v1_2 = *var_v0_6;
var_t2_6 += 2;
var_v0_6 += 4;
gPlayerPositions[temp_v1_2] = var_t3_3;
gGPCurrentRaceRankByPlayerId[temp_v1_2] = var_t3_3;
var_t3_3 = var_t1_4;
var_t2_6->unk-2 = (s16) temp_v1_2;
var_t1_4 += 1;
@@ -514,19 +515,19 @@ block_50:
temp_v1_3 = *var_v0_7;
var_t2_7 += 8;
var_v0_7 += 0x10;
gPlayerPositions[temp_v1_3] = var_t3_3;
gGPCurrentRaceRankByPlayerId[temp_v1_3] = var_t3_3;
temp_a1 = var_v0_7->unk-C;
temp_t7 = var_t3_3 + 2;
var_t2_7->unk-8 = (s16) temp_v1_3;
gPlayerPositions[temp_a1] = var_t1_5;
gGPCurrentRaceRankByPlayerId[temp_a1] = var_t1_5;
temp_a3 = var_v0_7->unk-8;
temp_t9_2 = var_t3_3 + 3;
var_t3_3 += 4;
gPlayerPositions[temp_a3] = temp_t7;
gGPCurrentRaceRankByPlayerId[temp_a3] = temp_t7;
temp_t0_4 = var_v0_7->unk-4;
var_t1_5 += 4;
var_t2_7->unk-6 = (s16) temp_a1;
gPlayerPositions[temp_t0_4] = temp_t9_2;
gGPCurrentRaceRankByPlayerId[temp_t0_4] = temp_t9_2;
var_t2_7->unk-4 = (s16) temp_a3;
var_t2_7->unk-2 = (s16) temp_t0_4;
} while (var_t3_3 != var_t4);
@@ -870,7 +871,7 @@ block_21:
var_a1_2 += 1;
} while (var_a1_2 != temp_t0);
}
var_v1_3 = gPlayerPositions;
var_v1_3 = gGPCurrentRaceRankByPlayerId;
var_v0_4 = &D_801643E0;
do {
temp_t7 = *var_v1_3;
@@ -889,7 +890,7 @@ block_21:
temp_v1_2 = *var_v0_5;
var_t0_3 += 2;
var_v0_5 += 4;
gPlayerPositions[temp_v1_2] = var_a3_3;
gGPCurrentRaceRankByPlayerId[temp_v1_2] = var_a3_3;
var_a3_3 = var_a1_3;
var_t0_3->unk-2 = (s16) temp_v1_2;
var_a1_3 += 1;
@@ -906,19 +907,19 @@ block_35:
temp_v1_3 = *var_v0_6;
var_t0_4 += 8;
var_v0_6 += 0x10;
gPlayerPositions[temp_v1_3] = var_a3_3;
gGPCurrentRaceRankByPlayerId[temp_v1_3] = var_a3_3;
temp_a0_6 = var_v0_6->unk-C;
temp_t6 = var_a3_3 + 2;
var_t0_4->unk-8 = (s16) temp_v1_3;
gPlayerPositions[temp_a0_6] = var_a1_4;
gGPCurrentRaceRankByPlayerId[temp_a0_6] = var_a1_4;
temp_t1_2 = var_v0_6->unk-8;
temp_t9 = var_a3_3 + 3;
var_a3_3 += 4;
gPlayerPositions[temp_t1_2] = temp_t6;
gGPCurrentRaceRankByPlayerId[temp_t1_2] = temp_t6;
temp_t2_6 = var_v0_6->unk-4;
var_a1_4 += 4;
var_t0_4->unk-6 = (s16) temp_a0_6;
gPlayerPositions[temp_t2_6] = temp_t9;
gGPCurrentRaceRankByPlayerId[temp_t2_6] = temp_t9;
var_t0_4->unk-4 = (s16) temp_t1_2;
var_t0_4->unk-2 = (s16) temp_t2_6;
} while (var_a3_3 != var_a2);
@@ -1202,7 +1203,7 @@ block_55:
var_a3_3 += 1;
} while (var_a3_3 != 7);
}
var_v1_3 = gPlayerPositions;
var_v1_3 = gGPCurrentRaceRankByPlayerId;
var_v0_4 = &D_801643E0;
do {
temp_t6_3 = *var_v1_3;
@@ -1218,19 +1219,19 @@ block_55:
temp_v1 = *var_v0_5;
var_v0_5 += 0x10;
var_a0_4 += 8;
gPlayerPositions[temp_v1] = var_t0_5;
gGPCurrentRaceRankByPlayerId[temp_v1] = var_t0_5;
temp_a1 = var_v0_5->unk-C;
temp_t8_3 = var_t0_5 + 2;
var_a0_4->unk-8 = (s16) temp_v1;
gPlayerPositions[temp_a1] = var_a3_4;
gGPCurrentRaceRankByPlayerId[temp_a1] = var_a3_4;
temp_a2 = var_v0_5->unk-8;
temp_t7_3 = var_t0_5 + 3;
var_t0_5 += 4;
gPlayerPositions[temp_a2] = temp_t8_3;
gGPCurrentRaceRankByPlayerId[temp_a2] = temp_t8_3;
temp_t1_2 = var_v0_5->unk-4;
var_a3_4 += 4;
var_a0_4->unk-6 = (s16) temp_a1;
gPlayerPositions[temp_t1_2] = temp_t7_3;
gGPCurrentRaceRankByPlayerId[temp_t1_2] = temp_t7_3;
var_a0_4->unk-4 = (s16) temp_a2;
var_a0_4->unk-2 = (s16) temp_t1_2;
} while (var_t0_5 != 8);
@@ -1276,8 +1277,8 @@ void func_80007D04(s32 playerId, Player *player) {
temp_v1 = D_80163478;
temp_t1 = D_80164450[temp_v1];
temp_t2 = D_80164450[playerId];
if (gPlayerPositions[playerId] < 2) {
if (((s16) (temp_t2 - temp_t1) >= 0x191) && ((s16)gPlayerPositions[temp_v1] >= 6)) {
if (gGPCurrentRaceRankByPlayerId[playerId] < 2) {
if (((s16) (temp_t2 - temp_t1) >= 0x191) && ((s16)gGPCurrentRaceRankByPlayerId[temp_v1] >= 6)) {
player->unk_0BC &= ~0x200000;
func_80030FC8(player);
var_t5 = 4;
@@ -1752,15 +1753,15 @@ s32 func_800088D8(s32 arg0, s16 arg1, s16 arg2) {
do {
temp_t7 = (u16) *var_a0_3;
var_a0_3 += 2;
if (gPlayerPositions[temp_t7] < arg2) {
if (gGPCurrentRaceRankByPlayerId[temp_t7] < arg2) {
var_v0 += 1;
}
} while ((u32) var_a0_3 < (u32) &D_80163348);
temp_t1_2 = D_8018EDF3;
var_a0_4 = 0;
var_v1 = gPlayerPositions;
var_v1 = gGPCurrentRaceRankByPlayerId;
if (temp_t1_2 > 0) {
sp4 = &gPlayerPositions[temp_t1_2];
sp4 = &gGPCurrentRaceRankByPlayerId[temp_t1_2];
do {
if (*var_v1 < arg2) {
var_a0_4 += 1;
@@ -2204,10 +2205,10 @@ void func_800099EC(s32 arg0, ? arg1) {
phi_s0 = 0;
phi_a0 = temp_a0;
if (temp_a0 > ZERO_PLAYERS_SELECTED) {
phi_s2 = gPlayerPositions;
phi_s2 = gGPCurrentRaceRankByPlayerId;
phi_s1 = 0;
do {
temp_v0 = gPlayerPositions[arg0];
temp_v0 = gGPCurrentRaceRankByPlayerId[arg0];
temp_v1 = *phi_s2;
if ((temp_v0 < temp_v1) && (temp_v0 == *(&D_801643E0 + phi_s1)) && (temp_v1 == *(&D_801643E0 + (arg0 * 4)))) {
func_800C92CC(arg0 & 0xFF, 0x2900800D);
@@ -2553,7 +2554,7 @@ block_63:
return;
}
temp_v0_9 = D_8018EDF3;
if ((temp_v0_9 > 0) && (temp_v0_9 < 3) && (*(&D_80163330 + sp34) == 1) && ((s32) *(&D_8016334C + sp34) < *(gPlayerPositions + sp38))) {
if ((temp_v0_9 > 0) && (temp_v0_9 < 3) && (*(&D_80163330 + sp34) == 1) && ((s32) *(&D_8016334C + sp34) < *(gGPCurrentRaceRankByPlayerId + sp38))) {
var_t0 = sp38 + &D_80163210;
*var_t0 = 0x41055555;
} else if (D_80162FD0 == (s16) 1U) {
@@ -4498,79 +4499,55 @@ void func_8000EEDC(void) {
}
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
void func_80076D70(void *, f32, s16); // extern
extern f32 D_800ED040;
extern f32 D_800ED044;
extern f32 D_800ED048;
extern f32 D_800ED04C;
extern ? gActorList;
extern ? D_801641F8;
extern ? D_801642D8;
#ifdef NEEDS_RODATA
// data/data_0DD0A0_3.s
extern f32 D_800ED040;// = 0.3f;
extern f32 D_800ED044;// = 0.45f;
extern f32 D_800ED048;// = 0.15f;
extern f32 D_800ED04C;// = 0.9f;
void func_8000EF20(void) {
? *temp_s0;
f32 temp_f22;
s16 temp_v0;
u32 temp_t0;
u32 temp_v0_2;
u32 temp_v0_3;
u32 temp_v0_4;
void *temp_s1;
? *phi_s0;
u32 phi_v0;
f32 phi_f20;
s32 someIndex;
f32 var_f20;
struct Actor *temp_s1;
struct unk_41F8 *var_s0;
temp_f22 = D_800ED048;
phi_s0 = &D_801641F8;
do {
if (phi_s0->unkC == 1) {
temp_v0 = phi_s0->unk10;
temp_t0 = phi_s0->unk14 + 1;
phi_s0->unk14 = temp_t0;
temp_s1 = &gActorList + (phi_s0->unkE * 0x70);
if (temp_v0 != 0) {
if (temp_v0 != 1) {
if (temp_v0 != 2) {
phi_v0 = temp_t0;
phi_f20 = 1.0f;
} else {
temp_v0_2 = phi_s0->unk14;
phi_v0 = temp_v0_2;
if (temp_v0_2 < 0xA) {
phi_f20 = temp_f22;
} else {
goto block_14;
}
}
for (someIndex = 0; someIndex < 8; someIndex++) {
var_s0 = &D_801641F8[someIndex];
if (var_s0->unkC == 1) {
temp_s1 = &gActorList[var_s0->unkE];
var_s0->unk14++;
switch (var_s0->unk10) {
case 0:
if (var_s0->unk14 < 0xA) {
var_f20 = 0.3f;
} else {
temp_v0_3 = phi_s0->unk14;
phi_v0 = temp_v0_3;
if (temp_v0_3 < 0xA) {
phi_f20 = temp_f22;
} else {
block_14:
phi_v0 = phi_s0->unk14;
phi_f20 = D_800ED044;
}
var_f20 = 0.9f;
}
} else {
temp_v0_4 = phi_s0->unk14;
phi_v0 = temp_v0_4;
if (temp_v0_4 < 0xA) {
phi_f20 = D_800ED040;
break;
case 1:
if (var_s0->unk14 < 0xA) {
var_f20 = 0.15f;
} else {
phi_f20 = D_800ED04C;
var_f20 = 0.45f;
}
break;
case 2:
if (var_s0->unk14 < 0xA) {
var_f20 = 0.15f;
} else {
var_f20 = 0.45f;
}
break;
default:
var_f20 = 1.0f;
break;
}
if ((phi_v0 & 1) == 0) {
func_80076D70(temp_s1 + 0x18, ((random_int(0x1E) + 0x14) * phi_f20) / 50.0f, phi_s0->unk10);
if (!(var_s0->unk14 & 1)) {
func_80076D70(temp_s1->pos, ((random_int(30) + 20) * var_f20) / 50.0f, var_s0->unk10);
}
}
temp_s0 = phi_s0 + 0x1C;
phi_s0 = temp_s0;
} while (temp_s0 != &D_801642D8);
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000EF20.s")
@@ -5067,7 +5044,7 @@ void func_8000F628(void) {
var_ra = &D_801631A0;
var_s6 = &D_801643E0;
var_s5 = &D_801634F8;
var_s4 = gPlayerPositions;
var_s4 = gGPCurrentRaceRankByPlayerId;
var_s2 = &D_80163330;
var_s1 = gPlayers;
sp4C = &D_801630B8;
@@ -5268,7 +5245,7 @@ void func_8000F628(void) {
}
var_v1 = gNearestWaypointByPlayerId;
var_v0_3 = gPathIndexByPlayerId;
var_s4_2 = gPlayerPositions;
var_s4_2 = gGPCurrentRaceRankByPlayerId;
do {
var_v1 += 2;
temp_t9_2 = (gWaypointCountByPathIndex[0 & 0xFFFF] - *var_s4_2) - 4;
@@ -10224,7 +10201,7 @@ extern s16 D_80164680;
void func_8001A124(s32 arg0, s32 arg1) {
s32 temp_v0;
temp_v0 = gPlayerPositions[arg0];
temp_v0 = gGPCurrentRaceRankByPlayerId[arg0];
switch (temp_v0) { /* irregular */
case 0:
if (random_int(0x0064U) < 0x32) {
@@ -10482,12 +10459,12 @@ void func_8001A588(s32 arg0, Camera *camera, u16 *arg2, s8 arg3, s32 arg4) {
D_801646C8 = 0;
}
if ((arg4 == 0) && ((temp_v0_4 = D_801646C8, (temp_v0_4 == 0x0000000A)) || (temp_v0_4 == 0x0000000B))) {
func_8001A518((s32) var_s0, gPlayerPositions[var_s0], 0, arg4);
func_8001A518((s32) var_s0, gGPCurrentRaceRankByPlayerId[var_s0], 0, arg4);
}
if ((gModeSelection != TIME_TRIALS) && (arg4 == 1) && ((temp_v0_5 = D_801646C8, (temp_v0_5 == 0x00000104)) || (temp_v0_5 == 0x00000105))) {
var_v1 = 0;
if (D_8018EDF3 == 2) {
func_8001A518((s32) var_s0, gPlayerPositions[var_s0], 1, arg4);
func_8001A518((s32) var_s0, gGPCurrentRaceRankByPlayerId[var_s0], 1, arg4);
} else {
sp44 = (s32) var_s0;
loop_34:
@@ -10727,14 +10704,14 @@ void func_8001AC10(s32 playerId) {
case 0: /* switch 1 */
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));
func_8001AB74(playerId, temp_s0, func_8007AF78((s32) (s16) temp_v1, gGPCurrentRaceRankByPlayerId[playerId].unk2));
} else {
func_8001ABE0(playerId, (s32) temp_s0);
}
default: /* switch 1 */
break;
case 1: /* switch 1 */
if ((gLapCountByPlayerId[playerId] > 0) && (temp_v1_2 = D_80163478, temp_a0 = gPlayerPositions[temp_v1_2], ((temp_a0 < gPlayerPositions[playerId]) != 0)) && (temp_a0 == 0)) {
if ((gLapCountByPlayerId[playerId] > 0) && (temp_v1_2 = D_80163478, temp_a0 = gGPCurrentRaceRankByPlayerId[temp_v1_2], ((temp_a0 < gGPCurrentRaceRankByPlayerId[playerId]) != 0)) && (temp_a0 == 0)) {
temp_v0 = sp2C->characterId;
switch (temp_v0) { /* switch 3; irregular */
case 4: /* switch 3 */
+3 -1
View File
@@ -21,7 +21,8 @@ struct unk_41F8 {
u16 unkC;
u16 unkE;
s16 unk10;
s32 unk14;
// s16 compilerPadding;
u32 unk14;
s32 unk18;
};
@@ -64,6 +65,7 @@ s32 func_8000EDC8(s32);
void func_8000DF8C(s32);
s32 func_8000EE10(s32);
void func_8000EE58(s32);
void func_8000EF20();
void func_8000EEDC();
void func_8000EF20();
void func_8000F0E0();
+9 -9
View File
@@ -2988,7 +2988,7 @@ void func_8004E800(s32 playerId) {
func_8004A384(temp_v0->slideRankX + temp_v0->rankX, temp_v0->slideRankY + temp_v0->rankY, 0U, temp_v0->rankScaling, 0x000000FF, D_800E55F8[temp_v1], 0, 0x000000FF, (s32) ((temp_v1 << 0xC) + D_0D00D258), D_0D0068F0, 0x00000080, 0x00000040, 0x00000080, 0x00000040);
return;
}
func_8004A384(temp_v0->slideRankX + temp_v0->rankX, temp_v0->slideRankY + temp_v0->rankY, 0U, temp_v0->rankScaling, 0x000000FF, D_800E55F8[D_80165594], 0, 0x000000FF, (s32) ((gPlayerPositions[playerId] << 0xC) + D_0D00D258), D_0D0068F0, 0x00000080, 0x00000040, 0x00000080, 0x00000040);
func_8004A384(temp_v0->slideRankX + temp_v0->rankX, temp_v0->slideRankY + temp_v0->rankY, 0U, temp_v0->rankScaling, 0x000000FF, D_800E55F8[D_80165594], 0, 0x000000FF, (s32) ((gGPCurrentRaceRankByPlayerId[playerId] << 0xC) + D_0D00D258), D_0D0068F0, 0x00000080, 0x00000040, 0x00000080, 0x00000040);
}
}
#else
@@ -3007,11 +3007,11 @@ void func_8004E998(s32 playerId) {
temp_v0 = &D_8018CA70[playerId];
if ((u8) temp_v0->unk_81 != 0) {
if (temp_v0->lapCount != 3) {
temp_v1 = gPlayerPositions[playerId];
temp_v1 = gGPCurrentRaceRankByPlayerId[playerId];
func_8004A384(temp_v0->slideRankX + temp_v0->rankX, temp_v0->slideRankY + temp_v0->rankY, 0U, temp_v0->rankScaling, 0x000000FF, D_800E5618[temp_v1], 0, 0x000000FF, (s32) ((temp_v1 << 0xB) + D_0D015258), D_0D006030, 0x00000040, 0x00000040, 0x00000040, 0x00000040);
return;
}
func_8004A384(temp_v0->slideRankX + temp_v0->rankX, temp_v0->slideRankY + temp_v0->rankY, 0U, temp_v0->rankScaling, 0x000000FF, D_800E5618[D_80165598], 0, 0x000000FF, (s32) ((gPlayerPositions[playerId] << 0xB) + D_0D015258), D_0D006030, 0x00000040, 0x00000040, 0x00000040, 0x00000040);
func_8004A384(temp_v0->slideRankX + temp_v0->rankX, temp_v0->slideRankY + temp_v0->rankY, 0U, temp_v0->rankScaling, 0x000000FF, D_800E5618[D_80165598], 0, 0x000000FF, (s32) ((gGPCurrentRaceRankByPlayerId[playerId] << 0xB) + D_0D015258), D_0D006030, 0x00000040, 0x00000040, 0x00000040, 0x00000040);
}
}
#else
@@ -3195,14 +3195,14 @@ void func_8004F168(s32 arg0, s32 arg1, s32 arg2) {
temp_a0 = ((*(&D_8018D2C0 + temp_t0) + D_8018D2F0) - ((s16) D_8018D2B0 / 2)) + D_8018D2E0 + (s16) (s32) (temp_v1->pos[0] * D_8018D2A0);
temp_a1 = ((*(&D_8018D2D8 + temp_t0) + D_8018D2F8) - ((s16) D_8018D2B8 / 2)) + D_8018D2E8 + (s32) (temp_v1->pos[2] * D_8018D2A0);
if (arg2 != 8) {
if ((gPlayerPositions[arg1] == 0) && (gModeSelection != 3) && (gModeSelection != 1)) {
if ((gGPCurrentRaceRankByPlayerId[arg1] == 0) && (gModeSelection != 3) && (gModeSelection != 1)) {
func_80046424((s32) temp_a0, (s32) temp_a1, (temp_v1->unk_02C[1] + 0x8000) & 0xFFFF, 1.0f, (s32) gMiniMapKartTextures[arg2], (s32) D_0D005470, 8, 8, 8, 8);
return;
}
func_800463B0((s32) temp_a0, (s32) temp_a1, (temp_v1->unk_02C[1] + 0x8000) & 0xFFFF, 1.0f, (s32) gMiniMapKartTextures[arg2], (s32) D_0D005470, 8, 8, 8, 8);
return;
}
if (gPlayerPositions[arg1] == 0) {
if (gGPCurrentRaceRankByPlayerId[arg1] == 0) {
func_8004C450((s32) temp_a0, (s32) temp_a1, 8U, 8U, (s32) gTextureMiniMapProgressDot);
return;
}
@@ -3715,7 +3715,7 @@ extern ? D_8018D028;
extern f32 D_8018D050;
extern ? D_8018D078;
extern s32 D_8018D3E0;
extern ? gGPCurrentRaceRanks;
extern ? gGPCurrentRaceCharacterIdByRank;
void func_80050320(void) {
Gfx *temp_v1_3;
@@ -3749,7 +3749,7 @@ void func_80050320(void) {
if ((f64) *(&D_8018D078 + var_s1) < 0.0) {
var_a0 = 1;
}
temp_v1 = *((var_s0 * 2) + &gGPCurrentRaceRanks);
temp_v1 = *((var_s0 * 2) + &gGPCurrentRaceCharacterIdByRank);
temp_a1 = gLapCountByPlayerId[gGPCurrentRacePlayerIdByRank[var_s0]];
if (temp_v1 == gPlayerOne->characterId) {
func_8004FDB4(*temp_t0, temp_f14, var_a0, temp_a1, var_s0, (s16) temp_a1, (s32) temp_v1, 0x000000FF, 1, var_a0, 0);
@@ -3832,7 +3832,7 @@ s32 func_80050644(u16 arg0, s32 *arg1, s32 *arg2) {
}
} else if (gPlayerCountSelection1 == 1) {
*arg1 = 0x00000020;
*arg2 = (gPlayerPositions[arg0] * 0x14) + 0x20;
*arg2 = (gGPCurrentRaceRankByPlayerId[arg0] * 0x14) + 0x20;
} else {
thing = (s32) (gLapCompletionPercentByPlayerId[arg0] * 260);
*arg1 = thing;
@@ -4324,7 +4324,7 @@ void func_800514BC(void) {
if (gModeSelection == TIME_TRIALS) {
func_80050E34(0, D_80164408);
} else if (gPlayerCountSelection1 == 1) {
func_80050E34(0, *gPlayerPositions);
func_80050E34(0, *gGPCurrentRaceRankByPlayerId);
}
temp_v1 = gDisplayListHead;
gDisplayListHead = temp_v1 + 8;
+24 -69
View File
@@ -668,45 +668,31 @@ void func_80059358(void) {
}
#ifdef MIPS_TO_C
//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b
extern s8 D_801657B0;
void func_80059360(void) {
if (D_801657B0 == 0) {
func_8004FA78(0);
if (D_8018CA70->lapCount != 3) {
func_8004CB60((s32) D_8018CA70->lapX, (s32) D_8018CA70->lapY, (s32) D_0D00A958);
func_8004FC78((s16) (D_8018CA70->lapX + 0xC), (s16) (D_8018CA70->lapY - 4), D_8018CA70->alsoLapCount);
if (D_8018CA70[0].lapCount != 3) {
func_8004CB60(D_8018CA70[0].lapX, D_8018CA70[0].lapY, D_0D00A958);
func_8004FC78(D_8018CA70[0].lapX + 0xC, D_8018CA70[0].lapY - 4, D_8018CA70[0].alsoLapCount);
func_8004E638(0);
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80059360.s")
#endif
void func_800593F0(void) {
}
#ifdef MIPS_TO_C
//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b
extern s8 D_801657B0;
void func_800593F8(void) {
if (D_801657B0 == 0) {
func_8004FA78(1);
if (D_8018CA70->unkF5 != 3) {
func_8004CB60((s32) D_8018CA70->unkDE, (s32) D_8018CA70->unkE4, (s32) D_0D00A958);
func_8004FC78((s16) (D_8018CA70->unkDE + 0xC), (s16) (D_8018CA70->unkE4 - 4), D_8018CA70->unkF6);
if (D_8018CA70[1].lapCount != 3) {
func_8004CB60(D_8018CA70[1].lapX, D_8018CA70[1].lapY, D_0D00A958);
func_8004FC78(D_8018CA70[1].lapX + 0xC, D_8018CA70[1].lapY - 4, D_8018CA70[1].alsoLapCount);
func_8004E638(1);
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80057C60/func_800593F8.s")
#endif
void func_80059488(s32 arg0) {
if ((gModeSelection != BATTLE) && (*(&D_80165800 + arg0) == 0) && (D_8018D188 != 0)) {
@@ -970,51 +956,20 @@ void func_80059AC8(void) {
GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80059AC8.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b
extern ? D_801643D8;
extern ? D_8018CF90;
extern ? D_8018CF98;
extern ? gGPCurrentRaceRanks;
void func_80059C50(void) {
? *var_v0;
? *var_v1;
s16 *var_a0;
s32 *var_v0_2;
s32 temp_lo;
s32 temp_t0;
s32 temp_t1;
s32 temp_t2;
s32 temp_t9;
s32 someIndex;
s32 playerId;
func_8005A3C0();
var_v0 = &gGPCurrentRaceRanks;
var_a0 = gGPCurrentRacePlayerIdByRank;
do {
var_v0 += 2;
temp_lo = *var_a0 * 0xDD8;
var_a0 += 2;
var_v0->unk-2 = (u16) (temp_lo + gPlayerOne)->unk254;
} while ((u32) var_v0 < (u32) &D_8018CF90);
var_v0_2 = gPlayerPositions;
var_v1 = &D_8018CF98;
do {
temp_t0 = var_v0_2->unk4;
temp_t1 = var_v0_2->unk8;
temp_t2 = var_v0_2->unkC;
temp_t9 = var_v0_2->unk0;
var_v0_2 += 0x10;
var_v1 += 8;
var_v1->unk-6 = (s16) temp_t0;
var_v1->unk-4 = (s16) temp_t1;
var_v1->unk-2 = (s16) temp_t2;
var_v1->unk-8 = (s16) temp_t9;
} while (var_v0_2 != &D_801643D8);
for (someIndex = 0; someIndex < 8; someIndex++) {
playerId = gGPCurrentRacePlayerIdByRank[someIndex];
// I hate this dumb pointer access here
gGPCurrentRaceCharacterIdByRank[someIndex] = (gPlayerOne + playerId)->characterId;
}
for (someIndex = 0; someIndex < 8; someIndex++) {
D_8018CF98[someIndex] = gGPCurrentRaceRankByPlayerId[someIndex];
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80059C50.s")
#endif
void func_80059D00(void) {
@@ -2208,7 +2163,7 @@ block_76:
func_8005AA94(0x00000082);
goto block_76;
case 0x80:
if (*gPlayerPositions < 4) {
if (*gGPCurrentRaceRankByPlayerId < 4) {
func_8005AA6C(0x0000008C);
} else {
func_8005AA6C(0x00000082);
@@ -2533,7 +2488,7 @@ extern s32 D_8018D3E8;
extern s32 D_8018D3EC;
extern s32 D_8018D3F4;
extern s32 D_8018D3F8;
extern ? gGPCurrentRaceRanks;
extern ? gGPCurrentRaceCharacterIdByRank;
static struct _struct_D_800E55D0_0x3 D_800E55D0[0xD] = {
{ 0x64, 0x64, 0x64 },
{ 0x96, 0x96, 0x73 },
@@ -2570,7 +2525,7 @@ void func_8005C980(void) {
temp_a3 = gPlayerOne;
temp_a1 = D_80165590;
var_a0 = gPlayerPositions;
var_a0 = gGPCurrentRaceRankByPlayerId;
var_v0 = 0;
do {
temp_v1 = *var_a0;
@@ -2591,23 +2546,23 @@ void func_8005C980(void) {
temp_v0 = var_a0_2->unk0;
var_t0->unk0 = temp_v0;
if (temp_a1 == 0) {
*(&gGPCurrentRaceRanks + var_v1) = temp_a3[temp_v0].characterId;
*(&gGPCurrentRaceCharacterIdByRank + var_v1) = temp_a3[temp_v0].characterId;
}
temp_a2 = var_a0_2->unk2;
var_t0->unk2 = temp_a2;
if (temp_a1 == 0) {
(&gGPCurrentRaceRanks + var_v1)->unk2 = (u16) temp_a3[temp_a2].characterId;
(&gGPCurrentRaceCharacterIdByRank + var_v1)->unk2 = (u16) temp_a3[temp_a2].characterId;
}
temp_a2_2 = var_a0_2->unk4;
var_t0->unk4 = temp_a2_2;
if (temp_a1 == 0) {
(&gGPCurrentRaceRanks + var_v1)->unk4 = (u16) temp_a3[temp_a2_2].characterId;
(&gGPCurrentRaceCharacterIdByRank + var_v1)->unk4 = (u16) temp_a3[temp_a2_2].characterId;
}
temp_a2_3 = var_a0_2->unk6;
var_a0_2 += 8;
var_t0->unk6 = temp_a2_3;
if (temp_a1 == 0) {
(&gGPCurrentRaceRanks + var_v1)->unk6 = (u16) temp_a3[temp_a2_3].characterId;
(&gGPCurrentRaceCharacterIdByRank + var_v1)->unk6 = (u16) temp_a3[temp_a2_3].characterId;
}
var_t0 += 8;
var_v1 += 8;
@@ -2838,7 +2793,7 @@ void func_8005D18C(void) {
D_801657D8 = 1;
D_8018D2BC = 0;
D_8018D2A4 = 0;
if (gPlayerPositions[0] >= 4) {
if (gGPCurrentRaceRankByPlayerId[0] >= 4) {
D_8018D1FC = 1;
D_8018D2A4 = 1;
D_8018D2BC = 1;
+3
View File
@@ -55,6 +55,7 @@ void func_800598D4(s32);
void func_8005994C();
void func_8005995C();
void func_80059A88(s32);
void func_80059C50();
void func_80059D00();
void func_8005A070();
@@ -301,6 +302,8 @@ extern s8 D_801657D8;
extern s8 D_801657E8;
extern s8 D_8018CAE0;
extern s16 gGPCurrentRaceCharacterIdByRank[];
extern s16 D_8018CF98[];
extern s32 D_8018D120;
extern s32 D_8018D170;
+9 -9
View File
@@ -1878,7 +1878,7 @@ void func_80071428(void) {
D_8018CA70->itemBoxY = -0x0020;
D_8018CA70->slideItemBoxX = 0;
D_8018CA70->slideItemBoxY = 0;
D_8018CA70->stagingPosition = (s16) *gPlayerPositions;
D_8018CA70->stagingPosition = (s16) *gGPCurrentRaceRankByPlayerId;
func_8006EE7C(*gItemWindowObjectByPlayerId);
var_f0 = 35.0f;
var_v0 = &D_8018D078;
@@ -2016,8 +2016,8 @@ void func_80071818(void) {
D_8018CA70->unkE4 = 0x0028;
func_8006EE7C(*(gItemWindowObjectByPlayerId + 4));
D_8018CA70->unk88 = 0.5f;
D_8018CA70->stagingPosition = (s16) gPlayerPositions->unk0;
D_8018CA70->unkEE = (s16) gPlayerPositions->unk4;
D_8018CA70->stagingPosition = (s16) gGPCurrentRaceRankByPlayerId->unk0;
D_8018CA70->unkEE = (s16) gGPCurrentRaceRankByPlayerId->unk4;
D_8018CA70->rankScaling = D_8018CA70->unk88;
D_8018D3C4 = 0x0000001E;
D_8018D3BC = 0x00000018;
@@ -2094,8 +2094,8 @@ void func_80071A20(void) {
D_8018CA70->unkC8 = 0x00D0;
}
D_8018CA70->unk88 = 0.5f;
D_8018CA70->stagingPosition = (s16) gPlayerPositions->unk0;
D_8018CA70->unkEE = (s16) gPlayerPositions->unk4;
D_8018CA70->stagingPosition = (s16) gGPCurrentRaceRankByPlayerId->unk0;
D_8018CA70->unkEE = (s16) gGPCurrentRaceRankByPlayerId->unk4;
D_8018CA70->rankScaling = D_8018CA70->unk88;
func_8006EE7C(*gItemWindowObjectByPlayerId);
func_8006EE7C(*(gItemWindowObjectByPlayerId + 4));
@@ -2210,10 +2210,10 @@ void func_80071C28(void) {
D_8018CA70->unk10C = (f32) D_8018CA70->unk190;
D_8018CA70->unk88 = (f32) D_8018CA70->unk190;
D_8018CA70->rankScaling = D_8018CA70->unk190;
D_8018CA70->stagingPosition = (s16) gPlayerPositions->unk0;
D_8018CA70->unkEE = (s16) gPlayerPositions->unk4;
D_8018CA70->unk172 = (s16) gPlayerPositions->unk8;
D_8018CA70->unk1F6 = (s16) gPlayerPositions->unkC;
D_8018CA70->stagingPosition = (s16) gGPCurrentRaceRankByPlayerId->unk0;
D_8018CA70->unkEE = (s16) gGPCurrentRaceRankByPlayerId->unk4;
D_8018CA70->unk172 = (s16) gGPCurrentRaceRankByPlayerId->unk8;
D_8018CA70->unk1F6 = (s16) gGPCurrentRaceRankByPlayerId->unkC;
func_8006EE7C(*gItemWindowObjectByPlayerId);
func_8006EE7C(*(gItemWindowObjectByPlayerId + 4));
func_8006EE7C(*(gItemWindowObjectByPlayerId + 8));
+2 -2
View File
@@ -2248,7 +2248,7 @@ void func_80076C9C(s32 objectIndex, Vec3f arg1, s16 arg2) {
GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80076C9C.s")
#endif
void func_80076D70(Vec3f arg0, s32 arg1, s16 arg2) {
void func_80076D70(Vec3f arg0, f32 arg1, s16 arg2) {
s32 temp_v0;
temp_v0 = func_80072044(D_8018C870, &D_80183E6C, 0x00000040);
@@ -5217,7 +5217,7 @@ s16 func_8007C9F8(void) {
}
if (temp_v0 == 2) {
if (gModeSelection == GRAND_PRIX) {
if (gPlayerPositions->unk0 < gPlayerPositions->unk4) {
if (gGPCurrentRaceRankByPlayerId->unk0 < gGPCurrentRaceRankByPlayerId->unk4) {
return 0;
}
return 1;
+1 -1
View File
@@ -142,7 +142,7 @@ void func_80076AEC(s32);
void func_80076B7C();
void func_80076B84();
void func_80076C9C(s32, Vec3f, s16);
void func_80076D70(Vec3f, s32, s16);
void func_80076D70(Vec3f, f32, s16);
void func_80076DC4(s32);
void func_80076E14(s32);
void func_80076ED8(s32);
+1 -1
View File
@@ -333,7 +333,7 @@ void func_8008C8C4(Player* player, s8 arg1) {
if ((D_80165460[arg1] == 1) && ((player->unk_000 & 0x4000) == 0x4000)) {
player->unk_09C = (f32) (player->unk_09C + 100.0f);
}
if ((gModeSelection == VERSUS) && ((player->unk_000 & 0x1000) == 0x1000) && (D_800DC51C == 0) && ((player->unk_0CA & 2) == 0) && (gPlayerPositions[arg1] != 0)) {
if ((gModeSelection == VERSUS) && ((player->unk_000 & 0x1000) == 0x1000) && (D_800DC51C == 0) && ((player->unk_0CA & 2) == 0) && (gGPCurrentRaceRankByPlayerId[arg1] != 0)) {
player->statusEffects = (s32) (player->statusEffects | 0x400000);
}
}
+162 -216
View File
@@ -1678,47 +1678,55 @@ void func_80094C60(void) {
GLOBAL_ASM("asm/non_matchings/code_80091750/func_80094C60.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022
? func_8009E230(); /* extern */
static s8 *gDebugCourseNames[0x14] = {
"m circuit",
"mountain",
"castle",
"ghost",
"maze",
"snow",
"beach",
"p circuit",
"l circuit",
"farm",
"highway",
"desert",
"sherbet",
"rainbow",
"stadium",
"block",
"skyscraper",
"deck",
"jungle",
"doughnut",
};
static s8 *gDebugCharacterNames[8] = { "MARIO", "LUIGI", "YOSHI", "KINOPIO", "D.KONG", "WARIO", "PEACH", "KOOPA" };
static s8 *gDebugScreenModeNames[5] = { "1p", "2players UD", "2players LR", "3players", "4players" };
s16 gCurrentCourseId; /* unable to generate initializer */
s8 *gDebugSoundModeNames[4] = { "stereo", "head phone", "xxx", "monaural" };
#ifdef NEEDS_RODATA
// data_0DD0A0_3_0.s
extern char *D_800F0B58[];// = "debug_mode";
extern char *D_800F0B64[];// = "*";
extern char *D_800F0B68[];// = "*";
extern char *D_800F0B6C[];// = "*";
extern char *D_800F0B70[];// = "*";
extern char *D_800F0B74[];// = "*";
extern char *D_800F0B78[];// = "*";
extern char *D_800F0B7C[];// = "on";
extern char *D_800F0B80[];// = "off";
extern char *D_800F0B84[];// = "map_number";
extern char *D_800F0B90[];// = "screen_mode";
extern char *D_800F0B9C[];// = "player";
extern char *D_800F0BA4[];// = "sound mode";
extern char *D_800F0BB0[];// = "push b to get all goldcup";
// I think all these are plain data, don't know which file they belong in
extern char *gDebugCourseNames[0x14];// = {
// "m circuit",
// "mountain",
// "castle",
// "ghost",
// "maze",
// "snow",
// "beach",
// "p circuit",
// "l circuit",
// "farm",
// "highway",
// "desert",
// "sherbet",
// "rainbow",
// "stadium",
// "block",
// "skyscraper",
// "deck",
// "jungle",
// "doughnut",
// };
extern char *gDebugCharacterNames[8];// = { "MARIO", "LUIGI", "YOSHI", "KINOPIO", "D.KONG", "WARIO", "PEACH", "KOOPA" };
extern char *gDebugScreenModeNames[5];// = { "1p", "2players UD", "2players LR", "3players", "4players" };
extern char *gDebugSoundModeNames[4];// = { "stereo", "head phone", "xxx", "monaural" };
void func_80095574(void) {
Gfx *temp_v1;
s32 var_v0;
s32 var_v0_2;
s8 temp_v0;
if ((D_8018EE0C < 3) || (D_8018E7B0 != 0)) {
func_800A8230();
}
temp_v0 = gDebugMenuSelection;
if (temp_v0 >= 2) {
if (gDebugMenuSelection >= 2) {
load_debug_font();
debug_print_str2(0x00000050, 0x00000064, "debug_mode");
switch (gDebugMenuSelection) {
@@ -1759,7 +1767,7 @@ void func_80095574(void) {
debug_print_str2(0x00000050, 0x00000078, "screen_mode");
debug_print_str2(0x000000AA, 0x00000078, gDebugScreenModeNames[D_8018EDF1]);
debug_print_str2(0x00000050, 0x00000082, "player");
debug_print_str2(0x000000AA, 0x00000082, gDebugCharacterNames[*gCharacterSelections]);
debug_print_str2(0x000000AA, 0x00000082, gDebugCharacterNames[gCharacterSelections[0]]);
debug_print_str2(0x00000050, 0x0000008C, "sound mode");
debug_print_str2(0x000000AA, 0x0000008C, gDebugSoundModeNames[gSoundMode]);
if (gDebugMenuSelection == DEBUG_MENU_GIVE_ALL_GOLD_CUP) {
@@ -1767,59 +1775,48 @@ void func_80095574(void) {
}
func_80057778();
}
if (temp_v0 == DEBUG_MENU_DISABLED) {
if (gDebugMenuSelection == DEBUG_MENU_DISABLED) {
gMenuTimingCounter += 1;
} else {
gMenuTimingCounter = 3;
}
var_v0_2 = gMenuTimingCounter;
if (var_v0_2 == DEBUG_MENU_DEBUG_MODE) {
if (gMenuTimingCounter == DEBUG_MENU_DEBUG_MODE) {
play_sound2(0x49009009);
var_v0_2 = gMenuTimingCounter;
}
if (var_v0_2 >= 0x12D) {
if (gMenuTimingCounter >= 0x12D) {
func_8009E230();
func_800CA0A0();
}
temp_v1 = gDisplayListHead;
gDisplayListHead = temp_v1 + 8;
temp_v1->words.w0 = 0x06000000;
temp_v1->words.w1 = (u32) D_020076E0;
gSPDisplayList(gDisplayListHead++, D_020076E0);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80091750/func_80095574.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda
extern s32 D_8018E7A8;
// While this matches, its a little screwy
// This function seemingly needs to return a Gfx*, but doing that explicity doesn't match
// Instead we depend on the fact that the result of func_80098C18 is left
// in v0 which means it is returned, sort of.
// Its also weird that the displayListHead argument goes entirely unused. What's up with that?
Gfx *func_800958D4(Gfx *displayListHead, s32 ulx, s32 uly, s32 lrx, s32 lry, s32 arg5) {
s32 temp_lo;
s32 phi_v0;
s32 phi_v0_2;
temp_lo = (s32) (((s32) D_8018E7A8 % arg5) << 9) / arg5;
phi_v0 = temp_lo;
if (temp_lo >= 0x101) {
phi_v0 = 0x200 - temp_lo;
phi_v0 = ((D_8018E7A8 % arg5) << 9) / arg5;
if (phi_v0 >= 0x101) {
phi_v0 = 0x200 - phi_v0;
}
phi_v0_2 = phi_v0;
if (phi_v0 >= 0x100) {
phi_v0_2 = 0xFF;
phi_v0 = 0xFF;
}
gDisplayListHead = func_80098C18(gDisplayListHead, ulx, uly, lrx, lry, phi_v0_2, phi_v0_2, phi_v0_2, 0xFF);
gDisplayListHead = func_80098C18(gDisplayListHead, ulx, uly, lrx, lry, phi_v0, phi_v0, phi_v0, 0xFF);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80091750/func_800958D4.s")
#endif
Gfx *func_800959A0(Gfx *displayListHead, s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
return func_800958D4(displayListHead, arg1, arg2, arg3, arg4, 64);
}
Gfx *func_800959CC(Gfx *displayListHead, s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
func_800958D4(displayListHead, arg1, arg2, arg3, arg4, 4);
return func_800958D4(displayListHead, arg1, arg2, arg3, arg4, 4);
}
Gfx *func_800959F8(Gfx *displayListHead, Vtx *arg1) {
@@ -7997,36 +7994,22 @@ void func_800A08D8(u8 arg0, s32 column, s32 row) {
GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A08D8.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit 6b6e1390bf30013247343623194964ff13d0c45b
s32 func_800A095C(s8 *arg0, s32 len, s32 column, s32 row) {
s32 var_s0;
s32 var_s1;
s32 var_s3;
s8 *var_s2;
s8 temp_v0;
var_s1 = len;
var_s2 = arg0;
var_s3 = 0;
var_s0 = column;
if (len != 0) {
do {
temp_v0 = *var_s2;
if (temp_v0 != 0) {
var_s3 += 1;
}
var_s2 += 1;
func_800A08D8(temp_v0 & 0xFF, var_s0, row);
var_s1 -= 1;
var_s0 += 8;
} while (var_s1 != 0);
// Walks through `someString` for `len` charcters, seemingly even going over null terminators.
// Returns a count of all non-terminator characters walked over.
s32 func_800A095C(char *someString, s32 len, s32 column, s32 row) {
s32 tempColumn;
s32 nonTerminatorCount;
nonTerminatorCount = 0;
tempColumn = column;
for (; len != 0; len--, tempColumn += 8) {
if(*someString != 0) {
nonTerminatorCount++;
}
func_800A08D8(*someString++, tempColumn, row);
}
return var_s3;
return nonTerminatorCount;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A095C.s")
#endif
#ifdef NON_MATCHING
// Non-matching due to the constants 9 and 0xA being saved to the wrong registers
@@ -11014,7 +10997,7 @@ void func_800A69C8(s32 arg0) {
var_v1 = 0;
switch (temp_v0) { /* irregular */
case VERSUS:
if (gPlayerPositions[var_s0] != 0) {
if (gGPCurrentRaceRankByPlayerId[var_s0] != 0) {
var_v1 = 1;
}
var_s4 = gNmiUnknown1 + var_s0;
@@ -11176,7 +11159,7 @@ void func_800A6E94(s32 arg0, s32 arg1, s32 arg2) {
u8 *temp_v0;
void *temp_s0;
temp_t8 = gPlayerPositions[arg1];
temp_t8 = gGPCurrentRaceRankByPlayerId[arg1];
sp3C = temp_t8;
if (temp_t8 == 0) {
set_text_color((s32) gGlobalTimer % 3);
@@ -12115,50 +12098,30 @@ void func_800A874C(struct_8018D9E0_entry *arg0) {
GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A874C.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit 6b6e1390bf30013247343623194964ff13d0c45b
void func_800A890C(s32 arg0, struct_8018D9E0_entry *arg1) {
Gfx *temp_v0;
Gfx *temp_v0_2;
Gfx *temp_v0_3;
Gfx *var_v0;
s32 temp_a2;
s32 temp_t0;
s32 temp_t1;
s32 temp_t7;
temp_t1 = arg1->unk1C;
if (temp_t1 < 0x20) {
temp_v0 = gDisplayListHead;
temp_t0 = arg1->column;
if (arg1->unk1C < 32) {
if (1) {}
temp_t7 = (arg1->unk1C * 65) / 64;
temp_t1 = arg1->column;
temp_a2 = arg1->row;
gDisplayListHead = temp_v0 + 8;
temp_v0->words.w1 = 0;
temp_v0->words.w0 = 0xE7000000;
temp_v0_2 = gDisplayListHead;
gDisplayListHead = temp_v0_2 + 8;
temp_v0_2->words.w0 = 0xB900031D;
temp_v0_2->words.w1 = 0x0F0A4000;
temp_v0_3 = gDisplayListHead;
temp_t7 = (s32) (temp_t1 * 0x41) / 64;
gDisplayListHead = temp_v0_3 + 8;
temp_v0_3->words.w0 = 0xFCFFFFFF;
temp_v0_3->words.w1 = 0xFFFCF279;
gDPPipeSync(gDisplayListHead++);
gDPSetRenderMode(gDisplayListHead++, G_RM_OPA_SURF, G_RM_OPA_SURF2);
gDPSetCombineMode(gDisplayListHead++, G_CC_DECALRGBA, G_CC_DECALRGBA);
if (arg0 == gCupSelection) {
if (D_8018EDEC == 1) {
var_v0 = func_800959A0(gDisplayListHead, temp_t0 + temp_t7, temp_a2, (temp_t0 - temp_t7) + 0x40, temp_a2 + 0x27);
gDisplayListHead = func_800959A0(gDisplayListHead, temp_t1 + temp_t7, temp_a2, (temp_t1 - temp_t7) + 64, temp_a2 + 39);
} else {
var_v0 = func_80098C18(gDisplayListHead, temp_t0 + temp_t7, temp_a2, (temp_t0 - temp_t7) + 0x40, temp_a2 + 0x27, 0x000000FF, 0x000000F9, 0x000000DC, 0x000000FF);
gDisplayListHead = func_80098C18(gDisplayListHead, temp_t1 + temp_t7, temp_a2, (temp_t1 - temp_t7) + 64, temp_a2 + 39, 255, 249, 220, 255);
}
} else {
var_v0 = func_80098C18(gDisplayListHead, temp_t0 + temp_t7, temp_a2, (temp_t0 - temp_t7) + 0x40, temp_a2 + 0x27, 1, 1, 1, 0x000000FF);
gDisplayListHead = func_80098C18(gDisplayListHead, temp_t1 + temp_t7, temp_a2, (temp_t1 - temp_t7) + 64, temp_a2 + 39, 1, 1, 1, 255);
}
gDisplayListHead = var_v0;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A890C.s")
#endif
#ifdef NEEDS_RODATA
// data/data_0DD0A0_2_0.s
@@ -14040,44 +14003,41 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AB904.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda
//generated by m2c commit c5625f046032f9746ce523be6766af27204fcbe9 on Jan-28-2023
struct _struct_D_800E7268_0x8 {
/* 0x0 */ s16 unk0; /* inferred */
/* 0x2 */ s16 unk2; /* inferred */
/* 0x4 */ char pad4[4]; /* maybe part of unk2[3]? */
}; /* size = 0x8 */
void func_800A91D8(struct_8018D9E0_entry *, s16, s16); /* extern */
static struct _struct_D_800E7268_0x8 D_800E7268[0]; /* unable to generate initializer; const */
static ? D_800E7E20; /* unable to generate initializer; const */
static struct _struct_D_800E7268_0x8 D_800E7268[0]; /* unable to generate initializer */
static ? D_800E7E20; /* unable to generate initializer */
void func_800AB9B0(struct_8018D9E0_entry *arg0) {
s32 temp_v0;
s32 temp_v0_2;
s32 temp_v0_3;
s8 temp_v0;
struct _struct_D_800E7268_0x8 *temp_v1;
temp_v0 = gCupSelection;
if (temp_v0 != arg0->unk1C) {
arg0->unk1C = (s32) temp_v0;
temp_v0_2 = func_800B54C0((s32) gCupSelection, gCCSelection);
arg0->unk20 = temp_v0_2;
func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(*(&D_800E7E20 + ((((s32) gCCSelection / 2) * 0x10) + -(s32) (temp_v0_2 * 4)))));
if (gCupSelection != arg0->unk1C) {
arg0->unk1C = (s32) gCupSelection;
temp_v0 = func_800B54C0((s32) gCupSelection, gCCSelection);
arg0->unk20 = temp_v0;
func_8009A594(arg0->D_8018DEE0_index, 0, segmented_to_virtual_dupe_2(*(&D_800E7E20 + ((((s32) gCCSelection / 2) * 0x10) + -(temp_v0 * 4)))));
arg0->column = (s32) D_800E7268->unk0;
arg0->row = (s32) D_800E7268->unk2;
}
temp_v0_3 = arg0->unk4;
temp_v1 = &D_800E7268[temp_v0_3];
switch (temp_v0_3) { /* irregular */
temp_v0_2 = arg0->unk4;
temp_v1 = &D_800E7268[temp_v0_2];
switch (temp_v0_2) { /* irregular */
case 0:
func_800A91D8(arg0, temp_v1->unk0, temp_v1->unk2);
func_800A91D8(arg0, (s32) temp_v1->unk0, (s32) temp_v1->unk2);
if (D_8018EDEC == 3) {
arg0->unk4 = 1;
return;
}
return;
case 1:
func_800A91D8(arg0, temp_v1->unk0, temp_v1->unk2);
func_800A91D8(arg0, (s32) temp_v1->unk0, (s32) temp_v1->unk2);
if (D_8018EDEC == 1) {
arg0->unk4 = 0;
}
@@ -14883,7 +14843,7 @@ void func_800ACF40(struct_8018D9E0_entry *arg0) {
var_v1 = 0;
switch (temp_v0_3) { /* switch 1; irregular */
case VERSUS: /* switch 1 */
if (gPlayerPositions[temp_a2] != 0) {
if (gGPCurrentRaceRankByPlayerId[temp_a2] != 0) {
block_11:
var_v1 = 1;
}
@@ -15203,30 +15163,25 @@ block_56:
GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AD2E8.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-12-2022
static ? D_800F0B50; /* unable to generate initializer; const */
static ? D_800F0B54; /* unable to generate initializer; const */
#ifdef NEEDS_RODATA
// data_0DD0A0_3_0.s
// jpt_800F287C
extern f64 D_800F2930;// = 4.2;
extern f64 D_800F2938;// = 4.2;
extern f64 D_800F2940;// = 4.2;
// plain data I think?
extern s8 D_800F0B50[];// = {31, 11, 21, 41};
extern s8 D_800F0B54[];// = {32, 15, 24, 44};
void func_800ADF48(struct_8018D9E0_entry *arg0) {
void *sp18;
f64 temp_f0;
f64 temp_f0_2;
f64 temp_f0_3;
s32 temp_t7;
s32 temp_v0;
s32 temp_v0_2;
s32 var_a0;
s8 temp_v0_3;
u16 var_v1;
void *var_a2;
s32 stackPadding;
struct Controller *controller;
if (D_800DC5FC != 0) {
temp_t7 = arg0->unk4;
switch (temp_t7) {
switch (arg0->unk4) {
case 0:
arg0->unk4 = (s32) *(&D_800F0B50 + gModeSelection);
return;
arg0->unk4 = D_800F0B50[gModeSelection];
break;
case 11:
case 12:
case 13:
@@ -15243,69 +15198,56 @@ void func_800ADF48(struct_8018D9E0_entry *arg0) {
case 43:
case 44:
if (func_800B4520() == 0) {
var_a2 = (D_800DC5FC * 0x10) - 0x10 + gControllers;
var_v1 = var_a2->unk6;
var_a0 = var_v1 | var_a2->unkC;
if (var_a0 & 0x800) {
temp_v0 = arg0->unk4;
if (*(&D_800F0B50 + gModeSelection) < temp_v0) {
arg0->unk4 = temp_v0 - 1;
sp18 = var_a2;
controller = &gControllers[D_800DC5FC - 1];
if ((controller->buttonPressed | controller->stickPressed) & 0x800) {
if (D_800F0B50[gModeSelection] < arg0->unk4) {
arg0->unk4--;
play_sound2(0x49008000);
temp_f0 = (f64) arg0->unk24;
if (temp_f0 < 4.2) {
arg0->unk24 = (f32) (temp_f0 + 4.0);
if (arg0->unk24 < 4.2) {
arg0->unk24 += 4.0;
}
arg0->unk8 = -1;
var_v1 = var_a2->unk6;
var_a0 = var_v1 | var_a2->unkC;
}
}
if (var_a0 & 0x400) {
temp_v0_2 = arg0->unk4;
if (temp_v0_2 < *(&D_800F0B54 + gModeSelection)) {
arg0->unk4 = temp_v0_2 + 1;
sp18 = var_a2;
if ((controller->buttonPressed | controller->stickPressed) & 0x400) {
if (arg0->unk4 < D_800F0B54[gModeSelection]) {
arg0->unk4++;
play_sound2(0x49008000);
temp_f0_2 = (f64) arg0->unk24;
if (temp_f0_2 < 4.2) {
arg0->unk24 = (f32) (temp_f0_2 + 4.0);
if (arg0->unk24 < 4.2) {
arg0->unk24 += 4.0;
}
arg0->unk8 = 1;
var_v1 = var_a2->unk6;
}
}
if (var_v1 & 0x4000) {
temp_v0_3 = *(&D_800F0B50 + gModeSelection);
if (arg0->unk4 != temp_v0_3) {
arg0->unk4 = (s32) temp_v0_3;
if (controller->buttonPressed & 0x4000) {
if (arg0->unk4 != D_800F0B50[gModeSelection]) {
arg0->unk4 = D_800F0B50[gModeSelection];
play_sound2(0x49008002);
return;
}
}
if (var_v1 & 0x9000) {
if (arg0->unk4 == *(&D_800F0B50 + gModeSelection)) {
if (controller->buttonPressed & 0x9000) {
if (arg0->unk4 == D_800F0B50[gModeSelection]) {
arg0->unk4 = 0;
D_800DC5FC = 0;
func_8028DF38(0x0000001E, arg0, var_a2, &gModeSelection);
func_8028DF38();
func_800C9F90(0U);
return;
}
func_8009DFE0(0x0000001E);
play_sound2(0x4900801B);
func_800CA330(0x3CU);
temp_f0_3 = (f64) arg0->unk24;
if (temp_f0_3 < 4.2) {
arg0->unk24 = (f32) (temp_f0_3 + 4.0);
return;
} else {
func_8009DFE0(30);
play_sound2(0x4900801B);
func_800CA330(60);
if (arg0->unk24 < 4.2) {
arg0->unk24 += 4.0;
}
}
}
}
break;
default:
break;
}
} else {
arg0->unk4 = 0;
default:
}
}
#else
@@ -15906,7 +15848,7 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_800AF1AC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 06ada559d7a32fdab49fa2d619cdfa027615bcda
//generated by m2c commit c5625f046032f9746ce523be6766af27204fcbe9 on Jan-28-2023
struct _struct_D_800E7458_0x8 {
/* 0x0 */ s16 unk0; /* inferred */
/* 0x2 */ s16 unk2; /* inferred */
@@ -15919,12 +15861,9 @@ struct _struct_D_800E7480_0x8 {
/* 0x4 */ char pad4[4]; /* maybe part of unk2[3]? */
}; /* size = 0x8 */
void func_800A91D8(struct_8018D9E0_entry *, s16, s16); /* extern */
void func_800C90F4(?, s32); /* extern */
void func_800CA0A0(); /* extern */
extern ? D_8018DEE4;
static struct _struct_D_800E7458_0x8 D_800E7458[0]; /* unable to generate initializer; const */
static struct _struct_D_800E7480_0x8 D_800E7480[0]; /* unable to generate initializer; const */
static struct _struct_D_800E7458_0x8 D_800E7458[0]; /* unable to generate initializer */
static struct _struct_D_800E7480_0x8 D_800E7480[0]; /* unable to generate initializer */
static MkAnimation *gCharacterCelebrateAnimation[8] = {
D_02006718,
D_02006900,
@@ -15934,7 +15873,7 @@ static MkAnimation *gCharacterCelebrateAnimation[8] = {
D_02007290,
D_02007478,
D_02006AE8,
}; /* const */
};
static MkAnimation *D_800E83A0[8] = {
D_02006778,
D_02006960,
@@ -15944,8 +15883,17 @@ static MkAnimation *D_800E83A0[8] = {
D_020072F0,
D_020074D8,
D_02006B48,
}; /* const */
static s32 D_800E8440[8] = { 0xA, 0xA, 0xA, 0xA, 0xA, 0xA, 0xA, 0xA }; /* const */
};
static s32 D_800E8440[8] = {
0x0000000A,
0x0000000A,
0x0000000A,
0x0000000A,
0x0000000A,
0x0000000A,
0x0000000A,
0x0000000A,
};
static ? D_800EFD64; /* unable to generate initializer; const */
void func_800AF270(struct_8018D9E0_entry *arg0) {
@@ -15954,15 +15902,13 @@ void func_800AF270(struct_8018D9E0_entry *arg0) {
s32 temp_t2;
s32 temp_t8;
s32 temp_v1;
s8 temp_t6;
s8 temp_v0;
struct _struct_D_800E7458_0x8 *temp_v0_2;
struct _struct_D_800E7480_0x8 *temp_v0_3;
temp_t6 = D_802874D8.unk_1E;
sp30 = (s32) temp_t6;
sp30 = (s32) D_802874D8.unk_1E;
temp_t8 = arg0->unk4;
temp_v0 = *(&D_800EFD64 + temp_t6);
temp_v0 = *(&D_800EFD64 + D_802874D8.unk_1E);
temp_v1 = arg0->type - 0x12C;
switch (temp_t8) {
case 0:
@@ -15974,7 +15920,7 @@ void func_800AF270(struct_8018D9E0_entry *arg0) {
case 1:
temp_v0_3 = &D_800E7480[temp_v1];
sp20 = temp_v0_3;
func_800A91D8(arg0, temp_v0_3->unk0, temp_v0_3->unk2);
func_800A91D8(arg0, (s32) temp_v0_3->unk0, (s32) temp_v0_3->unk2);
if ((temp_v0_3->unk0 == arg0->column) && (temp_v0_3->unk2 == arg0->row)) {
arg0->unk4 = 2;
arg0->unk20 = 0;
@@ -15986,17 +15932,17 @@ void func_800AF270(struct_8018D9E0_entry *arg0) {
temp_t2 = arg0->unk20 + 1;
arg0->unk20 = temp_t2;
if (temp_t2 >= 0x1F) {
if ((s32) D_802874D8.unk_1D >= 3) {
if (D_802874D8.unk_1D >= 3) {
arg0->unk4 = 4;
func_800CA0B8();
func_800C90F4(0, (sp30 * 0x10) + 0x29008003);
func_800CA0B8((MkAnimation *(*)[]) gCharacterCelebrateAnimation, &D_802874D8);
func_800C90F4(0U, (sp30 * 0x10) + 0x29008003);
func_800CA0A0();
return;
}
arg0->unk4 = 3;
func_8009A640(arg0->D_8018DEE0_index, 0, sp30, segmented_to_virtual_dupe_2(gCharacterCelebrateAnimation[temp_v0]));
func_800CA0B8();
func_800C90F4(0, (sp30 * 0x10) + 0x29008007);
func_800C90F4(0U, (sp30 * 0x10) + 0x29008007);
func_800CA0A0();
return;
}
+5
View File
@@ -108,6 +108,7 @@ void func_800947B4(struct GfxPool*, s32);
void func_80094A64(Mtx*);
void func_80094C60();
void func_80095574();
Gfx *func_800958D4(Gfx*, s32, s32, s32, s32, s32);
Gfx *func_800959A0(Gfx*, s32, s32, s32, s32);
Gfx *func_800959F8(Gfx*, Vtx*);
Gfx *func_80098C18(Gfx*, s32, s32, s32, s32, s32, s32, s32, s32);
@@ -169,6 +170,8 @@ void func_8009E5FC(s32);
void func_8009E620();
void add_8018D9E0_entry(s32, s32, s32, s8);
void func_800A08D8(u8, s32, s32);
s32 func_800A095C(char*, s32, s32, s32);
void func_800A09E0(struct_8018D9E0_entry*);
void func_800A0AD0(struct_8018D9E0_entry*);
void func_800A0DFC();
void func_800A11D0(struct_8018D9E0_entry*, s32, s32);
@@ -203,6 +206,7 @@ void get_time_record_centiseconds(s32, char*);
void func_800A8230();
void func_800A8250();
void func_800A86E8(struct_8018D9E0_entry*);
void func_800A890C(s32, struct_8018D9E0_entry*);
void func_800A8A98(struct_8018D9E0_entry*);
void func_800A8E14(struct_8018D9E0_entry*);
void func_800A8EC0(struct_8018D9E0_entry*);
@@ -248,6 +252,7 @@ void func_800AC300(struct_8018D9E0_entry*);
void func_800AC324(struct_8018D9E0_entry*);
void func_800AC978(struct_8018D9E0_entry*);
void func_800AD1A4(struct_8018D9E0_entry*);
void func_800ADF48(struct_8018D9E0_entry*);
void func_800AEC54(struct_8018D9E0_entry*);
void func_800AEDBC(struct_8018D9E0_entry*);
void func_800AEE90(struct_8018D9E0_entry*);
+1 -1
View File
@@ -709,7 +709,7 @@ void update_race_position_data(void) {
if (((gPlayers[i].unk_000 & PLAYER_EXISTS) != 0) &&
((gPlayers[i].unk_000 & PLAYER_CINEMATIC_MODE) == 0) &&
((gPlayers[i].unk_000 & PLAYER_INVISIBLE_OR_BOMB) == 0)) {
position = gPlayerPositions[i];
position = gGPCurrentRaceRankByPlayerId[i];
gPlayers[i].currentRank = position;
gPlayerPositionLUT[position] = i;
}
+1 -1
View File
@@ -38,7 +38,7 @@ void func_80290B14();
extern f32 gTimePlayerLastTouchedFinishLine[];
extern f32 gLapCompletionPercentByPlayerId[];
extern s32 gPlayerPositions[]; // D_801643B8 (position for each player)
extern s32 gGPCurrentRaceRankByPlayerId[]; // D_801643B8 (position for each player)
extern s16 gPlayerPositionLUT[]; // D_8015F8F0 (player index at each position)
extern u16 D_80162DD6;
+11 -60
View File
@@ -517,7 +517,7 @@ GLOBAL_ASM("asm/non_matchings/skybox/func_802A4A0C.s")
#ifdef NEEDS_RODATA
//generated by m2c commit 9841ff34ca242f5f14b2eab2b54a7a65ac47d80f
// data/data_
// data/data_121DA0_2_2.s
// jtbl_802B9BB8
extern f32 D_802B9BB4;// = 6800.0f;
extern f32 D_802B9C04;// = 2700.0f;
@@ -1301,69 +1301,20 @@ void func_802A74BC(void) {
}
}
#ifdef MIPS_TO_C
//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de
void func_802A7658(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5) {
s32 temp_t5;
s32 var_a0;
s32 var_a1;
s32 var_a2;
s32 var_v0;
void func_802A7658(s32 arg0, s32 arg1, s32 arg2, s32 arg3, u16 *source, u16 *target) {
s32 var_v1;
u16 *var_t1;
u16 *var_t3;
u16 temp_t8;
u16 temp_t9;
void *var_t3_2;
s32 var_a1;
s32 targetIndex;
s32 sourceIndex;
var_v0 = 0;
var_v1 = 0;
if (arg3 > 0) {
var_a2 = (arg1 * 0x140) + arg0;
do {
var_a0 = var_a2;
var_a1 = 0;
if (arg2 > 0) {
temp_t5 = arg2 & 3;
var_t1 = arg5 + (var_v0 * 2);
if (temp_t5 != 0) {
var_t3 = arg4 + (var_a0 * 2);
do {
temp_t9 = *var_t3;
var_a1 += 1;
var_v0 += 1;
var_t1 += 2;
var_a0 += 1;
var_t3 += 2;
var_t1->unk-2 = temp_t9;
} while (temp_t5 != var_a1);
if (var_a1 != arg2) {
goto block_7;
}
} else {
block_7:
var_t3_2 = arg4 + (var_a0 * 2);
do {
var_a1 += 4;
var_v0 += 4;
*var_t1 = var_t3_2->unk0;
temp_t8 = var_t3_2->unk2;
var_t1 += 8;
var_t3_2 += 8;
var_t1->unk-6 = temp_t8;
var_t1->unk-4 = (u16) var_t3_2->unk-4;
var_t1->unk-2 = (u16) var_t3_2->unk-2;
} while (var_a1 != arg2);
}
}
var_v1 += 1;
var_a2 += 0x140;
} while (var_v1 != arg3);
targetIndex = 0;
for (var_v1 = 0; var_v1 < arg3; var_v1++) {
sourceIndex = ((arg1 + var_v1) * 320) + arg0;
for (var_a1 = 0; var_a1 < arg2; var_a1++, targetIndex++, sourceIndex++) {
target[targetIndex] = source[sourceIndex];
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/skybox/func_802A7658.s")
#endif
extern s32 D_800DC5DC;
extern s32 D_800DC5E0;
+1 -1
View File
@@ -416,7 +416,7 @@ void func_80039DA4(void) {
}
} else {
for (i = 0; i < 8; i++) {
D_80165270[i] = spC[gPlayerPositions[i]];
D_80165270[i] = spC[gGPCurrentRaceRankByPlayerId[i]];
}
}
}