yeah soz about that, this is a extract from my app and i accidently left that out
but thanks for your help
EDIT* after examining pataters tutorial i have made my simple sprite code.
Here it is
Code: Select all
/*-------------------------------------------------------------\
| opearns sprite code |
| based off the devkitpro examples and pataters tut. |
\-------------------------------------------------------------*/
#include <nds.h>
#include "drunkenlogo.h"
int main(void) {
videoSetMode(MODE_0_2D | DISPLAY_SPR_ACTIVE | DISPLAY_SPR_1D);//set the video mode to 2d
vramSetBankA(VRAM_A_MAIN_SPRITE); //set up some VRam for sprites
oamInit(&oamMain, SpriteMapping_Bmp_1D_128, false); //initialize the oam
u16* gfx = oamAllocateGfx(&oamMain, SpriteSize_64x64, SpriteColorFormat_256Color);//setup the sprite
dmaCopy(drunkenlogoTiles, gfx, drunkenlogoTilesLen);//load the sprite to gfx (last line)
dmaCopy(drunkenlogoPal, SPRITE_PALETTE, drunkenlogoPalLen); //copy the sprites palette
while(1) {//infinite loop
oamSet(&oamMain,0,32,32,0,0,SpriteSize_64x64,SpriteColorFormat_256Color,gfx,-1,false,false,false,false,false);
swiWaitForVBlank();
oamUpdate(&oamMain);
}
return 0;
}
the grit has to use tiles so the code for that is here
Code: Select all
# 8 bit bitmap
-gB8
# Tile the image
-gt