usage: bmp2gbtile ?file2.bmp? ... ?-classname ? ?-obj_offset ?
This program converts a set of 16/256 color bmp files into GBA sprite/tile data
The program takes one or more .bmp files as input and generates
a single header file based on all read files. This header will
contain a single '1D' binary stream of the tile data along with an
enumeration of palette information for each sprite.
This program also generates an index structure that will give correct
GBA hardware settings for each object. The format of this structure
will be the OBJ format
This program will perform limited palette mactching using the following algorithm:
1) All bitmaps are loaded into memory 16x16 palettes are cleared
2) bitmaps are split into 2 groups (A,B) where 0 < A <= 16 < B < 256 colors
3) For each group A_i from A from the most colors to the least:
a) select a palette that has the lowest palette delta from A_i,
expand the palette to support A_i, remap A_i, and continue
4) Try to fit group B into existing palette.
If any of the above steps fail, the program will not complete and
will return an error
Options include:
-classname [name] The header file will be generated as a static
class with a default classname of .
This option can be used to override this name.
-lang [name] The language format to use. Currently c or c++ is
accepted as input
-obj_offset [n] This can be used to set the object offset. This
parameter is useful when using bitmapped graphics
modes (set obj_offset to 512 in these modes for
correct header information
-tile This puts the bmp2gbtile program in tile mode. In tile
mode, any bmp dimension that is a multiple of 8 is accepted.
in this mode, the bitmap is scanned from left to right and 8x8
chunks are outputted
-no_attr This surpresses attrN data from the output files
-no_palette This surpresses palette data from the output files
-palette_file [file] This loads a specially formatted palette constraint file
that can be used to manually constrain parts of a palette
This is useful when combining the results of multiple
Invovations on bmp2gbtile, when it makes sence to do things
this way.
The format of the palette file is simple, here is an example:
# This is a comment
# start a palette by stating 'pal' followed by a palette number (0-15)
# if using 256 colors, simply use '0'
pal 0
# The rest is the colors in 5 bpp, BGR format, the same as the GBA
# hardware would expect. The color idx always starts at zero, there
# is currently no way to start at a non zero index. Palette data is
# assumed hex
#Here are two colors (0 and 1):
7FFF
0000