From c4a3769aee4a5b8afe805227df63c9d5976ade4d Mon Sep 17 00:00:00 2001 From: raven02 Date: Thu, 30 May 2013 16:29:38 +0800 Subject: [PATCH 1/2] Fix incorrect clut in Dainiji_Super_Robot_Taisen_Z Hakaihen --- GPU/GLES/TextureCache.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index b26b75e22e..3c4d9ec706 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -191,7 +191,10 @@ static u32 GetClutAddr() { } static u32 GetClutIndex(u32 index) { - return ((((gstate.clutformat >> 16) & 0x1f) + index) >> ((gstate.clutformat >> 2) & 0x1f)) & ((gstate.clutformat >> 8) & 0xff); + const u32 clutBase = (gstate.clutformat & 0x1f0000) >> 12; + const u32 clutMask = (gstate.clutformat >> 8) & 0xff + const u8 clutShift = (gstate.clutformat >> 2) & 0x1f; + return ((index >> clutShift) & clutMask) | clutBase; } void *TextureCache::UnswizzleFromMem(u32 texaddr, u32 bufw, u32 bytesPerPixel, u32 level) { From 4a31e13c9bbd2ee5b83d3b8b11e20903d1e1ddec Mon Sep 17 00:00:00 2001 From: raven02 Date: Thu, 30 May 2013 18:33:11 +0900 Subject: [PATCH 2/2] Missing semi-colon --- GPU/GLES/TextureCache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index 3c4d9ec706..5aa6f54f90 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -192,7 +192,7 @@ static u32 GetClutAddr() { static u32 GetClutIndex(u32 index) { const u32 clutBase = (gstate.clutformat & 0x1f0000) >> 12; - const u32 clutMask = (gstate.clutformat >> 8) & 0xff + const u32 clutMask = (gstate.clutformat >> 8) & 0xff; const u8 clutShift = (gstate.clutformat >> 2) & 0x1f; return ((index >> clutShift) & clutMask) | clutBase; }