A few matches across a couple files, although mostly code_80005FD0 (#460)

Signed-off-by: Taggerung <tyler.taggerung@email.com>
This commit is contained in:
Tyler McGavran
2023-10-14 00:09:18 -04:00
committed by GitHub
parent d71e1c7b70
commit aa720db51a
27 changed files with 1898 additions and 4393 deletions
+1504 -2162
View File
File diff suppressed because it is too large Load Diff
+92 -11
View File
@@ -3,6 +3,7 @@
#include "vehicles.h"
#include "camera.h"
#include "waypoints.h"
struct struct_801642D8 {
/* 0x0 */ u16 unk0;
@@ -34,6 +35,20 @@ typedef struct {
extern Test D_801634F8[];
// Something related to CPU item usage
typedef struct {
/* 0x00 */ s16 unk_00;
/* 0x02 */ s16 actorIndex;
/* 0x04 */ s16 unk_04;
/* 0x06 */ s16 unk_06;
/* 0x08 */ s16 unk_08;
/* 0x0A */ s16 unk_0A;
/* 0x0C */ s16 unk_0C;
/* 0x0E */ s16 unk_0E;
} D_801642D8_entry; // size = 0x10
extern D_801642D8_entry D_801642D8[];
/* Function Prototypes */
void func_80012190(void);
void func_8000BA14(u16, f32, f32, s16);
@@ -44,7 +59,9 @@ void func_800147E0(void);
void func_800132F4(void);
s16 func_80005FD0(Vec3f, Vec3f);
void func_800100F0(s32);
void func_80011E38(s32);
void func_800120C8(void);
void func_80012780(TrainCarStuff*, s16*, u16);
void func_800127E0(void);
s32 func_80006018(f32, f32, f32, f32, f32, f32, f32, f32);
void func_80006114(Vec3f, Vec3f, s16);
@@ -61,6 +78,7 @@ void func_80008F38(s32);
void func_80009000(s32);
void func_800090F0(s32, Player*);
f32 func_80009258(s32, f32, f32);
void func_800097E0(void);
void func_80009B60(s32);
@@ -68,6 +86,7 @@ s32 func_8000B7E4(s32, u16);
s32 func_8000B820(s32);
f32 func_8000B874(f32, f32, u16, s32);
void func_8000B95C(s32, u16, s32);
void func_8000BBD8(u16, f32, s16);
s16 func_8000BD94(f32, f32, f32, s32);
s16 func_8000C0BC(f32, f32, f32, u16, s32*);
@@ -81,8 +100,9 @@ s16 func_8000CD24(f32, f32, f32, s16, Player*, s32, s32);
s16 func_8000D24C(f32, f32, f32, s32*);
s16 func_8000D2B4(f32, f32, f32, s16, s32);
s16 func_8000D33C(f32, f32, f32, s16, s32);
s16 func_8000D6D0(Vec3f, s16*, f32, f32, s32, s32);
s16 func_8000D940(Vec3f, s16*, f32, f32, s32);
f32 func_8000D3B8(s32);
s16 func_8000D6D0(Vec3f, s16*, f32, f32, s16, s16);
s16 func_8000D940(Vec3f, s16*, f32, f32, s16);
s16 func_8000DBAC(Vec3f, s16*, f32);
void func_8000DD78(void);
void func_8000DF8C(s32);
@@ -94,19 +114,25 @@ s32 func_8000EE10(s32);
void func_8000EE58(s32);
void func_8000EEDC(void);
void func_8000EF20(void);
void func_8000EF20(void);
void func_8000F0E0(void);
void func_8000F124(void);
void func_8000F2BC(TrackWaypoint*, size_t);
void func_8000F2DC(void);
void func_80010218(s32);
f32 func_80010480(s32, u16);
void func_800107C4(s32);
s16 func_80010CB0(s32, s32);
void func_80010DBC(s32);
void func_80010E6C(s32);
f32 func_80010F40(f32, f32, f32, s32);
f32 func_80010FA0(f32, f32, f32, s32);
u16 func_80011014(TrackWaypoint *, TrackWaypoint *, s32, s32);
s32 process_path_data(TrackWaypoint*, TrackWaypoint*);
s32 func_8001168C(void*, void*, s32);
void func_80011A5C(void);
void func_80011AB8(s32);
void func_80011AE4(s32);
@@ -116,8 +142,11 @@ void func_80012A48(TrainCarStuff*, s16);
void func_80012AC0(void);
void func_80012DC0(s32, Player*);
void func_80013054(void);
void func_800131DC(s32);
void func_800133C4(void);
void func_80013854(Player*);
void func_800139E4(f32, f32, s32, s32, VehicleStuff*, TrackWaypoint*);
f32 func_80013C74(s16, s16);
void func_80013D20(VehicleStuff*);
void func_80013F7C(s32, Player*, VehicleStuff*, f32, f32, s32, u32);
@@ -137,13 +166,31 @@ void func_80014C78(void);
void func_80014CC0(s32, Player*);
void func_80014D08(s32);
void func_80014D30(s32, s32);
f32 func_80014EE4(f32 arg0, s32 arg1);
f32 func_80014EE4(f32, s32);
void func_800151A4(Camera*, s32);
void func_8001530C(void);
void func_80015314(s32, f32, s32);
void func_80015390(Camera*, Player*, s32);
void func_80015544(s32, f32, s32, s32);
void func_8001577C(Camera*, s32, s32, s32);
void func_80015A9C(s32, f32, s32, s16);
void func_800162CC(s32, f32, s32, s16);
void func_80016C3C(s32, f32, s32);
void func_80017720(s32, f32, s32, s16);
void func_80017F10(s32, f32, s32, s16);
void func_80018718(s32, f32, s32, s16);
void func_80019118(s32, f32, s32, s16);
void func_8001933C(Camera*, s32, s32, s32);
void func_8001968C(void);
void func_8001969C(s32, f32, s32, s16);
void func_80019760(Camera*, s32, s32, s32);
void func_80019890(s32, s32);
void func_80019B50(s32, u16);
void func_80019C50(s32);
void func_80019D2C(Camera*, Player*, s32);
void func_80019DE4(void);
@@ -154,10 +201,20 @@ void func_80019FB4(s32);
void func_8001A0A4(u16*, Camera*, Player*, s8, s32);
void func_8001A0DC(u16*, Camera*, Player*, s8, s32);
void func_8001A124(s32, s32);
s32 func_8001A310(s32, s32);
void func_8001A348(s32, f32, s32);
void func_8001A3D8(s32, f32, s32);
void func_8001A450(s32, s32, s32);
void func_8001A518(s32, s32, s32);
void func_8001A588(u16*, Camera*, Player*, s8, s32);
void func_8001ABE0(s32, s32);
void func_8001AB00(void);
void func_8001AB74(s32, s16*, s32);
void func_8001ABE0(s32, D_801642D8_entry*);
void func_8001ABEC(struct struct_801642D8*);
void func_8001AC10(s32);
void func_8001BE78(void);
void func_8001C05C(void);
void func_8001C14C(void);
@@ -174,17 +231,22 @@ extern f32 D_800DCA4C[];
// See bss_80005FD0.s
extern Collision D_80162E70;
extern s16 D_80162EB0;
extern u16 D_801631E0[8];
extern s32 D_80163488;
extern s16 D_80162FCC;
extern f32 D_80162FA0[];
extern s32 D_8016337C;
extern s16 D_80164378[];
extern s32 D_801643E0[];
extern struct unexpiredActors gUnexpiredActorsList[];
extern s16 D_8016348C;
extern s32 D_801643E0[];
extern s32 D_80164408[];
extern s32 D_8016448C;
extern f32 D_80164498[];
extern f32 D_801645F8[];
extern s32 D_80164608[];
extern f32 D_80164618[];
extern f32 D_80164638[];
extern f32 D_80164648[];
extern f32 D_80164658[];
extern s16 D_80164670[];
extern s16 D_80164672;
extern s16 D_80164674;
@@ -193,11 +255,30 @@ extern s16 D_80164678[]; // Size 4? Is the three below this fake?
extern s16 D_8016467A;
extern s16 D_8016467C;
extern s16 D_8016467E;
extern s16 D_80164680[];
extern s16 D_80164682;
extern f32 D_80164688[];
extern s16 D_801646C0[];
extern s16 D_801646CC;
extern s16 D_801630FC;
extern s16 D_801631C8;
extern u16 D_801631E0[8];
extern s32 D_80163238;
extern s16 D_801632B8[];
extern s16 D_801632D0[];
extern u16 D_801632E8[];
extern s16 D_801646CC;
extern s32 D_8016337C;
extern u16 D_80163410[]; // One per player?
extern s16 D_80163478;
extern s32 D_80163488;
extern s16 D_8016348C;
extern s16 D_801634D8[8];
extern s32 D_8016359C;
extern u16 D_801637BC[2];
extern u16 D_801637BE;
extern s32 D_80163DD8[];
extern u16 D_80163E2A;
extern Gfx D_0D0076F8[];
extern s32 D_800DDB20;
+11 -40
View File
@@ -4783,40 +4783,11 @@ GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80065AB0.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b
? func_800652D4(f32 *, s16 *, f32); /* extern */
//generated by m2c commit 08138748803d75e73e4a94bb0c619a273754ee9c on Oct-09-2023
extern ? D_05FF8DB8;
extern u32 D_8018D494;
extern u32 D_8018D498;
static s32 D_800E47DC[0xC] = {
0x00FBFFFB,
0x00A06011,
0x00E0C090,
0x00D0B080,
0x00907040,
0x00C07010,
0x00D0F0FF,
0x00E09030,
0x00C09030,
0x00604020,
0x00F0D0B0,
0x00A08030,
};
static s32 D_800E480C[0xC] = {
0x00B0B0B0,
0x00804011,
0x00B08050,
0x00A07040,
0x00603011,
0x00804010,
0x007090A0,
0x00A06030,
0x00A07010,
0x00301011,
0x00B0A080,
0x00806010,
};
static ? D_800E8C00; /* unable to generate initializer */
extern ? D_800E47DC;
extern ? D_800E480C;
extern ? D_800E8C00;
void func_80065F0C(Player *player, s32 arg1, s16 arg2, s8 arg3) {
f32 spE4;
@@ -4862,11 +4833,11 @@ void func_80065F0C(Player *player, s32 arg1, s16 arg2, s8 arg3) {
Gfx *temp_s0_8;
Gfx *temp_s0_9;
s16 temp_a0;
s16 temp_a1;
s16 temp_ra;
s16 temp_s2;
s16 temp_s3;
s32 temp_a2;
s32 temp_t6;
s32 temp_v1;
void *temp_v0;
@@ -4881,11 +4852,11 @@ void func_80065F0C(Player *player, s32 arg1, s16 arg2, s8 arg3) {
sp44 = temp_v0;
func_800652D4(&spDC, &spD4, temp_v0->unk534 * player->size);
if ((s32) sp44->unk53C != 8) {
temp_a1 = sp44->unk560;
temp_a0 = sp44->unk562;
temp_v1 = D_800E47DC[temp_a1];
temp_t6 = sp44->unk560 * 4;
temp_v1 = *(&D_800E47DC + temp_t6);
temp_ra = ((temp_v1 >> 0x10) & 0xFF) - temp_a0;
temp_a2 = D_800E480C[temp_a1];
temp_a2 = *(&D_800E480C + temp_t6);
temp_s2 = ((temp_v1 >> 8) & 0xFF) - temp_a0;
temp_s3 = (temp_v1 & 0xFF) - temp_a0;
spCA = ((temp_a2 >> 0x10) & 0xFF) - temp_a0;
@@ -4900,7 +4871,7 @@ void func_80065F0C(Player *player, s32 arg1, s16 arg2, s8 arg3) {
temp_s0_2 = gDisplayListHead;
gDisplayListHead = temp_s0_2 + 8;
temp_s0_2->words.w0 = 0xFD900000;
temp_s0_2->words.w1 = D_8018D494;
temp_s0_2->words.w1 = (u32) D_8018D494;
temp_s0_3 = gDisplayListHead;
gDisplayListHead = temp_s0_3 + 8;
temp_s0_3->words.w1 = 0x07000000;
@@ -4938,7 +4909,7 @@ void func_80065F0C(Player *player, s32 arg1, s16 arg2, s8 arg3) {
temp_s0_11 = gDisplayListHead;
gDisplayListHead = temp_s0_11 + 8;
temp_s0_11->words.w0 = 0xFD900000;
temp_s0_11->words.w1 = D_8018D494;
temp_s0_11->words.w1 = (u32) D_8018D494;
temp_s0_12 = gDisplayListHead;
gDisplayListHead = temp_s0_12 + 8;
temp_s0_12->words.w1 = 0x07000000;
@@ -4985,7 +4956,7 @@ void func_80065F0C(Player *player, s32 arg1, s16 arg2, s8 arg3) {
temp_s0_22 = gDisplayListHead;
gDisplayListHead = temp_s0_22 + 8;
temp_s0_22->words.w0 = 0xFD100000;
temp_s0_22->words.w1 = D_8018D498;
temp_s0_22->words.w1 = (u32) D_8018D498;
temp_s0_23 = gDisplayListHead;
gDisplayListHead = temp_s0_23 + 8;
temp_s0_23->words.w1 = 0x07080200;
+224 -406
View File
File diff suppressed because it is too large Load Diff
+5 -1
View File
@@ -11,6 +11,8 @@ void func_8006ED60(void);
u8 *func_8006ED94(u8*, u8*, u32, u32);
void func_8006EE44(void);
void init_item_window(s32);
void func_8006EEE8(s32);
void func_8006F824(s32);
void func_8006FA94(void);
void func_80070148(void);
void func_80070190(void);
@@ -20,6 +22,7 @@ void func_800703E0(s32, s32, StarSpawn*);
void func_800704A0(StarSpawn*);
void func_8007055C(void);
void func_80070714(void);
void func_80070780();
void init_hud_one_player(void);
void init_hud_two_player_vertical(void);
void init_hud_three_four_player(void);
@@ -27,7 +30,7 @@ void init_hud_two_player_horizontal(void);
extern s16 D_800E5520[];
extern s16 D_800E5548[];
extern s32 gCourseOutlineTextures[0x14];
extern u8 *gCourseOutlineTextures[0x14];
extern s8 *gTextureLogoMarioKart64;
extern s16 D_80165730;
@@ -42,6 +45,7 @@ extern intptr_t D_8018D9B0;
extern u8 (*D_8018D220)[1024];
extern s32 D_8018D240;
extern u8 *D_8018D248[];
extern s16 D_8018D2B0;
extern s16 D_8018D2B8;
extern s32 D_80183DA0;
+54 -108
View File
@@ -840,95 +840,52 @@ u8 func_800B60E8(s32 arg0)
GLOBAL_ASM("asm/non_matchings/code_800B45E0/func_800B60E8.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022
s32 func_800B6178(s32 arg0) {
s32 temp_v0;
s32 var_s0_2;
s32 var_v0;
s32 var_v1;
s8 temp_t0;
s8 temp_t1;
s8 temp_t3;
s8 temp_t4;
s8 temp_t5;
s8 temp_t9;
s8 var_s0;
s8 var_s0_3;
s32 var_s0;
struct_8018EE10_entry *temp_s3;
struct_8018EE10_entry *var_s1;
struct_8018EE10_entry *var_s1_2;
struct_8018EE10_entry *var_s1_3;
u8 temp_v0_2;
if ((arg0 != 0) && (arg0 != 1)) {
return -1;
switch (arg0) {
case 0:
case 1:
break;
default:
return -1;
}
if (gGamestate == 4) {
func_800051C4();
}
temp_s3 = &D_8018EE10[arg0];
temp_s3->ghostDataSaved = 0;
temp_v0 = func_800B6088(arg0);
var_v1 = temp_v0;
if (temp_v0 != 0) {
var_v0 = func_800B6088(arg0);
if (var_v0 != 0) {
temp_s3->ghostDataSaved = 0;
var_s0 = 0;
var_s1 = temp_s3;
do {
temp_t9 = var_s0 + 1;
temp_t0 = var_s0 + 2;
temp_t1 = var_s0 + 3;
var_s1->unk_07[0] = var_s0;
var_s0 += 4;
var_s1->unk_07[3] = temp_t1;
var_s1->unk_07[2] = temp_t0;
var_s1->unk_07[1] = temp_t9;
var_s1 += 4;
} while (var_s0 != 0x3C);
for (var_s0 = 0; var_s0 < 0x3C; var_s0++) {
temp_s3->unk_07[var_s0] = var_s0;
}
} else {
var_v0 = osPfsReadWriteFile(&gControllerPak1FileHandle, gControllerPak1FileNote, 1U, (arg0 * 0x3C00) + 0x100, 0x00003C00, (u8 *) D_800DC714);
var_v1 = var_v0;
if (var_v0 == 0) {
temp_s3->ghostDataSaved = 1;
if (gGamestate == 4) {
temp_s3->courseIndex = (gCupSelection * 4) + gCupCourseSelection;
}
var_s0_2 = 0;
temp_s3->unk_00 = D_80162DFC;
var_s1_2 = temp_s3;
temp_s3->characterId = (u8) D_80162DE0;
do {
temp_v0_2 = func_800B60E8(var_s0_2);
var_s0_2 += 1;
var_s1_2 += 1;
var_s1_2->characterId = temp_v0_2;
} while (var_s0_2 != 0x0000003C);
for (var_s0 = 0; var_s0 < 0x3C; var_s0++) {
temp_s3->unk_07[var_s0] = func_800B60E8(var_s0);
}
var_v0 = func_800B6088(arg0);
var_v1 = var_v0;
}
if (var_v0 != 0) {
temp_s3->ghostDataSaved = 0;
var_s0_3 = 0;
var_s1_3 = temp_s3;
do {
temp_t3 = var_s0_3 + 1;
temp_t4 = var_s0_3 + 2;
temp_t5 = var_s0_3 + 3;
var_s1_3->unk_07[0] = var_s0_3;
var_s0_3 += 4;
var_s1_3->unk_07[3] = temp_t5;
var_s1_3->unk_07[2] = temp_t4;
var_s1_3->unk_07[1] = temp_t3;
var_s1_3 += 4;
} while (var_s0_3 != 0x3C);
for (var_s0 = 0; var_s0 < 0x3C; var_s0++) {
temp_s3->unk_07[var_s0] = var_s0;
}
}
}
return var_v1;
return var_v0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_800B45E0/func_800B6178.s")
#endif
s32 func_800B6348(s32 arg0) {
if ((D_8018EE10[0].ghostDataSaved != 0) && (arg0 == D_8018EE10[0].courseIndex)) {
@@ -1022,43 +979,36 @@ s32 func_800B64EC(s32 arg0) {
return temp_v0;
}
#ifdef MIPS_TO_C
//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022
#ifdef NON_MATCHING
// Matching decomp courstesy of Vetri, leaving it as this becasue I'm lazy
// https://decomp.me/scratch/qrC3l
s32 func_800B65F4(s32 arg0, s32 arg1) {
s32 sp34;
s32 temp_v0;
s32 stackPadding;
s32 var_s0;
s32 temp_v0;
struct_8018EE10_entry *temp_s3;
struct_8018EE10_entry *var_s1;
u8 temp_v0_2;
if ((arg0 != 0) && (arg0 != 1)) {
return -1;
switch (arg0) {
case 0:
case 1:
break;
default:
return -1;
}
temp_v0 = osPfsReadWriteFile(&gControllerPak2FileHandle, gControllerPak2FileNote, 0U, (arg0 * 0x3C00) + 0x100, 0x00003C00, (u8 *) D_800DC714);
sp34 = temp_v0;
if (temp_v0 == 0) {
temp_s3 = &D_8018D9C0[arg0];
var_s1 = temp_s3;
var_s0 = 0;
loop_5:
temp_v0_2 = func_800B60E8(var_s0);
var_s0 += 1;
if ((u8) var_s1->unk_07[0] != temp_v0_2) {
temp_s3->ghostDataSaved = 0;
return -2;
for (var_s0 = 0; var_s0 < 0x3C; var_s0++) {
if (temp_s3->unk_07[var_s0] != func_800B60E8(var_s0)) {
temp_s3->ghostDataSaved = 0;
return -2;
}
}
var_s1 += 1;
if (var_s0 == 0x0000003C) {
D_80162DE0 = (s32) temp_s3->characterId;
D_80162DFC = temp_s3->unk_00;
*(&D_8018EE10->courseIndex + (arg1 << 7)) = temp_s3->courseIndex;
goto block_9;
}
goto loop_5;
D_80162DE0 = temp_s3->characterId;
D_80162DFC = temp_s3->unk_00;
D_8018EE10[arg1].courseIndex = temp_s3->courseIndex;
}
block_9:
return sp34;
return temp_v0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_800B45E0/func_800B65F4.s")
@@ -1095,7 +1045,7 @@ void func_800B6798(void) {
}
#ifdef MIPS_TO_C
//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de
//generated by m2c commit 08138748803d75e73e4a94bb0c619a273754ee9c on Oct-08-2023
u8 func_800B6828(s32 arg0) {
s32 temp_a2;
s32 temp_lo;
@@ -1130,30 +1080,26 @@ GLOBAL_ASM("asm/non_matchings/code_800B45E0/func_800B6828.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern s32 D_8018D9C0;
s32 func_800B68F4(s32 arg0) {
//generated by m2c commit 08138748803d75e73e4a94bb0c619a273754ee9c on Oct-08-2023
u8 func_800B68F4(s32 arg0) {
s32 temp_a1;
s32 temp_a2;
s32 temp_a3;
s32 var_a1;
s32 var_a2;
struct_8018EE10_entry *temp_v1;
void *temp_v0;
void *temp_v1;
s32 phi_a2;
s32 phi_a1;
temp_a3 = arg0 + 1;
temp_v1 = (arg0 << 7) + D_8018D9C0;
phi_a2 = 3;
phi_a1 = (temp_v1->unk0 * temp_a3) + (temp_v1->unk1 * temp_a3) + 1 + (temp_v1->unk2 * temp_a3) + 2;
temp_v1 = &D_8018D9C0[arg0];
var_a2 = 3;
var_a1 = (temp_v1->unk0 * temp_a3) + (temp_v1->unk1 * temp_a3) + 1 + (temp_v1->unk2 * temp_a3) + 2;
do {
temp_v0 = temp_v1 + phi_a2;
temp_a2 = phi_a2 + 4;
temp_a1 = phi_a1 + ((temp_v0->unk0 * temp_a3) + phi_a2) + ((temp_v0->unk1 * temp_a3) + phi_a2) + 1 + ((temp_v0->unk2 * temp_a3) + phi_a2) + 2 + ((temp_v0->unk3 * temp_a3) + phi_a2) + 3;
phi_a2 = temp_a2;
phi_a1 = temp_a1;
} while (temp_a2 != 0x43);
return temp_a1 & 0xFF;
temp_v0 = temp_v1 + var_a2;
temp_a1 = var_a1 + ((temp_v0->unk0 * temp_a3) + var_a2) + ((temp_v0->unk1 * temp_a3) + var_a2) + 1 + ((temp_v0->unk2 * temp_a3) + var_a2) + 2 + ((temp_v0->unk3 * temp_a3) + var_a2);
var_a2 += 4;
var_a1 = temp_a1 + 3;
} while (var_a2 != 0x43);
return var_a1 & 0xFF;
}
#else
GLOBAL_ASM("asm/non_matchings/code_800B45E0/func_800B68F4.s")
-2
View File
@@ -120,8 +120,6 @@ extern u16 D_802BA260; // Box Truck sub-type?
// end of definition of actor.c variables
extern u16 gNearestWaypointByPlayerId[];
extern s16 gCurrentCourseId;
extern u16 isCrossingTriggeredByIndex[];
extern Lights1 D_800DC610[];