#27720 - Celeryface - Wed Oct 20, 2004 12:56 am
Hi there,
I have my sprite animations updating a single element in the Sprite Data (OAMData for some) one animation frame per frame tick. So I can overwrite the frame everytime I update, rather than store all of the frames in OAM.
I have run into a problem where if I do this on multiple animations the framerate slows down due to the big for loops and copying.
I have tried to use DMAFastCopy on the sprite data array and OAMData but haven't been able to figure it out. Can someone give me a hand?
I want to use DMA fast copy. Here is what I've tried so far:
Doing the DMAFastCopy above using the square bracks to indicate the starting points of where I want to copy the data gives me the following compiler warning: warning: cast to pointer from integer of different size
Anyone see what I can improve?
Thanks.[/code]
I have my sprite animations updating a single element in the Sprite Data (OAMData for some) one animation frame per frame tick. So I can overwrite the frame everytime I update, rather than store all of the frames in OAM.
I have run into a problem where if I do this on multiple animations the framerate slows down due to the big for loops and copying.
I have tried to use DMAFastCopy on the sprite data array and OAMData but haven't been able to figure it out. Can someone give me a hand?
Code: |
void DMAFastCopy( void *source, void *destination, unsigned int count, unsigned int mode )
{ if( mode == DMA_16NOW || mode == DMA_32NOW ) { REG_DMA3SAD = (unsigned int)source; REG_DMA3DAD = (unsigned int)destination; REG_DMA3CNT = count | mode; } // end if } // end DMAFastCopy() // This is the way I updated the frame before // Update Ryu's Sprite frame for( n16 = (64*64/2)+512; n16 < (64*64/2)+512+(64*64/2); n16++ ) SpriteData[n16] = beelData[ ( (64*64/2) * currentBeelFrame) + (n16-((64*64/2)+512)) ]; |
I want to use DMA fast copy. Here is what I've tried so far:
Code: |
DMAFastCopy( (void*)beelData[ (64*64/2) * currentBeelFrame ], (void*)SpriteData[start], end, DMA_16NOW ); |
Doing the DMAFastCopy above using the square bracks to indicate the starting points of where I want to copy the data gives me the following compiler warning: warning: cast to pointer from integer of different size
Anyone see what I can improve?
Thanks.[/code]