From 2142ae441060259bb74fa91ab83509b5d1e6e038 Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Tue, 17 Oct 2023 17:08:15 -0300 Subject: [PATCH] guLookAt --- .vscode/settings.json | 3 +++ Makefile | 1 + src/libultra/gu/lookat.c | 17 ++++++++++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index ec06a287..7d4875a4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,6 +13,9 @@ "tools/aspatch/**": false, "tools/gfxsotn/**": false, }, + "defines": [ + "_LANGUAGE_C" // For gbi.h + ], "files.associations": { }, } \ No newline at end of file diff --git a/Makefile b/Makefile index ace0d144..9418d988 100644 --- a/Makefile +++ b/Makefile @@ -194,6 +194,7 @@ build/src/libultra/2D300.o: OPTFLAGS := -O1 -g0 build/src/libultra/io/controller.o: OPTFLAGS := -O1 -g0 build/src/libultra/libc/string.o: OPTFLAGS := -O2 -g0 build/src/libultra/libc/ldiv.o: OPTFLAGS := -O2 -g0 +#build/src/libultra/gu/lookat.o: OPTFLAGS := -O3 -g0 # cc & asm-processor build/src/%.o: CC := $(ASM_PROC) $(ASM_PROC_FLAGS) $(CC) -- $(AS) $(ASFLAGS) -- diff --git a/src/libultra/gu/lookat.c b/src/libultra/gu/lookat.c index 57fc1b00..e66f3fc1 100644 --- a/src/libultra/gu/lookat.c +++ b/src/libultra/gu/lookat.c @@ -1,5 +1,20 @@ -#include "common.h" +#include "global.h" +#include "PR/gbi.h" + +typedef float Matrix[4][4]; #pragma GLOBAL_ASM("asm/us/nonmatchings/libultra/gu/lookat/guLookAtF.s") +#if 0 +void guLookAt(Mtx* m, float xEye, float yEye, float zEye, float xAt, float yAt, float zAt, float xUp, float yUp, + float zUp) { + Matrix mf; + + guLookAtF(mf, xEye, yEye, zEye, xAt, yAt, zAt, xUp, yUp, zUp); + + guMtxF2L(mf, m); +} +#else #pragma GLOBAL_ASM("asm/us/nonmatchings/libultra/gu/lookat/guLookAt.s") +#endif +