annotate 06/ecl.xhtml @ 3:bd0f1253691d

Add documentation of ECL format.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 06 Aug 2011 13:42:40 +0200
parents
children b3644dff344c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
1 <?xml version="1.0" encoding="utf-8"?>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
2 <?xml-stylesheet type="text/css" href="../style.css"?>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
3 <!DOCTYPE html>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
5 <head>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
6 <title>ECL format</title>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
7 </head>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
8 <body>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
9 <h1>ECL format</h1>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
10
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
11 <h2>Header</h2>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
12 <pre>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
13 typedef struct {
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
14 uint32_t sub_count;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
15 uint32_t main_offset;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
16 uint32_t padding[2]; // Always 0.
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
17 uint32_t subs_offsets[sub_count];
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
18 } thecl06_header_t;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
19 </pre>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
20
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
21
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
22 <h2>Sub</h2>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
23 <p>Starting at 0x10.<br/>They describe the appearance and comportment of a certain type of enemy</p>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
24 <p>Ends with frame_num = 0xffffffff and opcode = 0xffff, for a size of 0xc (the minimum) and default masks.</p>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
25 <p>Parameters are dependants of the opcode.</p>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
26 <pre>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
27 typedef struct {
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
28 uint32_t frame_num;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
29 uint16_t <a href="ecl.xml">opcode</a>;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
30 uint16_t size; // Never less than 0xc.
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
31 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.
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
32 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.
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
33 unsigned char params[size-0xc];
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
34 } thecl06_sub_t;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
35 </pre>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
36
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
37
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
38 <h2>Main</h2>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
39 <p>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).<br/>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
40 The frame_num must greater than or equal to the previous, or the instruction will be skipped.<br/>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
41 The parsing ends when frame_num is 0xffff.</p>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
42 <pre>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
43 typedef struct {
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
44 uint16_t frame_num;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
45 uint16_t unused1;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
46 uint16_t unused2;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
47 uint16_t size;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
48 uint8_t arguments[size-8];
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
49 } thecl_main_instr_t;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
50 </pre>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
51
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
52 <p>Most present instruction, that pops an enemy.</p>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
53 <pre>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
54 typedef struct {
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
55 uint16_t time;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
56 uint16_t sub; // Sub function to use.
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
57 uint16_t <a href="#type">type</a>;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
58 uint16_t size; // Really the size of the instruction. NOT ignored by the game.
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
59 float x;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
60 float y;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
61 float z; // Unused, always 0.
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
62 int16_t resistance; // From 0 to 0x7fff; greater is equal to 0.
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
63 uint16_t unknown1;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
64 uint16_t unknown2;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
65 uint16_t unknown3;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
66 } thecl_enemy_t;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
67 </pre>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
68
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
69 <p>Unknown, used only at the end of each stage.</p>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
70 <pre>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
71 typedef struct {
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
72 uint16_t time;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
73 uint16_t sub; // always 0.
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
74 uint16_t <a href="#type">type</a>; // always 0xa.
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
75 uint16_t size;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
76 float unused1; // always 0.
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
77 float unused2; // always 0.
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
78 } thecl_other1_t;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
79 </pre>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
80
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
81 <p>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).</p>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
82 <pre>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
83 typedef struct {
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
84 uint16_t time;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
85 uint16_t sub; // always 0.
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
86 uint16_t <a href="#type">type</a>;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
87 uint16_t size;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
88 } thecl_other2_t;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
89 </pre>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
90
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
91 <h3 id="type">Type</h3>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
92 <p>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.</p>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
93 <style type="text/css">
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
94 li.used {
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
95 font-weight: bold;
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
96 }
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
97 </style>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
98 <ol start="0">
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
99 <li class="used">normal enemy</li>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
100 <li>normal enemy</li>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
101 <li class="used">mirrored enemy</li>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
102 <li>mirrored enemy</li>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
103 <li class="used">normal enemy</li>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
104 <li>normal enemy</li>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
105 <li class="used">mirrored enemy</li>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
106 <li>mirrored enemy</li>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
107 <li class="used">starts the msg (which?)</li>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
108 <li class="used">nothing?</li>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
109 <li class="used">crash!?</li>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
110 <li>nothing?</li>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
111 <li class="used">nothing?</li>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
112 etc.
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
113 </ol>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
114 </body>
bd0f1253691d Add documentation of ECL format.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
115 </html>