 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
coolkehon
Joined: 20 Oct 2008 Posts: 355
|
Posted: Sun Jul 19, 2009 1:18 am Post subject: libpspvram error |
|
|
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 |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Sun Jul 19, 2009 2:15 am Post subject: |
|
|
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 |
|
 |
coolkehon
Joined: 20 Oct 2008 Posts: 355
|
Posted: Sun Jul 19, 2009 3:46 am Post subject: |
|
|
| thanks it worked |
|
| Back to top |
|
 |
|
|
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
|