Difference between revisions of "FF8/FileFormat JSM"

From Final Fantasy Inside
< FF8
Jump to navigation Jump to search
my_wiki>Myst6re
m (9 revisions imported)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
By myst6re.
 +
 
== Fields Scripts ==
 
== Fields Scripts ==
  
Line 8: Line 10:
 
| 0
 
| 0
 
| 1 byte
 
| 1 byte
| Number of door entity
+
| Count of door entity
 
|-
 
|-
 
| 1
 
| 1
 
| 1 byte
 
| 1 byte
| Number of location (walkmesh line) entity
+
| Count of walkmesh line entity
 
|-
 
|-
 
| 2
 
| 2
 
| 1 byte
 
| 1 byte
| Number of background entity
+
| Count of background entity
 
|-
 
|-
 
| 3
 
| 3
 
| 1 byte
 
| 1 byte
| Number of other entity
+
| Count of other entity
 
|-
 
|-
 
| 4
 
| 4
Line 50: Line 52:
 
   label = entryPointEntity >> 7;
 
   label = entryPointEntity >> 7;
 
</pre>
 
</pre>
 +
 +
The entry points are sorted in order of execution (I guess), not in the order in which entities appear in the file.
 +
 +
When sorting entities, it will be always in that order:
 +
<ol>
 +
<li>Lines</li>
 +
<li>Doors</li>
 +
<li>Backgrounds</li>
 +
<li>Other</li>
 +
</ol>
 +
 +
To know what type of an entity, so we were just use their count.
  
 
=== Entry point of each script ===
 
=== Entry point of each script ===
Line 59: Line 73:
 
</pre>
 
</pre>
  
The position is relative to offsetScriptData. The meaning of the flag is unknown.
+
The position is relative to ''offsetScriptData''. The meaning of the flag is unknown, it appear always and only with door, location and background entities.
 +
Last entry point is relative EOF
  
 
=== Script Data ===
 
=== Script Data ===

Latest revision as of 05:24, 23 May 2019

By myst6re.

Fields Scripts

Offset Size Data
0 1 byte Count of door entity
1 1 byte Count of walkmesh line entity
2 1 byte Count of background entity
3 1 byte Count of other entity
4 2 bytes Offset section 1
6 2 bytes Offset script data
8 offsetSection1 - 8 = nbEntity * 2 Entry point of each entity
offsetSection1 offsetScriptData - offsetSection1 Entry point of each script
offsetScriptData varies Script Data

Entry point of each entity

Each entry is 2 bytes with:

  scriptCount = entryPointEntity & 0x7F;
  label = entryPointEntity >> 7;

The entry points are sorted in order of execution (I guess), not in the order in which entities appear in the file.

When sorting entities, it will be always in that order:

  1. Lines
  2. Doors
  3. Backgrounds
  4. Other

To know what type of an entity, so we were just use their count.

Entry point of each script

Each entry is 2 bytes with:

  position = (entryPointScript & 0x7FFF)*4;
  flag = entryPointScript >> 15;

The position is relative to offsetScriptData. The meaning of the flag is unknown, it appear always and only with door, location and background entities. Last entry point is relative EOF

Script Data

Each opcode is 4 bytes.

Opcode List