Mercurial > touhou-doc
changeset 5:b3644dff344c
Way too much changes. :/
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Mon, 22 Aug 2011 20:30:51 +0200 |
parents | 617e7760fd9f |
children | 578e67aa3c03 |
files | 06/ecl.xhtml 06/ecl.xml 10/ecl.xml html.xsl |
diffstat | 4 files changed, 495 insertions(+), 414 deletions(-) [+] |
line wrap: on
line diff
--- a/06/ecl.xhtml +++ b/06/ecl.xhtml @@ -29,7 +29,7 @@ typedef struct { uint16_t <a href="ecl.xml">opcode</a>; 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. + uint16_t param_mask; // If the last param is a stack, the number of bits at 0 indicates the number of items in the stack. unsigned char params[size-0xc]; } thecl06_sub_t; </pre> @@ -60,9 +60,12 @@ typedef struct { float y; float z; // Unused, always 0. int16_t resistance; // From 0 to 0x7fff; greater is equal to 0. + int16_t object_dropped; // Between -2 and 2. + // 0000 to 00ff: power + // ff00 to ffff: random + // other: nothing uint16_t unknown1; - uint16_t unknown2; - uint16_t unknown3; + uint16_t unknown2; // 0 for normal enemies; 1 for mid-boss; 3 or 4 for boss. } thecl_enemy_t; </pre>
--- a/06/ecl.xml +++ b/06/ecl.xml @@ -3,91 +3,153 @@ <?xml-stylesheet type="text/css" href="../style.css"?> <!DOCTYPE html> <opcodes xmlns="urn:opcodes:description"> - <title>ECL opcodes</title> + <title>ECL Sub format</title> + + <text> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h2>Lvalues and Rvalues / direct vs memory indirect addressing</h2> + <p>In EoSD, most 32-bits arguments passed to instructions may be actual values or variable/register indexes.<br/> + [TODO: verify] values inferior to -10000 are variable/register indexes, whereas values superior to this are actual values.<br/> + Values passed through variable/register indexes are Lvalues, other values are not. Some instructions require some of their operands to be Lvalues.<br/> + Another way to look at it would be C++-style references. <code>ins_20</code> would then be <code>ins_20(int32 &value, float a, float b);</code></p> + + <p>Note: variables seems to be somehow superposed to the enemy's state structure, with <code>-10015 = x</code> and <code>-10016 = y</code>.</p> + + + <h2>Accessing values</h2> + <p>[TODO: verify] How the game accesses values passed as argument is as follows:<br/> + TYPE is the type of the argument (float, int32, ...):</p> + +<pre>if ((TYPE) argument < -10000) + return *(TYPE*) &variables[(int)(-10000-(TYPE) argument)]; +else + return (TYPE) argument;</pre> + + <h2>Variables</h2> + <p>Only variables in the range [-10001, -10025] without -10014, -10020 and -10023 are used in the game.</p> + + <h3>Local variables</h3> + <table> + <tr><th>Number</th><th>Type</th></tr> + <tr><td>-10001</td><td>int</td></tr> + <tr><td>-10002</td><td>int</td></tr> + <tr><td>-10003</td><td>int</td></tr> + <tr><td>-10004</td><td>int</td></tr> + <tr><td>-10005</td><td>float</td></tr> + <tr><td>-10006</td><td>float</td></tr> + <tr><td>-10007</td><td>float</td></tr> + <tr><td>-10008</td><td>float</td></tr> + <tr><td>-10009</td><td>int</td></tr> + <tr><td>-10010</td><td>int</td></tr> + <tr><td>-10011</td><td>int</td></tr> + <tr><td>-10012</td><td>int</td></tr> + </table> + + <h3>Special variables</h3> + <table> + <tr><th>Number</th><th>Type</th> <th>Name</th> <th>RW/RO</th> <th>Notes</th></tr> + <tr><td>-10013</td><td>int</td> <td>rank</td> <td>ro</td> <td></td></tr> + <tr><td>-10014</td><td>int</td> <td>difficulty</td> <td>ro</td> <td>Unused.</td></tr> + <tr><td>-10015</td><td>float</td> <td>x</td> <td>rw</td> <td></td></tr> + <tr><td>-10016</td><td>float</td> <td>y</td> <td>rw</td> <td></td></tr> + <tr><td>-10017</td><td>float</td> <td>z</td> <td>rw</td> <td></td></tr> + <tr><td>-10018</td><td>float</td> <td>player_x</td> <td>ro</td> <td></td></tr> + <tr><td>-10019</td><td>float</td> <td>player_y</td> <td>ro</td> <td></td></tr> + <tr><td>-10020</td><td>float</td> <td></td> <td>ro</td> <td>Unused.</td></tr> + <tr><td>-10021</td><td>float</td> <td>enemy_player_angle</td> <td>ro</td> <td></td></tr> + <tr><td>-10022</td><td>int</td> <td>last_frame</td> <td>rw</td> <td></td></tr> + <tr><td>-10023</td><td>float</td> <td>enemy_player_distance</td><td>ro</td><td>Unused.</td></tr> + <tr><td>-10024</td><td>int</td> <td>life</td> <td>rw</td> <td></td></tr> + <tr><td>-10025</td><td>int</td> <td>player</td> <td>ro</td> <td>0 = ReimuA, 1 = ReimuB, 2 = MarisaA, 3 = MarisaB</td></tr> + </table> + + <h2>Opcodes</h2> + </div> + </text> <op> <num>0</num> - <name>return</name> - <desc>Returns from the current function.</desc> + <name>noop</name> + <desc>Do nothing.</desc> </op> <op> <num>1</num> - <name>return</name> + <name>delete</name> <params> - <param type="S" values="0"></param> + <param type="S" values="0">Unknown</param> </params> - <desc>Always at the end of the function. Often after a very long amount of time, like 10000 frames.</desc> + <desc>Delete the sprite and perhaps free the memory used.</desc> </op> <op> <num>2</num> - <name></name> + <name>relative_jump</name> <params> - <param type="S" min="0" max="360"></param> - <param type="S" min="-2032" max="632"></param> + <param type="S" name="new_frame" unit="frame" values="0 to 360"/> + <param type="S" name="relative_offset" unit="bytes" values="-2032 to 632">Starting from the start of the current opcode.</param> </params> - <desc></desc> + <desc>Unconditionally jump to relative_offset with new frame counter. Used as a while.</desc> </op> <op> <num>3</num> - <name></name> + <name>relative_jump_ex</name> <params> - <param type="S" min="0" max="532"></param> - <param type="S" min="-1376" max="-12"></param> - <param type="S" min="-10011" max="-10009"></param> + <param type="S" name="new_frame" unit="frame" values="0 to 532"/> + <param type="S" name="relative_offset" unit="bytes" values="-1376 to -12"/> + <param type="S" name="counter_id" unit="var_id" var="must" values="-10011 to -10009"/> </params> - <desc></desc> + <desc>If the counter is non-null, jump to relative_offset with new frame counter, and decrease counter counter_id by 1. Used as a for.</desc> </op> <op> <num>4</num> - <name></name> + <name>set_int</name> <params> - <param type="S" min="-10012" max="-10001"></param> - <param type="S" min="-10021, 0" max="-10005, 300"></param> + <param type="S" name="variable" unit="var_id" var="must" values="-10012 to -10001"/> + <param type="S" name="value" var="can" values="-10005 to -10021, 0 to 300"/> </params> - <desc></desc> + <desc>Assign a value to the variable. Sometimes, value can be another variable.</desc> </op> <op> <num>5</num> - <name></name> + <name>set_float</name> <params> - <param type="S"></param> - <param type="f"></param> + <param type="S" name="variable" unit="var_id" var="must" values="-10005 to -10017"/> + <param type="f" name="value" var="can" values="-12.0f to 460.0f"/> </params> - <desc></desc> + <desc>Like <ref>4</ref>, but with a float as value.</desc> </op> <op> <num>6</num> - <name></name> + <name>set_random_int</name> <params> - <param type="S" values="-10001"></param> - <param type="S" values="2 or 3"></param> + <param type="S" name="variable" unit="var_id" var="must" values="-10001"/> + <param type="S" name="value" var="can" values="2, 3"/> </params> - <desc></desc> + <desc>Assign an integer in the [0, value) range to the variable.</desc> </op> <op> <num>8</num> - <name></name> + <name>set_random_float</name> <params> - <param type="S"></param> - <param type="f"></param> + <param type="S" name="variable" unit="var_id" var="must"/> + <param type="f" name="maximum" var="can" values="1.0f to 2pi to 384.0f"/> </params> - <desc></desc> + <desc>Like <ref>6</ref>, but with a float as value.</desc> </op> <op> <num>9</num> <name></name> <params> - <param type="S"></param> - <param type="f"></param> - <param type="f"></param> + <param type="S"/> + <param type="f"/> + <param type="f"/> </params> <desc></desc> </op> @@ -96,7 +158,7 @@ <num>10</num> <name></name> <params> - <param type="S" values="-10005"></param> + <param type="S" var="can/must" values="-10005"/> </params> <desc>Used only one time, in <stage>2</stage>.</desc> </op> @@ -105,9 +167,9 @@ <num>13</num> <name></name> <params> - <param type="S"></param> - <param type="S"></param> - <param type="S"></param> + <param type="S"/> + <param type="S"/> + <param type="S"/> </params> <desc></desc> </op> @@ -116,9 +178,9 @@ <num>14</num> <name></name> <params> - <param type="S"></param> - <param type="S"></param> - <param type="S"></param> + <param type="S"/> + <param type="S"/> + <param type="S"/> </params> <desc></desc> </op> @@ -127,9 +189,9 @@ <num>15</num> <name></name> <params> - <param type="S" values="-10001"></param> - <param type="S" values="-10012"></param> - <param type="S" min="1" max="5"></param> + <param type="S" var="can/must" values="-10001"/> + <param type="S" var="can/must" values="-10012"/> + <param type="S" values="1 to 5"/> </params> <desc></desc> </op> @@ -138,9 +200,9 @@ <num>16</num> <name></name> <params> - <param type="S"></param> - <param type="S"></param> - <param type="S"></param> + <param type="S"/> + <param type="S"/> + <param type="S"/> </params> <desc></desc> </op> @@ -149,9 +211,9 @@ <num>17</num> <name></name> <params> - <param type="S"></param> - <param type="S"></param> - <param type="S"></param> + <param type="S" name="variable1?"/> + <param type="S" name="variable2?"/> + <param type="S"/> </params> <desc></desc> </op> @@ -160,40 +222,40 @@ <num>18</num> <name></name> <params> - <param type="S"></param> + <param type="S" name="variable?" var="can/must" values="-10012, -10004, -10002, -10001"/> </params> <desc></desc> </op> <op> <num>20</num> - <name></name> + <name>add</name> <params> - <param type="S"></param> - <param type="f"></param> - <param type="f"></param> + <param type="S" name="variable" unit="var_id" var="must"/> + <param type="f" name="a"/> + <param type="f" name="b"/> </params> - <desc></desc> + <desc>variable = a + b; Warning: a and b will be dereferenced as integers (not converted) if variable is an integer!</desc> </op> <op> <num>21</num> <name></name> <params> - <param type="S"></param> - <param type="f"></param> - <param type="f"></param> + <param type="S" name="variable" unit="var_id" var="must"/> + <param type="f" name="a"/> + <param type="f" name="b"/> </params> - <desc></desc> + <desc>variable = a - b; Warning: a and b will be dereferenced as integers (not converted) if variable is an integer!</desc> </op> <op> <num>23</num> <name></name> <params> - <param type="S"></param> - <param type="f"></param> - <param type="f"></param> + <param type="S"/> + <param type="f"/> + <param type="f"/> </params> <desc></desc> </op> @@ -202,11 +264,11 @@ <num>25</num> <name></name> <params> - <param type="S" values="-10005"></param> - <param type="f"></param> - <param type="f"></param> - <param type="f" values="192.0f"></param> - <param type="f" values="224.0f"></param> + <param type="S" var="can/must" values="-10005"/> + <param type="f"/> + <param type="f"/> + <param type="f" values="192.0f"/> + <param type="f" values="224.0f"/> </params> <desc></desc> </op> @@ -215,27 +277,27 @@ <num>26</num> <name></name> <params> - <param type="S"></param> + <param type="S"/> </params> <desc></desc> </op> <op> <num>27</num> - <name></name> + <name>compare_ints</name> <params> - <param type="S"></param> - <param type="S"></param> + <param type="S" name="a"/> + <param type="S" name="b"/> </params> - <desc></desc> + <desc>Compare a and b, store the result (-1 if a < b, 0 if a == b, 1 if a > b) in the "comparison register".</desc> </op> <op> <num>28</num> <name></name> <params> - <param type="f"></param> - <param type="f"></param> + <param type="f"/> + <param type="f"/> </params> <desc></desc> </op> @@ -244,8 +306,8 @@ <num>29</num> <name></name> <params> - <param type="S"></param> - <param type="S"></param> + <param type="S"/> + <param type="S"/> </params> <desc></desc> </op> @@ -254,28 +316,28 @@ <num>30</num> <name></name> <params> - <param type="S"></param> - <param type="S"></param> + <param type="S"/> + <param type="S"/> </params> <desc></desc> </op> <op> <num>31</num> - <name></name> + <name>relative_jump_if_equal</name> <params> - <param type="S"></param> - <param type="S"></param> + <param type="S" name="new_frame" unit="frame" values="0, 2, 60"/> + <param type="S" name="relative_offset" unit="bytes" values="44, 176, 324">Starting from the start of the current opcode.</param> </params> - <desc></desc> + <desc>Jump if the "comparison register" equals to 0, that is, if the compared values are equal.</desc> </op> <op> <num>32</num> <name></name> <params> - <param type="S" value="120"></param> - <param type="S" value="64"></param> + <param type="S" value="120"/> + <param type="S" value="64"/> </params> <desc>Used only one time in <stage>4</stage></desc> </op> @@ -284,8 +346,8 @@ <num>33</num> <name></name> <params> - <param type="S"></param> - <param type="S"></param> + <param type="S"/> + <param type="S"/> </params> <desc></desc> </op> @@ -294,21 +356,21 @@ <num>34</num> <name></name> <params> - <param type="S"></param> - <param type="S"></param> + <param type="S"/> + <param type="S"/> </params> <desc></desc> </op> <op> <num>35</num> - <name></name> + <name>call</name> <params> - <param type="S"></param> - <param type="S"></param> - <param type="f"></param> + <param type="S" name="function" unit="sub"/> + <param type="S" name="param1"/> + <param type="f" name="param2" values="-0.31415927f to 0.31415927f"/> </params> - <desc></desc> + <desc>Call given sub with -10001 = param1, -10005 = param2</desc> </op> <op> @@ -319,43 +381,43 @@ <op> <num>39</num> - <name></name> + <name>call_if_equal</name> <params> - <param type="S"></param> - <param type="S" values="0"></param> - <param type="S" values="0"></param> - <param type="S"></param> - <param type="S"></param> + <param type="S" name="function" unit="sub"/> + <param type="S" values="0" name="param1"/> + <param type="f" values="0" name="param2"/> + <param type="S" name="a"/> + <param type="S" name="b"/> </params> - <desc></desc> + <desc>Call given sub with -10001 = param1, -10005 = param2 if a == b</desc> </op> <op> <num>43</num> - <name></name> + <name>set_position</name> <params> - <param type="f"></param> - <param type="f"></param> - <param type="S" values="0"></param> + <param type="f" name="x"/> + <param type="f" name="y"/> + <param type="f" name="y" values="0">Ignored</param> </params> - <desc></desc> + <desc>Move the enemy to a new position, using interpolation.</desc> </op> <op> <num>45</num> <name>set_angle_speed</name> <params> - <param type="f">Angle in radians, 0.0f is left, PI/2 is down.</param> - <param type="f">Speed in pixels per frame.</param> + <param type="f" name="angle" unit="radian">0.0f is left, PI/2 is down.</param> + <param type="f" name="speed" unit="pixels/frame"/> </params> <desc>Set the angular trajectory and speed of the enemy.</desc> </op> <op> <num>46</num> - <name>set_angle</name> + <name>set_rotation_speed</name> <params> - <param type="f">The new angle, in radians.</param> + <param type="f" name="speed" unit="radian/frame"/> </params> <desc>Change the angular trajectory of the enemy. It continues to turn until this function is called again.</desc> </op> @@ -364,7 +426,7 @@ <num>47</num> <name>set_speed</name> <params> - <param type="f">The new speed.</param> + <param type="f" name="speed" unit="pixels/frame"/> </params> <desc>Change the speed of the enemy.</desc> </op> @@ -373,7 +435,7 @@ <num>48</num> <name>set_acceleration</name> <params> - <param type="f">New step.</param> + <param type="f" name="step" unit="pixels/frame"/> </params> <desc>Change the speed of the enemy step by step, at each frame.</desc> </op> @@ -382,8 +444,8 @@ <num>49</num> <name>set_random_?</name> <params> - <param type="f" values="0.7853982f">The new angle?.</param> - <param type="f" values="2.3561945f">Some deplacement?.</param> + <param type="f" values="0.7853982f">The new angle?</param> + <param type="f" values="2.3561945f">Some deplacement?</param> </params> <desc>Used only five times, in <stage>2</stage>. Seems to involve some randomness.</desc> </op> @@ -392,29 +454,29 @@ <num>50</num> <name></name> <params> - <param type="f" values="PI (3.1415927f)"></param> - <param type="f" values="PI (3.1415927f)"></param> + <param type="f" values="PI (3.1415927f)"/> + <param type="f" values="PI (3.1415927f)"/> </params> <desc></desc> </op> <op> <num>51</num> - <name></name> + <name>set_speed_forward_player</name> <params> - <param type="S" value="0"></param> - <param type="f" value="2.4f"></param> + <param type="S" value="0">Ignored</param> + <param type="f" name="speed" unit="pixels/frame"/> </params> - <desc>Used only one time in <stage>2</stage></desc> + <desc>Sets the speed of the enemy, and change its direction to where the player is at that frame. Used only one time in <stage>2</stage>.</desc> </op> <op> <num>52</num> <name></name> <params> - <param type="S"></param> - <param type="f"></param> - <param type="f"></param> + <param type="S"/> + <param type="f"/> + <param type="f"/> </params> <desc></desc> </op> @@ -423,155 +485,155 @@ <num>56</num> <name></name> <params> - <param type="S"></param> - <param type="f"></param> - <param type="f"></param> - <param type="S" values="0"></param> + <param type="S"/> + <param type="f"/> + <param type="f"/> + <param type="S" values="0"/> </params> <desc>Used only two times in <stage>7</stage></desc> </op> <op> <num>57</num> - <name></name> + <name>move_to</name> <params> - <param type="S"></param> - <param type="f"></param> - <param type="f"></param> - <param type="S" values="0"></param> + <param type="S" name="duration" unit="frames"/> + <param type="f" name="x" unit="pixels"/> + <param type="f" name="y" unit="pixels"/> + <param type="f" name="z" unit="pixels" values="0.0f">Ignored</param> </params> - <desc></desc> + <desc>Move the enemy to the new position in this amount of frames.</desc> </op> <op> <num>59</num> - <name></name> + <name>move_to2</name> <params> - <param type="S"></param> - <param type="f" values="192.0f"></param> - <param type="f"></param> - <param type="S" values="0"></param> + <param type="S" name="duration" unit="frames"/> + <param type="f" name="x" unit="pixels" values="192.0f"/> + <param type="f" name="y" unit="pixels" values="-64.0f, 150.0f"/> + <param type="f" name="z" unit="pixels" values="0.0f"/> </params> - <desc></desc> + <desc>Move the enemy to the new position in this amount of frames. TODO: how it is different from move_to?</desc> </op> <op> <num>61</num> - <name></name> + <name>stop_in</name> <params> - <param type="S"></param> + <param type="S" name="duration" unit="frames"/> </params> - <desc></desc> + <desc>keep a straight trajectory with decelerating speed to stop in duration frames.</desc> </op> <op> <num>63</num> <name></name> <params> - <param type="S"></param> + <param type="S"/> </params> <desc></desc> </op> <op> <num>65</num> - <name></name> + <name>set_screen_box</name> <params> - <param type="f"></param> - <param type="f"></param> - <param type="f"></param> - <param type="f"></param> + <param type="f" name="x1" unit="pixels"/> + <param type="f" name="y1" unit="pixels"/> + <param type="f" name="x2" unit="pixels"/> + <param type="f" name="y2" unit="pixels"/> </params> - <desc></desc> + <desc>Disallow an enemy to quit the defined rectangle. If it goes outside it is destroyed. By default this rectangle is the displayed screen.</desc> </op> <op> <num>66</num> - <name></name> - <desc></desc> + <name>clear_screen_box</name> + <desc>Remove the limit set in <ref>65</ref>.</desc> </op> <op> <num>67</num> <name>set_bullet_attributes</name> <params> - <param type="s">Bullet sprite.</param> - <param type="s">Launch sprite.</param> - <param type="S">Number of bullets per salvo.</param> - <param type="S">Number of salvos.</param> - <param type="f">Speed.</param> - <param type="f">Speed2?.</param> - <param type="f">Launch angle.</param> - <param type="f">Angle between two bullets of a same salvo.</param> - <param type="S">(>= 64, freezed).</param> + <param type="s" name="bullet" unit="script"/> + <param type="s" name="launch" unit="script"/> + <param type="S" name="bullets_per_shot"/> + <param type="S" name="number_of_shots"/> + <param type="f" name="speed" unit="pixels/frame"/> + <param type="f"/> + <param type="f" name="launch_angle" unit="radian"/> + <param type="f" name="angle_between_two_bullets" unit="radian"/> + <param type="S" name="flags">>= 64, freezed</param> </params> - <desc>Modify the attributes of the next enemy attack</desc> + <desc>Modify the attributes of the next enemy attack. Directs it to the player.</desc> </op> <op> <num>68</num> <name></name> <params> - <param type="s"></param> - <param type="s"></param> - <param type="S"></param> - <param type="S"></param> - <param type="f"></param> - <param type="f"></param> - <param type="f"></param> - <param type="f"></param> - <param type="S"></param> + <param type="s"/> + <param type="s"/> + <param type="S"/> + <param type="S"/> + <param type="f"/> + <param type="f"/> + <param type="f"/> + <param type="f"/> + <param type="S"/> </params> - <desc>Supposedly the same as <ref>67</ref>.</desc> + <desc>The same as <ref>67</ref>, except the shot is directed to the right of the enemy.</desc> </op> <op> <num>69</num> <name></name> <params> - <param type="s"></param> - <param type="s"></param> - <param type="S"></param> - <param type="S"></param> - <param type="f"></param> - <param type="f"></param> - <param type="f"></param> - <param type="f"></param> - <param type="S"></param> + <param type="s"/> + <param type="s"/> + <param type="S"/> + <param type="S"/> + <param type="f"/> + <param type="f"/> + <param type="f"/> + <param type="f"/> + <param type="S"/> </params> - <desc></desc> + <desc>No visible difference from <ref>67</ref>.</desc> </op> <op> <num>70</num> <name></name> <params> - <param type="s"></param> - <param type="s"></param> - <param type="S"></param> - <param type="S"></param> - <param type="f"></param> - <param type="f"></param> - <param type="f"></param> - <param type="f"></param> - <param type="S"></param> + <param type="s"/> + <param type="s"/> + <param type="S"/> + <param type="S"/> + <param type="f"/> + <param type="f"/> + <param type="f"/> + <param type="f"/> + <param type="S"/> </params> - <desc></desc> + <desc>No visible difference from <ref>68</ref>.</desc> </op> <op> <num>71</num> <name></name> <params> - <param type="s"></param> - <param type="s"></param> - <param type="S"></param> - <param type="S"></param> - <param type="f"></param> - <param type="f"></param> - <param type="S"></param> - <param type="S"></param> - <param type="S"></param> + <param type="s"/> + <param type="s"/> + <param type="S"/> + <param type="S"/> + <param type="f"/> + <param type="f"/> + <param type="S"/> + <param type="S"/> + <param type="S"/> </params> <desc></desc> </op> @@ -580,15 +642,15 @@ <num>74</num> <name></name> <params> - <param type="s"></param> - <param type="s"></param> - <param type="S"></param> - <param type="S"></param> - <param type="f"></param> - <param type="f"></param> - <param type="S"></param> - <param type="S"></param> - <param type="S"></param> + <param type="s"/> + <param type="s"/> + <param type="S"/> + <param type="S"/> + <param type="f"/> + <param type="f"/> + <param type="S"/> + <param type="S"/> + <param type="S"/> </params> <desc>Used only one time, in <stage>3</stage>.</desc> </op> @@ -597,24 +659,24 @@ <num>75</num> <name></name> <params> - <param type="s"></param> - <param type="s"></param> - <param type="S"></param> - <param type="S"></param> - <param type="f"></param> - <param type="f"></param> - <param type="f"></param> - <param type="f"></param> - <param type="S"></param> + <param type="s"/> + <param type="s"/> + <param type="S"/> + <param type="S"/> + <param type="f"/> + <param type="f"/> + <param type="f"/> + <param type="f"/> + <param type="S"/> </params> - <desc></desc> + <desc>Seems like <ref>68</ref>, but with some differences in speed.</desc> </op> <op> <num>76</num> <name></name> <params> - <param type="S"></param> + <param type="S"/> </params> <desc></desc> </op> @@ -623,30 +685,30 @@ <num>77</num> <name>bullet_interval</name> <params> - <param type="S">In frames.</param> + <param type="S" name="interval" unit="frames"/> </params> - <desc>Time between two salvos.</desc> + <desc>Time between two shots.</desc> </op> <op> <num>78</num> - <name></name> - <desc>Seems related to attacks, but removing them doesn't change anything...</desc> + <name>delay_attack</name> + <desc>If present, delays the first attack of the amount of frames defined by <ref>77</ref>. If not, the enemy shoots instantly after setting the bullets attributes.</desc> </op> <op> <num>79</num> - <name></name> - <desc>Seems related to attacks, but removing them doesn't change anything...</desc> + <name>no_delay_attack</name> + <desc></desc> </op> <op> <num>81</num> <name>bullet_launch_offset</name> <params> - <param type="f">x offset.</param> - <param type="f">y offset.</param> - <param type="S" values="0"></param> + <param type="f" name="x" unit="pixels"/> + <param type="f" name="y" unit="pixels"/> + <param type="f" name="z" unit="pixels" values="0">Ignored</param> </params> <desc>Change the offset of the launch of bullets.</desc> </op> @@ -655,14 +717,14 @@ <num>82</num> <name></name> <params> - <param type="S"></param> - <param type="S"></param> - <param type="S"></param> - <param type="S"></param> - <param type="f"></param> - <param type="f"></param> - <param type="f" values="-1.0f"></param> - <param type="f" values="-1.0f"></param> + <param type="S"/> + <param type="S"/> + <param type="S"/> + <param type="S"/> + <param type="f"/> + <param type="f"/> + <param type="f" values="-1.0f"/> + <param type="f" values="-1.0f"/> </params> <desc></desc> </op> @@ -670,36 +732,36 @@ <op> <num>83</num> <name></name> - <desc></desc> + <desc>No-op? Doesn't seem to change anything.</desc> </op> <op> <num>84</num> <name></name> <params> - <param type="S"></param> + <param type="S"/> </params> <desc></desc> </op> <op> <num>85</num> - <name></name> + <name>laser</name> <params> - <param type="s"></param> - <param type="s"></param> - <param type="f"></param> - <param type="S"></param> - <param type="f"></param> - <param type="f"></param> - <param type="f"></param> - <param type="f"></param> - <param type="S"></param> - <param type="S"></param> - <param type="S"></param> - <param type="S"></param> - <param type="S"></param> - <param type="S" values="0"></param> + <param type="s"/> + <param type="s"/> + <param type="f"/> + <param type="S"/> + <param type="f"/> + <param type="f"/> + <param type="f"/> + <param type="f"/> + <param type="S"/> + <param type="S"/> + <param type="S"/> + <param type="S"/> + <param type="S"/> + <param type="S" values="0"/> </params> <desc></desc> </op> @@ -708,51 +770,51 @@ <num>86</num> <name></name> <params> - <param type="s"></param> - <param type="s"></param> - <param type="f"></param> - <param type="f"></param> - <param type="S"></param> - <param type="f"></param> - <param type="f"></param> - <param type="f"></param> - <param type="S"></param> - <param type="S"></param> - <param type="S"></param> - <param type="S"></param> - <param type="S"></param> - <param type="S" values="0"></param> + <param type="s"/> + <param type="s"/> + <param type="f"/> + <param type="f"/> + <param type="S"/> + <param type="f"/> + <param type="f"/> + <param type="f"/> + <param type="S"/> + <param type="S"/> + <param type="S"/> + <param type="S"/> + <param type="S"/> + <param type="S" values="0"/> </params> <desc></desc> </op> <op> <num>87</num> - <name></name> + <name>set_upcoming_id</name> <params> - <param type="S"></param> + <param type="S" name="laser" unit="laser_id"/> </params> - <desc></desc> + <desc>Sets upcoming laser to a given id, in order to manipulate it later.</desc> </op> <op> <num>88</num> - <name></name> + <name>alter_laser_angle</name> <params> - <param type="S"></param> - <param type="f"></param> + <param type="S" name="laser" unit="laser_id"/> + <param type="f" name="delta" unit="radian"/> </params> - <desc></desc> + <desc>Adds delta to the laser's angle.</desc> </op> <op> <num>90</num> <name></name> <params> - <param type="S"></param> - <param type="S" values="0"></param> - <param type="S" values="0"></param> - <param type="S" values="0"></param> + <param type="S" values="0 to 3"/> + <param type="S" values="0"/> + <param type="S" values="0"/> + <param type="S" values="0"/> </params> <desc>Used only one time, in <stage>7</stage>.</desc> </op> @@ -761,7 +823,7 @@ <num>92</num> <name></name> <params> - <param type="S"></param> + <param type="S"/> </params> <desc></desc> </op> @@ -770,9 +832,9 @@ <num>93</num> <name>set_spellcard</name> <params> - <param type="s"></param> - <param type="s">The number of the spellcard, as it will be counted in the captured spellcards.</param> - <param type="z">The name of the spellcard, in SHIFT_JIS.</param> + <param type="s"/> + <param type="s" name="number">As in the captured spellcards screen, minus 1.</param> + <param type="z" name="name">In SHIFT_JIS</param> </params> <desc></desc> </op> @@ -787,13 +849,13 @@ <num>95</num> <name></name> <params> - <param type="S"></param> - <param type="f"></param> - <param type="f"></param> - <param type="f"></param> - <param type="s"></param> - <param type="s"></param> - <param type="S"></param> + <param type="S"/> + <param type="f"/> + <param type="f"/> + <param type="f"/> + <param type="s"/> + <param type="s"/> + <param type="S"/> </params> <desc></desc> </op> @@ -806,32 +868,32 @@ <op> <num>97</num> - <name>set_enemy_sprite</name> + <name>set_enemy_anim</name> <params> - <param type="S" min="0" max="165">Sprite number.</param> + <param type="S" name="anim" unit="script"/> </params> <desc>Set a sprite (taken from current anm) for the enemy.</desc> </op> <op> <num>98</num> - <name></name> + <name>set_boss_anims</name> <params> - <param type="s"></param> - <param type="s"></param> - <param type="s"></param> - <param type="s"></param> - <param type="S"></param> + <param type="s" name="default" unit="script"/> + <param type="s" name="far_left" unit="script"/> + <param type="s" name="far_right" unit="script"/> + <param type="s" name="left" unit="script"/> + <param type="S" name="right" unit="script">Perhaps two int16_t instead.</param> </params> - <desc></desc> + <desc>Give a set of animations for a boss deplacements.</desc> </op> <op> <num>99</num> <name></name> <params> - <param type="S"></param> - <param type="S"></param> + <param type="S"/> + <param type="S"/> </params> <desc></desc> </op> @@ -840,158 +902,158 @@ <num>100</num> <name>set_death_anim</name> <params> - <param type="S" values="258, 768, 769">In fact, any 256n+[0-2] works and is the same; other values make the program crash.</param> + <param type="S" name="anim" unit="script" values="768, 769, 258">In fact, any 256n+[0-2] works and is the same; other values make the program crash.</param> </params> <desc>When the enemy is destroyed, the animation used.</desc> </op> <op> <num>101</num> - <name></name> + <name>set_boss_mode</name> <params> - <param type="S" values="-1, 0"></param> + <param type="S" values="-1, 0">Unknown meaning, seems to be 0 for mid-boss and -1 for real boss.</param> </params> - <desc></desc> + <desc>Activates the boss mode, with her life bar and lives number displayed on the top. Doesn't do anything before calling <ref>126</ref>.</desc> </op> <op> <num>102</num> <name></name> <params> - <param type="S"></param> - <param type="f"></param> - <param type="f"></param> - <param type="f"></param> - <param type="f" values="48.0f"></param> + <param type="S"/> + <param type="f"/> + <param type="f"/> + <param type="f"/> + <param type="f" values="48.0f"/> </params> - <desc></desc> + <desc>Create the "squares" running around Rumia ???</desc> </op> <op> <num>103</num> - <name>set_enemy</name> + <name>set_enemy_hitbox</name> <params> - <param type="f" min="16" max="56">Size of the enemy hitbox.</param> - <param type="f" min="16" max="56"></param> - <param type="f" values="32.0f"></param> + <param type="f" name="width" unit="pixels" values="16 to 56"/> + <param type="f" name="height" unit="pixels" values="16 to 56"/> + <param type="f" name="depth" unit="pixels" values="32.0f">Ignored</param> </params> - <desc>The two last parameters are unknown</desc> + <desc></desc> </op> <op> <num>104</num> <name></name> <params> - <param type="S" values="0, 1"></param> + <param type="S" values="0, 1"/> </params> - <desc></desc> + <desc>noop?</desc> </op> <op> <num>105</num> - <name></name> + <name>set_vulnerable</name> <params> - <param type="S" values="0, 1"></param> + <param type="S" name="x" values="0, 1"/> </params> - <desc></desc> + <desc>if x & 1, the enemy can take damage, else it cannot.</desc> </op> <op> <num>106</num> - <name></name> + <name>play_sound</name> <params> - <param type="S"></param> + <param type="S"/> </params> - <desc></desc> + <desc>Play a sound.</desc> </op> <op> <num>107</num> - <name></name> + <name>set_death_flags</name> <params> - <param type="S"></param> + <param type="S"/> </params> - <desc></desc> + <desc>Control what to do when life falls to zero. 0 = normal, 1 = don't clean the sprite, 2 = don't die, 4 (unused) = don't die and don't drop bonus. These are flags that can be combined.</desc> </op> <op> <num>108</num> - <name></name> + <name>call_when_killed</name> <params> - <param type="S"></param> + <param type="S" name="function" unit="sub"/> </params> - <desc></desc> + <desc>Specify the subroutine to call when the enemy is killed.</desc> </op> <op> <num>109</num> <name></name> <params> - <param type="S"></param> - <param type="S" values="0"></param> + <param type="S"/> + <param type="S" values="0"/> </params> <desc></desc> </op> <op> <num>111</num> - <name></name> + <name>set_life</name> <params> - <param type="S"></param> + <param type="S" name="life"/> </params> - <desc></desc> + <desc>equivalent to <ref>4</ref>(-10024, life)</desc> </op> <op> <num>112</num> <name></name> <params> - <param type="S" values="0, 99999"></param> + <param type="S" values="0, 99999"/> </params> <desc></desc> </op> <op> <num>113</num> - <name></name> + <name>set_boss_lower_life_limit</name> <params> - <param type="S" values="-1, 500-3400"></param> + <param type="S" name="limit" unit="life" values="-1, 500-3400"/> </params> - <desc></desc> + <desc>When enemy's life gets lower or equal to the limit, the callback set by <ref>114</ref> is called.</desc> </op> <op> <num>114</num> - <name></name> + <name>set_boss_callback</name> <params> - <param type="S" values="9-68"></param> + <param type="S" name="callback" unit="sub" values="9-68"/> </params> - <desc></desc> + <desc>Specify the sub to call when the enemy's life gets below a certain amount set by a <ref>113</ref>.</desc> </op> <op> <num>115</num> - <name></name> + <name>set_timeout</name> <params> - <param type="S"></param> + <param type="S" name="timeout" unit="frame"/> </params> - <desc></desc> + <desc>Sets the timeout of the current boss attack.</desc> </op> <op> <num>116</num> <name></name> <params> - <param type="S"></param> + <param type="S"/> </params> - <desc></desc> + <desc>Doesn't seem to do anything. Tried to remove it, use 0, 1, 127, 1023, 1024, 4096 as an argument, nothing... ???</desc> </op> <op> <num>117</num> <name></name> <params> - <param type="S"></param> + <param type="S"/> </params> <desc></desc> </op> @@ -1000,28 +1062,28 @@ <num>118</num> <name></name> <params> - <param type="S"></param> - <param type="S"></param> - <param type="s"></param> - <param type="s"></param> + <param type="S"/> + <param type="S"/> + <param type="s"/> + <param type="s"/> </params> - <desc></desc> + <desc>TODO: "explosion" (dying boss)</desc> </op> <op> <num>119</num> - <name></name> + <name>drop_bonus</name> <params> - <param type="S"></param> + <param type="S" name="number" values="3, 4, 5, 6, 8, 10, 12, 20"/> </params> - <desc></desc> + <desc>Drop a certain number of bonus at the frame it is called. If the power is not max, drop power items, else drop point items.</desc> </op> <op> <num>120</num> <name></name> <params> - <param type="S"></param> + <param type="S"/> </params> <desc></desc> </op> @@ -1030,8 +1092,8 @@ <num>121</num> <name></name> <params> - <param type="S"></param> - <param type="S"></param> + <param type="S"/> + <param type="S"/> </params> <desc></desc> </op> @@ -1040,7 +1102,7 @@ <num>122</num> <name></name> <params> - <param type="S"></param> + <param type="S"/> </params> <desc></desc> </op> @@ -1049,7 +1111,7 @@ <num>123</num> <name></name> <params> - <param type="S"></param> + <param type="S"/> </params> <desc></desc> </op> @@ -1058,7 +1120,7 @@ <num>124</num> <name></name> <params> - <param type="S"></param> + <param type="S"/> </params> <desc></desc> </op> @@ -1071,18 +1133,18 @@ <op> <num>126</num> - <name></name> + <name>set_boss_lives</name> <params> - <param type="S"></param> + <param type="S" name="lives">Can even be negative. :D</param> </params> - <desc></desc> + <desc>Sets the remaining lives of a boss. Should be called at the start of each round.</desc> </op> <op> <num>127</num> <name></name> <params> - <param type="S"></param> + <param type="S"/> </params> <desc></desc> </op> @@ -1091,7 +1153,7 @@ <num>128</num> <name></name> <params> - <param type="S"></param> + <param type="S"/> </params> <desc></desc> </op> @@ -1100,8 +1162,8 @@ <num>129</num> <name></name> <params> - <param type="S"></param> - <param type="S"></param> + <param type="S"/> + <param type="S"/> </params> <desc></desc> </op> @@ -1110,7 +1172,7 @@ <num>130</num> <name></name> <params> - <param type="S"></param> + <param type="S"/> </params> <desc></desc> </op> @@ -1119,12 +1181,12 @@ <num>131</num> <name></name> <params> - <param type="f"></param> - <param type="f"></param> - <param type="S"></param> - <param type="S"></param> - <param type="S"></param> - <param type="S"></param> + <param type="f"/> + <param type="f"/> + <param type="S"/> + <param type="S"/> + <param type="S"/> + <param type="S"/> </params> <desc></desc> </op> @@ -1133,7 +1195,7 @@ <num>132</num> <name></name> <params> - <param type="S"></param> + <param type="S"/> </params> <desc></desc> </op> @@ -1154,7 +1216,7 @@ <num>135</num> <name></name> <params> - <param type="S"></param> + <param type="S"/> </params> <desc></desc> </op>
--- a/10/ecl.xml +++ b/10/ecl.xml @@ -12,13 +12,13 @@ <op> <num>1</num> <name>return</name> - <desc>A <i>return</i> instruction.</desc> + <desc>A return instruction.</desc> </op> <op> <num>10</num> <name>return</name> - <desc>A <i>return</i> instruction.</desc> + <desc>A return instruction.</desc> </op> <op> @@ -35,7 +35,7 @@ <li>That the data is of integer type, but is used as a float type. (0x6669)</li> <li>That the data is of integer type. (0x6969)</li> </ol> - <p>In the current syntax this is represented by prefixing the data with either <strong>(int)</strong> or <strong>(float)</strong>.</p> + <p>In the current syntax this is represented by prefixing the data with either (int) or (float).</p> <p>The parameters seem to end up on the stack of the called subroutine.</p> </desc> </op> @@ -258,7 +258,6 @@ <op> <num>79</num> -<p><i>Takes no parameters.</i> </p> </op> <op>
--- a/html.xsl +++ b/html.xsl @@ -1,36 +1,37 @@ <?xml version="1.0" encoding="utf-8"?> <x:stylesheet version="1.0" + exclude-result-prefixes="o h" xmlns:x="http://www.w3.org/1999/XSL/Transform" xmlns:o="urn:opcodes:description" + xmlns:h="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml"> <x:output encoding="utf-8" indent="yes" method="xml" /> <x:template match="/o:opcodes"> - <x:processing-instruction name="xml-stylesheet">type="text/css" href="../style.css"</x:processing-instruction> <html> <head> <title><x:value-of select="o:title"/></title> </head> <body> <h1><x:value-of select="o:title"/></h1> - <x:apply-templates select="o:text"/> + + <x:for-each select="o:text/h:div/*"> + <x:call-template name="xhtml"/> + </x:for-each> + <x:apply-templates select="o:op"/> </body> </html> </x:template> - <x:template match="o:text"> - <div><x:apply-templates/></div> - </x:template> - <x:template match="o:op"> - <h2 id="i{o:num}"> + <h3 id="i{o:num}"> <x:value-of select="o:num"/> <x:if test="o:name != ''"> - - <small><x:value-of select="o:name"/></small> + <x:text> - </x:text><small><x:value-of select="o:name"/></small> </x:if> - </h2> + </h3> <x:choose> <x:when test="o:params"> @@ -41,16 +42,18 @@ </x:otherwise> </x:choose> - <p><x:apply-templates select="o:desc"/></p> + <x:apply-templates select="o:desc"/> </x:template> <x:template match="o:params"> <table> <tr> <th>Type</th> - <th>Description</th> + <x:if test="o:param/@name"><th>Name</th></x:if> + <x:if test="o:param/@unit"><th>Unit</th></x:if> + <x:if test="o:param/@var"><th>Variable</th></x:if> + <x:if test="o:param != ''"><th>Notes</th></x:if> <x:if test="o:param/@values"><th>Values</th></x:if> - <x:if test="o:param/@min and o:param/@max"><th>Range</th></x:if> </tr> <x:apply-templates select="o:param"/> </table> @@ -59,14 +62,20 @@ <x:template match="o:param"> <tr> <td><x:apply-templates select="@type"/></td> - <td><x:value-of select="."/></td> - <x:if test="@values"> + <x:if test="../o:param/@name"> + <td><x:value-of select="@name"/></td> + </x:if> + <x:if test="../o:param/@unit"> + <td><x:value-of select="@unit"/></td> + </x:if> + <x:if test="../o:param/@var"> + <td><x:value-of select="@var"/></td> + </x:if> + <x:if test="../o:param != ''"> + <td><x:value-of select="."/></td> + </x:if> + <x:if test="../o:param/@values"> <td><x:value-of select="@values"/></td> - <x:if test="../o:param/@min and ../o:param/@max"><td/></x:if> - </x:if> - <x:if test="@min and @max"> - <x:if test="../o:param/@values"><td/></x:if> - <td><x:value-of select="@min"/> to <x:value-of select="@max"/></td> </x:if> </tr> </x:template> @@ -98,16 +107,14 @@ </x:choose> </x:template> - <x:template match="o:p"> - <p><x:apply-templates/></p> + <x:template name="xhtml" match="node() | @*"> + <x:copy> + <x:apply-templates select="node() | @*" /> + </x:copy> </x:template> - <x:template match="o:strong"> - <strong><x:value-of select="."/></strong> - </x:template> - - <x:template match="o:i"> - <i><x:value-of select="."/></i> + <x:template match="o:p"> + <p><x:apply-templates/></p> </x:template> <x:template match="o:br"> @@ -123,10 +130,20 @@ </x:template> <x:template match="o:stage"> - stage <x:value-of select="."/> + <x:text>stage </x:text><x:value-of select="."/> </x:template> <x:template match="o:ref"> - <a href="#i{.}">instruction <x:value-of select="."/></a> + <x:variable name="ref" select="."/> + <a href="#i{$ref}"> + <x:choose> + <x:when test="/o:opcodes/o:op[o:num = $ref]/o:name = ''"> + <x:text>instruction </x:text><x:value-of select="$ref"/> + </x:when> + <x:otherwise> + <x:value-of select="/o:opcodes/o:op[o:num = $ref]/o:name"/> + </x:otherwise> + </x:choose> + </a> </x:template> </x:stylesheet>