From 72b7d4168afc63db572539d41623c3ab0f09ddf4 Mon Sep 17 00:00:00 2001 From: "John Wilbert M. Villamor" Date: Mon, 23 Sep 2019 11:28:07 +0800 Subject: Added strcat(), added gte_stsz() macro, added _boot() and fixed typos in setUVWH() macro --- libpsn00b/include/inline_c.h | 6 ++++++ libpsn00b/include/psxapi.h | 2 ++ libpsn00b/include/psxgpu.h | 6 +++--- libpsn00b/include/psxgte.h | 10 +++++----- 4 files changed, 16 insertions(+), 8 deletions(-) (limited to 'libpsn00b/include') diff --git a/libpsn00b/include/inline_c.h b/libpsn00b/include/inline_c.h index 4341624..aa2c197 100644 --- a/libpsn00b/include/inline_c.h +++ b/libpsn00b/include/inline_c.h @@ -206,6 +206,12 @@ : "r"( r0 ), "r"( r1 ), "r"( r2 ) \ : "memory" ) +#define gte_stsz( r0 ) __asm__ volatile ( \ + "swc2 $19, 0( %0 );" \ + : \ + : "r"( r0 ) \ + : "memory" ) + #define gte_stotz( r0 ) __asm__ volatile ( \ "swc2 $7, 0( %0 );" \ : \ diff --git a/libpsn00b/include/psxapi.h b/libpsn00b/include/psxapi.h index d25e620..9abcd0c 100644 --- a/libpsn00b/include/psxapi.h +++ b/libpsn00b/include/psxapi.h @@ -159,6 +159,8 @@ void ChangeClearRCnt(int t, int m); // Executable functions int Exec(struct EXEC *exec, int argc, char *argv); +void _boot(void); + #ifdef __cplusplus } #endif diff --git a/libpsn00b/include/psxgpu.h b/libpsn00b/include/psxgpu.h index d6c68cf..215b59b 100644 --- a/libpsn00b/include/psxgpu.h +++ b/libpsn00b/include/psxgpu.h @@ -106,9 +106,9 @@ #define setUVWH( p, _u0, _v0, _w, _h ) \ (p)->u0 = _u0, (p)->v0 = _v0, \ - (p)->u1 = _u1+(_w), (p)->v1 = _v1, \ - (p)->u2 = _u2, (p)->v2 = _v2+(_h), \ - (p)->u2 = _u3+(_h), (p)->v2 = _v3+(_h) + (p)->u1 = _u0+(_w), (p)->v1 = _v0, \ + (p)->u2 = _u0, (p)->v2 = _v0+(_h), \ + (p)->u3 = _u0+(_h), (p)->v3 = _v0+(_h) /* diff --git a/libpsn00b/include/psxgte.h b/libpsn00b/include/psxgte.h index 43d529a..98d9fa4 100644 --- a/libpsn00b/include/psxgte.h +++ b/libpsn00b/include/psxgte.h @@ -12,24 +12,24 @@ #define rcos(a) icos(a) -typedef struct { +typedef struct MATRIX { short m[3][3]; int t[3]; } MATRIX; -typedef struct { +typedef struct VECTOR { int vx, vy, vz; } VECTOR; -typedef struct { +typedef struct SVECTOR { short vx, vy, vz, pad; } SVECTOR; -typedef struct { +typedef struct CVECTOR { unsigned char r, g, b, cd; } CVECTOR; -typedef struct { +typedef struct DVECTOR { short vx, vy; } DVECTOR; -- cgit v1.2.3