Jump to content

OBD:Instance file format: Difference between revisions

corrections for .oni and OniX formats
m (hatnote wording)
(corrections for .oni and OniX formats)
 
Line 38: Line 38:
{{OBDtr| 0x12 | uint16  | | 08 00      | 8        | size of name descriptor }}
{{OBDtr| 0x12 | uint16  | | 08 00      | 8        | size of name descriptor }}
{{OBDtr| 0x14 | uint32  | | 83 24 00 00 | 9347      | instance descriptor count  }}
{{OBDtr| 0x14 | uint32  | | 83 24 00 00 | 9347      | instance descriptor count  }}
{{OBDtr| 0x18 | uint32  | | D4 1B 00 00 | 7124      | name descriptor count }}
{{OBDtr| 0x18 | uint32  | | D4 1B 00 00 | 7124      | name descriptor count; 0 for .oni files because there is no name desc. table }}
{{OBDtr| 0x1C | uint32  | | 38 00 00 00 | 56        | template descriptor count }}
{{OBDtr| 0x1C | uint32  | | 38 00 00 00 | 56        | template descriptor count; 0 for .oni files because there is no template desc. table }}
{{OBDtr| 0x20 | uint32  | | A0 BC 03 00 | 0x03BCA0  | data block offset }}
{{OBDtr| 0x20 | uint32  | | A0 BC 03 00 | 0x03BCA0  | data block offset }}
{{OBDtr| 0x24 | uint32  | | A0 35 25 00 | 2438560  | data block size }}
{{OBDtr| 0x24 | uint32  | | A0 35 25 00 | 2438560  | data block size }}
Line 58: Line 58:
The '''descriptor counts''' are the sizes of arrays which are coming up in this file: the instance, name and template descriptors. For instance, the size of the instance descriptor array will be 0x2483, or 9,347 items, in length.
The '''descriptor counts''' are the sizes of arrays which are coming up in this file: the instance, name and template descriptors. For instance, the size of the instance descriptor array will be 0x2483, or 9,347 items, in length.


Next we are told the addresses and sizes of the '''data and name block''' in the instance file. The name block simply follows the data block, as you'll see if you add the data block offset plus the data block size, so the name block offset is technically redundant. The name block offset plus the name block size equals the total size of the file since it's the last segment of the file.
Next we are told the addresses and sizes of the '''data and name block''' in the instance file. The name block simply follows the data block, as you'll see if you add the data block offset plus the data block size, so the name block offset is technically redundant. The name block offset plus the name block size equals the total size of the file since it's the last segment of the file. (However in a .oni file, the order of these blocks is reversed.)


After the name block's size comes four "int"s of '''garbage'''; this is padding in order to align the start of the next segment of the file on a 32-byte boundary. The first two 32-bit fields in this space are, however, used in .oni files generated by OniSplit<!--, and the last 32-bit field is partly used by OniX for a new form of template versioning. Future usage of these fields by OniSplit and/or OniX may change (hopefully not too much)-->.
After the name block's size comes four "int"s of '''garbage'''; this is padding in order to align the start of the next segment of the file on a 32-byte boundary. The first two 32-bit fields in this space are, however, used in .oni files generated by OniSplit<!--, and the next two 32-bit fields are used by OniX for a new form of template versioning-->.


That concludes the header of the instance file. Immediately after this header we find the instance descriptors array.
That concludes the header of the instance file. Immediately after this header we find the instance descriptors array.