SRD

From Spiral Framework
Jump to navigation Jump to search
SRD
TypeReference Format
SystemSteam
Applicable TitlesDanganronpa V3: Killing Harmony
Credityukinogatari/Danganronpa-Tools
Default SignednessUnsigned
Default EndiannessBoth Little-Endian and Big-Endian
Implementation Status80%

SRD (Or Spike Reference Descriptor as it is theorized to stand for) is a file format that stores information about one or more game resources, such as a texture, model, etc. Each section of the file differs depending on what the specific resource requires (for instance, an SRD file might only contain a texture, or it might contain both a model and its associated textures).

SRD "archives" themselves are very simple; they're simply a collection of SRD entries, one after another, with each entry containing a "sub-entry" after the main data block, usually an RSI entry containing additional data.

SRD entries all follow a simple pattern (with the exception of special entries like CFH and CT0); a 4-byte string which specifies the entry type, followed by a UInt32BE int for the main entry length, then another UInt32BE for the sub-entry length, then an unknown UInt32BE (possibly just padding for most entry types, but seems important for $CFH entries).

Alignment

All entries in a SRD file are aligned to 16 bytes. This means, if an entry is only 10 bytes long, there will be an extra 6 bytes of padding before the next entry. If an entry is 125 bytes long, then there will be 3 bytes of padding afterward. Entries and sub-entries are subjected to this padding.

Entry Types

CFH (Content File Header)

This is always the first entry in an SRD file. Has an RSF sub-entry, which seems to contain the directory name that the SRD's virtual contents are stored inside.

It is a special entry type, and has a completely empty header (zero-filled) aside from the entry type string and the third UInt32BE parameter, which (probably?) specifies the number of RSF sub-entries contained within.

TXI (Texture Information)

This entry contains information about textures, but the specifics have yet to be determined. Has an RSI sub-entry.

TXR (Texture Resource/Reference)

This contains info about a texture resource. Has an RSI sub-entry which contains a significant amount of info related to the texture resolution, format, and mipmaps.

SCN (Scene)

Seems to be related to 3D models. Has an RSI sub-entry.

MSH (Mesh)

Contains mesh information for a 3D model. Has an RSI sub-entry.

VTX (Vertex)

Contains vertex information for a 3D model. Has an RSI sub-entry.

MAT (Material)

Contains material information for a 3D model. Has an RSI sub-entry.

RSI (Resource Information)

Seems to contain additional data related to whatever entry precedes it. Its layout and structure seems to change based on what kind of data it contains.

CT0 (Content Terminator)

This marks the end of the SRD file, and is also present after most other entry types that have an RSI sub-entry.

It is a special entry type, and has a completely empty header (zero-filled) aside from the entry type string.