# HG changeset patch # User Emmanuel Gil Peyrot # Date 1312630960 -7200 # Node ID bd0f1253691d10c5741ca8f93e1a8070f7128f80 # Parent 0a7e6e3d5327055c1f677cff9d7884004a2b4883 Add documentation of ECL format. diff --git a/06/ecl.xhtml b/06/ecl.xhtml new file mode 100644 --- /dev/null +++ b/06/ecl.xhtml @@ -0,0 +1,115 @@ + + + + + + ECL format + + +

ECL format

+ +

Header

+
+typedef struct {
+    uint32_t sub_count;
+    uint32_t main_offset;
+    uint32_t padding[2]; // Always 0.
+    uint32_t subs_offsets[sub_count];
+} thecl06_header_t;
+
+ + +

Sub

+

Starting at 0x10.
They describe the appearance and comportment of a certain type of enemy

+

Ends with frame_num = 0xffffffff and opcode = 0xffff, for a size of 0xc (the minimum) and default masks.

+

Parameters are dependants of the opcode.

+
+typedef struct {
+    uint32_t frame_num;
+    uint16_t opcode;
+    uint16_t size; // Never less than 0xc.
+    uint16_t rank_mask; // the first byte is always 0xff, and the second the mask of the ranks to which the instruction applies, 1 for easy, 8 for lunatic.
+    uint16_t param_mask; // If the last param is a stack, the number of bytes at 0 indicates the number of items in the stack.
+    unsigned char params[size-0xc];
+} thecl06_sub_t;
+
+ + +

Main

+

Each instruction contains its size (which is always greater than 8, or else the game crashs). The only values encountered in the game are 0x1c, 0x10 and 8, but values of 0x38 work (skip the next instruction).
+ The frame_num must greater than or equal to the previous, or the instruction will be skipped.
+ The parsing ends when frame_num is 0xffff.

+
+typedef struct {
+    uint16_t frame_num;
+    uint16_t unused1;
+    uint16_t unused2;
+    uint16_t size;
+    uint8_t arguments[size-8];
+} thecl_main_instr_t;
+
+ +

Most present instruction, that pops an enemy.

+
+typedef struct {
+    uint16_t time;
+    uint16_t sub; // Sub function to use.
+    uint16_t type;
+    uint16_t size; // Really the size of the instruction. NOT ignored by the game.
+    float x;
+    float y;
+    float z; // Unused, always 0.
+    int16_t resistance; // From 0 to 0x7fff; greater is equal to 0.
+    uint16_t unknown1;
+    uint16_t unknown2;
+    uint16_t unknown3;
+} thecl_enemy_t;
+
+ +

Unknown, used only at the end of each stage.

+
+typedef struct {
+    uint16_t time;
+    uint16_t sub; // always 0.
+    uint16_t type; // always 0xa.
+    uint16_t size;
+    float unused1; // always 0.
+    float unused2; // always 0.
+} thecl_other1_t;
+
+ +

Unknown, used only at the end of each stage. Always in group of 1, 2 or 3, with a sequence of (9), (8, 9) or (0xc, 8, 9).

+
+typedef struct {
+    uint16_t time;
+    uint16_t sub; // always 0.
+    uint16_t type;
+    uint16_t size;
+} thecl_other2_t;
+
+ +

Type

+

Used in the game are: 0, 2, 4, 6 for the enemies (0x1c-long), 0xa for the 0x10-long instruction, and 8, 9 and 0xc for the 8-long one.

+ +
    +
  1. normal enemy
  2. +
  3. normal enemy
  4. +
  5. mirrored enemy
  6. +
  7. mirrored enemy
  8. +
  9. normal enemy
  10. +
  11. normal enemy
  12. +
  13. mirrored enemy
  14. +
  15. mirrored enemy
  16. +
  17. starts the msg (which?)
  18. +
  19. nothing?
  20. +
  21. crash!?
  22. +
  23. nothing?
  24. +
  25. nothing?
  26. + etc. +
+ + diff --git a/06/ecl.xml b/06/ecl.xml --- a/06/ecl.xml +++ b/06/ecl.xml @@ -380,12 +380,12 @@ 49 - + set_random_? The new angle?. Some deplacement?. - Used only five times, in 2. + Used only five times, in 2. Seems to involve some randomness. diff --git a/06/std.xhtml b/06/std.xhtml --- a/06/std.xhtml +++ b/06/std.xhtml @@ -25,6 +25,7 @@ typedef struct { char song2_path[128]; char song3_path[128]; // ? A single blank if unused char song4_path[128]; // ? A single blank if unused + uint32_t offsets[nb_objects]; // offsets of the start of each object of section 1 } thstd_header_t; @@ -60,13 +61,6 @@ struct object { }; -

The following description is symbolic.

-
-struct section1 {
-    uint32_t offsets[]; // header.nb_objects offsets towards objects
-};*/
-
-

Second section

This section is responsible for placing objects from section 1 in the space.

diff --git a/index.xhtml b/index.xhtml --- a/index.xhtml +++ b/index.xhtml @@ -11,6 +11,7 @@

Opcodes