Monday, May 28, 2012

Palette animations and 4096 colours

I've seen the use of multiple palettes on DS first in the Tetris Attack source code.
The game used to use multiple palette to handle "shading" of the game when you're K.O. It involves using one of the VRAM slot (usually VRAM_E) as a extra-palette place, but you need to map it back as LCD to enable modifications ... so it's not convenient if you're planning to do palette animations.

it's completely OK to switch the VRAM bank you're using for ext palette to LCD mode -when in vblanking- to access it, the DS doesn't care when it's not drawing the screen. Just remember to set it back to ext palette mode as soon as you updated its contents. Using multiple palettes, for instance for sprites, could be useful if you want to have enemies with different colors but just store their frames in memory once (/Sverx :)


That's good to know. I won't have to drop palette animation altogether if I start using multiple palettes for "painting" books in the school. If I'd be checking gbadev more often, I'd know for quite a while.

2 comments:

sverx said...

An example of an useful use of the extended palette is Waimanu DS: the 'Wekas' (the alien jellies - our enemies) are actually all made using the same sprite sheet and their 4 different colors is achieved simply using 4 different 256-colors palette... :)

PypeBros said...

Yep. And that reminds me I still have to try the game. Here, I rather intend to use alternate palette for bringing more colour diversity in the background, e.g. the books used as building blocks in the school zone...