Difference between revisions of "Icon.bin"
m (→The Palettes) |
|||
(13 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
+ | These are the banners you'll see in various places in the [[System Menu]]. They have the dimension 32x32 pixels. | ||
+ | |||
[[Image:icon_1.gif]] | [[Image:icon_1.gif]] | ||
[[Image:icon_2.gif]] | [[Image:icon_2.gif]] | ||
Line 4: | Line 6: | ||
[[Image:icon_4.gif]] | [[Image:icon_4.gif]] | ||
[[Image:icon_5.gif]] | [[Image:icon_5.gif]] | ||
+ | |||
+ | These are converted by a tool blasty wrote. Icon files were supplied by loopy. | ||
+ | |||
+ | == Basic File Structure == | ||
+ | {| class="wikitable" | ||
+ | |- style="background-color: #ddd;" | ||
+ | ! Start | ||
+ | ! Length | ||
+ | ! Description | ||
+ | |- | ||
+ | | 0x0000 | ||
+ | | 1 | ||
+ | | Number of titles (5+N) | ||
+ | |- | ||
+ | | 0x0001 | ||
+ | | 1 | ||
+ | | Animated (1=contains animated icon at 0x1240) | ||
+ | |- | ||
+ | | 0x0002 | ||
+ | | 2*4 | ||
+ | | 4 CRC checksums (polynomial 0xA001) | ||
+ | |- | ||
+ | | 0x000A | ||
+ | | 22 | ||
+ | | Padding (00's) | ||
+ | |- | ||
+ | | 0x0020 | ||
+ | | 512 | ||
+ | | Default Bitmap | ||
+ | |- | ||
+ | | 0x0220 | ||
+ | | 32 | ||
+ | | Palette for above | ||
+ | |- | ||
+ | | 0x0240 | ||
+ | | 256*16 | ||
+ | | Application Titles, wide chars | ||
+ | |- | ||
+ | | 0x1240 | ||
+ | | 512*8 | ||
+ | | 8 Bitmaps (for animation) | ||
+ | |- | ||
+ | | 0x2240 | ||
+ | | 32*8 | ||
+ | | 8 Palettes | ||
+ | |- | ||
+ | | 0x2340 | ||
+ | | 128 | ||
+ | | Animation Sequence | ||
+ | |} | ||
+ | Languages (in correct order) are: Japanese, English, French, German, Italian, Spanish, ?Chinese?, Korean. | ||
+ | |||
+ | == Animation Sequence == | ||
+ | The sequence is represented by 2-byte tokens, in the following format (we're now talking bits, from left to right): | ||
+ | {| class="wikitable" | ||
+ | |- style="background-color: #ddd;" | ||
+ | ! Length | ||
+ | ! Description | ||
+ | ! Mask | ||
+ | |- | ||
+ | | 1 | ||
+ | | Flip Vertically | ||
+ | | 0x8000 | ||
+ | |- | ||
+ | | 1 | ||
+ | | Flip Horizontally | ||
+ | | 0x4000 | ||
+ | |- | ||
+ | | 3 | ||
+ | | Palette Index | ||
+ | | 0x3800 | ||
+ | |- | ||
+ | | 3 | ||
+ | | Bitmap Index | ||
+ | | 0x0700 | ||
+ | |- | ||
+ | | 8 | ||
+ | | Frame Duration (in frames (one frame = 1/60sec)) | ||
+ | | 0x00FF | ||
+ | |} | ||
+ | Both bytes being zero indicates the end of the sequence. If the first token is zero, the non-animated default image is shown. | ||
+ | |||
+ | == Bitmap Format == | ||
+ | The bitmap is tiled 8x8 pixels (Nintendo tends to do this). Each pixel contain 4 bits of data, being the index into the palette specified by the current sequence-token. | ||
+ | |||
+ | == The Palettes == | ||
+ | Each color in the palette is in the standard 2-byte RGB5551 format (used since GBA). | ||
+ | |||
+ | The conversion to RGB888 is made like this (C): | ||
+ | <source lang="c"> | ||
+ | u8 r = ((color ) & 0x1f)<<3; | ||
+ | u8 g = ((color >> 5) & 0x1f)<<3; | ||
+ | u8 b = ((color >> 10) & 0x1f)<<3; | ||
+ | </source> | ||
+ | |||
+ | == Checksums == | ||
+ | The CRC-output is not bitwise inverted after the calculation, but it is byte-swapped to big-endian. Polynomial used is: 0xA001, same for all. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- style="background-color: #ddd;" | ||
+ | ! Number | ||
+ | ! Range | ||
+ | |- | ||
+ | | 0 | ||
+ | | 020-83F | ||
+ | |- | ||
+ | | 1 | ||
+ | | 020-93F | ||
+ | |- | ||
+ | | 2 | ||
+ | | 020-A3F | ||
+ | |- | ||
+ | | 3 | ||
+ | | 1240-23C0 | ||
+ | |} |
Latest revision as of 18:41, 13 February 2011
These are the banners you'll see in various places in the System Menu. They have the dimension 32x32 pixels.
These are converted by a tool blasty wrote. Icon files were supplied by loopy.
Basic File Structure
Start | Length | Description |
---|---|---|
0x0000 | 1 | Number of titles (5+N) |
0x0001 | 1 | Animated (1=contains animated icon at 0x1240) |
0x0002 | 2*4 | 4 CRC checksums (polynomial 0xA001) |
0x000A | 22 | Padding (00's) |
0x0020 | 512 | Default Bitmap |
0x0220 | 32 | Palette for above |
0x0240 | 256*16 | Application Titles, wide chars |
0x1240 | 512*8 | 8 Bitmaps (for animation) |
0x2240 | 32*8 | 8 Palettes |
0x2340 | 128 | Animation Sequence |
Languages (in correct order) are: Japanese, English, French, German, Italian, Spanish, ?Chinese?, Korean.
Animation Sequence
The sequence is represented by 2-byte tokens, in the following format (we're now talking bits, from left to right):
Length | Description | Mask |
---|---|---|
1 | Flip Vertically | 0x8000 |
1 | Flip Horizontally | 0x4000 |
3 | Palette Index | 0x3800 |
3 | Bitmap Index | 0x0700 |
8 | Frame Duration (in frames (one frame = 1/60sec)) | 0x00FF |
Both bytes being zero indicates the end of the sequence. If the first token is zero, the non-animated default image is shown.
Bitmap Format
The bitmap is tiled 8x8 pixels (Nintendo tends to do this). Each pixel contain 4 bits of data, being the index into the palette specified by the current sequence-token.
The Palettes
Each color in the palette is in the standard 2-byte RGB5551 format (used since GBA).
The conversion to RGB888 is made like this (C):
u8 r = ((color ) & 0x1f)<<3;
u8 g = ((color >> 5) & 0x1f)<<3;
u8 b = ((color >> 10) & 0x1f)<<3;
Checksums
The CRC-output is not bitwise inverted after the calculation, but it is byte-swapped to big-endian. Polynomial used is: 0xA001, same for all.
Number | Range |
---|---|
0 | 020-83F |
1 | 020-93F |
2 | 020-A3F |
3 | 1240-23C0 |