i want to change my psp
here is my code
Code: Select all
int bmpsave(SDL_Surface *scr,int startx, int starty)
{
int iw,jh,filepos;
uint8 bitheader[54]= {0x42,0x4D,0xDE,0x55,0x02,0x00,0x00,0x00,0x00,0x00,
0x36,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x2C,0X01,
0X00,0X00,0XAA,0X00,0X00,0X00,0X01,0X00,0X18,0X00,
0X00,0X00,0X00,0X00,0XA8,0X55,0X02,0X00,0X12,0X17,
0X00,0X00,0X12,0X17,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00};
int wfd;
uint8 *savedata;
int sdlline = 0;
int sdlcount = 0;
if ( SCREEN_WIDTH - startx < SAVEWIDTH)
return 0;
if ( SCREEN_HEIGHT - starty < SAVEHEIGHT)
return 0;
savedata = (uint8 *)malloc(SAVEWIDTH*SAVEHEIGHT*SAVEPIXELBIT);
wfd = sceIoOpen("flash0:/vsh/resource/01.bmp", PSP_O_WRONLY, 0777 );
sceIoWrite(wfd, bitheader, 54);
filepos = 0;
for (jh = SAVEHEIGHT+starty ; jh >0+starty ; jh--)
{
sdlline = jh* scr->pitch;
for(iw = 0+startx ; iw < SAVEWIDTH+startx ; iw++)
{
sdlcount = sdlline + iw*4;
savedata[filepos+2] = *((uint8 *)scr->pixels+sdlcount+0);
savedata[filepos+1] = *((uint8 *)scr->pixels+sdlcount+1);
savedata[filepos+0] = *((uint8 *)scr->pixels+sdlcount+2);
filepos +=3;
}
}
sceIoWrite(wfd, savedata, SAVEWIDTH*SAVEHEIGHT*SAVEPIXELBIT);
sceIoClose(wfd);
free(savedata);
return 1;
}
[code]
but
not copy.. --;;;
why not?
i'm sorry, i can't english.. T.T;;;