how would I store something in unused pvr memory, untill i needed it?
thanks,
Troy(GPF)
http://gpf.dcemu.co.uk
storing stuff in unused pvr memory
-
- DC Developer
- Posts: 529
- https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
- Joined: Wed Oct 17, 2001 7:44 pm
- Location: Texas
- Has thanked: 0
- Been thanked: 0
- Contact:
-
- DC Developer
- Posts: 9951
- Joined: Sun Dec 30, 2001 9:02 am
- Has thanked: 0
- Been thanked: 1 time
If you're using the PVR for rendering, you can just allocate a chunk of memory like so:
To get it back, just copy it back again:
You could also use store queues (or DMA, if the data's just laying around in main memory already) to copy the data to VRAM, and I think you could probably use DMA to transfer it back as long as you remember to flush the data cache over the area you copied it back to.
If you're not using the PVR (you're just using the framebuffer), there's no need to use pvr_mem_malloc. Just grab a pointer to the framebuffer (vram_s works nicely), add the size of the framebuffer, and use that.
Code: Select all
pvr_ptr_t pvr_mem_handle = pvr_mem_malloc(size);
void *pointer = (void *)pvr_mem_handle;
memcpy(pointer, source, size);
Code: Select all
memcpy(dest, pointer, size);
If you're not using the PVR (you're just using the framebuffer), there's no need to use pvr_mem_malloc. Just grab a pointer to the framebuffer (vram_s works nicely), add the size of the framebuffer, and use that.