forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

wallpaper change for psp??

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
taejung kim



Joined: 02 Jan 2006
Posts: 3

PostPosted: Tue Apr 18, 2006 11:46 am    Post subject: wallpaper change for psp?? Reply with quote

hi..

i want to change my psp

here is my code

[code]
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;;;
Back to top
View user's profile Send private message MSN Messenger
placasoft



Joined: 28 Mar 2005
Posts: 53

PostPosted: Sun Apr 23, 2006 9:22 am    Post subject: Reply with quote

Because flash0 is read only. It's not a good idea to play with data in flash0, use a programm like pspset or pspflash to change your wallpaper, it's easier and safer ;)

cya
placa
Back to top
View user's profile Send private message
taejung kim



Joined: 02 Jan 2006
Posts: 3

PostPosted: Wed Apr 26, 2006 12:16 pm    Post subject: thank you. placasoft.. but.. i has resolved it. Reply with quote

thanks..

before code
Code:

sceIoOpen("flash0:/vsh/resource/01.bmp", PSP_O_WRONLY, 0777 );

after
Code:

sceIoUnassign("flash0:");
   sceIoAssign("flash0:", "lflash0:0,0", "flashfat0:", 0, NULL, 0);
sceIoOpen(("flash0:/vsh/resource/01.bmp",PSP_O_CREAT | PSP_O_WRONLY | PSP_O_TRUNC, 0777 );
[/code]
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group