copyImage help!

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

Moderators: cheriff, TyRaNiD

Post Reply
kazlivsjy
Posts: 6
Joined: Sun Dec 25, 2005 2:24 am
Location: PSPain
Contact:

copyImage help!

Post by kazlivsjy »

I have this weird problem: when I copyImage a background bitmap into the screen, I get some 'garbage' in the bottom-most lines, in the form of spureous-looking black or colour-inverting horizontal lines, with varying length. They appear and disappear during the first frames of animation and then stand still. I suspect it has anything to do with an incorrect configuration of the different buffers and/or data structures that fill the VRAM (draw buffer, depth buffer, etc...), as though they overlapped at some point, but I don't think it's the case. I don't know what goes on when swapBuffers is called, though. I don't even know the size of the VRAM!

The really weird thing is that sometimes it doesn't happen, or a texture is garbaged instead of the background!

My RGBA8888 480x272 image is held on a int buffer with size [512*272] 16-byte aligned

I call
sceGuCopyImage(GU_PSM_8888,0,0,480,272,512,pixeldata,0,0,512,(void*)(0x04000000+(u32)framebuffer));

on every frame, framebuffer = sceGuSwapBuffers()

Can anybody tell or suggest what is the problem?
void printSignature(void) {

printf("Brought to you by Kazlivsjy\n");

}
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

You just need to flush the cache before drawing an image that was modified with the CPU. Call sceKernelDcacheWritebackInvalidateAll();
Sorry for my bad english
Image Oldschool library for PSP - PC version released
kazlivsjy
Posts: 6
Joined: Sun Dec 25, 2005 2:24 am
Location: PSPain
Contact:

Post by kazlivsjy »

Yeah, thanks, man!
void printSignature(void) {

printf("Brought to you by Kazlivsjy\n");

}
Post Reply