#35380 - Mitch GBA - Thu Feb 03, 2005 9:11 pm
Hey. I have a problem.. I've started a new project, and I'm doing everything I did at other projects, and now it doesnt work.. The sprite wont show up, the background does show up. You know what I'm doing wrong here???
It's not the files.. I tested them in another project and they're fine.. I dunno why it doesnt work..
Code: |
//***********************\\
// COLOR TAP ADVANCE \\ //***********************\\ //by: Mitch Monhemius #include "gba.h" #include "levelbg.h" #include "pressor.h" void InitializeSprites(void); void CopyOAM(void); OAMEntry sprites[128]; u16 xship = 32; u16 yship = 80; int main() { u16 loop; SetMode(MODE_4 | BG2_ENABLE | OBJ_ENABLE | OBJ_MAP_1D); for (loop = 0; loop < 256; loop++) { BG_PaletteMem[loop]=levelbgPalette[loop]; } for (loop = 0; loop < (120*160); loop++) { FrontBuffer[loop] = levelbgData[loop] ; } for(loop = 0; loop < 256; loop++) { OBJ_PaletteMem[loop] = pressorPalette[loop]; } memcpy( (u16 *)0x06014000, &pressorData, sizeof(pressorData) ); //bullets\\ sprites[0].attribute0 = COLOR_256 | WIDE | yship; sprites[0].attribute1 = SIZE_16 | xship; sprites[0].attribute2 = 512; while(1) { WaitForVsync(); CopyOAM(); } return 0; } // FUNCTIONS HERE: void InitializeSprites(void) { u16 loop; for(loop = 0; loop < 128; loop++) { sprites[loop].attribute0 = 160; sprites[loop].attribute1 = 240; } } void CopyOAM(void) { u16 loop; u16* temp; temp = (u16*)sprites; for(loop = 0; loop < 128*4; loop++) { OAM_Mem[loop] = temp[loop]; } } |
It's not the files.. I tested them in another project and they're fine.. I dunno why it doesnt work..