gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Multiple Palette possible?

#100178 - smoothingeye - Sat Aug 26, 2006 6:34 pm

I need to draw a fewgroup of sprite using more then 1 15bit palette how i can do it or could it be done at all?

#100187 - josath - Sat Aug 26, 2006 7:15 pm

You have several options:

Code:

- 1 x (256 colors) palette = 256 total colors = 256 colors per sprite(1 byte per pixel)

- 16 x (16 color) palettes = 256 total colors = 16 colors per sprite (0.5 bytes per pixel)

- 15bit bitmap sprites = 32768 total colorsĀ  = 32768 colors per sprite (2 bytes per pixel)

- 16 x (256 color) palettes = 4096 colors = 256 colors per sprite (1 byte per pixel)


I suggest reading the libnds video.h file, along with gbatek, in order to figure out exactly which to use. http://nocash.emubase.de/gbatek.htm

#100296 - smoothingeye - Sun Aug 27, 2006 7:57 am

this means that i cannot swap palette during 1 draw?

#100352 - tepples - Sun Aug 27, 2006 2:44 pm

If you have one sprite near the top and one sprite closer to the bottom, you can use the relatively advanced trick of palette swapping after each sprite in a VCOUNT interrupt handler. But you can't have two sprites with different 256-color palettes on one scanline unless you use DS extended palettes.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.