#16682 - Musashi - Sun Feb 22, 2004 7:47 pm
I was wondering how often I should really be using DMA. It seems like I'll be using it constantly. Especially in mode 3 and 4. Is that good? Doesn't seem like it should cause any problems but I'd like the opinion of the community.
Also is there any reason I shouldn't be using DMA to copy palettes and images for mode 3 and 4 (and probably 5, I haven't used it yet).
#16687 - DekuTree64 - Sun Feb 22, 2004 8:27 pm
That's what it's there for. I use it for pretty much all data copying. I think I heard somewhere that about 32 bytes is where it could start getting faster to use a regular memcpy, because you have to write the source/dest/control regs for the DMA, and then it takes a couple cycles to start up, but with 32 or more bytes it's almost always the fastest way.
Although for setting data to a single value, like 0, you can beat it with an unrolled stmia loop in ASM. There's also the SWI call, CpuFastSet (don't remember what number it is), which uses stmia with 8 regs to do 32 bytes at a time, and it can beat DMA on memory setting too. Not on copying though.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku
#16693 - Miked0801 - Sun Feb 22, 2004 11:16 pm
Large DMA copies can interfere with VCount, sound, and serial interrupts if you aren't careful. Just make sure you are aware of the side effects of large transfers.