Backgrounds with extended palette ?

Discussion in 'NDS - Emulation and Homebrew' started by Ben_j, Apr 2, 2011.

  1. Ben_j
    OP

    Ben_j GBAtemp Advanced Fan

    Member
    696
    13
    Nov 13, 2005
    France
    I'm using extended palettes for my sprites, and I'd like to use different backgrounds with different palettes as well. The problem is I didn't find anything to tell the background what palette to use.

    Here's what I did so far :
    CODEvramSetBankH(VRAM_H_LCD);
    dmaCopy(alphabgPal, VRAM_H_EXT_PALETTE[0], 512);
    dmaCopy(kaossbgPal, VRAM_H_EXT_PALETTE[1], 512);
    vramSetBankH(VRAM_H_SUB_BG_EXT_PALETTE);

    Then what ? Do I have to use registries or something ?
     
  2. chintoi

    chintoi Advanced Member

    Newcomer
    51
    0
    Oct 9, 2008
    Serbia, Republic of
    I think you use oamSet() on each sprite individually to tell what palette it should use
     
  3. Ben_j
    OP

    Ben_j GBAtemp Advanced Fan

    Member
    696
    13
    Nov 13, 2005
    France
    I'm not talking about sprites here. I want extended palettes on backgrounds
     
  4. chintoi

    chintoi Advanced Member

    Newcomer
    51
    0
    Oct 9, 2008
    Serbia, Republic of
    Ah, sorry.
    Maybe vramSetBankH() should be used before copying. And try to use less ambiguous defines to check the compliance between engines and layers (slots)

    VRAM_G_BG_EXT_PALETTE_SLOT23 - maps vram g to main engine background extended palette slot 2 and 3

    Also found this thread http://devkitpro.org/viewtopic.php?f=6&t=511

    Looks like the easy way to map entire banks for palettes are macros like VRAM_G_BG_EXT_PALETTE_SLOT01