-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditops.doc
More file actions
352 lines (227 loc) · 10.5 KB
/
editops.doc
File metadata and controls
352 lines (227 loc) · 10.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
=== Board info labels ===
Use ED1 and one of the following numbers to override some of the labels in
the board info menu:
32 = User flag 0
33 = User flag 1
34 = User flag 2
35 = User flag 3
36 = Board user data
37 = Misc1 of stat 1
38 = Misc2 of stat 1
39 = Misc3 of stat 1
The syntax will be:
ED1 number,string
=== F1-F12 menus ===
Use ED1 and the menu number 1 to 12 at the beginning of this menu. The
number can be 13 to 24 for shifted functions.
The instructions in this menu are of the formats:
ED 0,kind,flag (immediate; no menu)
ED 1,text (menu heading)
ED 2 (end of menu)
ED key,text,kind,flag (menu item)
A menu must be either an immediate command or the first instruction must
be a menu heading; if not immediate then menu items follow and additional
menu headings are also possible, and the end of menu must be last. The
menu items must all have different keys, which are ASCII characters '0'
to '9' and 'A' to 'Z'.
The kind is a element number in the low 8-bits, and the stat number in the
high 8-bits (zero if no stat).
The normal flag is as follows:
* bit7-bit0 = Intended colour of tile
* bit10-bit8 = Mode of colour of tile
* bit11 = If set, add a new stat
* bit12 = If set, use text entry mode
* bit13 = (Reserved)
* bit14 = (Reserved)
* bit15 = Abnormal flag
The modes of colours of tiles are:
* 0 = Use the current colour; ignore the colour in the menu.
* 1 = Use the current background but use the specified foreground.
* 2 = Use the current foreground but use the specified background.
* 3 = Use the specified colour; override the current colour.
* 4 = Door colour; use the specified foreground, and the bit7; the low
3-bits of current colour will then be shifted left by 4.
* 5 = Door colour where the current colour is multiplied by seventeen and
then adding the specified colour value.
* 6-7 = (Reserved)
The abnormal flag has the high bit set. In this case, the "kind" is the
address of a parameter editor to execute instead, and the flag is:
* bit7-bit0 = Initial value
* bit8 = Use stat of saved tile
* bit9 = Use parameter editor of tile at cursor after completed
* bit10 = Set default value of parameter of tile at cursor after completed
* bit13-bit11 = (Reserved)
* bit14 = Kind is address of revealing list (you should clear bit13-bit0)
* bit15 = Abnormal flag
=== Revealing list ===
Each entry in a revealing list consists of two cells.
The low 11-bits of the first cell have the format:
* $000 = End of revealing list
* $001 = Match everything
* $002 = Match stats
* $004 = Match unmarked cells
* $005 = Match marked cells
* $01x = Class number
* $1xx = Kind number
* $2xx = Bit number of attribute; bit7 is the required state to match
* $3xx = Stat number
The other bits have the format:
* bit11 = (reserved)
* bit13-bit12 = Layers to match (0=under and main, 1=under, 2=main, 3=over)
* bit14 = Special character mode
* bit15 = XOR colour
The format of the second cell is:
* bit7-bit0 = Character
* bit15-bit8 = Colour (if not XOR colour, 0 means colour of matching tile)
The special character modes can be:
* $00 = Leave display unchanged
* $01 = Use parameter
If multiple matching entries are found, only the first appropriate entry
that is found will be used for each cell.
=== Parameter editors ===
Use ED0 and the element number to define how element parameter editors,
and default values (for both tiles and stats), will work.
If you write ED0 and the element and then comma and a value $00 to $FF then
it always uses that default parameter value, and if $100 then it will ask
for a character code and use that.
In the below descriptions, ! means it is only valid in a form, and + means
it is meaningful inside and outside of a form; other commands are only
meaningful outside of a form (but are allowed after the end of a form).
In ED2 commands, the second operand (the "text") can contain up to one
tilde, which will not be displayed but makes the next character to be
displayed green and can be used with ALT key to select it.
ED 0
End of instructions. This must be the last instruction.
ED 1,parameter
Set the default parameter value. If present, it must be the first
instruction. If it is a new stat added due to the bit11 flag of F1-F12
menus, then the high 8-bits of the parameter will be used as the speed
value of the new stat.
ED 2,width,height,stats,option
This is only allowed as the first instruction of a parameter editor for
creating a new board, and is mandatory in that case. The width and
height of the board, and the number of stats, can be specified; none
of these are allowed to be zero. The option is a bit field; currently
only bit0 is used, which means that the size of the previously selected
board should be used if there is one.
ED '/',which,bits !
Set a condition for further form items to be displayed or suppressed
(up to the next ED '/' instruction). The bits are, if any bit is set
then it is allowed but if clear then it is suppressed; numbers higher
than 15 are treated as 15 so that the high bit will control it. If the
value is invalid then it is automatically suppressed.
ED ':',string
Execute a colon command. Some colon commands are restricted.
ED ';',string
Execute a colon command, but allow the use of escapes in the string,
which start with ` and then another character. Doubling the ` will
represent a literal ` character. A uppercase letter A to H means use
the value of that register, or don't execute if negative. A lowercase
letter a to h means use the value of the register with a plus or minus
sign in front (which is always valid; plus is used if it is zero).
ED '=',string
Make a calculation.
ED '@',string,speed
Select a stat according to the specified name (which will not have
another at sign at first). If there is no stat with the specified name,
then such a stat will be added, with the specified speed. The string
can be 0 instead to always add a new stat, which will have no name.
ED2 'B',text,which !
Add a boolean item to a form.
ED 'C'
Ask for a character code to use as the parameter.
ED2 'C',text,which !
Add an item to a form to ask for a character code.
ED 'E'
Edit the text of the stat. If there is no stat, then does nothing.
ED 'H',string +
Add a heading to a form. This must be the first command in a form
(although you can have other commands before the beginning of the form).
ED2 'L',text,which !
Add an item to a form to ask for a colour code.
ED 'M',which !
Set a value to zero inside of a form. This can be used to mask out any
bits that you do not need.
ED2 'N',text,which,min,max !
Add a numeric item to a form.
ED 'O',which !
Beginning of a option group in a form.
ED2 'O',text,value !
Add a item to a option group, with the specified value.
ED 'P',kind,flag
Place a tile at the cursor. The flag is as follows:
bit7-bit0 = Intended colour of tile
bit10-bit8 = Mode of colour of tile
bit11 = Set to use selected stat; clear to use saved tile
bit12 = Set to use parameter value; clear to use saved tile
bit13 = Copy user/lock flag, delay, and instruction pointer
bit14 = Set to override saved tile with this one
bit15 = Do not use floors
If kind is $FFFF then use the kind of the saved tile instead.
ED 'S',stat
Select stat. This affects some of the other commands that can be used
in the parameter editor, such as the ED 'E' command. If the stat number
is specified as $FFFF then the stat of the saved tile is used instead.
ED 'V',kind,color,character
Fill the overlay with the specified tile.
ED3 key,value[,key,value,...]
If the parameter any of the keys then the A register is changed to the
specified value. All of the keys and values must be 8-bit numbers.
ED4 register,number
Sets the value of a signed 32-bit register A to H, which can later be
used in a ED '=' command.
ED5 register,how,which
Copy or exchange registers to/from the "which" value as documented in
the below section. The "how" is made by: bit0 is set to copy register
to other, bit1 to copy other way around, and bit2 for addition. This
will not work to affect only some bits; it will always overwrite the
entire value instead of the specified bits, although it is able to
read only the specified bits and ignore the others when reading.
Furthermore, bit0 can't be used to write to A to H registers.
=== Parameter editor item specifications ===
The "which" operand in some of the instructions is encoded as follows:
* bit3-bit0 = Shift amount
* bit7-bit4 = One less than the number of bits (ignored for ED2 'B')
* bit11-bit8 = Minor code
* bit14-bit12 = Major code
* bit15 = Inverse
The major codes are:
* 0 = Parameter; minor code should always be zero.
* 1 = Stat data; minor 0 is the speed, and minor 1 to 3 are the Misc1 to
Misc3 values.
* 2 = Stat XY data; minor 0 for delay, minor 1 for instruction pointer,
minor 2 for user/lock flags.
* 3 = Board info; minor 0 for flags, 1 for user data, 2 for screen, and 8
to 11 for exits.
* 4 = Overlay values; minor 0 for kind, 1 for color, 2 for parameter, and
3 for stat number.
* 7 = One of the 32-bit registers A to H (minor codes 0 to 7) (although
only the low 16-bits are valid).
=== Parameter calculations ===
Initially, the primary and secondary value are both set to the parameter
value, but the below calculations can change them.
Uppercase alphabets will copy the primary value to something, and lowercase
alphabets will copy the primary to the secondary and then read the value
into the primary value. These values are:
* A to H = Signed 32-bit registers.
* K = Kind of saved tile.
* L = Colour of saved tile.
* M = Parameter of saved tile.
* N = Stat of saved tile.
* P = Parameter value. (This can affect the parameter value that is used
after the calculation is finished.)
* S = Stat number. (This is not saved after the calculation is finished.)
* T = Same as L but writes are ignored if config.default_colors is 0.
* X and Y = Cursor position.
The digits 0 to 9 will set the secondary value to the number 0 to 9.
The following calculations will change the primary value to a calculation
of it and the secondary value: + - * & | ^ < > these are the same as the
corresponding operators in C, except that < and > are bit shifts.
You can write . to exchange primary and secondary values.
The ? and ! means to ignore the rest of the calculation unless the primary
value is nonzero or zero.
=== Miscellaneous options ===
ED1 64,margin
Set the right margin position in the text editor, from 1 to 79.
ED1 65
Followed by parameter editor code for setting values of a new board.