Code: Select all
include <nds.h>
include "sprite.h"
int main(){
vramSetBankB(VRAM_B_MAIN_SPRITE);
videoSetMode(MODE_0_2D);
OamState *oam = &oamMain;
oamInit(oam, SpriteMapping_1D_32, false);
u16* gfx = oamAllocateGfx(oam, SpriteSize_32x32, SpriteColorFormat_16Color);
oamSet (oam, //oam
0, //id
0, //x
0, //y
0, //priority
0, //palette_alpha
SpriteSize_32x32, //size
SpriteColorFormat_16Color, //format
gfx, //gfxOffset
-1, //affine index
false, //sizeDouble
false, //hide
false, //hflip
false, //vflip
false); //mosaic
dmaCopy(spriteTiles, oamGetGfxPtr(oam, 0), sizeof(spriteTiles));
dmaCopy(spritePal, SPRITE_PALETTE, sizeof(spritePal));
while(true){
swiWaitForVBlank();
oamUpdate(oam);
}
}
[img]
http://postimage.org/image/tdwqziu3p/e332470c/
[/img]
The sprite is the jumbled mess with the light blue background. I turned off its transparency to better illustrate the shape.
It SHOULD look like this:
[img]
http://postimage.org/image/ixl8axkh1/7caa177c/
[/img]
Any help is greatly appreciated!
