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 

libpspvram error

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



Joined: 20 Oct 2008
Posts: 355

PostPosted: Sun Jul 19, 2009 1:18 am    Post subject: libpspvram error Reply with quote

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:
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);
Back to top
View user's profile Send private message MSN Messenger
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Sun Jul 19, 2009 2:15 am    Post subject: Reply with quote

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

You can get the relative pointer using vrelptr().

ie.

Code:
void *fbp = (void *)valloc(FRAMEBUFFER_SIZE);
sceGuDispBuffer(SCREEN_WIDTH, SCREEN_HEIGHT, vrelptr(fbp), PSP_LINE_SIZE);
Back to top
View user's profile Send private message
coolkehon



Joined: 20 Oct 2008
Posts: 355

PostPosted: Sun Jul 19, 2009 3:46 am    Post subject: Reply with quote

thanks it worked
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