I am playing around with the pspsdk and I would like to replace the texture of the cube sample with a 32-bit one.
So i removed the logo.o in the Makefile and I created a 32x32x32-bit texture in the code, plus I modified few lines to replace the 64x64 4444 texture with 32x32 8888 texture.
My texture is totally white but at the screen I have strange black lines on it.
I cannot show you a screenshot but there is several black lines on the white texture. With the 32x32 texture, they are strangely located from 0px to 16px or from 16px to 32px.
I tried with a 256x256 texture and the black lines are only present at the top of the texture.
It looks like some data have been written in the texture memory area but that is not the case.
Here are the code (its compiled with c++):
Code: Select all
static unsigned short __attribute__((aligned(16))) pixels[32*32*4];
Code: Select all
unsigned char *pData = (unsigned char *)pixels;
for (int y = 0 ; y < 32 ; ++y)
{
for (int x = 0 ; x < 32 ; ++x)
{
*(pData++) = 255;
*(pData++) = 255;
*(pData++) = 255;
*(pData++) = 255;
}
}
Code: Select all
sceGuTexMode(GU_PSM_8888, 0, 0, 0);
sceGuTexImage(0,32, 32, 32, pixels);
sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGB);
2) Another question not related to the previous one, can I use malloc and free with the PSPSDK ? I noted that there is no dynamic allocation at all in the samples. I know that there is reserved memory area, where can I find info about that ?
Thanks in advance for any help