MREA (Metroid Prime 2)

See MREA (File Format) for the other revisions of this format.

The MREA format defines areas (rooms) in Metroid Prime 2. It serves the same purpose as the MREA files from Prime 1, but in Echoes it was updated with new features, including some new data sections and the ability to compress most of the data in the file.

Format
Like CMDL, MREA files are split up into a number of 32-byte aligned sections. Every section both starts and ends on a 32-byte boundary. These are used to separate different parts of the file; different types of sections typically indicate different sets of data. The header declares the section count and the size of each one; using these is the only way to navigate the file.

Header
Following the section sizes comes an array defining the file's compressed cluster. Each definition is 0x10 bytes and is formatted like this: