gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > DMA overlapping copying

#22212 - DiscoStew - Mon Jun 14, 2004 10:15 pm

Just a quick question, since I am not at my computer to check this out...

If I had an array, and I were to do a DMA where the source points to the first element of the array, and the destination points to the second element of that same array, would that repeatedly copy what was in the first element of the array (if DMA did stream copying), or would it actually, in a sense, move the grouped information of the array over by one element?
_________________
DS - It's all about DiscoStew

#22213 - poslundc - Mon Jun 14, 2004 10:19 pm

I'm pretty sure it would stream-copy. There are faster ways to fill memory, though.

Dan.

#22214 - Abscissa - Mon Jun 14, 2004 10:48 pm

Unless the GBA's DMA does copying in some weird way I'm not familiar with, then it would be like this:

As long as dest is always source+1, then if you start at the beginning and keep incrementing both, then the memory would be filled with the first value. If you started at the end of the block of memory and kept decrementing both, then the the whole data would just get shifted over.

#22215 - DiscoStew - Mon Jun 14, 2004 11:10 pm

Should have thought so.

I just doing an insertion into an array of numbers, so I guess if I were to do a reverse DMA opertion, it would work, right?
_________________
DS - It's all about DiscoStew