From e3df273095a5800e3dcdcb63bd66e269c0c2d3a8 Mon Sep 17 00:00:00 2001 From: iCatButler Date: Mon, 28 Mar 2016 13:01:50 +0100 Subject: - Fix memory addresses as each mirrored address range is further mirrored 4 times... :( - Catch 8bit reads/writes and invalidate registers and memory as needed - Prevent reading over the end of stride and count arrays when decoding primitive commands --- plugins/peopsxgl/pgxp_gpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/peopsxgl/pgxp_gpu.c b/plugins/peopsxgl/pgxp_gpu.c index 5b64382a..1ce67bf8 100644 --- a/plugins/peopsxgl/pgxp_gpu.c +++ b/plugins/peopsxgl/pgxp_gpu.c @@ -64,7 +64,7 @@ void PGXP_SetAddress(unsigned int addr) int PGXP_GetVertices(unsigned int* addr, void* pOutput) { unsigned int primCmd = ((*addr >> 24) & 0xff); // primitive command - unsigned int primIdx = (primCmd - 0x20) >> 2; // index to primitive lookup + unsigned int primIdx = min((primCmd - 0x20) >> 2, 8); // index to primitive lookup OGLVertex* pVertex = (OGLVertex*)pOutput; // pointer to output vertices unsigned int stride = primStrideTable[primIdx]; // stride between vertices unsigned int count = primCountTable[primIdx]; // number of vertices -- cgit v1.2.3