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.

Graphics > colour palletes

#28969 - ThUg4LiFe - Tue Nov 09, 2004 11:26 am

if i use 256-colours for the images in a GBA game, can i use more than 256 as long as they are not on-screen at the same time?? i dont know if this is possible or if you has to load a new pallete or something, and what affect this has on the rest of the game and if it would compromise other features, or not?

#28970 - Krakken - Tue Nov 09, 2004 12:46 pm

Yep that's definately possible. Loading a palette at any time is absolutely fine.

#28984 - tepples - Tue Nov 09, 2004 4:57 pm

You can rewrite the palette during vblank. In fact, you can rewrite part of the palette during draw time if you want separate palettes for the playfield and the status bar. The StarTropics games for NES do this; it's even easier on the GBA with all the memory dual-ported.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#28985 - ThUg4LiFe - Tue Nov 09, 2004 5:06 pm

sounds good and will allow for extra flexability and creativity without making images higher colour depth and take more space. thanx for the info

#28999 - Abscissa - Tue Nov 09, 2004 9:44 pm

tepples wrote:
You can rewrite the palette during vblank. In fact, you can rewrite part of the palette during draw time if you want separate palettes for the playfield and the status bar. The StarTropics games for NES do this; it's even easier on the GBA with all the memory dual-ported.


A-ha! I bet that's why the colors on StarTropics were screwed up on the earlier NES emulators. (Good game, BTW)

#29599 - blinky465 - Mon Nov 22, 2004 12:22 pm

So I guess that if I build my sprites with individual 16-colour palettes, I can change the palettes in different 'rooms' and reuse the same sprites? Interesting idea....

#29609 - Nessie - Mon Nov 22, 2004 3:56 pm

Of course you could also do the same thing within a room. You could have a couple of different 16 colour palettes loaded at a time and have sprites using the same pixel data but a different palette.