I am trying to setup a 32Bit Palette to use as Texture which generally works just fine using:
Code: Select all
		sceGuClutMode(GU_PSM_8888,0,0xff,0); // 32-bit palette
		sceGuClutLoad((256/8),clut256); // upload 32*8 entries (256)
		sceGuTexMode(GU_PSM_T8,0,0,0); // 8-bit image
Code: Select all
    outp(0x3C8,col);   
    outp(0x3C9,R);   
    outp(0x3C9,G);   
    outp(0x3C9,B);
Code: Select all
    for (x=1; x<=32; x++) {
        setrgb(x, 0, 0, x*2-1);       /* Blue part */
        setrgb(x+32, x*2-1, 0, 63);
        setrgb(x+64, 63, x*2-1, 63);
        setrgb(x+96, 63, 63, 63);
 
        setrgb(x+128, 63, 63, 63);
        setrgb(x+160, 63, 63, 63-(x*2-1));
        setrgb(x+192, 63, 63-(x*2-1), 0);
        setrgb(x+224, 63-(x*2-1), 0, 0); /* Red part */
    }
Code: Select all
unsigned int* clut = (unsigned int*)(((unsigned int)clut256)|0x40000000);
		for (i = 0; i < 256; ++i)
		{
			unsigned int j = (i + offset)&0xff;
			*(clut++) = (j << 24)|(j << 16)|(j << 8)|(j);
		}
I tried to do:
Code: Select all
   for (i=1; i<=32; i++) 
	{
        *clut+i		= (0xff << 24) | ((i*2-1) << 16) | (0 << 8) | 0;  	
        *clut+i+32	= (0xff << 24) | (63 << 16) | (0 << 8) | (i*2-1);
        *clut+i+64	= (0xff << 24) | (63 << 16) | ((i*2-1) << 8) | 63;
        *clut+i+96	= (0xff << 24) | (63 << 16) | (63 << 8) | 63;
        *clut+i+128	= (0xff << 24) | (63 << 16) | (63 << 8) | 63;
        *clut+i+160	= (0xff << 24) | (63-(i*2-1) << 16) | (63 << 8) | 63;
        *clut+i+192	= (0xff << 24) | (0 << 16) | (63-(i*2-1) << 8) | 63;
        *clut+i+224	= (0xff << 24) | (0 << 16) | (0 << 8) | 63-(i*2-1); */
	}
 }
error: invalid lvalue in assignment
Anyhow.. I am really bad at pointers and not really sure how to get this done.. Is there anybody out that that can help me?? I am aware that this is a general C problem and the topic will most likely be closed but maybe somebody can shed some light ?!??!
THANK YOU SO MUCH!
