mirror of
https://github.com/n64decomp/mk64
synced 2026-07-28 23:25:37 -04:00
Match a variety of functions (#245)
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
This commit is contained in:
+20
-30
@@ -3,19 +3,13 @@
|
||||
#include "types.h"
|
||||
#include "variables.h"
|
||||
#include "waypoints.h"
|
||||
#include "actors.h"
|
||||
#include "actor_types.h"
|
||||
#include <defines.h>
|
||||
|
||||
extern void func_800C8F44(u16 arg0);
|
||||
extern u16 D_800DC5A8;
|
||||
|
||||
struct UnkStruct8015F8D0 {
|
||||
f32 unk0;
|
||||
f32 unk4;
|
||||
f32 unk8;
|
||||
};
|
||||
|
||||
extern struct UnkStruct8015F8D0 D_8015F8D0;
|
||||
|
||||
extern struct Controller *gControllerOne[];
|
||||
|
||||
extern s32 D_800DC510;
|
||||
@@ -67,10 +61,7 @@ extern u32 *D_06014330;
|
||||
|
||||
extern f32 gCourseDirection;
|
||||
|
||||
extern u16 gNumPermanentActors;
|
||||
|
||||
extern s16 D_800DC5BC, D_800DC5C8;
|
||||
extern u16 gNumActors;
|
||||
extern s16 D_800DC5C8;
|
||||
|
||||
|
||||
s32 D_800DC5E0 = 32;
|
||||
@@ -154,18 +145,18 @@ void setup_race(void) {
|
||||
func_8029E158();
|
||||
|
||||
if (gModeSelection != BATTLE) {
|
||||
D_8015F8D0.unk4 = (f32) (D_80164490->wayPointY - 15);;
|
||||
D_8015F8D0.unk8 = D_80164490->wayPointZ;
|
||||
D_8015F8D0[1] = (f32) (D_80164490->wayPointY - 15);;
|
||||
D_8015F8D0[2] = D_80164490->wayPointZ;
|
||||
if (gCurrentCourseId == COURSE_TOADS_TURNPIKE) {
|
||||
D_8015F8D0.unk0 = (gIsMirrorMode != 0) ?
|
||||
D_8015F8D0[0] = (gIsMirrorMode != 0) ?
|
||||
D_80164490->wayPointX + 138.0f :
|
||||
D_80164490->wayPointX - 138.0f;
|
||||
} else if (gCurrentCourseId == COURSE_WARIO_STADIUM) {
|
||||
D_8015F8D0.unk0 = (gIsMirrorMode != 0) ?
|
||||
D_8015F8D0[0] = (gIsMirrorMode != 0) ?
|
||||
D_80164490->wayPointX + 12.0f :
|
||||
D_80164490->wayPointX - 12.0f;
|
||||
} else {
|
||||
D_8015F8D0.unk0 = D_80164490->wayPointX;
|
||||
D_8015F8D0[0] = D_80164490->wayPointX;
|
||||
}
|
||||
}
|
||||
if (D_800DC51C == 0) {
|
||||
@@ -232,10 +223,9 @@ void clear_nmi_buffer(void) {
|
||||
}
|
||||
|
||||
void func_80003040(void) {
|
||||
u32 pad[2];
|
||||
f32 sp34;
|
||||
s32 sp28[3] = {0};
|
||||
s16 sp20[3] = {0};
|
||||
Vec3f position;
|
||||
Vec3f velocity = {0, 0, 0};
|
||||
Vec3s rotation = {0, 0, 0};
|
||||
|
||||
D_800DC5BC = 0;
|
||||
D_800DC5C8 = 0;
|
||||
@@ -258,9 +248,9 @@ void func_80003040(void) {
|
||||
func_802AF8BC(0x7000878, -0x80, 0, 0, 0);
|
||||
break;
|
||||
case COURSE_YOSHI_VALLEY:
|
||||
vec3f_set(&sp34, -2300.0f, 0.0f, 634.0f);
|
||||
sp34 *= gCourseDirection;
|
||||
func_8029EC88(&sp34, &sp20, &sp28, 9);
|
||||
vec3f_set(position, -2300.0f, 0.0f, 634.0f);
|
||||
position[0] *= gCourseDirection;
|
||||
func_8029EC88(position, rotation, velocity, ACTOR_YOSHI_VALLEY_EGG);
|
||||
break;
|
||||
case COURSE_MOO_MOO_FARM:
|
||||
func_802A84F4(&D_0F04FE28, 0x3E8, 0x800);
|
||||
@@ -287,12 +277,12 @@ void func_80003040(void) {
|
||||
func_802AF8BC(0x7001318, -1, 0xFF, 0xFF, 0);
|
||||
break;
|
||||
case COURSE_WARIO_STADIUM:
|
||||
vec3f_set(&sp34, -131.0f, 83.0f, 286.0f);
|
||||
func_8029EC88(&sp34, &sp20, &sp28, 0x23);
|
||||
vec3f_set(&sp34, -2353.0f, 72.0f, -1608.0f);
|
||||
func_8029EC88(&sp34, &sp20, &sp28, 0x23);
|
||||
vec3f_set(&sp34, -2622.0f, 79.0f, 739.0f);
|
||||
func_8029EC88(&sp34, &sp20, &sp28, 0x23);
|
||||
vec3f_set(position, -131.0f, 83.0f, 286.0f);
|
||||
func_8029EC88(position, rotation, velocity, ACTOR_WARIO_STADIUM_SIGN);
|
||||
vec3f_set(position, -2353.0f, 72.0f, -1608.0f);
|
||||
func_8029EC88(position, rotation, velocity, ACTOR_WARIO_STADIUM_SIGN);
|
||||
vec3f_set(position, -2622.0f, 79.0f, 739.0f);
|
||||
func_8029EC88(position, rotation, velocity, ACTOR_WARIO_STADIUM_SIGN);
|
||||
func_802AF8BC(0x7000C50, 0x64, 0xFF, 0xFF, 0xFF);
|
||||
func_802AF8BC(0x7000BD8, 0x64, 0xFF, 0xFF, 0xFF);
|
||||
func_802AF8BC(0x7000B60, 0x64, 0xFF, 0xFF, 0xFF);
|
||||
|
||||
+30
-39
@@ -4,6 +4,7 @@
|
||||
#include <defines.h>
|
||||
#include "types.h"
|
||||
#include "variables.h"
|
||||
#include "math_util.h"
|
||||
#include "code_8001F980.h"
|
||||
#include "code_80057C60.h"
|
||||
|
||||
@@ -868,48 +869,38 @@ void func_80021DA8(void) {
|
||||
func_8006E940(gPlayerFour, 3, 3);
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd
|
||||
void func_80021E10(Mat4 arg0, f32 *arg1, s16 *arg2) {
|
||||
f32 sp38;
|
||||
f32 sp30;
|
||||
f32 sp2C;
|
||||
f32 sp28;
|
||||
f32 temp_f0;
|
||||
f32 temp_f12;
|
||||
f32 temp_f12_2;
|
||||
f32 temp_f20;
|
||||
f32 temp_f6;
|
||||
void func_80021E10(Mat4 arg0, Vec3f arg1, Vec3s arg2) {
|
||||
f32 stackPadding[3];
|
||||
f32 sin1;
|
||||
f32 cos1;
|
||||
f32 sin2;
|
||||
f32 cos2;
|
||||
f32 sin3;
|
||||
f32 cos3;
|
||||
|
||||
sp38 = sins((u16) arg2->unk0);
|
||||
temp_f20 = coss((u16) arg2->unk0);
|
||||
sp30 = sins(arg2->unk2);
|
||||
sp2C = coss(arg2->unk2);
|
||||
sp28 = sins(arg2->unk4);
|
||||
temp_f0 = coss(arg2->unk4);
|
||||
temp_f12 = sp38 * sp30;
|
||||
temp_f6 = temp_f12 * temp_f0;
|
||||
arg0[0][0] = (sp2C * temp_f0) + (temp_f12 * sp28);
|
||||
arg0->unk20 = (f32) (temp_f20 * sp30);
|
||||
arg0->unk10 = (f32) ((-sp2C * sp28) + temp_f6);
|
||||
arg0->unk24 = (f32) -sp38;
|
||||
temp_f12_2 = sp38 * sp2C;
|
||||
arg0[0][1] = temp_f20 * sp28;
|
||||
arg0->unk30 = (f32) arg1->unk0;
|
||||
arg0->unk14 = (f32) (temp_f20 * temp_f0);
|
||||
arg0->unk34 = (f32) arg1->unk4;
|
||||
arg0[0][2] = (-sp30 * temp_f0) + (temp_f12_2 * sp28);
|
||||
arg0->unk28 = (f32) (temp_f20 * sp2C);
|
||||
arg0->unk18 = (f32) ((sp30 * sp28) + (temp_f12_2 * temp_f0));
|
||||
sin1 = sins(arg2[0]);
|
||||
cos1 = coss(arg2[0]);
|
||||
sin2 = sins(arg2[1]);
|
||||
cos2 = coss(arg2[1]);
|
||||
sin3 = sins(arg2[2]);
|
||||
cos3 = coss(arg2[2]);
|
||||
arg0[0][0] = (cos2 * cos3) + ((sin1 * sin2) * sin3);
|
||||
arg0[1][0] = (-cos2 * sin3) + ((sin1 * sin2) * cos3);
|
||||
arg0[2][0] = cos1 * sin2;
|
||||
arg0[3][0] = arg1[0];
|
||||
arg0[0][1] = cos1 * sin3;
|
||||
arg0[1][1] = cos1 * cos3;
|
||||
arg0[2][1] = -sin1;
|
||||
arg0[3][1] = arg1[1];
|
||||
arg0[0][2] = (-sin2 * cos3) + ((sin1 * cos2) * sin3);
|
||||
arg0[1][2] = (sin2 * sin3) + ((sin1 * cos2) * cos3);
|
||||
arg0[2][2] = cos1 * cos2;
|
||||
arg0[3][2] = arg1[2];
|
||||
arg0[0][3] = 0.0f;
|
||||
arg0->unk1C = 0.0f;
|
||||
arg0->unk2C = 0.0f;
|
||||
arg0->unk3C = 1.0f;
|
||||
arg0->unk38 = (f32) arg1->unk8;
|
||||
arg0[1][3] = 0.0f;
|
||||
arg0[2][3] = 0.0f;
|
||||
arg0[3][3] = 1.0f;
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/code_8001F980/func_80021E10.s")
|
||||
#endif
|
||||
|
||||
UNUSED void func_80021F50(Mat4 arg0, Vec3f arg1) {
|
||||
arg0[3][0] += arg1[0];
|
||||
|
||||
@@ -16,6 +16,8 @@ void func_800219BC();
|
||||
void func_80021C78();
|
||||
void func_80021D40();
|
||||
void func_80021DA8();
|
||||
void func_80021E10(Mat4, Vec3f, Vec3s);
|
||||
void func_80021F50(Mat4, Vec3f);
|
||||
void func_80021F84(Mat4, f32);
|
||||
void func_80021FF8(Mtx*, Mat4);
|
||||
void func_80022180(Mtx*, Mat4);
|
||||
|
||||
+24
-20
@@ -1277,31 +1277,35 @@ void func_800B6798(void) {
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
extern ? D_8018EE10;
|
||||
|
||||
s32 func_800B6828(s32 arg0) {
|
||||
s32 temp_a1;
|
||||
//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de
|
||||
u8 func_800B6828(s32 arg0) {
|
||||
s32 temp_a2;
|
||||
s32 temp_lo;
|
||||
s32 temp_v1;
|
||||
void *temp_v0;
|
||||
s32 phi_a1;
|
||||
s32 phi_v1;
|
||||
void *phi_a3;
|
||||
s32 var_a1;
|
||||
s32 var_v1;
|
||||
struct_8018EE10_entry *temp_v0;
|
||||
u8 temp_t1;
|
||||
u8 temp_t4;
|
||||
u8 temp_t7;
|
||||
void *var_a3;
|
||||
|
||||
temp_v0 = (arg0 << 7) + &D_8018EE10;
|
||||
temp_v0 = &D_8018EE10[arg0];
|
||||
temp_a2 = arg0 + 1;
|
||||
phi_a1 = 3;
|
||||
phi_v1 = (temp_v0->unk0 * temp_a2) + (temp_v0->unk1 * temp_a2) + 1 + (temp_v0->unk2 * temp_a2) + 2;
|
||||
phi_a3 = temp_v0 + 3;
|
||||
var_a3 = temp_v0 + 3;
|
||||
var_a1 = 3;
|
||||
var_v1 = (temp_v0->unk0 * temp_a2) + (temp_v0->unk1 * temp_a2) + 1 + (temp_v0->unk2 * temp_a2) + 2;
|
||||
do {
|
||||
temp_a1 = phi_a1 + 4;
|
||||
temp_v1 = phi_v1 + ((phi_a3->unk0 * temp_a2) + phi_a1) + ((phi_a3->unk1 * temp_a2) + phi_a1) + 1 + ((phi_a3->unk2 * temp_a2) + phi_a1) + 2 + ((phi_a3->unk3 * temp_a2) + phi_a1) + 3;
|
||||
phi_a1 = temp_a1;
|
||||
phi_v1 = temp_v1;
|
||||
phi_a3 += 4;
|
||||
} while (temp_a1 != 0x43);
|
||||
return temp_v1 & 0xFF;
|
||||
temp_t7 = var_a3->unk1;
|
||||
temp_t1 = var_a3->unk2;
|
||||
temp_lo = var_a3->unk0 * temp_a2;
|
||||
temp_t4 = var_a3->unk3;
|
||||
var_a3 += 4;
|
||||
temp_v1 = var_v1 + (temp_lo + var_a1) + ((temp_t7 * temp_a2) + var_a1) + 1 + ((temp_t1 * temp_a2) + var_a1) + 2 + ((temp_t4 * temp_a2) + var_a1);
|
||||
var_a1 += 4;
|
||||
var_v1 = temp_v1 + 3;
|
||||
} while (var_a1 != 0x43);
|
||||
return var_v1 & 0xFF;
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/menus/func_800B6828.s")
|
||||
|
||||
+47
-96
@@ -3,10 +3,8 @@
|
||||
#include <types.h>
|
||||
#include <common_structs.h>
|
||||
#include "main.h"
|
||||
|
||||
extern struct UnkStruct_80280658 *D_802874F8;
|
||||
extern Gfx *gDisplayListHead;
|
||||
extern struct GfxPool *gGfxPool;
|
||||
#include "code_8001F980.h"
|
||||
#include "code_80280650.h"
|
||||
|
||||
void func_80280650(void) {
|
||||
|
||||
@@ -54,37 +52,33 @@ struct UnkStruct_80280658 *func_80280734(struct UnkStruct_80280658 *arg0) {
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
extern u16 D_80284E60;
|
||||
//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de
|
||||
static u16 D_80284E60 = 0;
|
||||
|
||||
u16 func_8028076C(void) {
|
||||
s32 temp_a1;
|
||||
s32 temp_t5;
|
||||
s32 temp_t8;
|
||||
s32 temp_v0_2;
|
||||
s32 temp_v0;
|
||||
u16 temp_t4;
|
||||
u16 temp_v0;
|
||||
u16 phi_v0;
|
||||
u16 var_v0;
|
||||
|
||||
//temp_v0 = D_80284E60;
|
||||
phi_v0 = D_80284E60;
|
||||
|
||||
if (D_80284E60 == 0x560A) {
|
||||
var_v0 = D_80284E60;
|
||||
if (var_v0 == 0x560A) {
|
||||
D_80284E60 = 0;
|
||||
phi_v0 = 0 & 0xFFFF;
|
||||
var_v0 = 0 & 0xFFFF;
|
||||
}
|
||||
|
||||
temp_t8 = (phi_v0 << 8) ^ phi_v0;
|
||||
temp_t8 = (var_v0 << 8) ^ var_v0;
|
||||
temp_a1 = temp_t8 & 0xFF;
|
||||
temp_t4 = (temp_a1 << 8) + ((temp_t8 & 0xFF00) >> 8);
|
||||
temp_t4 = (temp_a1 << 8) + ((s32) (temp_t8 & 0xFF00) >> 8);
|
||||
temp_t5 = ((temp_a1 * 2) ^ temp_t4) & 0xFFFF;
|
||||
D_80284E60 = temp_t4;
|
||||
if ((temp_t5 & 1) == 0) {
|
||||
D_80284E60 = ((temp_t5 >> 1) ^ 0xFF80) & 0xFFFF;
|
||||
if (D_80284E60 == 0xAA55) {
|
||||
if (!(temp_t5 & 1)) {
|
||||
temp_v0 = ((temp_t5 >> 1) ^ 0xFF80) & 0xFFFF;
|
||||
if (temp_v0 == 0xAA55) {
|
||||
D_80284E60 = 0;
|
||||
} else {
|
||||
D_80284E60 = D_80284E60 ^ 0x1FF4;
|
||||
D_80284E60 = temp_v0 ^ 0x1FF4;
|
||||
}
|
||||
} else {
|
||||
D_80284E60 = (temp_t5 >> 1) ^ 0xFF80 ^ 0x8180;
|
||||
@@ -95,14 +89,10 @@ u16 func_8028076C(void) {
|
||||
GLOBAL_ASM("asm/non_matchings/code_80280650/func_8028076C.s")
|
||||
#endif
|
||||
|
||||
u16 func_8028076C();
|
||||
|
||||
f32 func_8028080C(void) {
|
||||
return func_8028076C() / 65536.0f;
|
||||
}
|
||||
|
||||
f32 func_8028080C();
|
||||
|
||||
f32 func_80280850(f32 arg0) {
|
||||
return (func_8028080C() * arg0) - (arg0 * 0.5f);
|
||||
}
|
||||
@@ -146,11 +136,6 @@ s32 D_80284E40[] = {
|
||||
0x00FF4080, 0x008040FF, 0x0040FF40, 0x00FFFF40
|
||||
};
|
||||
|
||||
extern struct UnkStruct_80280658 *D_80284E7C;
|
||||
extern f32 D_80286B74;
|
||||
extern f32 D_80286B78;
|
||||
extern f32 D_80286B7C;
|
||||
|
||||
void func_8028093C(struct UnkStruct_80280658 *arg0) {
|
||||
struct UnkStruct_80280658 *temp_v0;
|
||||
f32 temp_f0;
|
||||
@@ -174,36 +159,22 @@ void func_8028093C(struct UnkStruct_80280658 *arg0) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
void func_80021E10(f32, f32 *, s32, s32); // extern
|
||||
void func_80022180(f32, struct GfxPool*, f32*); // extern
|
||||
extern s16 D_80164AF0;
|
||||
extern struct UnkStruct_80287500 *D_80287500;
|
||||
=
|
||||
void func_80280A28(Vec3f arg0, Vec3s arg1, f32 arg2) {
|
||||
Mat4 sp20;
|
||||
|
||||
void func_80280A28(s32 arg0, s32 arg1, f32 arg2) {
|
||||
|
||||
f32 sp20[14];
|
||||
Gfx *temp_v1;
|
||||
|
||||
func_80021E10(arg2, &sp20, arg0, arg1);
|
||||
sp20[0] = D_80287500->unk0[0] * arg2;
|
||||
sp20[1] = D_80287500->unk10 * arg2;
|
||||
sp20[2] = D_80287500->unk20 * arg2;
|
||||
sp20[3] = D_80287500->unk0[1] * arg2;
|
||||
sp20[4] = D_80287500->unk14 * arg2;
|
||||
sp20[5] = D_80287500->unk24 * arg2;
|
||||
sp20[6] = D_80287500->unk0[2] * arg2;
|
||||
sp20[7] = D_80287500->unk18 * arg2;
|
||||
sp20[8] = D_80287500->unk28 * arg2;
|
||||
func_80022180(arg2, &gGfxPool->mtxPool[D_80164AF0 + 0x3EB], &sp20);
|
||||
|
||||
gSPMatrix(gDisplayListHead, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
func_80021E10(sp20, arg0, arg1);
|
||||
sp20[0][0] = D_80287500[0][0] * arg2;
|
||||
sp20[0][1] = D_80287500[1][0] * arg2;
|
||||
sp20[0][2] = D_80287500[2][0] * arg2;
|
||||
sp20[1][0] = D_80287500[0][1] * arg2;
|
||||
sp20[1][1] = D_80287500[1][1] * arg2;
|
||||
sp20[1][2] = D_80287500[2][1] * arg2;
|
||||
sp20[2][0] = D_80287500[0][2] * arg2;
|
||||
sp20[2][1] = D_80287500[1][2] * arg2;
|
||||
sp20[2][2] = D_80287500[2][2] * arg2;
|
||||
func_80022180(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB], sp20);
|
||||
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPool[D_80164AF0 + 0x3EB]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/code_80280650/func_80280A28.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
@@ -379,10 +350,6 @@ void func_80280FA8(s32 arg0) {
|
||||
|
||||
}
|
||||
|
||||
struct UnkStruct_80280658 *func_80280734(struct UnkStruct_80280658*);
|
||||
extern s32 D_80284E88;
|
||||
extern s32 D_802874E0;
|
||||
|
||||
void func_80280FB0(void) {
|
||||
D_802874E0 = 0;
|
||||
|
||||
@@ -391,8 +358,6 @@ void func_80280FB0(void) {
|
||||
func_80280734(&D_80284E88);
|
||||
}
|
||||
|
||||
extern s8 D_802874F4;
|
||||
|
||||
void func_80280FFC(void) {
|
||||
D_802874F4 = 1;
|
||||
}
|
||||
@@ -482,48 +447,39 @@ GLOBAL_ASM("asm/non_matchings/code_80280650/func_8028118C.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
? func_8028101C(?, s32, ?); // extern
|
||||
? func_8028118C(?, s32, ?); // extern
|
||||
? guLookAtF(? *, s32, s32, s32, f32, f32, f32, f32, f32, f32); // extern
|
||||
extern ? cameras;
|
||||
extern f32 D_801646F4;
|
||||
//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de
|
||||
? func_8028101C(?, s32, ?); /* extern */
|
||||
? func_8028118C(?, s32, ?); /* extern */
|
||||
? guLookAtF(? *, f32, f32, f32, f32, f32, f32, f32, f32, f32); /* extern */
|
||||
extern s16 D_802874C4;
|
||||
extern s32 D_802874E0;
|
||||
extern s8 D_802874F5;
|
||||
extern ? D_80287500;
|
||||
|
||||
void func_802812C8(void) {
|
||||
f32 temp_f0;
|
||||
s32 temp_v0;
|
||||
s32 temp_v0_2;
|
||||
s32 phi_v0;
|
||||
s32 phi_v0_2;
|
||||
s32 var_v0;
|
||||
|
||||
guLookAtF(&D_80287500, cameras.unk0, cameras.unk4, cameras.unk8, cameras.unkC, cameras.unk10, cameras.unk14, cameras.unk18, cameras.unk1C, cameras.unk20);
|
||||
guLookAtF(&D_80287500, cameras->pos[0], cameras->pos[1], cameras->pos[2], cameras->lookAt[0], cameras->lookAt[1], cameras->lookAt[2], cameras->up[0], cameras->up[1], cameras->up[2]);
|
||||
if (D_802874F5 < 3) {
|
||||
temp_v0 = D_802874E0;
|
||||
phi_v0 = temp_v0;
|
||||
if (temp_v0 < 0x12C) {
|
||||
temp_f0 = D_80164700;
|
||||
func_8028118C(-0xE0E, ((temp_f0 - D_801646F4) * 1.5f) + temp_f0, -0x258);
|
||||
phi_v0 = D_802874E0;
|
||||
var_v0 = D_802874E0;
|
||||
if (var_v0 < 0x12C) {
|
||||
temp_f0 = cameras->lookAt[1];
|
||||
func_8028118C(-0xE0E, (s32) (((temp_f0 - cameras->pos[1]) * 1.5f) + temp_f0), -0x258);
|
||||
var_v0 = D_802874E0;
|
||||
}
|
||||
phi_v0_2 = phi_v0;
|
||||
if (phi_v0 == 0x78) {
|
||||
func_8028101C(-0xC6C, D_802874C4 + 210.0f, -0x1EF);
|
||||
if (var_v0 == 0x00000078) {
|
||||
func_8028101C(-0xC6C, (s32) ((f32) D_802874C4 + 210.0f), -0x1EF);
|
||||
goto block_7;
|
||||
}
|
||||
} else {
|
||||
temp_v0_2 = D_802874E0;
|
||||
phi_v0_2 = temp_v0_2;
|
||||
if (temp_v0_2 == 2) {
|
||||
func_8028101C(-0xC6C, D_802874C4 + 210.0f, -0x1EF);
|
||||
var_v0 = D_802874E0;
|
||||
if (var_v0 == 2) {
|
||||
func_8028101C(-0xC6C, (s32) ((f32) D_802874C4 + 210.0f), -0x1EF);
|
||||
block_7:
|
||||
phi_v0_2 = D_802874E0;
|
||||
var_v0 = D_802874E0;
|
||||
}
|
||||
}
|
||||
D_802874E0 = phi_v0_2 + 1;
|
||||
D_802874E0 = var_v0 + 1;
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/code_80280650/func_802812C8.s")
|
||||
@@ -571,8 +527,6 @@ loop_2:
|
||||
GLOBAL_ASM("asm/non_matchings/code_80280650/func_80281438.s")
|
||||
#endif
|
||||
|
||||
extern s32 D_802874D4;
|
||||
|
||||
void func_8028150C(void) {
|
||||
D_802874D4 = gDisplayListHead;
|
||||
}
|
||||
@@ -597,9 +551,6 @@ void func_80281540(void) {
|
||||
|
||||
}
|
||||
|
||||
extern s16 D_80150112;
|
||||
extern s32 D_802874FC;
|
||||
|
||||
void ending_sequence_loop(void) {
|
||||
D_80150112 = 0;
|
||||
D_802874FC = 0;
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
#ifndef CODE_80280650_H
|
||||
#define CODE_80280650_H
|
||||
|
||||
struct UnkStruct_80280658 {
|
||||
s32 unk0;
|
||||
s16 unk4;
|
||||
s16 unk6;
|
||||
s8 unk8;
|
||||
s8 unk9;
|
||||
s16 unkA;
|
||||
s16 unkC;
|
||||
s16 unkE;
|
||||
f32 unk10;
|
||||
f32 unk14;
|
||||
f32 unk18;
|
||||
f32 unk1C;
|
||||
f32 unk20;
|
||||
f32 unk24;
|
||||
struct UnkStruct_80280658_2 *unk28;
|
||||
s32 unk2C;
|
||||
s32 unk30;
|
||||
f32 unk34;
|
||||
f32 unk38;
|
||||
s32 unk3C;
|
||||
s32 unk40;
|
||||
s32 unk44;
|
||||
s32 unk48;
|
||||
};
|
||||
|
||||
struct UnkStruct_80280658_2 {
|
||||
s16 unk0;
|
||||
s16 unk2;
|
||||
s16 unk4;
|
||||
s16 unk6;
|
||||
s8 unk8;
|
||||
s8 unk9;
|
||||
s8 unkA;
|
||||
f32 unkC;
|
||||
};
|
||||
|
||||
struct UnkStruct_8028088C {
|
||||
s32 unk0;
|
||||
s16 unk4;
|
||||
s16 unk6;
|
||||
s8 unk8;
|
||||
s8 unk9;
|
||||
s16 unkA;
|
||||
s16 unkC;
|
||||
s16 unkE;
|
||||
f32 unk10;
|
||||
f32 unk14;
|
||||
f32 unk18;
|
||||
f32 unk1C;
|
||||
f32 unk20;
|
||||
f32 unk24;
|
||||
struct UnkStruct_80280658_2 *unk28;
|
||||
s16 unk2C;
|
||||
s16 unk2E;
|
||||
s16 unk30;
|
||||
s16 unk32;
|
||||
s16 unk34;
|
||||
s16 unk36;
|
||||
s32 unk38;
|
||||
s32 unk3C;
|
||||
};
|
||||
|
||||
void func_80280650();
|
||||
void func_80280658(struct UnkStruct_80280658*);
|
||||
struct UnkStruct_80280658 *func_802806C8();
|
||||
struct UnkStruct_80280658 *func_80280734(struct UnkStruct_80280658*);
|
||||
u16 func_8028076C();
|
||||
f32 func_8028080C();
|
||||
f32 func_80280850(f32);
|
||||
void func_80280884();
|
||||
void func_8028093C(struct UnkStruct_80280658*);
|
||||
void func_80280A28(Vec3f, Vec3s, f32);
|
||||
void func_80280FA0(s32);
|
||||
void func_80280FA8(s32);
|
||||
void func_80280FB0();
|
||||
void func_80280FFC();
|
||||
void func_8028100C(s32, s32, s32);
|
||||
void func_8028150C();
|
||||
void func_80281520();
|
||||
void func_80281528();
|
||||
void func_80281530();
|
||||
void func_80281538();
|
||||
void func_80281540();
|
||||
void func_80281548();
|
||||
|
||||
extern struct UnkStruct_80280658 *D_802874F8;
|
||||
extern struct UnkStruct_80280658 *D_80284E7C;
|
||||
extern f32 D_80286B74;
|
||||
extern f32 D_80286B78;
|
||||
extern f32 D_80286B7C;
|
||||
extern s32 D_80284E88;
|
||||
extern s32 D_802874E0;
|
||||
extern s8 D_802874F4;
|
||||
extern s32 D_802874D4;
|
||||
extern s16 D_80150112;
|
||||
extern s32 D_802874FC;
|
||||
extern Mat4 D_80287500;
|
||||
extern s16 D_80164AF0;
|
||||
|
||||
#endif
|
||||
+87
-27
@@ -455,27 +455,20 @@ void func_80282F00(s16 *arg0, s16 arg1) {
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
? vec3f_set_dupe(?32 *, ?32, ?32, ?32); // extern
|
||||
s32 func_80282364(void *, ?, s16); // extern
|
||||
? func_80282454(?32 *, ?32 *, s32 *, s16 *, s16 *); // extern
|
||||
? func_80282504(?32 *, ?32 *, s32, s16, s32); // extern
|
||||
? func_80282F00(void *, s16); // extern
|
||||
f32 sins(u16); // extern
|
||||
|
||||
void func_80282F44(s32 arg0, void *arg1, void *arg2) {
|
||||
s32 sp5C;
|
||||
//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de
|
||||
void func_80282F44(s32 arg0, void *arg1, Camera *camera) {
|
||||
f32 sp5C;
|
||||
s16 sp52;
|
||||
s16 sp50;
|
||||
?32 sp44;
|
||||
?32 sp38;
|
||||
f32 sp44;
|
||||
f32 sp38;
|
||||
s32 sp30;
|
||||
s16 *temp_v0;
|
||||
s32 temp_t9;
|
||||
void *temp_s0;
|
||||
|
||||
vec3f_set_dupe(&sp44, arg2->unk0, arg2->unk4, arg2->unk8);
|
||||
vec3f_set_dupe(&sp38, arg2->unkC, arg2->unk10, arg2->unk14);
|
||||
vec3f_set_dupe(&sp44, camera->pos[0], camera->pos[1], camera->pos[2]);
|
||||
vec3f_set_dupe(&sp38, camera->lookAt[0], camera->lookAt[1], camera->lookAt[2]);
|
||||
if ((arg0 == 0) || (arg0 == 1)) {
|
||||
if ((arg1->unk48 != 0) || (arg1->unk4A != 0)) {
|
||||
func_80282454(&sp44, &sp38, &sp5C, &sp50, &sp52);
|
||||
@@ -483,18 +476,18 @@ void func_80282F44(s32 arg0, void *arg1, void *arg2) {
|
||||
temp_s0 = arg1 + temp_t9;
|
||||
sp30 = temp_t9;
|
||||
temp_v0 = sp30 + &sp50;
|
||||
*temp_v0 = *temp_v0 + (temp_s0->unk48 * sins(temp_s0->unk4E));
|
||||
*temp_v0 = (s16) (s32) ((f32) *temp_v0 + ((f32) temp_s0->unk48 * sins(temp_s0->unk4E)));
|
||||
if ((sp50 < 0x3800) && (sp50 >= -0x37FF)) {
|
||||
func_80282504(&sp44, &sp38, sp5C, sp50, sp52);
|
||||
func_80282504(&sp44, &sp38, sp5C, sp50, (s16) (s32) sp52);
|
||||
}
|
||||
func_80282F00(temp_s0 + 0x4E, temp_s0->unk54);
|
||||
if (func_80282364(temp_s0 + 0x48, 0, temp_s0->unk5A) == 0) {
|
||||
temp_s0->unk4E = 0;
|
||||
temp_s0->unk4E = 0U;
|
||||
}
|
||||
}
|
||||
arg2->unkC = sp38;
|
||||
arg2->unk10 = sp3C;
|
||||
arg2->unk14 = sp40;
|
||||
camera->lookAt[0] = sp38;
|
||||
camera->lookAt[1] = sp3C;
|
||||
camera->lookAt[2] = sp40;
|
||||
}
|
||||
}
|
||||
#else
|
||||
@@ -1214,15 +1207,82 @@ GLOBAL_ASM("asm/non_matchings/code_80281FA0/func_802847CC.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
/*
|
||||
Failed to decompile function func_80284AE8:
|
||||
//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de
|
||||
struct _struct_D_80286B5C_0x8 {
|
||||
/* 0x0 */ ? (*unk0)(); /* inferred */
|
||||
/* 0x4 */ s16 unk4; /* inferred */
|
||||
/* 0x6 */ char pad6[2];
|
||||
}; /* size = 0x8 */
|
||||
|
||||
Unable to determine jump table for jr instruction at func_80284AE8.s line 13.
|
||||
? func_802847CC(); /* extern */
|
||||
static ? D_80285D10; /* unable to generate initializer */
|
||||
static ? D_80285D58; /* unable to generate initializer */
|
||||
static struct _struct_D_80286B5C_0x8 D_80286B5C[2] = { { func_802847CC, 0x7FFF }, { NULL, 0 } };
|
||||
|
||||
There must be a read of a variable in the same block as
|
||||
the instruction, which has a name starting with "jtbl"/"jpt_".
|
||||
*/
|
||||
void func_80284AE8(void *arg0) {
|
||||
s16 sp1A;
|
||||
s16 temp_v0_3;
|
||||
struct _struct_D_80286B5C_0x8 *temp_v0_7;
|
||||
u8 temp_v0;
|
||||
void *temp_v0_2;
|
||||
void *temp_v0_4;
|
||||
void *temp_v0_5;
|
||||
void *temp_v0_6;
|
||||
|
||||
temp_v0 = arg0->unk1C;
|
||||
switch (temp_v0) { /* irregular */
|
||||
case 2:
|
||||
temp_v0_2 = (D_802876D0 * 8) + &D_80285D10;
|
||||
sp1A = temp_v0_2->unk4;
|
||||
temp_v0_2->unk0();
|
||||
default:
|
||||
block_8:
|
||||
if ((sp1A != 0) && (temp_v0_3 = D_802876D2, ((temp_v0_3 & 0xC000) == 0))) {
|
||||
if (temp_v0_3 < 0x3FFF) {
|
||||
D_802876D2 = temp_v0_3 + 1;
|
||||
}
|
||||
if (sp1A == D_802876D2) {
|
||||
D_802876D2 = 0;
|
||||
D_802876D0 += 1;
|
||||
func_8028240C();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (D_802876D2 & 0x4000) {
|
||||
D_802876D2 = 0;
|
||||
func_8028240C();
|
||||
return;
|
||||
}
|
||||
D_802876D8 = 0;
|
||||
D_802876D0 = 0;
|
||||
D_802876D2 = 0;
|
||||
func_8028240C();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
temp_v0_4 = (D_802876D0 * 8) + &D_80285D10;
|
||||
sp1A = temp_v0_4->unk4;
|
||||
temp_v0_4->unk0();
|
||||
goto block_8;
|
||||
case 4:
|
||||
temp_v0_5 = (D_802876D0 * 8) + &D_80285D10;
|
||||
sp1A = temp_v0_5->unk4;
|
||||
temp_v0_5->unk0();
|
||||
goto block_8;
|
||||
case 5:
|
||||
temp_v0_6 = (D_802876D0 * 8) + &D_80285D58;
|
||||
sp1A = temp_v0_6->unk4;
|
||||
temp_v0_6->unk0();
|
||||
func_80283C58((s32) arg0);
|
||||
goto block_8;
|
||||
case 6:
|
||||
temp_v0_7 = &D_80286B5C[D_802876D0];
|
||||
sp1A = temp_v0_7->unk4;
|
||||
temp_v0_7->unk0();
|
||||
goto block_8;
|
||||
}
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/code_80281FA0/func_80284AE8.s")
|
||||
#endif
|
||||
|
||||
+380
-585
File diff suppressed because it is too large
Load Diff
+29
-10
@@ -14,6 +14,7 @@
|
||||
|
||||
#define sqr(x) ((x) * (x))
|
||||
|
||||
void func_802B4FF0();
|
||||
s32 func_802B4FF8(Mat4, s32);
|
||||
f32 func_802B51E8(Vec3f, Vec3f);
|
||||
u32 func_802B5224(Vec3f, Vec3f);
|
||||
@@ -23,17 +24,28 @@ void vec3s_set(Vec3s, s16, s16, s16);
|
||||
void *vec3f_copy(Vec3f, Vec3f);
|
||||
void vec3s_copy(Vec3s, Vec3s);
|
||||
void *sm64_vec3f_set(Vec3f, f32, f32, f32);
|
||||
void func_802B5398(s32*, s32*, s32);
|
||||
void mtxf_identity(Mat4);
|
||||
//void func_802B5398(Mat4, Mat4, s32);
|
||||
void func_802B5450(Mat4, Mat4, Mat4);
|
||||
void func_802B54EC(Mat4, Mat4, Mat4);
|
||||
void mtxf_translate(Mat4, Vec3f);
|
||||
void func_802B5564(Mat4, u16*, f32, f32, f32, f32, f32);
|
||||
void func_802B59DC(Mat4, s16);
|
||||
void func_802B5F74(Mat4, Vec3f, Vec3s);
|
||||
f32 func_802B80D0(Vec3f, Vec3f, u16, f32, f32, f32);
|
||||
void func_802B5A44(Mat4, s16);
|
||||
void func_802B5AAC(Mat4, s16);
|
||||
void func_802B5CAC(s16, s16, Vec3f);
|
||||
void func_802B5D30(s16, s16, s32);
|
||||
void func_802B5F00(Mat4, f32);
|
||||
void func_802B5F74(Mat4, Vec3f, Vec3s);
|
||||
void func_802B60B4(Mat4, Vec3s, Vec3s);
|
||||
void func_802B6214(Mat4, Vec3s, Vec3s);
|
||||
void func_802B6374(Vec3f);
|
||||
void func_802B63B8(Vec3f, Mat3);
|
||||
void func_802B6434(Vec3f, Mat4);
|
||||
void func_802B64B0(s32, s32, s32, s32);
|
||||
void func_802B64C4(Vec3f, s16);
|
||||
void func_802B6BC0(Mat4, s16, f32, f32, f32);
|
||||
void func_802B6D58(Mat4, Vec3f, Vec3f);
|
||||
void func_802B71CC(Mat4, Mat4, Mat4);
|
||||
void func_802B75F8(Mtx*, Mat4);
|
||||
u16 atan2_lookup(f32, f32);
|
||||
@@ -44,13 +56,20 @@ void func_802B7C18(f32);
|
||||
s16 func_802B7C40(f32);
|
||||
void func_802B7C6C(f32);
|
||||
s16 func_802B7CA8(f32);
|
||||
void func_802B7CE8(f32);
|
||||
s16 func_802B7D28(f32);
|
||||
u16 random_u16();
|
||||
u16 random_int(u16);
|
||||
s16 func_802B7F34(f32, f32, f32, f32);
|
||||
f32 func_802B7CE8(f32);
|
||||
s16 func_802B7D28(f32);
|
||||
u16 random_u16();
|
||||
u16 random_int(u16);
|
||||
s16 func_802B7F34(f32, f32, f32, f32);
|
||||
void func_802B7F7C(Vec3f, Vec3f, Vec3s);
|
||||
f32 sins(u16);
|
||||
f32 coss(u16);
|
||||
f32 sins(u16);
|
||||
f32 coss(u16);
|
||||
s32 func_802B8058(u16, u16, u16);
|
||||
f32 func_802B80D0(Vec3f, Vec3f, u16, f32, f32, f32);
|
||||
|
||||
extern f64 D_802B9FB0; // = 0.017453292222222222;
|
||||
extern f32 D_802B9FD8; // = 1000000.0f;
|
||||
extern f64 D_802BA018; // = 3.141592653589793;
|
||||
extern u16 gRandomSeed16;
|
||||
|
||||
#endif // MATH_UTIL_H
|
||||
|
||||
Reference in New Issue
Block a user