Code: Select all
sceGuClutMode(GU_PSM_8888, 0, 0xff, 0);
sceGuClutLoad(65536/8, myclut);
I'm wondering if large CLUTs need to be uploaded/installed in pieces or something.
Any ideas?
Code: Select all
sceGuClutMode(GU_PSM_8888, 0, 0xff, 0);
sceGuClutLoad(65536/8, myclut);
Yup, got that.Raphael wrote:a) make sure myclut was aligned on 16 byte on allocation
No, you missed my point. The hardware appears to also support 16 and 32 bit CLUT indices (see src/gu/doc/commands.txt for command 195), but I can't get them to do anything useful.b) you're trying to submit (65536/8) * 8 = 65536 entries. Yet a CLUT4 has only 16 and a CLUT8 only 256 entries. So the only two possible parameters for num_blocks would be 2 or 32.
Code: Select all
sceGuSendCommandi(0xC3, 6); // Texture Pixel Storage Format CLUT16
sceGuSendCommandi(0xC5, (11b | (0xff << 8)) ); // Set CLUT8888 (bit order could be wrong)
sceGuSendCommand(0xB0, ((int)CLUT) & 0xfffffff ); // send 24 LSB of clut pointer
sceGuSendCommand(0xB1, ((int)CLUT) >> 24 ); // send 4 MSB of clut pointer
sceGuSendCommandi(0xC4, 65536/8); // Set number of Colors and upload the data
I've been working on two uses:Raphael wrote:Well, apart from the fact that I don't get the point, why anyone would use a 16 or even 32bit indexed palette as it's only memory waste and nothing else...
I don't think there's anything special to implement. The existing sceGuClutMode/ClutLoad are equivalent to your open-coded versions.sceGuTexMode(GU_PSM_T16, maxmips, a2, swizzle) and also upload the texture correctly? I'd guess the GU needs to know the tex mod
Also GU_PSM_T16 isn't mentioned in the description of the function although it is defined in the gu header. So probably it's not correctly implemented yet?
I played around with these parameters a some point, for the same reason as you, but I didn't get to understand it all and haven't looked at it since.jsgf wrote: I suspect the other arguments to sceGuClutMode() are the key. I wonder if you can only use 2^8 CLUT entries at once, but the other params to ClutMode define how your 16/32bpp index gets mapped to the 2^8 entries...