-
Notifications
You must be signed in to change notification settings - Fork 1
/
Ncgr2tga.mw
62 lines (39 loc) · 2.15 KB
/
Ncgr2tga.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Nintendo NCGR image to TGA converter
= Synopsis =
ncgr2tga [<options>] <width> <height> <ncgr> [<ngr> [...]] <nclr> <tga>
= Description =
'''ncgr2tga''' converts Nintendo's tile-based NCGR images into common TGA images.
2D graphics on the Nintendo DS is fundamentally tile-based. Specifically, the graphics data in NCGR is ordered in tiles of 8x8 pixels. Moreover, an NCGR file can itself be a tile of a larger image. This tool can automatically combine and unwrap these tiles, and, together with an NCLR file for the palette, converts a grid of NCGR into a plain old linear TGA image.
= Options =
'''-h''' <br />
'''--help'''
: Show a help text and exit.
'''--version'''
: Show version information and exit.
<width>
: The width of the NCGR grid, in NCGR files.
<height>
: The height of the NCGR grid, in NCGR files.
<ncgr>
: The name of an NCGR file to use. The NCGR contains the pixel graphics part of the image.
: width x height NCGR files have to be given; they are drawn into the final TGA in row-major order. An empty filename, commonly specified with "", means that this grid cell will be empty, filled with palette entry 0.
<nclr>
: The name of the NCLR file to use. The NCLR file contains the palette part of the image.
<tga>
: The resulting TGA file will be written there.
= Limitations =
'''- '''Only NCGR files with version 1.1 are supported <br />
'''- '''Only NCLR files with version 1.0 are supported <br />
'''- '''Only palettes with bit-depths of 4 or 8 are supported <br />
'''- '''Non-tiled or partitioned NCGR files are not supported <br />
'''- '''Some NCGR files don't contain valid width/height values, and seem to need an NCER file for this information. These files are currently not supported <br />
= Examples =
Convert a 2x3 grid of NCGR files:
ncgr2tga 2 3 a0.ncgr a1.ncgr a2.ncgr a3.ncgr a4.ncgr a5.ncgr a.nclr a.tga
Convert a 2x2 grid of NCGR files, leaving the lower left quadrant blank:
ncgr2tga 2 2 b0.ncgr, b1.ncgr "" b2.ncgr b.nclr b.tga
= See also =
[[cbgt2tga]]
= References =
* https://github.com/pleonex/tinke/blob/30e91bfff13555279e6fd69dd0de82961936a1dd/Plugins/Images/Images/NCGR.cs
* http://llref.emutalk.net/docs/?file=xml/ncgr.xml