Jump to content

OBD:Instance file format: Difference between revisions

→‎Header: as of 2021 AD, we've just noticed that this space is *not* zeroed out in the vanilla data
m (→‎Template descriptors: let's use data that actually comes from level0, shall we?)
(→‎Header: as of 2021 AD, we've just noticed that this space is *not* zeroed out in the vanilla data)
Line 41: Line 41:
{{OBDtr| 0x28 | int32  | | 40 F2 28 00 | 0x28F240  | name table offset }}
{{OBDtr| 0x28 | int32  | | 40 F2 28 00 | 0x28F240  | name table offset }}
{{OBDtr| 0x2C | int32  | | 04 4F 02 00 | 151300    | name table size }}
{{OBDtr| 0x2C | int32  | | 04 4F 02 00 | 151300    | name table size }}
{{OBDtr| 0x30 | int32  | | 00 00 00 00 |           | used by OniSplit only: raw table offset }}
{{OBDtr| 0x30 | int32  | | 99 CF 40 00 | (garbage) | used by OniSplit for raw table offset }}
{{OBDtr| 0x34 | int32  | | 00 00 00 00 |           | used by OniSplit only: raw table size }}
{{OBDtr| 0x34 | int32  | | 90 4F 63 00 | (garbage) | used by OniSplit for raw table size }}
{{OBDtr| 0x38 | int32  | | 00 00 00 00 |           | unused }}
{{OBDtr| 0x38 | int32  | | F4 55 5F 00 | (garbage) | unused }}
{{OBDtr| 0x3C | int32  | | 00 00 00 00 |           | unused }}
{{OBDtr| 0x3C | int32  | | 90 4F 63 00 | (garbage) | unused }}
|}
|}


Line 57: Line 57:
Next we are told the addresses and sizes of the '''data and name tables''' in the instance file. The name table simply follows the data table, as you'll see if you add the data table offset plus the data table size, but that doesn't mean the name table offset is redundant; if its start was not 32-bit-aligned, it probably would be moved down to start at the next 32-bit word, but this is unnecessary because it happens to be aligned already.
Next we are told the addresses and sizes of the '''data and name tables''' in the instance file. The name table simply follows the data table, as you'll see if you add the data table offset plus the data table size, but that doesn't mean the name table offset is redundant; if its start was not 32-bit-aligned, it probably would be moved down to start at the next 32-bit word, but this is unnecessary because it happens to be aligned already.


After this comes four "int"s of '''zeroes'''. Empty space like this is common in the data files, and indicates that something stored in memory at this relative position was not written to disk (probably pointers, or sometimes a space reserved for possible future use in a resource type).
After this comes four "int"s of '''garbage'''. Space occupied by random values like this is common in the data files, and indicates that something stored in memory at this relative position was written to disk even though it wouldn't be meaningful on disk (probably pointers or uninitialized memory in a space that was being reserved for possible future use). The first two 32-bit fields are, however, used in a .oni file generated by OniSplit.


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.