#139402 - Corsix - Wed Sep 05, 2007 9:57 pm
I am trying to move from using the default BG palette to using an extended BG palette, but I am having some difficulty.
The dualis debugging type things show that the map data contains the correct tile indexes, and that the tiles contain the correct palette indexes, and that the palette contains the correct colours, however the video output window shows pure black, suggesting that I did not link the tiles to the extended palette.
I'm using background 3, mode 0, main 2D core.
Standard palette code (which works nicely):
When I change those sections to the following code, the background appears black:
What am I forgetting to do?
Edit: If I use BG0 instead of BG3, the extended palette code works, so I'm obviously not understanding something about BG numbers and extended palettes.
The dualis debugging type things show that the map data contains the correct tile indexes, and that the tiles contain the correct palette indexes, and that the palette contains the correct colours, however the video output window shows pure black, suggesting that I did not link the tiles to the extended palette.
I'm using background 3, mode 0, main 2D core.
Standard palette code (which works nicely):
Code: |
videoSetMode (MODE_0_2D | DISPLAY_SPR_1D_LAYOUT | DISPLAY_SPR_ACTIVE | DISPLAY_SPR_EXT_PALETTE);
... /* A -> main bg */ vramSetBankA(VRAM_A_MAIN_BG_0x06000000); ... SetBmpPaletteTo( BG_PALETTE, pBmp); |
When I change those sections to the following code, the background appears black:
Code: |
videoSetMode (MODE_0_2D | DISPLAY_SPR_1D_LAYOUT | DISPLAY_SPR_ACTIVE | DISPLAY_BG_EXT_PALETTE | DISPLAY_SPR_EXT_PALETTE);
... /* A -> main bg */ vramSetBankA(VRAM_A_MAIN_BG_0x06000000); /* F -> main bg extpal */vramSetBankF(VRAM_F_BG_EXT_PALETTE); ... #define EXT_PALETTE(BANK, NUM) ( reinterpret_cast<_ext_palette*>(BANK)[0][NUM] ) VRAM_F_CR = VRAM_ENABLE | VRAM_F_LCD; SetBmpPaletteTo( EXT_PALETTE(VRAM_F, 0), pBmp); VRAM_F_CR = VRAM_ENABLE | VRAM_F_BG_EXT_PALETTE; |
What am I forgetting to do?
Edit: If I use BG0 instead of BG3, the extended palette code works, so I'm obviously not understanding something about BG numbers and extended palettes.