image not showing!
Posted: Sat May 05, 2012 2:56 am
I made a ds game and tried to display a sprite on the screen. I used grit and it compiled just fine, but when I ran it the sprite did not show up on the screen. here is my code
Any help would be appreciated.
Code: Select all
#include <nds.h>
//include sprites
#include "sprite.h"
int main() {
// Setup the video modes.
videoSetMode( MODE_0_2D );
vramSetPrimaryBanks(VRAM_A_MAIN_SPRITE,VRAM_B_LCD,VRAM_C_LCD,VRAM_D_LCD);
//setup sprites
oamInit(&oamMain, SpriteMapping_Bmp_1D_128, false); //initialize the oam
u16* gfx = oamAllocateGfx(&oamMain, SpriteSize_64x64,SpriteColorFormat_256Color);//make room for the sprite
dmaCopy(spriteTiles,gfx, spriteTilesLen);//copy the sprite
dmaCopy(spritePal, SPRITE_PALETTE, spritePalLen); //copy the sprites palette oamEnable(&oamMain);
while (1) //infinite loop
{
oamSet(&oamMain,0,0,0,0,0,SpriteSize_64x64,SpriteColorFormat_256Color,gfx,0,false,false,false,false,false);
swiWaitForVBlank();
}
return 0;
}