The BGP file format is used in Pokémon Mystery Dungeon: Explorers of Time/Darkness/Sky to store full-screen background images, most notably the various images that appear in the background of the main menu.
It is stored using AT4PX compression.
|0x20||1024||Palette||Stores 64 colors for use by the tiles.|
|0x420||620||Tile Mapping||For each 8x8 region of the screen, identifies which tile, palette, and transform to use.|
|0xC40||Unknown/Varies||Tiles||Consecutive 8x8 4bbp tiles for use in the tile mapping.|
The palette consists of 1024 bytes, representing 256 colors. Each color has 4 bytes: Red, Green, Blue, and a 4th unknown byte which is always set to 0x80.
The Nintendo DS screen is 256x192 pixels. Because each tile is 8x8, this leaves a grid of 32x24, leaving 768 possible tiles. At two bytes per tile mapping, this region is 1536 (0x600) bytes long.
Each spot for a tile is given two bytes, which stores the index of the tile data (10 bit unsigned integer), the index of the palette (4 bit unsigned integer), and whether or not to perform an X or Y transform.
|10||Tile data index|
For each spot on the screen that needs a tile, the 4bpp 8x8 tile given by the Tile Data Index is used, transformed on either axis if applicable, and its palette is 16 consecutive colors from the Palette above, after skipping 16 times the Palette Index colors.
Tiles are simple. They are simply 4bpp tiles of 8x8 pixels referenced by the Tile Mapping.
Edited by evandixon