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 > BGs in tiled modes using several Palettes

#8995 - RaBBi - Fri Jul 25, 2003 10:35 pm

Hi,

In order to apply what Peter (author of Visual HAM) tought me about tiled bg in 16 colors ^^, I tried to re-compose a map taken from the game Golden Sun 2. (always for test not for rip ^^)

The map uses BG 3 to BG 1, and each BG uses tiles that are defined with different palettes of 16 colors.
And the palette don't have the same index 0 color.

So I have some difficulty to understand the concept of using several palette by BGs and define that a tile use a palette (and not another).

Does I have to use tricks in a map editor ?

I suppose I have to export separatly the 3 layers, but next ?
If I do that, there will be a palette by BG but it will not be 16 colors coz I'd use tiles from different palettes.

I'm lost with these concepts.
_________________
Sorry for my poor english, but it would be worst for you to understand me if I speak in my native language, French ^^

#8997 - Geno - Sat Jul 26, 2003 12:25 am

Well, the pern project might have something on this, but there should be an attribute(set of bits that you can change to configure something) to select which of the 16 16-color palettes you want to use.
_________________
Out of Order.

#9000 - RaBBi - Sat Jul 26, 2003 1:16 am

yeah you're right ^^

By this night, I read some old topics in the COding section, and found reflexions about this idea.

Bits to set is effectively a good solution to this.

Hope I'll manage to identify what tiles I would affect a certain palette ^^

I think I'll use Tile Studio which allow to "mark" tile with a code number (it generates an array of tile/code correspondance ^^).
And for some code number, I'll wrote code which define the palette of this tile.

Hope this last idea can open someone eyes ^^

EDIT: I found description of tile/map data on PERN PROJECT, but no tutorial about define palette for a tile.
Really exists ?
_________________
Sorry for my poor english, but it would be worst for you to understand me if I speak in my native language, French ^^

#9108 - djei-dot - Mon Jul 28, 2003 4:41 pm

From The Pern Project, Day 4:

Quote:
For text backgrounds the map data is a bit different. Each entry is a 16-bit number that gives a bit more information about each tile besides just the tile number. Here is the layout of a text background map entry:

Text background tile entry:

Code:
15  14  13  12  11  10  9  8  7  6  5  4  3  2  1  0 
Palette number  VF  HF  Tile Number 


bits 0-9: Tile number
bit 10: Horizontal flip flag
bit 11: Vertical flip flag
bits 12-15: 16-color palette number. Ignored if it is a 256-color background


As you can see, the last four bits are used to select the palette. Each map entry must be in this form. Note that this is only for text backgrounds, rotation backgrounds use only one 256 color palette.

#9115 - RaBBi - Mon Jul 28, 2003 5:46 pm

RaBBi wrote:
yeah you're right ^^

Bits to set is effectively a good solution to this.



oki so all that I read about tiles on this tuto was all that it was to be read ^^
Thank U
_________________
Sorry for my poor english, but it would be worst for you to understand me if I speak in my native language, French ^^