mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Make sure to wrap clut indexes at 1024 bytes.
So that's 256 for 32-bit and 512 for 16-bit.
This commit is contained in:
parent
6e50a0b274
commit
5822faabf9
1 changed files with 5 additions and 1 deletions
|
@ -309,7 +309,11 @@ struct GPUgstate
|
|||
int getClutIndexShift() const { return (clutformat >> 2) & 0x1F; }
|
||||
int getClutIndexMask() const { return (clutformat >> 8) & 0xFF; }
|
||||
int getClutIndexStartPos() const { return ((clutformat >> 16) & 0x1F) << 4; }
|
||||
u32 transformClutIndex(u32 index) const { return ((index >> getClutIndexShift()) & getClutIndexMask()) | getClutIndexStartPos(); }
|
||||
u32 transformClutIndex(u32 index) const {
|
||||
// We need to wrap any entries beyond the first 1024 bytes.
|
||||
u32 mask = getClutPaletteFormat() == GE_CMODE_32BIT_ABGR8888 ? 0xFF : 0x1FF;
|
||||
return ((index >> getClutIndexShift()) & getClutIndexMask()) | (getClutIndexStartPos() & mask);
|
||||
}
|
||||
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