From fda94524217ee35c2782f8bd6886c58d7ae22a42 Mon Sep 17 00:00:00 2001 From: MeltyPlayer Date: Thu, 20 Oct 2022 00:54:05 -0500 Subject: [PATCH] Fixed how DLs are rendered past the bounds of short values. --- Makefile | 2 +- src/decomp/engine/guMtxF2L.c | 3 +++ src/gfx_adapter.c | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 12aec67..b3fc266 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ else CC := cc LDFLAGS := -lm -shared endif -CFLAGS := -g -Wall -fPIC -DSM64_LIB_EXPORT +CFLAGS := -g -Wall -fPIC -DSM64_LIB_EXPORT -DGBI_FLOATS SRC_DIRS := src src/decomp src/decomp/engine src/decomp/game src/decomp/mario src/decomp/tools BUILD_DIR := build diff --git a/src/decomp/engine/guMtxF2L.c b/src/decomp/engine/guMtxF2L.c index 7d89761..246336b 100644 --- a/src/decomp/engine/guMtxF2L.c +++ b/src/decomp/engine/guMtxF2L.c @@ -44,6 +44,9 @@ void guMtxL2F(float mf[4][4], Mtx *m) { void guMtxF2L(float mf[4][4], Mtx *m) { memcpy(m, mf, sizeof(Mtx)); } +void guMtxL2F(float mf[4][4], Mtx *m) { + memcpy(mf, m, sizeof(Mtx)); +} #endif void guMtxIdentF(float mf[4][4]) { diff --git a/src/gfx_adapter.c b/src/gfx_adapter.c index 3698c2b..9a23e1c 100644 --- a/src/gfx_adapter.c +++ b/src/gfx_adapter.c @@ -65,9 +65,9 @@ static void process_display_list( void *dl ) DL_INT_SIZE v02 = *ptr++; UNUSED DL_INT_SIZE flag0 = *ptr++; - short x0 = vdata[v00].v.ob[0], y0 = vdata[v00].v.ob[1], z0 = vdata[v00].v.ob[2]; - short x1 = vdata[v01].v.ob[0], y1 = vdata[v01].v.ob[1], z1 = vdata[v01].v.ob[2]; - short x2 = vdata[v02].v.ob[0], y2 = vdata[v02].v.ob[1], z2 = vdata[v02].v.ob[2]; + float x0 = vdata[v00].v.ob[0], y0 = vdata[v00].v.ob[1], z0 = vdata[v00].v.ob[2]; + float x1 = vdata[v01].v.ob[0], y1 = vdata[v01].v.ob[1], z1 = vdata[v01].v.ob[2]; + float x2 = vdata[v02].v.ob[0], y2 = vdata[v02].v.ob[1], z2 = vdata[v02].v.ob[2]; Vec3f p0 = { (float)x0, (float)y0, (float)z0 }; Vec3f p1 = { (float)x1, (float)y1, (float)z1 }; Vec3f p2 = { (float)x2, (float)y2, (float)z2 };