diff options
| author | Tyler McGavran <tyler.taggerung@gmail.com> | 2023-07-11 14:54:39 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-11 12:54:39 -0600 |
| commit | 890aaee1620043ab3a998b03ba7a28471732bcd7 (patch) | |
| tree | 90f793155f4fdc7b08ca6c25ff97c58610a1dd06 /src/code_80091440.c | |
| parent | 04b9d5b4b8956b8b620242400bd6c47716c63f39 (diff) | |
Move plan data for code_8008C1D0 into asm files (#340)
Had to create a new file in order to get stuff matching right,
even though making a separate file for just 3 functions is
incredibly silly.
Signed-off-by: Taggerung <tyler.taggerung@email.com>
Diffstat (limited to 'src/code_80091440.c')
| -rw-r--r-- | src/code_80091440.c | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/src/code_80091440.c b/src/code_80091440.c new file mode 100644 index 000000000..ed6c9e66a --- /dev/null +++ b/src/code_80091440.c @@ -0,0 +1,91 @@ +#include "variables.h" +#include "code_80091440.h" + +void func_80091440(s8 arg0) { + if ((gPlayers[arg0].unk_044 & 0x800) == 0) { + gPlayers[arg0].unk_044 |= 0x2400; + gPlayers[arg0].unk_000 &= ~0x2000; + } +} + +void func_800914A0(void) { + D_80152308 = gPlayerOneCopy->unk_006 + 7; + if ((s32) D_8015F6F8 < D_80152308) { + D_80152308 -= D_8015F6F8; + } +} + +#ifdef MIPS_TO_C +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-15-2022 +extern u32 D_8015F718; +static ? D_800E7080; /* unable to generate initializer */ +static ? D_800E708C; /* unable to generate initializer */ + +void func_800914E0(void) { + ? sp64; + ? sp58; + s32 sp48; + f32 sp38; + f32 sp34; + f32 sp30; + Player **var_t1; + f32 temp_f12; + f32 temp_f14; + f32 temp_f16; + f32 temp_f4; + f32 temp_f8; + s16 temp_a0; + s16 temp_a0_2; + s16 temp_v0; + u16 temp_t0; + void *temp_v0_2; + + sp64.unk0 = (s32) D_800E7080.unk0; + sp64.unk4 = (s32) D_800E7080.unk4; + sp64.unk8 = (s32) D_800E7080.unk8; + sp58.unk0 = (s32) D_800E708C.unk0; + sp58.unk4 = (s32) D_800E708C.unk4; + sp58.unk8 = (s32) D_800E708C.unk8; + temp_a0 = D_8015F718 & 0xFFFFFF; + var_t1 = &gPlayerOneCopy; + sp48 = gSegmentTable[(u32) D_8015F718 >> 0x18] + temp_a0 + 0x80000000; + temp_t0 = D_80152308; + temp_v0 = (s16) gPlayerOneCopy->unk_006 - temp_t0; + cameras->up[0] = 0.0f; + cameras->up[2] = 0.0f; + cameras->up[1] = 1.0f; + if (temp_v0 == 7) { + func_800914A0(temp_a0, 7); + goto block_5; + } + if (temp_v0 < 0xE) { + temp_a0_2 = temp_v0 + (s16) D_8015F6F8; + if (temp_a0_2 == 7) { + func_800914A0(temp_a0_2, 7); +block_5: + var_t1 = &gPlayerOneCopy; + } + } + temp_v0_2 = (temp_t0 * 8) + sp48; + temp_f8 = (f32) (temp_v0_2->unk0 + 0xA); + cameras->pos[0] = temp_f8; + temp_f16 = (f32) (temp_v0_2->unk2 + 7); + cameras->pos[1] = temp_f16; + temp_f4 = (f32) (temp_v0_2->unk4 - 0x14); + cameras->pos[2] = temp_f4; + cameras->lookAt[0] = (*var_t1)->pos[0]; + cameras->lookAt[1] = (*var_t1)->pos[1]; + cameras->lookAt[2] = (*var_t1)->pos[2]; + func_802ADDC8(&cameras->unk_54, 20.0f, temp_f8, temp_f16, temp_f4); + temp_f12 = cameras->lookAt[0] - cameras->pos[0]; + sp38 = temp_f12; + temp_f14 = cameras->lookAt[2] - cameras->pos[2]; + sp34 = cameras->lookAt[1] - cameras->pos[1]; + sp30 = temp_f14; + cameras->rot[1] = atan2s(temp_f12, temp_f14); + cameras->rot[0] = atan2s(sqrtf((sp38 * sp38) + (temp_f14 * temp_f14)), sp34); + cameras->rot[2] = 0; +} +#else +GLOBAL_ASM("asm/non_matchings/code_80091440/func_800914E0.s") +#endif |
