Match a lot of functions, add header for objects (#251)

* Match a lot of functions, add header for objects

* Refreshed a TON of functions and created/added to several
 header files

* Add header for code_800431B0, address comments

Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
This commit is contained in:
Tyler McGavran
2022-08-23 12:33:00 -04:00
committed by GitHub
parent 7d23fcc063
commit dfd54d9a10
96 changed files with 9320 additions and 15193 deletions
+36 -48
View File
@@ -6632,8 +6632,6 @@ void func_80012A48(TrainCarStuff *trainCar, s16 arg1) {
#ifdef MIPS_TO_C
//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc
s16 func_8000DBAC(f32 *, s16 *, f32); /* extern */
? func_80012A48(TrainStuff *, s16); /* extern */
? func_800755FC(s32, f32 *, f32); /* extern */
extern s16 D_80162FCC;
extern f32 D_801635A4;
@@ -6682,7 +6680,7 @@ void func_80012AC0(void) {
temp_s1 = temp_v0;
var_s3->locomotive.velocity[0] = var_s3->locomotive.position[0] - temp_f20;
var_s3->locomotive.velocity[2] = var_s3->locomotive.position[2] - temp_f22;
func_80012A48(var_s3, temp_t0);
func_80012A48(&var_s3->locomotive, temp_t0);
temp_v0_2 = (u16) var_s3->locomotive.wayPointIndex;
if ((temp_s0 != temp_v0_2) && ((temp_v0_2 == 0x00BE) || (temp_v0_2 == 0x0140))) {
func_800C98B8(var_s6, var_s3->locomotive.velocity, 0x1901800EU);
@@ -6705,7 +6703,7 @@ void func_80012AC0(void) {
temp_a1 = func_8000DBAC(temp_s0_2->position, &temp_s0_2->wayPointIndex, var_s3->someMultiplier);
temp_s0_2->velocity[0] = temp_s0_2->position[0] - temp_f20_2;
temp_s0_2->velocity[2] = temp_s0_2->position[2] - temp_f22_2;
func_80012A48((TrainStuff *) temp_s0_2, temp_a1);
func_80012A48(temp_s0_2, temp_a1);
}
var_s2 = 0;
var_s1 = sp7C;
@@ -6717,7 +6715,7 @@ loop_13:
temp_a1_2 = func_8000DBAC(temp_s0_3->position, &temp_s0_3->wayPointIndex, var_s3->someMultiplier);
temp_s0_3->velocity[0] = temp_s0_3->position[0] - temp_f20_3;
temp_s0_3->velocity[2] = temp_s0_3->position[2] - temp_f22_3;
func_80012A48((TrainStuff *) temp_s0_3, temp_a1_2);
func_80012A48(temp_s0_3, temp_a1_2);
}
var_s2 += 0x24;
var_s1 += 0x24;
@@ -6942,8 +6940,6 @@ GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800132F4.s")
#ifdef MIPS_TO_C
//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc
? func_8000DBAC(f32 *, s16 *, f32); /* extern */
? func_80075A6C(s16, f32 *, ?); /* extern */
extern s16 D_80162EB0;
extern s16 D_801630FC;
extern s32 D_80163598;
@@ -6969,9 +6965,9 @@ void func_800133C4(void) {
f64 temp_f0;
f64 temp_f0_2;
s16 temp_a1;
s16 var_s3;
s16 var_v1;
s32 temp_v0;
s32 var_s3;
struct Actor *temp_v0_3;
void *temp_v0_2;
@@ -6980,7 +6976,7 @@ void func_800133C4(void) {
var_s3 = 0;
do {
temp_s2 = var_s0->position;
if (var_s0->isActive == 1) {
if (var_s0->isActive == (s16) 1) {
temp_f26 = var_s0->position[0];
temp_f28 = var_s0->position[1];
temp_f30 = var_s0->position[2];
@@ -6992,12 +6988,12 @@ void func_800133C4(void) {
sp7C = (f32) ((f64) var_s0->position[1] + 180.0);
sp80 = (f32) ((f64) var_s0->position[2] + 45.0);
func_80006114(&sp78, temp_s2, var_s0->yRotation);
func_80075A6C(var_s3, &sp78, 0x3F8CCCCD);
func_80075A6C(var_s3, (s32) &sp78, 1.1f);
sp78 = (f32) ((f64) var_s0->position[0] + 30.0);
sp7C = (f32) ((f64) var_s0->position[1] + 180.0);
sp80 = (f32) ((f64) var_s0->position[2] + 45.0);
func_80006114(&sp78, temp_s2, var_s0->yRotation);
func_80075A6C(var_s3, &sp78, 0x3F8CCCCD);
func_80075A6C(var_s3, (s32) &sp78, 1.1f);
}
if (random_int(0x0064U) == 0) {
temp_s1 = var_s0->velocity;
@@ -7119,8 +7115,6 @@ GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80013854.s")
#ifdef MIPS_TO_C
//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc
s16 func_8000D6D0(f32 *, s16 *, f32, f32, s32, s32); /* extern */
s16 func_8000D940(f32 *, s16 *, f32, f32, s32); /* extern */
extern s16 D_801631C8;
extern s16 D_8016347A;
@@ -7142,15 +7136,15 @@ void func_800139E4(f32 arg0, f32 arg1, s32 arg2, s32 arg3, VehicleStuff *vehicle
var_s0 = vehicle;
var_s4 = 0;
var_s1 = var_s0->position;
var_s2 = &var_s0->waypointId;
var_s2 = &var_s0->wayPointIndex;
do {
temp_hi = (s32) ((var_s4 / arg2) + arg3) % (s32) temp_s7;
temp_v0 = &wayPointList[temp_hi & 0xFFFF];
var_s0->position[0] = (f32) temp_v0->wayPointX;
var_s0->position[1] = (f32) temp_v0->wayPointY;
var_s0->actorIndex = -1;
var_s0->waypointId = (s16) temp_hi;
var_s0->unk0 = 0;
var_s0->wayPointIndex = (s16) temp_hi;
var_s0->unused = 0;
var_s0->velocity[0] = 0.0f;
var_s0->velocity[1] = 0.0f;
var_s0->velocity[2] = 0.0f;
@@ -7881,12 +7875,10 @@ GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80014EE4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
f32 sins(s32); // extern
f32 coss(s32); // extern
//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc
extern ? D_801646C0;
void func_800151A4(void *arg0, s32 arg1) {
void func_800151A4(Camera *camera, s32 arg1) {
f32 sp44;
f32 sp40;
f32 sp3C;
@@ -7901,34 +7893,32 @@ void func_800151A4(void *arg0, s32 arg1) {
f32 temp_f16;
f32 temp_f2;
f32 temp_f2_2;
f32 temp_f8;
u16 temp_s1;
temp_s1 = *(&D_801646C0 + (arg1 * 2));
if (temp_s1 == 0) {
arg0->unk18 = 0.0f;
arg0->unk20 = 0.0f;
arg0->unk1C = 1.0f;
camera->up[0] = 0.0f;
camera->up[2] = 0.0f;
camera->up[1] = 1.0f;
return;
}
temp_f2 = arg0->unkC - arg0->unk0;
temp_f14 = arg0->unk10 - arg0->unk4;
temp_f2 = camera->lookAt[0] - camera->pos[0];
temp_f14 = camera->lookAt[1] - camera->pos[1];
sp38 = temp_f2;
temp_f16 = arg0->unk14 - arg0->unk8;
temp_f16 = camera->lookAt[2] - camera->pos[2];
sp34 = temp_f14;
sp30 = temp_f16;
temp_f0 = sqrtf((temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16));
temp_f8 = temp_f14 / temp_f0;
sp44 = temp_f2 / temp_f0;
temp_f10 = temp_f16 / temp_f0;
sp40 = temp_f8;
sp40 = temp_f14 / temp_f0;
sp3C = temp_f10;
sp28 = 1.0 - coss(temp_s1 & 0xFFFF);
arg0->unk18 = (sp28 * sp44 * sp40) - (sins(temp_s1 & 0xFFFF) * temp_f10);
sp28 = (f32) (1.0 - (f64) coss(temp_s1 & 0xFFFF));
camera->up[0] = (sp28 * sp44 * sp40) - (sins(temp_s1 & 0xFFFF) * temp_f10);
temp_f2_2 = sp28 * sp40;
arg0->unk1C = coss(temp_s1 & 0xFFFF) + (temp_f2_2 * sp40);
camera->up[1] = coss(temp_s1 & 0xFFFF) + (temp_f2_2 * sp40);
sp20 = temp_f2_2;
arg0->unk20 = (sins(temp_s1 & 0xFFFF) * sp44) + (temp_f2_2 * temp_f10);
camera->up[2] = (sins(temp_s1 & 0xFFFF) * sp44) + (temp_f2_2 * temp_f10);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800151A4.s")
@@ -10357,25 +10347,24 @@ GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001A124.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
u32 random_int(?); /* extern */
//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc
extern ? D_80164680;
void func_8001A220(s32 arg0, s32 arg1) {
u32 temp_v0;
s16 phi_t9;
s16 *phi_at;
s16 *var_at;
s16 var_t9;
u16 temp_v0;
temp_v0 = random_int(6);
temp_v0 = random_int(6U);
switch (temp_v0) {
case 0:
*(&D_80164680 + (arg1 * 2)) = 4;
return;
case 1:
phi_t9 = 5;
phi_at = &D_80164680 + (arg1 * 2);
var_at = &D_80164680 + (arg1 * 2);
var_t9 = 5;
block_9:
*phi_at = phi_t9;
*var_at = var_t9;
return;
case 2:
*(&D_80164680 + (arg1 * 2)) = 6;
@@ -10390,8 +10379,8 @@ block_9:
*(&D_80164680 + (arg1 * 2)) = 1;
return;
default:
phi_t9 = 8;
phi_at = &D_80164680 + (arg1 * 2);
var_at = &D_80164680 + (arg1 * 2);
var_t9 = 8;
goto block_9;
}
}
@@ -10499,7 +10488,7 @@ GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001A518.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de
//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc
? func_800151A4(Camera *, s32); /* extern */
? func_80015390(Camera *, u16 *, s8, s32); /* extern */
? func_8001577C(Camera *, u16 *, s8, s32); /* extern */
@@ -10525,7 +10514,6 @@ extern ? D_801646C0;
extern u32 D_801646C8;
extern u16 D_801646CC;
extern ? D_801646D0;
extern s8 D_8018EDF3;
void func_8001A588(s32 arg0, Camera *camera, u16 *arg2, s8 arg3, s32 arg4) {
s32 sp44;
@@ -11467,14 +11455,14 @@ GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001C14C.s")
extern u16 D_80163E2A;
void func_8001C3C4(void) {
void func_8001C3C4(s32 arg0) {
if (gCurrentCourseId == COURSE_AWARD_CEREMONY) {
if (D_80163E2A >= 16) {
func_80057114(3);
}
} else {
if (gModeSelection == VERSUS) {
func_80057114();
func_80057114(arg0);
}
}
}