From 79a2414f3f25b7e2ced92587e621bdad21b8912f Mon Sep 17 00:00:00 2001 From: gm-matthew <108370479+gm-matthew@users.noreply.github.com> Date: Sun, 20 Nov 2022 01:27:50 +0000 Subject: [PATCH] Incomplete texture headers uploaded via FIFO are now discarded. Ski Champ sends one more 32-bit word via DMA than it should which was causing Supermodel to erroneously intepret the extra word as another texture --- Src/Model3/Real3D.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/Model3/Real3D.cpp b/Src/Model3/Real3D.cpp index 492f8c5..a15ac6b 100644 --- a/Src/Model3/Real3D.cpp +++ b/Src/Model3/Real3D.cpp @@ -656,9 +656,9 @@ void CReal3D::Flush(void) DebugLog("Real3D 88000000 written @ PC=%08X\n", ppc_get_pc()); // Upload textures (if any) - if (fifoIdx > 0) + if (fifoIdx > 2) // If the texture header/data aren't present, discard the texture (prevents garbage textures in Ski Champ) { - for (uint32_t i = 0; i < fifoIdx; ) + for (uint32_t i = 0; i < fifoIdx - 2; ) { uint32_t size = 2+textureFIFO[i+0]/2; size /= 4;