libpspvram error

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

Moderators: cheriff, TyRaNiD

Post Reply
coolkehon
Posts: 355
Joined: Mon Oct 20, 2008 5:44 am

libpspvram error

Post by coolkehon »

i thought i'd use libpspvram so that i could init the gu with it then allocate images so that they were in vram but when i setup the gu with it the screen doesnt show right (its fuzzy colors and stuff) but when i do the gu stuff by hand with the memory address it works

and when i don't init the gu using libpspvram but try to allocate an image then the image doesn't show but the screen flickers so does anyone have any idea why the gu is messed up like this when usign pspvram

here is how i had inited the gu with libpspvram and i'm not sure i'm explaining this correctly

the commented stuff is where i was using pspvram and the uncommented is where i manually init the gu

Code: Select all

sceGuDispBuffer(SCREEN_WIDTH, SCREEN_HEIGHT, (void*)0, PSP_LINE_SIZE); //Point out the display buffer
//	sceGuDispBuffer(SCREEN_WIDTH, SCREEN_HEIGHT, (void *)valloc(FRAMEBUFFER_SIZE), PSP_LINE_SIZE);
	sceGuDrawBuffer(GU_PSM_8888, (void*)FRAMEBUFFER_SIZE, PSP_LINE_SIZE); //Point out the drawing buffer
//	sceGuDrawBuffer(GU_PSM_8888, (void *)valloc(FRAMEBUFFER_SIZE), PSP_LINE_SIZE);
	sceGuDepthBuffer((void*) (FRAMEBUFFER_SIZE*2), PSP_LINE_SIZE); //Point out the depth buffer
//	sceGuDepthBuffer((void*) valloc(FRAMEBUFFER_SIZE), PSP_LINE_SIZE);
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

The GU expects a relative pointer, not an absolute pointer.

You can get the relative pointer using vrelptr().

ie.

Code: Select all

void *fbp = (void *)valloc(FRAMEBUFFER_SIZE);
sceGuDispBuffer(SCREEN_WIDTH, SCREEN_HEIGHT, vrelptr(fbp), PSP_LINE_SIZE);
coolkehon
Posts: 355
Joined: Mon Oct 20, 2008 5:44 am

Post by coolkehon »

thanks it worked
Post Reply