From 6e3207f9dcb35291248b0312b126601765555a15 Mon Sep 17 00:00:00 2001 From: RSDuck Date: Mon, 4 Jan 2021 16:36:51 +0100 Subject: [PATCH] GX: fix vector test after I broke it in d2c04c5c511cca3daeed292a397a5ae8ae2aa6a7 fixes Mario & Luigi Partners in Time --- src/GPU3D.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/GPU3D.cpp b/src/GPU3D.cpp index 53fafb3e..e199d9a6 100644 --- a/src/GPU3D.cpp +++ b/src/GPU3D.cpp @@ -1699,15 +1699,15 @@ void PosTest() AddCycles(5); } -void VecTest(u32* params) +void VecTest(u32 param) { // TODO: maybe it overwrites the normal registers, too s16 normal[3]; - normal[0] = (s16)((params[0] & 0x000003FF) << 6) >> 6; - normal[1] = (s16)((params[0] & 0x000FFC00) >> 4) >> 6; - normal[2] = (s16)((params[0] & 0x3FF00000) >> 14) >> 6; + normal[0] = (s16)((param & 0x000003FF) << 6) >> 6; + normal[1] = (s16)((param & 0x000FFC00) >> 4) >> 6; + normal[2] = (s16)((param & 0x3FF00000) >> 14) >> 6; VecTestResult[0] = (normal[0]*VecMatrix[0] + normal[1]*VecMatrix[4] + normal[2]*VecMatrix[8]) >> 9; VecTestResult[1] = (normal[0]*VecMatrix[1] + normal[1]*VecMatrix[5] + normal[2]*VecMatrix[9]) >> 9; @@ -2170,6 +2170,12 @@ void ExecuteCommand() Viewport[5] = (Viewport[1] - Viewport[3] + 1) & 0xFF; // height break; + case 0x72: // vec test + VertexPipelineCmdDelayed6(); + NumTestCommands--; + VecTest(entry.Param); + break; + default: VertexPipelineCmdDelayed4(); //printf("!! UNKNOWN GX COMMAND %02X %08X\n", entry.Command, entry.Param); @@ -2193,7 +2199,6 @@ void ExecuteCommand() VertexPipelineCmdDelayed8(); break; case 0x70: StallPolygonPipeline(10 + 1, 0); break; - case 0x72: VertexPipelineCmdDelayed6(); break; default: VertexPipelineCmdDelayed4(); break; } } @@ -2408,11 +2413,6 @@ void ExecuteCommand() BoxTest(ExecParams); break; - case 0x72: // vec test - NumTestCommands--; - VecTest(ExecParams); - break; - default: __builtin_unreachable(); }