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)
 
(3 intermediate revisions by 2 users not shown)
Line 47: Line 47:
 
|style="background:rgb(255,255,255)" | 00 00 (for 4 bytes align)
 
|style="background:rgb(255,255,255)" | 00 00 (for 4 bytes align)
 
|}
 
|}
 +
  
  
Line 52: Line 53:
  
 
After this goes object identifiers for selecting in scripts.
 
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).
 
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.
 
Identifiers count = Number of object`s in Data Structure.
 +
 +
  
 
'''''Pointers to objects'''''
 
'''''Pointers to objects'''''
  
 
Count of pointers = Number of object`s in Data Structure.
 
Count of pointers = Number of object`s in Data Structure.
 +
 
Size of all pointers are '''4 bytes'''.
 
Size of all pointers are '''4 bytes'''.
 +
 
Pointers are from current position (offset of current pointer + pointer value)
 
Pointers are from current position (offset of current pointer + pointer value)
 +
 +
  
 
'''''End`s pointer for objects'''''
 
'''''End`s pointer for objects'''''
  
After Pointers to objects goes 4 bytes.
+
After Pointers to objects goes '''4 bytes'''.
It`s pointer from offset first pointer to end of last object (offset of first pointer + end`s pointer)
+
 
 +
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)