-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cbgt2tga.mw
43 lines (26 loc) · 1.69 KB
/
Cbgt2tga.mw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
CBGT image to TGA converter
= Synopsis =
cbgt2tga [<options>] <cbgt> <pal> <2da> <tga>
= Description =
'''cbgt2tga''' converts CBGT image files into common TGA images. CBGT, Compressed BackGround Tiles, are used as area background images in BioWare's Nintendo DS game [[Sonic Chronicles: The Dark Brotherhood]].
Internally, a CBGT consists of a collection of 64x64 pixel cells, divided into tiles of 8x8 pixels. Each cell is compressed using Nintendo's 0x10 LZSS algorithm. Moreover, PAL files with the same name as the CBGT file contain the palette data, and 2DA files with the same name yet again contain the mapping of palette indices onto cells.
The width and height of the final image is not stored within the CBGT file, but the palette mapping 2DA does contain the number cells in X and Y direction, since it stores the palette indices in a two-dimensional array of those dimensions. Therefore, multi- plying the number of columns and rows in said 2DA by 64 yields the width and height, respectively, of the final image.
= Options =
'''-h''' <br />
'''--help'''
: Show a help text and exit.
'''--version'''
: Show version information and exit.
<cbgt>
: The name of the CBGT file to read. The CBGT contains the pixel graphics part of the image.
<pal>
: The name of the PAL file to use. The PAL file contains the palette part of the image.
<2da>
: The name of the 2DA file to use. The 2DA file contains information on which palette to use for each part of the CBGT, and on how many parts are in the CBGT in the first place.
<tga>
: The resulting TGA file will be written there.
= Examples =
Convert a CBGT+PAL+2DA into a TGA:
cbgt2tga a.cbgt a.pal a.2da result.tga
= See also =
[[cdpth2tga]], [[ncgr2tga]]