diff options
| author | Roman971 <32455037+Roman971@users.noreply.github.com> | 2020-06-07 16:08:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-07 10:08:06 -0400 |
| commit | c10bcdc3c456238ba27c3839a90cf18154e8e57d (patch) | |
| tree | 79fe6fbc3d47735b3205db9723d9441a9fd4f79f /src/code | |
| parent | 80ca848cfb297cb06e39dd5c5350c4e941354beb (diff) | |
Fix and match func_800BFCB8 (#196)
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/z_play.c | 48 |
1 files changed, 22 insertions, 26 deletions
diff --git a/src/code/z_play.c b/src/code/z_play.c index 7e47deb9c..a98d9076a 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -1071,7 +1071,7 @@ void Gameplay_DrawOverlayElements(GlobalContext* globalCtx) { } #ifdef NON_MATCHING -// regalloc, stakc usage and minor ordering differences +// regalloc, stack usage and minor ordering differences void Gameplay_Draw(GlobalContext* globalCtx) { LightMapper* sp228; Vec3f sp21C; @@ -1382,47 +1382,46 @@ s32 Gameplay_InCsMode(GlobalContext* globalCtx) { return (globalCtx->csCtx.state != 0) || func_8008E988(globalCtx); } -#ifdef NON_MATCHING -// saved register usage differences and possibly stack usage or regalloc differences f32 func_800BFCB8(GlobalContext* globalCtx, MtxF* mf, Vec3f* vec) { - PosRot sp50; - f32 temp_f0; - f32 phi_f12; - f32 phi_f16; + CollisionPoly sp50; + f32 temp1; + f32 temp2; + f32 temp3; f32 sp40; f32 sp3C; f32 sp38; f32 sp34; + s32 pad[5]; - sp40 = func_8003CB30(globalCtx, &globalCtx->colCtx, &sp50, mf); + sp40 = func_8003CB30(&globalCtx->colCtx, &sp50, vec, mf); if (sp40 > -32000.0f) { - sp3C = sp50.rot.x * (1.0f / 32767.0f); - sp38 = sp50.rot.y * (1.0f / 32767.0f); - sp34 = sp50.rot.z * (1.0f / 32767.0f); + sp3C = sp50.norm.x * (1.0f / 32767.0f); + sp38 = sp50.norm.y * (1.0f / 32767.0f); + sp34 = sp50.norm.z * (1.0f / 32767.0f); - temp_f0 = sqrtf(1.0f - SQ(sp3C)); + temp1 = sqrtf(1.0f - SQ(sp3C)); - if (temp_f0 != 0.0f) { - phi_f12 = sp38 * temp_f0; - phi_f16 = -sp34 * temp_f0; + if (temp1 != 0.0f) { + temp2 = sp38 * temp1; + temp3 = -sp34 * temp1; } else { - phi_f12 = 0.0f; - phi_f16 = 0.0f; + temp3 = 0.0f; + temp2 = 0.0f; } - mf->xx = temp_f0; - mf->xy = -sp3C * phi_f12; - mf->xz = sp3C * phi_f16; + mf->xx = temp1; + mf->xy = -sp3C * temp2; + mf->xz = sp3C * temp3; mf->yx = sp3C; mf->yy = sp38; - mf->zy = phi_f16; - mf->zz = phi_f12; + mf->yz = sp34; + mf->zy = temp3; + mf->zz = temp2; mf->xw = 0.0f; mf->yw = 0.0f; mf->zx = 0.0f; mf->zw = 0.0f; - mf->yz = sp34; mf->wx = vec->x; mf->wy = sp40; mf->wz = vec->z; @@ -1448,9 +1447,6 @@ f32 func_800BFCB8(GlobalContext* globalCtx, MtxF* mf, Vec3f* vec) { return sp40; } -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BFCB8.s") -#endif void* Gameplay_LoadFile(GlobalContext* globalCtx, RomFile* file) { u32 size; |
