Code: Select all
void setupToolSprites()
{
for(int i = 0; i < NUM_TOOLTYPES; ++i)
{
toolGfxLoc[i] = oamAllocateGfx(&oamSub, SpriteSize_32x32, SpriteColorFormat_16Color);
}
// Copy sprites into VRAM
dmaCopyHalfWords(3, Cursor_ToolTiles, toolGfxLoc[0], Cursor_ToolTilesLen);
dmaCopyHalfWords(3, Marquee_ToolTiles, toolGfxLoc[1], Marquee_ToolTilesLen);
dmaCopyHalfWords(3, Brush_ToolTiles, toolGfxLoc[2], Brush_ToolTilesLen);
dmaCopyHalfWords(3, Bucket_ToolTiles, toolGfxLoc[3], Bucket_ToolTilesLen);
dmaCopyHalfWords(3, Gradient_ToolTiles, toolGfxLoc[4], Gradient_ToolTilesLen);
dmaCopyHalfWords(3, Rectangle_ToolTiles, toolGfxLoc[5], Rectangle_ToolTilesLen);
}
I've been able to get sprites to display by calling oamAllocateGfx, dmaCopyHalfWords, and oamSet in that order, so my guess is that somewhere in the oamSet function, the OamState gets updated to know that it ought to proceed to the next offset. If this is the case, how should I go about setting up my sprites into memory if I don't want them assigned to a sprite in OAM immediately? Or is that simply not an option with libnds's current implementation?