wallpaper change for psp??

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
taejung kim
Posts: 3
Joined: Mon Jan 02, 2006 12:37 pm

wallpaper change for psp??

Post by taejung kim »

hi..

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;;;
placasoft
Posts: 53
Joined: Mon Mar 28, 2005 10:53 am

Post by placasoft »

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
taejung kim
Posts: 3
Joined: Mon Jan 02, 2006 12:37 pm

thank you. placasoft.. but.. i has resolved it.

Post by taejung kim »

thanks..

before code

Code: Select all

sceIoOpen&#40;"flash0&#58;/vsh/resource/01.bmp", PSP_O_WRONLY, 0777 &#41;; 
after

Code: Select all

sceIoUnassign&#40;"flash0&#58;"&#41;; 
	sceIoAssign&#40;"flash0&#58;", "lflash0&#58;0,0", "flashfat0&#58;", 0, NULL, 0&#41;;
sceIoOpen&#40;&#40;"flash0&#58;/vsh/resource/01.bmp",PSP_O_CREAT | PSP_O_WRONLY | PSP_O_TRUNC, 0777 &#41;; 
[/code]
Post Reply