summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorRoman971 <32455037+Roman971@users.noreply.github.com>2020-06-30 20:44:07 +0200
committerGitHub <noreply@github.com>2020-06-30 14:44:07 -0400
commit4a64c556b08093f40726e78296e1788456af857f (patch)
treecf15955dbd5402ea1554af85fd6dae09c1e7ef86 /src/code
parentb55fc9a4e0aa34242b17d1fa6cd51e85bd471448 (diff)
Fix and improve some non matchings (#229)
Diffstat (limited to 'src/code')
-rw-r--r--src/code/z_lifemeter.c2
-rw-r--r--src/code/z_view.c30
2 files changed, 18 insertions, 14 deletions
diff --git a/src/code/z_lifemeter.c b/src/code/z_lifemeter.c
index 63c328ce6..855692073 100644
--- a/src/code/z_lifemeter.c
+++ b/src/code/z_lifemeter.c
@@ -104,7 +104,7 @@ void Health_UpdateData(GlobalContext* globalCtx) {
temp2 *= temp_f0;
interfaceCtx->unk_208[1] = (u8)(temp2 + 0x28);
temp3 *= temp_f0;
- interfaceCtx->unk_208[2] = (u8)(temp2 + 0x3C);
+ interfaceCtx->unk_208[2] = (u8)(temp3 + 0x3C);
D_8015FDD0[0] = 0xFF;
D_8015FDD0[1] = 0xFF;
diff --git a/src/code/z_view.c b/src/code/z_view.c
index fc0cc3c71..63de9688d 100644
--- a/src/code/z_view.c
+++ b/src/code/z_view.c
@@ -351,8 +351,8 @@ s32 func_800AAA9C(View* view) {
}
func_800ABE74(view->eye.x, view->eye.y, view->eye.z);
- guLookAt(viewing, view->eye.x, view->eye.y, view->eye.z, view->lookAt.x, view->lookAt.y, view->lookAt.z,
- view->up.x, view->up.y, view->up.z);
+ guLookAt(viewing, view->eye.x, view->eye.y, view->eye.z, view->lookAt.x, view->lookAt.y, view->lookAt.z, view->up.x,
+ view->up.y, view->up.z);
view->viewing = *viewing;
@@ -500,8 +500,8 @@ s32 func_800AB560(View* view) {
}
func_800ABE74(view->eye.x, view->eye.y, view->eye.z);
- guLookAt(viewing, view->eye.x, view->eye.y, view->eye.z, view->lookAt.x, view->lookAt.y, view->lookAt.z,
- view->up.x, view->up.y, view->up.z);
+ guLookAt(viewing, view->eye.x, view->eye.y, view->eye.z, view->lookAt.x, view->lookAt.y, view->lookAt.z, view->up.x,
+ view->up.y, view->up.z);
view->viewing = *viewing;
@@ -527,17 +527,23 @@ s32 func_800AB944(View* view) {
}
#ifdef NON_MATCHING
-// saved register usage is wrong, relatively minor reorderings, regalloc
+// regalloc differences
s32 func_800AB9EC(View* view, s32 arg1, Gfx** gfxp) {
- GraphicsContext* gfxCtx = view->gfxCtx;
Gfx* gfx = *gfxp;
+ GraphicsContext* gfxCtx = view->gfxCtx;
+ s32 width;
+ s32 height;
+ Vp* vp;
+ Mtx* projection;
+ Mtx* viewing;
- arg1 = (view->flags & arg1) | arg1 >> 4;
+ arg1 = (arg1 & view->flags) | (arg1 >> 4);
if (arg1 & 2) {
- Vp* vp = Graph_Alloc(view->gfxCtx, sizeof(Vp));
+ vp = Graph_Alloc(view->gfxCtx, sizeof(Vp));
LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 910);
View_ViewportToVp(vp, &view->viewport);
+
view->vp = *vp;
gDPPipeSync(gfx++);
@@ -547,7 +553,7 @@ s32 func_800AB9EC(View* view, s32 arg1, Gfx** gfxp) {
}
if (arg1 & 8) {
- Mtx* projection = Graph_Alloc(gfxCtx, sizeof(Mtx));
+ projection = Graph_Alloc(gfxCtx, sizeof(Mtx));
LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 921);
view->projectionPtr = projection;
@@ -558,9 +564,7 @@ s32 func_800AB9EC(View* view, s32 arg1, Gfx** gfxp) {
gSPMatrix(gfx++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
} else if (arg1 & 6) {
- s32 width;
- s32 height;
- Mtx* projection = Graph_Alloc(gfxCtx, sizeof(Mtx));
+ projection = Graph_Alloc(gfxCtx, sizeof(Mtx));
LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 932);
view->projectionPtr = projection;
@@ -577,7 +581,7 @@ s32 func_800AB9EC(View* view, s32 arg1, Gfx** gfxp) {
}
if (arg1 & 1) {
- Mtx* viewing = Graph_Alloc(gfxCtx, sizeof(Mtx));
+ viewing = Graph_Alloc(gfxCtx, sizeof(Mtx));
LogUtils_CheckNullPointer("viewing", viewing, "../z_view.c", 948);
view->viewingPtr = viewing;