Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)
You are not logged in.
Hey guys,
I'm pretty new to GameBoy Color development and my question is, is it possible to give a background more than one color palette?
I know that it's possible with sprites by laying multiple tiles over each other, but how should it work with a background?
/Captain
Offline
On GBC, VRAM contains two memory banks. You have to use the VBK register (FF4F) to select VRAM bank 1. VRAM bank 0 is the regular tile/map. VRAM bank 1 contains the attribute map for the background, as well as an extra set of tiles. To set a tile attribute, you write to the same address you wrote to map memory, with an attribute as described in Pan Docs.
http://gbdev.gg8.se/wiki/articles/Video … round_Maps
Offline
@CaptainDaddy: When you say use more than 1 color palette, are you perhaps talking about using more than 4 colors per tile? To me, it sounds like that is what you're referring to since you mentioned using overlapping sprites to create that sort of effect with OBJs. If this is indeed what you're after, you can actually just use sprites as "extra" tiles to add color to a BG tile. What I mean is, have a sprite tile overlap a BG tile with the colors you want. In this way, you can get a maximum of 7 colors. This was one technique used in some commercial GBC games (notably the intro animations for LoZ:Oracle of Ages/Seasons). This method has some drawbacks though in that 1) you use up some of your sprites, and 2) you're still limited to 10 sprites per scanline.
There are other methods that try to draw to the background as if it were a bitmap (see the cutscenes from Tomb Raider for example) but that involves quite a bit of work changing color palettes almost every line and whatnot.
Offline