Pmd2 PKDPX: Difference between revisions

From ProjectPokemon Wiki
Jump to navigation Jump to search
(Re-wordedthe introduction a little. Added mention of instances where the format was wrapped in a SIR0 container. Changed title.)
No edit summary
Line 2: Line 2:
[[Category:ROM Hacking]]
[[Category:ROM Hacking]]
[[Category:Technical References]]
[[Category:Technical References]]
[[Category:NDS Mystery Dungeon]]
[[Category:Game Data]]
{{DISPLAYTITLE:PKDPX File Format}}
{{DISPLAYTITLE:PKDPX File Format}}
The PKDPX format is used as a compressed container for generic data. Unlike its specialized equivalent the [[pmd2_AT4PX|AT4PX]] format, the PKDPX format can contain any kind of data. Just like the [[pmd2_AT4PX|AT4PX]] format, its not unusual to find PKDPX files wrapped inside a [[Pmd2_SIR0|SIR0]] container!
The PKDPX format is used as a compressed container for generic data. Unlike its specialized equivalent the [[pmd2_AT4PX|AT4PX]] format, the PKDPX format can contain any kind of data. Just like the [[pmd2_AT4PX|AT4PX]] format, its not unusual to find PKDPX files wrapped inside a [[Pmd2_SIR0|SIR0]] container!

Revision as of 00:07, 3 February 2017


The PKDPX format is used as a compressed container for generic data. Unlike its specialized equivalent the AT4PX format, the PKDPX format can contain any kind of data. Just like the AT4PX format, its not unusual to find PKDPX files wrapped inside a SIR0 container! Its content is compressed using a custom compression format dubbed PX Compression for the lack of a better name.

File Structure

The structure is very simple. A 20 bytes long header followed with the compressed data.

Overview
Offset Length Endianness Type Name Description
0x00 5 big Magic Number The magic number, made of the ASCII characters "PKDPX" {0x50, 0x4B, 0x44, 0x50, 0x58}
0x05 2 little uint16 Container Length The length from the beginning of the header to the end of the compressed data.
0x07 9 byte array Ctrl Flags Array A list of flags to be used in decompressing the container's content. More detail about their purpose on the PX Compression page. They're really nybbles stored in the lower half of a single byte each.
0x10 4 little uint32 Decompressed Data Length This is the length of the raw input data before it was compressed. Note how the length of this field differ from the AT4PX format's own Decompressed Data Length !
0x14 ..The PX compressed data begins immediately here!..

Credits

A big thanks to Zhorkenwho figured out most of the header and the compression format!