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.

Beginners > DMA issue...

#27180 - mr_square - Tue Oct 05, 2004 3:46 pm

I have a header file containing a 64*64 character animation sequence. This:

REG_DM3SAD = (u32)runRightStateGraphicsData;
REG_DM3DAD = (u32)OAMData;
REG_DM3CNT = 2048|DMA_16NOW;

loads in the first frame of animation fine, but if I try to load in the frame of animation at position x of the array using:

REG_DM3SAD = (u32)runRightStateGraphicsData[x];
REG_DM3DAD = (u32)OAMData;
REG_DM3CNT = 2048|DMA_16NOW;

I just get nothing. Even putting 0 in there so that it should load the first frame screws it up.

Help! :p

#27181 - poslundc - Tue Oct 05, 2004 3:49 pm

Try

REG_DM3SAD = (u32)&runRightStateGraphicsData[x];

... and I'll let sajimori explain the difference between arrays and pointers. :P

Dan.

#27182 - mr_square - Tue Oct 05, 2004 4:00 pm

you're a saviour man - thanks :)

should have known that really!