VRAM Usage

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

Moderators: cheriff, TyRaNiD

Post Reply
Garak
Posts: 46
Joined: Wed Jul 27, 2005 1:59 am

VRAM Usage

Post by Garak »

Greetings,

I am using SDL to make a game. I have implemented some code to allow me to load an image into VRAM. When I place the image in VRAM, it comes well after my screen buffers. I noticed that for some reason, one of my images does not seem to copy in the last row of pixels when being transfered from sytem memory to VRAM.

I have tried using a single memcpy to go from SRAM to VRAM, as well as copying the image byte by byte. If I simply copy the size of my image, plus 1 extra row of pixels, I get the whole image.

To blit the image, I use the standard SDL_BlitSurface function. Is there any reson why my image does not seem to copy completly?

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

Post by Brunni »

You have to flush the data cache (sceKernelDcacheWritebackInvalidateAll) before drawing the image.
Sorry for my bad english
Image Oldschool library for PSP - PC version released
Garak
Posts: 46
Joined: Wed Jul 27, 2005 1:59 am

Post by Garak »

Thanks,

Would this need to be done each time the image is drawn, or just once after copying the image?

I am not drawing the images to the screen, SDL is doing that. I imagine SDL is using memcpy to move the data from the SDL Image to the screen buffer. Would you really need to call sceKernelDcacheWritebackInvalidateAll in that case, I thought that command was for when you were using PSP GU commands to draw images.

Garak
Post Reply