Backgrounds - multiple palettes
Posted: Wed Apr 15, 2009 3:28 pm
Hello.
I want to use multiple backgrounds at one screen (extended palettes).
Can you say, what's worng with this Code ?
I want to use multiple backgrounds at one screen (extended palettes).
Can you say, what's worng with this Code ?
Code: Select all
#include <nds.h>
#include <stdio.h>
// grit adds a nice header we can include to access the data
// this has the same name as the image
#include "drunkenlogo.h"
#include "drunkenlogo2.h"
#include <string.h>
int main(void)
{
// set the mode for 2 text layers and two extended background layers
videoSetMode(MODE_5_2D);
vramSetBankA(VRAM_A_MAIN_BG);
REG_DISPCNT |= DISPLAY_BG_EXT_PALETTE;
int bg2 = bgInit(2, BgType_Bmp8, BgSize_B8_128x128, 0,0);
int bg3 = bgInit(3, BgType_Bmp8, BgSize_B8_256x256, 1,0);
vramSetBankG(VRAM_G_LCD);
dmaCopy(drunkenlogoPal,VRAM_G_EXT_PALETTE[0],256*2);
dmaCopy(drunkenlogo2Pal,VRAM_G_EXT_PALETTE[1],256*2);
// set vram to ex palette
vramSetBankG(VRAM_G_BG_EXT_PALETTE);
REG_BG2CNT |= BG_PALETTE_SLOT1 ;
REG_BG3CNT |= BG_PALETTE_SLOT0 ;
dmaCopy(drunkenlogo2Bitmap, bgGetGfxPtr(bg2), 128*128);//bg 2 //klein
dmaCopy(drunkenlogoBitmap, bgGetGfxPtr(bg3), 256*256); //bg3 //gross
while(1) swiWaitForVBlank();
return 0;