summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2017-04-20 16:49:35 +0300
committerJari Vetoniemi <mailroxas@gmail.com>2017-05-01 22:58:22 +0300
commit29086b1d12a2c28cffdbfbf0b3990a7bd75506b9 (patch)
tree8acd48bc30932812744c0adb102d7a7add494357 /spec
parent76b8c9e03c97b16d9ff97f3b79c0ecbff0f5e7f2 (diff)
work in progress
Diffstat (limited to 'spec')
-rw-r--r--spec/ability.fspec21
-rw-r--r--spec/eaf.fspec17
-rw-r--r--spec/emz.fspec7
-rw-r--r--spec/ftable.fspec2
-rw-r--r--spec/name.fspec11
-rw-r--r--spec/spell.fspec36
-rw-r--r--spec/vtable.fspec2
7 files changed, 65 insertions, 31 deletions
diff --git a/spec/ability.fspec b/spec/ability.fspec
index 3c2c890..4498d69 100644
--- a/spec/ability.fspec
+++ b/spec/ability.fspec
@@ -1,11 +1,14 @@
-// Abilities
struct ability {
- u16 index;
- u16 icon_id;
- u16 mp_cost;
- u16 unknown;
- u16 targets;
- u8 name[32] = sjis; // The kind actually depends on ROM section
- u8 description[256] = sjis; // ^ Ditto, we probably can't express this
- u8 padding[726] = pad;
+ index: u16;
+ icon_id: u16;
+ mp_cost: u16;
+ unknown: u16;
+ targets: u16;
+ name: u8[32] | encoding('sjis') str; // The encoding actually depends on ROM region
+ description: u8[256] | encoding('sjis') str; // ^ Ditto, we can't express this (we need parser options)
+ padding: u8[726] nul;
+};
+
+struct dat {
+ ability: struct ability[$];
};
diff --git a/spec/eaf.fspec b/spec/eaf.fspec
new file mode 100644
index 0000000..e9c5702
--- /dev/null
+++ b/spec/eaf.fspec
@@ -0,0 +1,17 @@
+struct file {
+ path: u8[256] | encoding('ascii') str;
+ offset: u64;
+ size: u64;
+ padding: u8[16] nul;
+};
+
+struct eaf {
+ header: u8[4] | matches('#EAF') str;
+ major: u16;
+ minor: u16;
+ size: u64;
+ count: u32;
+ unknown: u64;
+ padding: u8[100] nul;
+ files: struct file[count];
+};
diff --git a/spec/emz.fspec b/spec/emz.fspec
new file mode 100644
index 0000000..0fe02a1
--- /dev/null
+++ b/spec/emz.fspec
@@ -0,0 +1,7 @@
+struct emz {
+ header: u8[4] | matches('#EMZ') str;
+ unknown: u32 hex; // most likely redunancy check (crc32?)
+ size: u32;
+ offset: u32; // always 16?
+ data: u8[$] | compression('deflate', size) hex;
+};
diff --git a/spec/ftable.fspec b/spec/ftable.fspec
index 615b7b3..39fdd26 100644
--- a/spec/ftable.fspec
+++ b/spec/ftable.fspec
@@ -1,3 +1,3 @@
struct ftable {
- u16 id;
+ id: u16[$] hex;
};
diff --git a/spec/name.fspec b/spec/name.fspec
index 69f75de..d4e0f7c 100644
--- a/spec/name.fspec
+++ b/spec/name.fspec
@@ -1,5 +1,8 @@
-// NPC IDs
-struct name = {
- u8 name[28] = ascii; // The kind actually depends on ROM section
- u32 id;
+struct name {
+ name: u8[28] | encoding('ascii') str; // The encoding actually depends on ROM region
+ id: u32;
+};
+
+struct dat {
+ name: struct name[$];
};
diff --git a/spec/spell.fspec b/spec/spell.fspec
index f65b5ad..68aa5fb 100644
--- a/spec/spell.fspec
+++ b/spec/spell.fspec
@@ -1,18 +1,22 @@
struct spell {
- u16 index;
- u16 type; // 1-6 for White/Black/Summon/Ninja/Bard/Blue
- u16 element;
- u16 targets;
- u16 skill;
- u16 mp_cost;
- u8 casting_time; // in quarter of seconds
- u8 recast_delay; // in quarter of seconds
- u8 level[24]; // 1 byte per job, 0xxFF if not learnable, first slot is NONE job so always 0xFF
- u16 id; // 0 for "unused" spells; often, but not always, equal to index
- u8 unknown;
- u8 jp_name[20] = sjis;
- u8 en_name[20] = ascii;
- u8 jp_description[128] = sjis;
- u8 en_description[128] = ascii;
- u8 padding[687] = pad;
+ index: u16;
+ type: u16; // 1-6 for White/Black/Summon/Ninja/Bard/Blue
+ element: u16;
+ targets: u16;
+ skill: u16;
+ mp_cost: u16;
+ casting_time: u8; // in quarter of seconds
+ recast_delay: u8; // in quarter of seconds
+ level: u8[24] hex; // 1 byte per job, 0xxFF if not learnable, first slot is NONE job so always 0xFF
+ id: u16; // 0 for "unused" spells; often, but not always, equal to index
+ unknown: u8;
+ jp_name: u8[20] | encoding('sjis') str;
+ en_name: u8[20] | encoding('ascii') str;
+ jp_description: u8[128] | encoding('sjis') str;
+ en_description: u8[128] | encoding('ascii') str;
+ padding: u8[687] nul;
+};
+
+struct dat {
+ spell: struct spell[$];
};
diff --git a/spec/vtable.fspec b/spec/vtable.fspec
index 0fc8701..de281b8 100644
--- a/spec/vtable.fspec
+++ b/spec/vtable.fspec
@@ -1,3 +1,3 @@
struct vtable {
- u8 exist;
+ exist: u8[$] hex;
};