#19786 - CyberSlag5k - Sun Apr 25, 2004 5:40 pm
I've got a sprite with 19 frames of animation. I use gifs2sprites to convert all the frames into one .h file complete with palette. However, any frame above the 7th or so acts kind of funny.
A download can be found here:
[url]homepages.udayton.edu/~pateramj/main.bin[/url]
Here are the setions of pertinant code:
When you press A or B, the visor of the little soldier guy should open or close (it just increments activeFrame based on time). All is well for the first 7 frames or so, and then, as you can see, everything goes to hell. I'm thinking maybe I'm overloading (not as in OOP, but as in putting too much into it) the OAM. Is that a reasonable assessment? These sprites are rather huge (64*64). I know there's a fix using the DMA but I'm not at that level just yet (I hope to tackle the DMA within a week or two), but is there something I'm doing wrong here? Or am I just pushing the OAM too far?
Thanks in advance![/url]
_________________
When you find yourself in the company of a halfling and an ill-tempered Dragon, remember, you do not have to outrun the Dragon...
Last edited by CyberSlag5k on Sun Apr 25, 2004 6:28 pm; edited 1 time in total
A download can be found here:
[url]homepages.udayton.edu/~pateramj/main.bin[/url]
Here are the setions of pertinant code:
Code: |
sprites[0].attribute0 = COLOR_256 | SQUARE | soldier.posY; sprites[0].attribute1 = SIZE_64 | soldier.posX; sprites[0].attribute2 = 0; u16 const *myArray[19] = {obj0, obj1, obj2, obj3, obj4, obj5, obj6, obj7, obj8, obj9, obj10, obj11, obj12, obj13, obj14, obj15, obj16, obj17}; //obj0, obj1, obj2,....are arrays containing the frame data stored in soldier.h for(int j = 0; j < 18; j++) { soldier.spriteFrame[j] = j*128; for(int i = 0; i < 2048; i++) { OAMData[i + (j * 2048)] = myArray[j][i]; } } soldier.OAMSpriteNum = 0; soldier.activeFrame = 0; |
When you press A or B, the visor of the little soldier guy should open or close (it just increments activeFrame based on time). All is well for the first 7 frames or so, and then, as you can see, everything goes to hell. I'm thinking maybe I'm overloading (not as in OOP, but as in putting too much into it) the OAM. Is that a reasonable assessment? These sprites are rather huge (64*64). I know there's a fix using the DMA but I'm not at that level just yet (I hope to tackle the DMA within a week or two), but is there something I'm doing wrong here? Or am I just pushing the OAM too far?
Thanks in advance![/url]
_________________
When you find yourself in the company of a halfling and an ill-tempered Dragon, remember, you do not have to outrun the Dragon...
Last edited by CyberSlag5k on Sun Apr 25, 2004 6:28 pm; edited 1 time in total