Author Topic: Magna Carta Portable SHIP.PPS file  (Read 6826 times)

Offline dots_tb

  • Refugee
  • **
  • Posts: 93
    • View Profile
Magna Carta Portable SHIP.PPS file
« on: August 24, 2019, 09:05:14 PM »
Magic: 53 4D 50 46 or SMPF

Header:
Code: [Select]
typedef struct pps_header {
    uint32_t magic;
    uint32_t file_num;
} pps_header;

Table 1, File IDs at 0x800:
Each file id is a uint16_t. It file_num long, hover the last few seem to have some sort of problem and there is overflow? These file ids align with the file names of the PS2 counterpart.

Table 2, File Info at 0x5800:
Code: [Select]
typedef struct pps_entry_offset {
uint32_t offset;
uint32_t entry_size;
} __attribute__((__packed__))  pps_entry_offset ;

Offset is multiplied by 0x800. Entry size is the size of the entry within the SHIP.PPS (aka compressed). Table 2 is ran in parallel to the Table 1.

Large files are made into a zlib stream, which has following header pre-pended to it.
Code: [Select]
typedef struct pps_entry_header {
uint32_t uncompressed_sz;
uint32_t compressed_sz;
} __attribute__((__packed__)) pps_entry_header;

Another file type which is embedded straight into the SHIP.PPS is the text files.
It is comprised of two sections.
The first section is unknown. It seems to have a variable to decide text speed. There seems to be a "section identifier" (0x4 size) that increases by at the start of a new section. These section identifiers are followed by length indicators (0x4 sized) that determine the lengths of the strings in the second section.

The second section has the text data:
$n is used for newlines in UTF-16 strings.
It auto newlines after 24 characters ingame.

The other files embedded are currently unknown.