Difference between revisions of "FF9/File/Data"

From Final Fantasy Inside
< FF9
Jump to navigation Jump to search
my_wiki>Zidane
m (9 revisions imported)
 
(7 intermediate revisions by 2 users not shown)
Line 7: Line 7:
 
|-
 
|-
 
|style="background:rgb(255,255,255)" | "DB"
 
|style="background:rgb(255,255,255)" | "DB"
|style="background:rgb(255,255,255)" | 1 bytes
+
|style="background:rgb(255,255,255)" | 1 byte
 
|-
 
|-
 
|style="background:rgb(255,255,255)" | Pointers count
 
|style="background:rgb(255,255,255)" | Pointers count
 +
|style="background:rgb(255,255,255)" | 1 byte
 +
|-
 +
|style="background:rgb(255,255,255)" | 00 00
 
|style="background:rgb(255,255,255)" | 2 bytes
 
|style="background:rgb(255,255,255)" | 2 bytes
 
|-
 
|-
Line 31: Line 34:
  
 
Data, where points this pointer begins with 2 bytes, first byte indicates, what data type we have, and second is count of objects of selected type.
 
Data, where points this pointer begins with 2 bytes, first byte indicates, what data type we have, and second is count of objects of selected type.
 +
 +
'''Data'''
 +
'''Data structure:'''
 +
{| border="0" cellspacing="1" cellpadding="3" style="background: rgb(0,0,0)" align="center"
 +
|style="background:rgb(255,255,255)" | 1 byte 
 +
|style="background:rgb(255,255,255)" | Data type
 +
|-
 +
|style="background:rgb(255,255,255)" | 1 byte
 +
|style="background:rgb(255,255,255)" | Number of object`s in this scope
 +
|-
 +
|style="background:rgb(255,255,255)" | 2 bytes
 +
|style="background:rgb(255,255,255)" | 00 00 (for 4 bytes align)
 +
|}
 +
 +
 +
 +
'''''Objects identifiers'''''
 +
 +
After this goes object identifiers for selecting in scripts.
 +
 +
One identifier are '''2 bytes''', and size of all identifiers must be '''aligned to 4 bytes''' (by add 0000 identifier).
 +
 +
Identifiers count = Number of object`s in Data Structure.
 +
 +
 +
 +
'''''Pointers to objects'''''
 +
 +
Count of pointers = Number of object`s in Data Structure.
 +
 +
Size of all pointers are '''4 bytes'''.
 +
 +
Pointers are from current position (offset of current pointer + pointer value)
 +
 +
 +
 +
'''''End`s pointer for objects'''''
 +
 +
After Pointers to objects goes '''4 bytes'''.
 +
 +
It`s pointer from first pointer offset to end of last object (offset of first pointer + end`s pointer)

Latest revision as of 05:25, 23 May 2019

Almost all files in FF9 has structure, which starts from 2 bytes DB (hex numbers). This record points, that after we'll have pointer list, which points to different data sections in the file (data can be sounds, TIMs, models, etc).

DB Structure:

Data Size
"DB" 1 byte
Pointers count 1 byte
00 00 2 bytes
Pointer1, Pointer2,... 4 bytes * Pointers count

Pointer is a number, which represent how many bytes from current position there is target data. Current position in this case is first byte of this pointer.

Pointer structure:

Data Size
Pointer 3 bytes
Data Type 1 byte

Data, where points this pointer begins with 2 bytes, first byte indicates, what data type we have, and second is count of objects of selected type.

Data Data structure:

1 byte Data type
1 byte Number of object`s in this scope
2 bytes 00 00 (for 4 bytes align)


Objects identifiers

After this goes object identifiers for selecting in scripts.

One identifier are 2 bytes, and size of all identifiers must be aligned to 4 bytes (by add 0000 identifier).

Identifiers count = Number of object`s in Data Structure.


Pointers to objects

Count of pointers = Number of object`s in Data Structure.

Size of all pointers are 4 bytes.

Pointers are from current position (offset of current pointer + pointer value)


End`s pointer for objects

After Pointers to objects goes 4 bytes.

It`s pointer from first pointer offset to end of last object (offset of first pointer + end`s pointer)