#171176 - grapeape - Wed Nov 04, 2009 4:18 pm
Hi all,
Can anyone tell me what I'm doing wrong? I'm trying to draw some sprites on top of a background on the main screen. I can draw the sprites or draw the background but not both!
The following gets me my sprites (sprite code is omitted - let me know if I should post it):
If I swap the vram banks for the sprites and background on the main screen like so:
I can see my background, but not my sprites. Any ideas?
The documentation for libnds appears a bit thin. Am I missing some good resources?
Can anyone tell me what I'm doing wrong? I'm trying to draw some sprites on top of a background on the main screen. I can draw the sprites or draw the background but not both!
The following gets me my sprites (sprite code is omitted - let me know if I should post it):
Code: |
videoSetMode(MODE_0_2D | DISPLAY_BG0_ACTIVE); videoSetModeSub(MODE_0_2D); vramSetBankA(VRAM_A_MAIN_SPRITE); vramSetBankB(VRAM_B_MAIN_BG); oamInit(&oamMain, SpriteMapping_1D_128, false); int bg = bgInit(0, BgType_Text8bpp, BgSize_T_256x256, 0,1); dmaCopy(tiles, bgGetGfxPtr(bg), sizeof(tiles)); dmaCopy(map32x32, bgGetMapPtr(bg), sizeof(map32x32)); dmaCopy(palette, BG_PALETTE, sizeof(palette)); |
If I swap the vram banks for the sprites and background on the main screen like so:
Code: |
vramSetBankA(VRAM_A_MAIN_BG); vramSetBankB(VRAM_B_MAIN_SPRITE); |
I can see my background, but not my sprites. Any ideas?
The documentation for libnds appears a bit thin. Am I missing some good resources?