#6899 - Peter - Wed Jun 04, 2003 10:49 am
Hi,
I'm thinking of what could be the fastest way of drawing graphics in mode4.
I guess the greatest disadvantage is its "strange" storage format, that's
why i decided to make a "virtual buffer" where i draw all my stuff in.
It's a 2D array (in EWRAM) so i can access each pixel like buffer[y][x] = color ...
This is pretty fast compared to drawing directly into VRAM.
Once drawing is done, i copy the entire buffer into VRAM. (once per frame)
I use DMA3 to copy the virtual buffer to VRAM, i also tried BIOS SWI "CpuFastMemSet" which seems to be slighty slower on real hardware than DMA. DMA3 requires around 1/4 frame.
To clear the virtual buffer i use the set function of CpuFastMemSet BIOS SWI. This needs around 1/5 frame.
Makes together around 1/2 frame so i should have 50% power free to perform the drawing itself.
As far as my tests went, this is faster than simply writing to VRAM in mode 4, but i guess this cannot be the "good" way of drawing efficient?!
Does anybody of you know of an efficient/fast way to draw stuff in mode 4?
Thanks for reading,
Peter
I'm thinking of what could be the fastest way of drawing graphics in mode4.
I guess the greatest disadvantage is its "strange" storage format, that's
why i decided to make a "virtual buffer" where i draw all my stuff in.
It's a 2D array (in EWRAM) so i can access each pixel like buffer[y][x] = color ...
This is pretty fast compared to drawing directly into VRAM.
Once drawing is done, i copy the entire buffer into VRAM. (once per frame)
I use DMA3 to copy the virtual buffer to VRAM, i also tried BIOS SWI "CpuFastMemSet" which seems to be slighty slower on real hardware than DMA. DMA3 requires around 1/4 frame.
To clear the virtual buffer i use the set function of CpuFastMemSet BIOS SWI. This needs around 1/5 frame.
Makes together around 1/2 frame so i should have 50% power free to perform the drawing itself.
As far as my tests went, this is faster than simply writing to VRAM in mode 4, but i guess this cannot be the "good" way of drawing efficient?!
Does anybody of you know of an efficient/fast way to draw stuff in mode 4?
Thanks for reading,
Peter