Pmd2 BGP: Difference between revisions

From ProjectPokemon Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 37: Line 37:
== Palette ==
== Palette ==
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 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.
== Tile Mapping ==
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.
{| class="wikitable"
! Bit Length
! Description
|-
| 10
| Tile data index
|-
| 1
| Flip X
|-
| 1
| Flip Y
|-
| 4
| Palette 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 ==
Tiles are simple.  They are simply 4bpp tiles of 8x8 pixels referenced by the Tile Mapping.

Revision as of 16:44, 10 May 2015


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.

Overview

Offset Length Name Description
0x0 20 Header Currently unresearched
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.

Palette

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.

Tile Mapping

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.

Bit Length Description
10 Tile data index
1 Flip X
1 Flip Y
4 Palette 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

Tiles are simple. They are simply 4bpp tiles of 8x8 pixels referenced by the Tile Mapping.