diff --git a/src_rebuild/PsyCross/include/PsyX/common/pgxp_defs.h b/src_rebuild/PsyCross/include/PsyX/common/pgxp_defs.h index 91dd4910..a2abc0d4 100644 --- a/src_rebuild/PsyCross/include/PsyX/common/pgxp_defs.h +++ b/src_rebuild/PsyCross/include/PsyX/common/pgxp_defs.h @@ -42,8 +42,6 @@ extern PGXPVector3D g_FP_SXYZ0; // direct access PGXP without table lookup extern PGXPVector3D g_FP_SXYZ1; extern PGXPVector3D g_FP_SXYZ2; -extern int g_pgxpVertexIndex; - /* clears PGXP vertex buffer */ void PGXP_ClearCache(); diff --git a/src_rebuild/PsyCross/src/gte/PsyX_GTE.cpp b/src_rebuild/PsyCross/src/gte/PsyX_GTE.cpp index 93299d1d..2bd6ed84 100644 --- a/src_rebuild/PsyCross/src/gte/PsyX_GTE.cpp +++ b/src_rebuild/PsyCross/src/gte/PsyX_GTE.cpp @@ -280,9 +280,12 @@ PGXPVector3D g_FP_SXYZ0; // direct access PGXP without table lookup PGXPVector3D g_FP_SXYZ1; PGXPVector3D g_FP_SXYZ2; -PGXPVData g_pgxpCache[65535]; -int g_pgxpVertexIndex = 0; +PGXPVData g_pgxpCache[1 << sizeof(ushort)*8]; +ushort g_pgxpVertexIndex = 0; + int g_pgxpTransformed = 0; + +// "render" states float g_pgxpZOffset = 0.0f; float g_pgxpZScale = 1.0f; @@ -330,10 +333,10 @@ int PGXP_GetCacheData(PGXPVData* out, uint lookup, ushort indexhint) } // index hint allows us to start from specific index - int start = max(0, indexhint - 8); - int end = g_pgxpVertexIndex;// min(start + 256, g_pgxpVertexIndex); + ushort start = max(0, indexhint - 8); + ushort end = g_pgxpVertexIndex; - for (int i = start; i < end; i++) + for (ushort i = start; i < end; i++) { if (g_pgxpCache[i].lookup == lookup) {