diff --git a/GPU/Common/DepalettizeShaderCommon.cpp b/GPU/Common/DepalettizeShaderCommon.cpp index 48e1a375fa..e511f42ee9 100644 --- a/GPU/Common/DepalettizeShaderCommon.cpp +++ b/GPU/Common/DepalettizeShaderCommon.cpp @@ -88,7 +88,7 @@ void GenerateDepalShader300(char *buffer, GEBufferFormat pixelFormat) { texturePixels = 512; if (shift) { - WRITE(p, " index = ((index >> %i) & 0x%02x)", shift, mask); + WRITE(p, " index = (int(uint(index) >> %i) & 0x%02x)", shift, mask); } else { WRITE(p, " index = (index & 0x%02x)", mask); } diff --git a/GPU/GPUState.h b/GPU/GPUState.h index 36f71cc6db..0559f84bda 100644 --- a/GPU/GPUState.h +++ b/GPU/GPUState.h @@ -309,7 +309,7 @@ struct GPUgstate int getClutIndexShift() const { return (clutformat >> 2) & 0x1F; } int getClutIndexMask() const { return (clutformat >> 8) & 0xFF; } int getClutIndexStartPos() const { return ((clutformat >> 16) & 0x1F) << 4; } - int transformClutIndex(int index) const { return ((index >> getClutIndexShift()) & getClutIndexMask()) | getClutIndexStartPos(); } + u32 transformClutIndex(u32 index) const { return ((index >> getClutIndexShift()) & getClutIndexMask()) | getClutIndexStartPos(); } bool isClutIndexSimple() const { return (clutformat & ~3) == 0xC500FF00; } // Meaning, no special mask, shift, or start pos. bool isTextureSwizzled() const { return texmode & 1; } bool isClutSharedForMipmaps() const { return (texmode & 0x100) == 0; }