#59366 - blacksun - Mon Oct 31, 2005 10:10 pm
I am trying to load up a bunch of sprites into my SpriteData 0x6010000. For some reason I can only load up 8 16x16 sprites at a time. If I load up any more, it will repeat the data with the first sprites in the strip. If I load 8 at a time it works perfectly. Is there a size or speed limitation to copy over the sprite data?
Here is what I am currently using:
I am not running out of memory because I can see it allocating the memory, just not copying over the right ones.
Here is what I am currently using:
Code: |
void InitGameSprites(int mode)
{ int i; int currSize = 0; int primesDim = 16*16*8/2; int prodDim = 16*16*8/2; int cursorDim = 16*16*6/2; //int blankDim = 32*32/2; numOfSelects = 0; for(i = 0; i < 10; i++) { select[i].xPos = 0; select[i].yPos = 0; select[i].index = 118; select[i].active = false; } for(i = 0; i < numOfSprites; i++) { spriteArray[i].xPos = 160; spriteArray[i].yPos = 240; spriteArray[i].spriteIndex = 0; } for(i = 0; i < 128; i++) SpriteData[i] = 0x0000; for(i = 0; i < 128; i++) { sprites[i].attribute0 = 160 | COLOR_256; sprites[i].attribute1 = 240; sprites[i].attribute2 = 0; sprites[i].attribute3 = 0; } numOfSprites = 0; for(i = 0; i < cursorDim; i++) SpriteData[i] = cursorData[i]; currSize += cursorDim; for(i = currSize; i < primesDim + currSize; i++) SpriteData[i] = primesData[i - currSize]; currSize += primesDim; for(i = currSize; i < prodDim + currSize; i++) SpriteData[i] = prods415Data[i - currSize]; currSize += prodDim; for(i = currSize; i < prodDim + currSize; i++) SpriteData[i] = prods1626Data[i - currSize]; currSize += prodDim; } |
I am not running out of memory because I can see it allocating the memory, just not copying over the right ones.