-
Notifications
You must be signed in to change notification settings - Fork 0
.nbf image format
##Overview This format is used exclusively for top screen background images. As such, they have to be 256 x 192 pixels (the same dimensions as the DSi screens).
##Format documentation
####Header
Start | Length | Type | Description |
---|---|---|---|
0 | 4 | Magic | "UGAR" |
4 | 4 | uint32 LE | Section count - always 2 |
8 | 4 | uint32 LE | Section 1 (palette data) length |
12 | 4 | uint32 LE | Section 2 (image data) length |
####Palette Data
Colors are stored in rgb555 format, so that each color only uses two bytes of data. This section should be padded to 512 bytes regardless of whether or not all 256 color slots are needed. The images doesn't seem to get read correctly otherwise.
####Image Data
Each pixel of the image is represented by a two-byte integer that refers to the index of the color in the palette section. It starts at 0 (0x00) and ends at 255 (0xFF).
Images are read using a scanline method. The data starts with the pixel at the top-left, then progresses linearly left-to-right, top-to-bottom until the pixel in the bottom-right corner.
##Things to investigate
- Can we use these from ugomenus as well?
- Is it possible to use a shorter palette length if not all 256 color slots are used?
- Do they support animation?