Format reference/ecl10

This one was originally posted at the Touhou Toolkit homepage, but was migrated due to the lack of a public editing functionality there.

0
Takes no parameters.

1
Takes no parameters.

A return instruction.

10
Takes no parameters.

A return instruction.

11
Calls a subroutine and passes it a number of parameters.

The parameters have a special representation in the data files: a type indicator, and then the data value. The data value can be either an integer or a float. The type indicator can indicate three things,


 * 1) That the data is of float type. (0x6666)
 * 2) That the data is of integer type, but is used as a float type. (0x6669)
 * 3) That the data is of integer type. (0x6969)

In the current syntax this is represented by prefixing the data with either (int) or (float).

The parameters seem to end up on the stack of the called subroutine.

12
Jumps to another instruction. The offset is calculated by subtracting the location of the current instruction from the location of the target instruction. Labels can be used to calculate this automatically.

The current time is also changed.

13
Jumps when the top of the arithmetic stack is equal to 0.

Refer to instruction 12.

14
Jumps when the top of the arithmetic stack is not equal to 0.

Refer to instruction 12.

15
Refer to instruction 11.

16
Runs a subroutine in the background and assigns it the given slot.

17
Terminates a subroutine launched with instruction 16

21
Takes no parameters.

40
Sets up the stack which is used for local variables and passed parameters. The stack size should be a multiple of four.

42
Pushes a value onto the arithmetic stack.

43
Stores the value at the top of the arithmetic stack at the given stack offset.

44
Pushes a value onto the arithmetic stack. Might be intended for floats.

45
Stores the value at the top of the arithmetic stack at the given stack offset. Might be intended for floats.

50
Takes no parameters.

Addition operator.

51
Takes no parameters.

Addition operator. Might be intended for floats.

52
Takes no parameters.

Subtraction operator.

53
Takes no parameters.

Subtraction operator. Might be intended for floats.

54
Takes no parameters.

Multiplication operator.

55
Takes no parameters.

Multiplication operator. Might be intended for floats.

56
Takes no parameters.

Division operator.

57
Takes no parameters.

Division operator. Might be intended for floats.

58
Takes no parameters.

Modulo operator.

59
Takes no parameters.

Equality operator.

61
Takes no parameters.

Inequality operator.

63
Takes no parameters.

Less-than operator.

64
Takes no parameters.

Less-than operator. Might be intended for floats.

65
Takes no parameters.

Less-than-or-equal-to operator.

67
Takes no parameters.

Greater-than operator.

68
Takes no parameters.

Greater-than operator. Might be intended for floats.

69
Takes no parameters.

Greater-than-or-equal-to operator.

70
Takes no parameters.

Greater-than-or-equal-to operator. Might be intended for floats.

71
Takes no parameters.

Boolean not operator.

73
Takes no parameters.

Boolean or operator.

74
Takes no parameters.

Boolean and operator.

78
Decrements the value passed and pushes its old value onto the arithmetic stack.

79
Takes no parameters.

83
Wait the specified time before continuing.

85
Takes no parameters.

256
Create an "object", i.e. an enemy or something that can move around. The subroutine is called to set up and control the object.

Items dropped (0 for nothing):


 * 1) Small powerup.
 * 2) Point item.
 * 3) Large green star.
 * 4) Large powerup.
 * 5) Full-score point item.
 * 6) Full-power powerup.
 * 7) 1-up.
 * 8) An autocollecting yellow orb.
 * 9) Small green star.

257
No differences from instruction 256 have been observed.

258
Selects which ANM file to use for further animation operations. 1 refers to the first file listed, and 2 to the second. 0 appears to have some special meaning.

259
Selects an animation for an object. The animation indices are listed in the ANM files, and contain their own animation script.

The first parameter might allow for attaching several sprites to an object.

260
No differences from instruction 256 have been observed.

261
No differences from instruction 256 have been observed.

262
Similar to instruction 257.

265
No differences from instruction 256 have been observed.

266
No differences from instruction 256 have been observed.

267
No differences from instruction 256 have been observed.

268
No differences from instruction 256 have been observed.

269
Related to animation.

270
Similar to instruction 256. Adds a third float parameter.

280
Instantly moves an object to the specified position.

281
Moves the object to the specified position in the specified time.

The movement mode controls how the object moves to the target position, but the time it takes is the same. 0 is normal movement, 1 accelerates and stops suddenly, 4 moves in an interpolated manner.

284
Sets movement direction and speed for an object. The speed might be pixels per frame.

285
Similar to instruction 285. Maybe it is used to change from one movement to another.

294
Takes no parameters.

320
Sets up a hitbox for an object. It is not disabled by setting both parameters to 0.0f.

321
Sets up a killbox (the area which kills the player) for an object. It can be disabled by setting both parameters to 0.0f.

322
Appears to set flags for objects, such as if it has a hitbox or not.

325
Takes no parameters.

Related to item drops.

326
Takes no parameters.

Clears the list of items to be dropped.

327
Sets up which items are dropped when this object is defeated (in addition to the one specified by the creation instruction). Can be called several times for more items.

328
Sets up an area in which items are dropped.

329
Takes no parameters.

Drops all loaded items.

331
Changes the hit points of an object.

332
Enables or disables "boss mode" (hit point bar, and name display). Enabled with 0 and disabled with -1.

333
Takes no parameters.

334
Sets up a condition for a boss. For example the specified subroutine can be called after a period of time has passed. It can also be used for hit points.

335
Makes the object invulnerable for the specified period of time.

338
Initiates dialogue. The first dialogue has index 0.

339
Takes no parameters.

340
Takes no parameters.

Wait until all active subroutines have returned.

342
Set up a spell card. One is added to the spell card number to get the number displayed in-game.

343
Takes no parameters.

345
Takes no parameters.

357
No differences from instruction 342 have been observed.

359
No differences from instruction 342 have been observed.

360
Sets the number of spell cards remaining, as indicated by a series of stars. Requires boss mode for the stars to show up.

362
Takes no parameters.

363
Takes no parameters.

365
Takes no parameters.

366
Enables or disables bomb-invulnerability for an object. Set the flag to 1 to enable or 0 to disable it. The object's animation is changed as specified for the duration of the bomb.

400
Might initialize a new bullet type. Eight different bullet types have been observed.

401
Fires a bullet of the specified type.

402
Sets the bullet type appearance.

403
Makes bullets spawn in a position offset from the object which fires them.

406
The bullet count parameter can be used to fire walls or circles of bullets The extra parameter fires additional bullets, each at half the speed of the previous.

409
Might set up random bullet attributes.

410
Takes no parameters.