Decompile SetVertex functions in reg03.c (#1598)
Some checks failed
Format code / format (push) Failing after 0s
Build C code / extract-assets (push) Failing after 0s
Build C code / build-linux (push) Has been skipped
Build C code / build-macos (push) Has been skipped
Build C code / build-windows (push) Has been skipped
Build C code / build-linux-lle (push) Has been skipped
Build Saturn version / build-and-test-saturn (push) Has been skipped
Build Saturn version / function-finder-saturn (push) Has been skipped
Build Debug Module tool / build (push) Failing after 0s
Build PSX and PSP version / build-and-test (pspeu, hd) (push) Has been skipped
Build PSX and PSP version / build-and-test (pspeu, pspeu) (push) Has been skipped
Build PSX and PSP version / build-and-test (us, us) (push) Has been skipped
Build PSX and PSP version / generate-progress-report (pspeu, hd) (push) Has been skipped
Build PSX and PSP version / generate-progress-report (pspeu, pspeu) (push) Has been skipped
Build PSX and PSP version / generate-progress-report (us, us) (push) Has been skipped
Build PSX and PSP version / generate-duplicates-report (us, us) (push) Has been skipped
Build PSX and PSP version / generate-duplicates-report-psp (pspeu, pspeu) (push) Has been skipped

Based this off other Josh's work on https://decomp.me/scratch/ncrbI

Noticed there was already a define in `libgte.h` for Vector0 which I've
used, but also filled out the other two.

Hope this is ok for a first PR 😄 
Let me know if anything needs changing.

Co-authored-by: Josh Schreuder <jschreuder@mediaocean.com>
This commit is contained in:
Josh Schreuder 2024-09-13 02:31:15 +10:00 committed by GitHub
parent 31048dac26
commit 20652c255c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 4 deletions

View File

@ -105,6 +105,16 @@ extern long ratan2(long y, long x);
"lwc2 $1, 4( %0 )" \
: \
: "r"(r0))
#define gte_ldv1(r0) \
__asm__ volatile("lwc2 $2, 0( %0 );" \
"lwc2 $3, 4( %0 )" \
: \
: "r"(r0))
#define gte_ldv2(r0) \
__asm__ volatile("lwc2 $4, 0( %0 );" \
"lwc2 $5, 4( %0 )" \
: \
: "r"(r0))
// NOTE: These are not the official defines in the SDK.
// They were identified by looking at functions which used them.

View File

@ -1,12 +1,17 @@
#include "common.h"
#include "psxsdk/libgte.h"
INCLUDE_ASM("main/nonmatchings/psxsdk/libgte/reg03", SetVertex0);
void SetVertex0(SVECTOR* vector) { gte_ldv0(vector); }
INCLUDE_ASM("main/nonmatchings/psxsdk/libgte/reg03", SetVertex1);
void SetVertex1(SVECTOR* vector) { gte_ldv1(vector); }
INCLUDE_ASM("main/nonmatchings/psxsdk/libgte/reg03", SetVertex2);
void SetVertex2(SVECTOR* vector) { gte_ldv2(vector); }
INCLUDE_ASM("main/nonmatchings/psxsdk/libgte/reg03", SetVertexTri);
void SetVertexTri(SVECTOR* vector1, SVECTOR* vector2, SVECTOR* vector3) {
gte_ldv0(vector1);
gte_ldv1(vector2);
gte_ldv2(vector3);
}
INCLUDE_ASM("main/nonmatchings/psxsdk/libgte/reg03", SetRGBfifo);