mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Avoid accidental sign ext for > 24 bit clut shift.
This commit is contained in:
parent
a4a10588ed
commit
5b61c03b7f
2 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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; }
|
||||
|
|
Loading…
Add table
Reference in a new issue