I have some data I'd like to store in VRAM, and of course I'd like to transfer it as quickly as possible. As far as I know, this entails using sceGuCopyImage(). However, sceGuCopyImage seems tailored to placing images in VRAM with a rectangular layout, and I'd really like to just copy various sizes of data to specified VRAM addresses in a linear fashion. My code currently works fine using:
memcpy(pVRAMAddr, pData, size);
but this is not as quick as the DMA copy triggered by sceGuCopyImage from what I understand... Can somebody give me some info on how to do a DMA copy of data to VRAM in a linear fashion? I tried using various manglings of sceGuCopyImage, but most of them just seem to crash the PSP or write data non-linearly.
Linear data copy to VRAM
I also had a performance problem with memcpy and the VRAM (it seems, copying the content of the whole screen with it is longer than 1/60s...).
There is an alignment requirement in the use of sceGuCopyImage() if I remember correctly. But using the Dmac functions would be better in your case.
http://forums.ps2dev.org/viewtopic.php?t=3890
This post talks about alignment requirement of the Dmac functions. I don't know if there is a way to know if the transfer is finished, must be a stub no one has found yet.
There is an alignment requirement in the use of sceGuCopyImage() if I remember correctly. But using the Dmac functions would be better in your case.
http://forums.ps2dev.org/viewtopic.php?t=3890
This post talks about alignment requirement of the Dmac functions. I don't know if there is a way to know if the transfer is finished, must be a stub no one has found yet.
You could, though I'm not sure what the limit is; if you can factor your copy area into two approximately equal products, then you can still do it in a 2D way.
Also, there doesn't seem to be much cost in issuing lots of separate copies. In PSPGL, I flip images by copying each scanline as a separate copy operation, with no obvious performance hit compared to doing a single bulk copy.
Also, there doesn't seem to be much cost in issuing lots of separate copies. In PSPGL, I flip images by copying each scanline as a separate copy operation, with no obvious performance hit compared to doing a single bulk copy.