Actor decomp (#183)

* Actor decomp
This commit is contained in:
MegaMech
2022-04-26 16:48:36 -06:00
committed by GitHub
parent 626513f90a
commit 2f8a1bfcb6
57 changed files with 1869 additions and 5545 deletions
+79 -108
View File
@@ -1,78 +1,61 @@
#include <ultra64.h>
#include <macros.h>
#include <defines.h>
#include <actor_types.h>
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? vec3f_copy(void *, void *, void *, void *); // extern
void *vec3f_copy(Vec3f, Vec3f); // extern
void func_802B0210(void *arg0, void *arg1) {
void *temp_a0;
void *temp_a2;
void *temp_a3;
void func_802B0210(UnkActorInner *arg0, UnkActorInner *arg1) {
arg1->unk30 = arg0->unk30;
arg1->unk32 = arg0->unk32;
arg1->unk34 = arg0->unk34;
arg1->unk36 = arg0->unk36;
arg1->unk38 = arg0->unk38;
arg1->unk3A = arg0->unk3A;
arg1->unk3C = arg0->unk3C;
arg1->unk40 = arg0->unk40;
temp_a3 = arg0;
temp_a2 = arg1;
arg1->unk0 = arg0->unk0;
arg1->unk2 = arg0->unk2;
arg1->unk4 = arg0->unk4;
arg1->unk6 = arg0->unk6;
arg1->unk8 = arg0->unk8;
arg1->unkA = arg0->unkA;
arg1->unkC = arg0->unkC;
arg1->unk10 = arg0->unk10;
temp_a0 = arg1 + 0x18;
arg1->unk14 = arg0->unk14;
arg0 = temp_a3;
arg1 = temp_a2;
vec3f_copy(temp_a0, temp_a3 + 0x18, temp_a2, temp_a3);
vec3f_copy(arg1 + 0x24, arg0 + 0x24, arg1, arg0);
vec3f_copy(arg1 + 0x30, arg0 + 0x30, arg1, arg0);
arg1->unk44 = arg0->unk44;
vec3f_copy(arg1->unk48, arg0->unk48);
vec3f_copy(arg1->unk54, arg0->unk54);
vec3f_copy(arg1->unk60, arg0->unk60);
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B0210.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? D_8015F9B8;
extern struct Actor D_8015F9B8[];
void func_802B02B4(void *arg0, s32 arg1) {
void func_802B02B4(struct Actor *arg0, s32 arg1) {
s32 temp_f6;
void *temp_v0;
struct Actor *temp_v0 = &D_8015F9B8[arg0->unk4];
temp_v0->unk4--;
switch((s16)arg0->unk8) {
case 0:
temp_v0->unk24[0] = -1.0f;
break;
case 1:
temp_v0->unk24[1] = -1.0f;
break;
case 2:
temp_v0->unk24[2] = -1.0f;
break;
temp_v0 = (arg0->unk4 * 0x70) + &D_8015F9B8;
temp_v0->unk4 = temp_v0->unk4 - 1;
temp_f6 = arg0->unk8;
if (temp_f6 != 0) {
if (temp_f6 != 1) {
if (temp_f6 != 2) {
} else {
temp_v0->unk2C = -1.0f;
}
} else {
temp_v0->unk28 = -1.0f;
}
} else {
temp_v0->unk24 = -1.0f;
}
arg0->unk2 = -0x8000;
arg0->unk12 = 0;
arg0->unk4 = 0x3C;
arg0->unk28 = 3.0f;
if (arg1 != 7) {
if (arg1 != 8) {
return;
}
arg0->unk6 = 7;
return;
arg0->unk2 = 0x8000; // bitflag
arg0->unk10[1] = 0;
arg0->unk24[1] = 3.0f;
arg0->unk4 = 60;
switch(arg1) {
case 7:
arg0->unk6 = 5;
break;
case 8:
arg0->unk6 = 7;
break;
}
arg0->unk6 = 5;
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B02B4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
@@ -1130,10 +1113,10 @@ void update_obj_banana(void *arg0) {
temp_t9 = arg0->unk6;
switch (temp_t9) {
case 0:
temp_f2 = gPlayers[temp_t6].posX - arg0->unk18;
temp_f14 = gPlayers[temp_t6].posY - arg0->unk1C;
temp_f2 = gPlayers[temp_t6].pos[0] - arg0->unk18;
temp_f14 = gPlayers[temp_t6].pos[1] - arg0->unk1C;
sp48 = temp_f2;
temp_f16 = gPlayers[temp_t6].posZ - arg0->unk20;
temp_f16 = gPlayers[temp_t6].pos[2] - arg0->unk20;
sp44 = temp_f14;
sp88 = &gPlayers[temp_t6];
sp40 = temp_f16;
@@ -1141,13 +1124,13 @@ void update_obj_banana(void *arg0) {
phi_f14 = (bitwise void *) temp_f14;
if (temp_f12 == 0.0f) {
temp_f0 = D_802B9EE0;
arg0->unk18 = gPlayers[temp_t6].posX + temp_f0;
arg0->unk1C = gPlayers[temp_t6].posY + temp_f0;
arg0->unk18 = gPlayers[temp_t6].pos[0] + temp_f0;
arg0->unk1C = gPlayers[temp_t6].pos[1] + temp_f0;
phi_f6 = gPlayers[temp_t6].posZ + temp_f0;
} else {
temp_f14_2 = temp_f14 / temp_f12;
arg0->unk18 = gPlayers[temp_t6].posX - (temp_f2 / temp_f12);
arg0->unk1C = (gPlayers[temp_t6].posY - temp_f14_2) - 2.0f;
arg0->unk18 = gPlayers[temp_t6].pos[0] - (temp_f2 / temp_f12);
arg0->unk1C = (gPlayers[temp_t6].pos[1] - temp_f14_2) - 2.0f;
phi_f6 = gPlayers[temp_t6].posZ - (temp_f16 / temp_f12);
phi_f14 = (bitwise void *) temp_f14_2;
}
@@ -1239,9 +1222,9 @@ void update_obj_banana(void *arg0) {
sp70 = -5.0f;
sp88 = &gPlayers[temp_t6];
func_802B64C4(&sp68, gPlayers[temp_t6].unk_02E + gPlayers[temp_t6].unk_0C0);
temp_f18 = sp68 + gPlayers[temp_t6].posX;
temp_f0_7 = sp6C + gPlayers[temp_t6].posY;
temp_f10 = sp70 + gPlayers[temp_t6].posZ;
temp_f18 = sp68 + gPlayers[temp_t6].pos[0];
temp_f0_7 = sp6C + gPlayers[temp_t6].pos[1];
temp_f10 = sp70 + gPlayers[temp_t6].pos[2];
sp34 = temp_f10;
temp_f2_4 = temp_f18 - arg0->unk18;
sp3C = temp_f18;
@@ -1254,9 +1237,9 @@ void update_obj_banana(void *arg0) {
temp_f0_8 = sqrtf((temp_f2_4 * temp_f2_4) + (temp_f14_3 * temp_f14_3) + (temp_f16_2 * temp_f16_2), temp_f14_3);
if (temp_f0_8 == 0.0f) {
temp_f0_9 = D_802B9EE8;
arg0->unk18 = gPlayers[temp_t6].posX + temp_f0_9;
arg0->unk1C = gPlayers[temp_t6].posY + temp_f0_9;
arg0->unk20 = gPlayers[temp_t6].posZ + temp_f0_9;
arg0->unk18 = gPlayers[temp_t6].pos[0] + temp_f0_9;
arg0->unk1C = gPlayers[temp_t6].pos[1] + temp_f0_9;
arg0->unk20 = gPlayers[temp_t6].pos[2] + temp_f0_9;
} else {
arg0->unk18 = sp68 + (temp_f18 - (temp_f2_4 / temp_f0_8));
arg0->unk1C = (sp38 - (temp_f14_3 / temp_f0_8)) - 2.0f;
@@ -1355,9 +1338,9 @@ void func_802B2914(void *arg0, Player *player, s16 arg2) {
temp_a0 = &sp4C;
temp_a1 = &sp58;
temp_a2 = &sp60;
sp4C += player->posX;
sp50 += player->posY;
sp54 += player->posZ;
sp4C += player->pos[0];
sp50 += player->pos[1];
sp54 += player->pos[2];
sp60 = player->unk_034;
sp64 = player->unk_038;
sp58 = 0;
@@ -1368,10 +1351,10 @@ void func_802B2914(void *arg0, Player *player, s16 arg2) {
temp_t6 = temp_v0;
if (temp_v0 >= 0) {
temp_lo = temp_t6 * 0x70;
sp4C = player->posX;
sp50 = player->posY;
sp4C = player->pos[0];
sp50 = player->pos[1];
temp_s0 = &D_8015F9B8 + temp_lo;
sp54 = player->posZ;
sp54 = player->pos[2];
sp6E = temp_t6;
func_802AD950(temp_s0 + 0x30, temp_s0->unkC + 1.0f, temp_s0->unk18, temp_s0->unk1C, temp_s0->unk20, sp4C, sp50, sp54);
func_802B4E30(temp_s0);
@@ -1724,7 +1707,7 @@ GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B30EC.s")
? func_802B64C4(f32 *, s16); /* extern */
extern ? D_8015F9B8;
void update_obj_green_shell(void *arg0) {
void update_obj_green_shell(struct Actor *arg0) {
f32 sp80;
f32 sp7C;
f32 sp78;
@@ -1767,15 +1750,15 @@ void update_obj_green_shell(void *arg0) {
arg0->unk10 = arg0->unk10 + 0x71C;
switch (temp_t3) {
case 0:
temp_s1 = &gPlayers[arg0->unk14];
temp_s1 = &gPlayers[arg0->unk10[2]];
func_802B0210(&temp_s1->unk_110, arg0 + 0x30);
sp6C = 0.0f;
sp70 = temp_s1->unk_070;
sp74 = -(temp_s1->unk_070 + arg0->unkC + 2.0f);
func_802B63B8(&sp6C, temp_s1->unk_174);
arg0->unk18 = sp6C + temp_s1->posX;
arg0->unk18 = sp6C + temp_s1->pos[0];
temp_f14 = temp_s1->posY - sp70;
arg0->unk20 = sp74 + temp_s1->posZ;
arg0->unk20 = sp74 + temp_s1->pos[2];
sp54 = temp_f14;
temp_f0_2 = func_802ABE30(arg0->unk18, temp_f14, arg0->unk20, temp_s1->unk_11A);
temp_f2_2 = temp_f14 - temp_f0_2;
@@ -2521,32 +2504,20 @@ block_16:
GLOBAL_ASM("asm/non_matchings/code_802B0210/update_obj_red_blue_shell.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
void func_802B4E30(void *arg0) {
f32 temp_f0;
f32 temp_f0_2;
f32 temp_f0_3;
temp_f0 = arg0->unk44;
if ((temp_f0 < 0.0f) && (arg0->unk34 == 1)) {
arg0->unk18 = arg0->unk18 - (arg0->unk60 * temp_f0);
arg0->unk1C = arg0->unk1C - (arg0->unk64 * temp_f0);
arg0->unk20 = arg0->unk20 - (arg0->unk68 * temp_f0);
void func_802B4E30(struct Actor *arg0) {
if ((arg0->unk30.unk44 < 0.0f) && (arg0->unk30.unk34 == 1)) {
arg0->unk18[0] -= (arg0->unk30.unk60[0] * arg0->unk30.unk44);
arg0->unk18[1] -= (arg0->unk30.unk60[1] * arg0->unk30.unk44);
arg0->unk18[2] -= (arg0->unk30.unk60[2] * arg0->unk30.unk44);
}
temp_f0_2 = arg0->unk3C;
if ((temp_f0_2 < 0.0f) && (arg0->unk30 == 1)) {
arg0->unk18 = arg0->unk18 - (arg0->unk48 * temp_f0_2);
arg0->unk1C = arg0->unk1C - (arg0->unk4C * temp_f0_2);
arg0->unk20 = arg0->unk20 - (arg0->unk50 * temp_f0_2);
if ((arg0->unk30.unk3C < 0.0f) && (arg0->unk30.unk30 == 1)) {
arg0->unk18[0] -= (arg0->unk30.unk48[0] * arg0->unk30.unk3C);
arg0->unk18[1] -= (arg0->unk30.unk48[1] * arg0->unk30.unk3C);
arg0->unk18[2] -= (arg0->unk30.unk48[2] * arg0->unk30.unk3C);
}
temp_f0_3 = arg0->unk40;
if ((temp_f0_3 < 0.0f) && (arg0->unk32 == 1)) {
arg0->unk18 = arg0->unk18 - (arg0->unk54 * temp_f0_3);
arg0->unk1C = arg0->unk1C - (arg0->unk58 * temp_f0_3);
arg0->unk20 = arg0->unk20 - (arg0->unk5C * temp_f0_3);
if ((arg0->unk30.unk40 < 0.0f) && (arg0->unk30.unk32 == 1)) {
arg0->unk18[0] -= (arg0->unk30.unk54[0] * arg0->unk30.unk40);
arg0->unk18[1] -= (arg0->unk30.unk54[1] * arg0->unk30.unk40);
arg0->unk18[2] -= (arg0->unk30.unk54[2] * arg0->unk30.unk40);
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B4E30.s")
#endif