#16146 - Darmstadium - Mon Feb 09, 2004 10:58 pm
I am having a lot of trouble making my own sprites and making them appear. I'm using dovoto's pcx2sprite program to make a header file with an array with my sprite. When I compile my code, there is nothing at all resembling my image. Here's my code:
Any help anyone could give would be GREATLY appreciated.
Code: |
#include "gba.h" #include "dispcnt.h" #include "spriteMan.h" #include "keypad.h" #include "sprite.h" u16* OAM = (u16*)0x7000000; OAMEntry sprites[128]; pRotData rotData = (pRotData)sprites; u16 loop; void InitializeSprites() { for(loop = 0; loop < 128; loop++) { sprites[loop].attribute0 = 160; sprites[loop].attribute1 = 240; } } void CopyOAM() { u16* temp = (u16*)sprites; for(loop = 0; loop < 512; loop++) OAM[loop] = temp[loop]; } void WaitForVsync() { while((volatile u16)REG_VCOUNT != 160){} } int main() { SetMode(MODE_1 | OBJ_ENABLE | OBJ_MAP_1D); for(loop = 0; loop < 256; loop++) OBJPaletteMem[loop] = spriteManPalette[loop]; InitializeSprites(); sprites[0].attribute0 = COLOR_256 | TALL | 60; sprites[0].attribute1 = SIZE_32 | 60; sprites[0].attribute2 = 0; for(loop = 0; loop < 256; loop++) OAMData[loop] = spriteManData[loop]; while(1) { WaitForVsync(); CopyOAM(); } return 0; } |
Any help anyone could give would be GREATLY appreciated.