The banner (“icon and title”) is what the DS menu shows for the game. The header gives its offset at 0x068. The layout is from GBATEK
(“DS Cartridge Icon/Title”), and the first version’s fields are the same in DeSmuME’s RomBanner
structure. The viewer draws the icon, shows the palette and reads the titles.
Versions
| Version | Size | What it adds |
|---|---|---|
0x0001 | 0x840 bytes | The original: icon and six titles. |
0x0002 | 0x940 bytes | A Chinese title. |
0x0003 | 0xA40 bytes | A Korean title. |
0x0103 | 0x23C0 bytes of data | An animated icon for the DSi: eight bitmaps and palettes and a sequence of tokens. |
The sizes are where the data ends; the viewer reads 0x2400 bytes for version 0x0103 (the data and 64 bytes of padding) and
does not decode the animation.
Layout
| Offset | Size | Field | What it holds |
|---|---|---|---|
0x0000 | 2 | Version | See above. |
0x0002 | 2 | Checksum 1 | CRC-16 of 0x0020–0x083F, in every version. |
0x0004 | 2 | Checksum 2 | CRC-16 of 0x0020–0x093F, from version 2. |
0x0006 | 2 | Checksum 3 | CRC-16 of 0x0020–0x0A3F, from version 3. |
0x0008 | 2 | Checksum 4 | CRC-16 of 0x1240–0x23BF, from version 0x0103. |
0x000A | 22 | Reserved | Zero. |
0x0020 | 512 | Icon bitmap | 32 × 32 pixels in 4 × 4 tiles of 8 × 8 pixels, 4 bits a pixel (32 bytes a tile). |
0x0220 | 32 | Icon palette | 16 colours of 16 bits, with values in 0x0000–0x7FFF. Colour 0 is transparent. |
0x0240 | 6 × 256 | Titles | Japanese, English, French, German, Italian, Spanish (0x0240, 0x0340 … 0x0740); then Chinese at 0x0840 (version 2 and up) and Korean at 0x0940 (version 3 and up). |
Each title is 128 UTF-16 characters, 256 bytes. Lines are separated by a line feed (0x000A), and the string ends at a zero.
Drawing the icon
The icon is made of 16 tiles, four across and four down, in that order. Each tile is 8 rows of 4 bytes, and each byte holds two pixels: the
low 4 bits are the left pixel and the high 4 bits the right one. A pixel is an index into the palette. Each palette entry is a 15-bit
colour, with red in bits 0–4, green in bits 5–9 and blue in bits 10–14; the viewer scales each 5-bit value to 0–255. GBATEK gives the range
0x0000–0x7FFF and does not name the colour layout; this is the layout of the Game Boy Advance’s colours, and we have not checked it against a real banner.
Checksums
The checksums use the same CRC-16 as the header. The viewer checks each one that the version has and shows it as correct or as wrong with the value it should have.