Difference between revisions of "Binary Spiral Template"

From Spiral Framework
Jump to navigation Jump to search
Line 69: Line 69:
  
 
===01 - Add Magic Number===
 
===01 - Add Magic Number===
Syntax: <code>00 [Magic Number]</code>
+
Syntax: <code>01 [Magic Number]</code>
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 78: Line 78:
 
!Name
 
!Name
 
|-
 
|-
|00
+
|00 || <code>4B 41 50 2E</code> || [[Pak]]
|<code>2E 50 41 4B</code>
+
|-
|Pak
+
|01 || <code>4E 49 4C 2E</code> || [[Lin]]
 +
|-
 +
|02 || <code>44 52 57 2E</code> || [[Word Script]]
 +
|-
 +
|03 || <code>44 52 53 2E</code> || [[Srd]]
 +
|-
 +
|04 || <code>49 44 52 53</code> || [[Srdi]]
 +
|-
 +
|05 || <code>56 44 52 53</code> || [[Srdv]]
 +
|-
 +
|style="text-align:center;" colspan="3" | ...
 +
|-
 +
|10 || <code>31 50 4C 2E</code> || Dr1 Loop
 +
|-
 +
|11 || <code>31 45 43 2E</code> || Dr1 Climax Episode
 +
|-
 +
|12 || <code>31 47 48 2E</code> || Dr1 Hangman's Gambit
 +
|-
 +
|13 || <code>31 44 4E 2E</code> || Dr1 Nonstop Debate
 +
|-
 +
|14 || <code>31 4F 52 2E</code> || Dr1 Room Object
 +
|-
 +
|style="text-align:center;" colspan="3" | ...
 +
|-
 +
|30 || <code>33 54 44 2E</code> || [[Data Table (V3)|V3 Data Table]]
 
|-
 
|-
 
|style="text-align:center;" colspan="3" | ...
 
|style="text-align:center;" colspan="3" | ...

Revision as of 14:25, 7 November 2019

Binary Spiral Templates (BST) are template files that use a set of opcodes to modify files to fit a certain binary format. These are used by Spiral to coerce some format files into being more easily and sanely recogniseable (such as Pak archives).


Specification

BST Opcodes
Hex Opcode Name Argument Count Comments
00 Parse Data As 1
01 Add Magic Number 1
02 Iterate Subfiles 0
03 Done 0
04 Break 0 Does not flush output
05 Skip 0

Opcodes

00 - Parse Data As

Syntax: 00 [File Type]

Parses the data as a certain type. Primarily used to iterate through sub-entries.

Magic Numbers
Hex Value Name
00 Pak
01 Spc
...
FF (Raw)

01 - Add Magic Number

Syntax: 01 [Magic Number]

Magic Numbers
Hex Opcode Hex Magic Number (LE) Name
00 4B 41 50 2E Pak
01 4E 49 4C 2E Lin
02 44 52 57 2E Word Script
03 44 52 53 2E Srd
04 49 44 52 53 Srdi
05 56 44 52 53 Srdv
...
10 31 50 4C 2E Dr1 Loop
11 31 45 43 2E Dr1 Climax Episode
12 31 47 48 2E Dr1 Hangman's Gambit
13 31 44 4E 2E Dr1 Nonstop Debate
14 31 4F 52 2E Dr1 Room Object
...
30 33 54 44 2E V3 Data Table
...
FC N/a (Raw Int8)
FD N/a (Raw Int16)
FE N/a (Raw Int32)
FF N/a (Raw Int64)

02 - Iterate Subfiles

03 - Done

04 - Break