-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathcommand.zap
510 lines (483 loc) · 9.69 KB
/
command.zap
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
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
.FUNCT RT-RM-COMMAND-MODULE:ANY:0:1,CONTEXT
EQUAL? CONTEXT,M-F-LOOK,M-V-LOOK,M-LOOK \?CCL3
PRINTC TAB
PRINTI "You "
EQUAL? CONTEXT,M-LOOK \?CCL6
PRINTI "are in"
JUMP ?CND4
?CCL6: PRINTI "enter"
?CND4: ICALL RT-PRINT-OBJ,RM-COMMAND-MODULE,K-ART-THE
PRINTI ", a long narrow cabin like the inside of a Winnebago packed with instrumentation. At the far end, a chair sits in front of a bank of monitors. The only exit is in the aft wall."
CRLF
RFALSE
?CCL3: EQUAL? CONTEXT,M-BEG \?CCL8
EQUAL? PRSA,V?SIT \FALSE
EQUAL? PRSO,ROOMS \FALSE
CALL1 RT-COMMAND-MENU
RSTACK
?CCL8: ZERO? CONTEXT \FALSE
RFALSE
.FUNCT RT-TH-MONITORS:ANY:0:1,CONTEXT
ZERO? CONTEXT \FALSE
EQUAL? PRSA,V?EXAMINE \?CCL5
PRINTC TAB
PRINTR "The monitors glow with data gathered from all over Deepcore."
?CCL5: EQUAL? PRSA,V?SIT \FALSE
CALL1 RT-COMMAND-MENU
RSTACK
.FUNCT RT-TH-COMMAND-CHAIR:ANY:0:1,CONTEXT
ZERO? CONTEXT \FALSE
EQUAL? PRSA,V?EXAMINE \?CCL5
PRINTC TAB
PRINTR "The chair is right in front of the main control panel."
?CCL5: EQUAL? PRSA,V?ENTER,V?SIT \FALSE
CALL1 RT-COMMAND-MENU
RSTACK
.FUNCT RT-COMMAND-MENU:ANY:0:0,C,L,ON?,X1,Y1,X2,Y2,?TMP2,?TMP1
SET 'X1,1
CALL2 L-PIXELS,4 >Y1
CALL2 C-PIXELS,16 >X2
CALL2 L-PIXELS,12 >Y2
MOUSE-LIMIT -1
CLEAR -1
GET 0,18 >?TMP1
MUL 6,GL-FONT-Y
SUB ?TMP1,STACK
ADD 1,STACK
WINPOS 0,STACK,1
MUL 6,GL-FONT-Y >?TMP1
GET 0,17
WINSIZE 0,?TMP1,STACK
ADD GL-FONT-Y,1
WINPOS 2,STACK,1
GET 0,18 >?TMP2
MUL 7,GL-FONT-Y
SUB ?TMP2,STACK >?TMP1
GET 0,17
WINSIZE 2,?TMP1,STACK
WINPOS 7,1,1
GET 0,18 >?TMP1
GET 0,17
WINSIZE 7,?TMP1,STACK
SET 'GL-SL-HERE,FALSE-VALUE
?PRG1: CLEAR 2
ICALL1 UPDATE-STATUS-LINE
SCREEN 2
CURSET 1,1
PRINTI "Main menu"
ICALL CCURSET,4,1
PRINTI "Emergency"
ICALL CCURSET,4,15
PRINTC 69
ICALL CCURSET,5,1
PRINTI "ROV"
ICALL CCURSET,5,15
PRINTC 82
ICALL CCURSET,6,1
PRINTI "Air"
ICALL CCURSET,6,15
PRINTC 65
ICALL CCURSET,7,1
PRINTI "Power"
ICALL CCURSET,7,15
PRINTC 80
ICALL CCURSET,8,1
PRINTI "Lights"
ICALL CCURSET,8,15
PRINTC 76
ICALL CCURSET,9,1
PRINTI "Life Support"
ICALL CCURSET,9,15
PRINTC 83
ICALL CCURSET,10,1
PRINTI "Pump"
ICALL CCURSET,10,15
PRINTC 77
ICALL CCURSET,11,1
PRINTI "Exit"
ICALL CCURSET,11,15
PRINTC 88
?PRG3: SCREEN 0
SET 'GL-INPUT-TIMEOUT,FALSE-VALUE
INPUT 1,3,RT-STOP-READ >C
ZERO? GL-INPUT-TIMEOUT \?CCL7
EQUAL? C,K-CLICK1,K-CLICK2 \?CCL10
CALL MOUSE-INPUT?,2,X1,Y1,X2,Y2
ZERO? STACK /?CCL13
CALL2 PIXELS-L,GL-MOUSE-Y >L
EQUAL? L,1 \?CCL16
SET 'C,101
JUMP ?REP4
?CCL16: EQUAL? L,2 \?CCL18
SET 'C,114
JUMP ?REP4
?CCL18: EQUAL? L,3 \?CCL20
SET 'C,97
JUMP ?REP4
?CCL20: EQUAL? L,4 \?CCL22
SET 'C,112
JUMP ?REP4
?CCL22: EQUAL? L,5 \?CCL24
SET 'C,108
JUMP ?REP4
?CCL24: EQUAL? L,6 \?CCL26
SET 'C,115
JUMP ?REP4
?CCL26: EQUAL? L,7 \?CCL28
SET 'C,109
JUMP ?REP4
?CCL28: SET 'C,120
JUMP ?REP4
?CCL13: SOUND S-BEEP
JUMP ?PRG3
?CCL10: LESS? C,65 /?CND29
GRTR? C,90 /?CND29
ADD C,32 >C
?CND29: EQUAL? C,101,114,97 /?REP4
EQUAL? C,112,108,115 /?REP4
EQUAL? C,109,120 /?REP4
SOUND S-BEEP
JUMP ?PRG3
?CCL7: SCREEN 2
ICALL CCURSET,4,1
ZERO? ON? /?PRT41
SET 'ON?,0
JUMP ?PRE43
?PRT41: SET 'ON?,1
?PRE43: ZERO? ON? /?CND39
HLIGHT K-H-INV
?CND39: PRINTI "Emergency"
HLIGHT K-H-NRM
JUMP ?PRG3
?REP4: EQUAL? C,101 \?CCL46
ICALL1 RT-EMERGENCY-MENU
JUMP ?PRG1
?CCL46: EQUAL? C,114 \?CCL48
ICALL1 RT-ROV-MENU
JUMP ?PRG1
?CCL48: EQUAL? C,97 \?CCL50
ICALL1 RT-AIR-MENU
JUMP ?PRG1
?CCL50: EQUAL? C,112 \?CCL52
ICALL1 RT-POWER-MENU
JUMP ?PRG1
?CCL52: EQUAL? C,108 \?CCL54
ICALL1 RT-LIGHT-MENU
JUMP ?PRG1
?CCL54: EQUAL? C,115 \?CCL56
ICALL1 RT-SUPPORT-MENU
JUMP ?PRG1
?CCL56: EQUAL? C,109 \?CCL58
ICALL1 RT-PUMP-MENU
JUMP ?PRG1
?CCL58: EQUAL? C,120 \?PRG1
CLEAR -1
ICALL1 INIT-STATUS-LINE
SCREEN 0
PRINTC TAB
PRINTR "You get up from the command chair."
.FUNCT RT-EMERGENCY-MENU:ANY:0:0,X1,Y1,X2,Y2,C,L
SET 'X1,1
CALL2 L-PIXELS,4 >Y1
CALL2 C-PIXELS,25 >X2
CALL2 L-PIXELS,6 >Y2
CLEAR 2
ICALL1 UPDATE-STATUS-LINE
SCREEN 2
CURSET 1,1
PRINTI "Emergency menu"
ICALL CCURSET,4,1
HLIGHT K-H-INV
ZERO? GL-KLAXON-ON /?CCL3
PRINTI "ON "
JUMP ?CND1
?CCL3: PRINTI "OFF"
?CND1: HLIGHT K-H-NRM
ICALL CCURSET,4,4
PRINTI "Emergency klaxons"
ICALL CCURSET,4,24
PRINTC 75
HLIGHT K-H-NRM
ICALL CCURSET,5,4
PRINTI "Exit"
ICALL CCURSET,5,24
PRINTC 88
?PRG4: SCREEN 0
INPUT 1 >C
EQUAL? C,K-CLICK1,K-CLICK2 \?CCL8
CALL MOUSE-INPUT?,2,X1,Y1,X2,Y2
ZERO? STACK /?CND6
CALL2 PIXELS-L,GL-MOUSE-Y >L
EQUAL? L,1 \?CCL13
SET 'C,107
JUMP ?CND6
?CCL13: SET 'C,120
JUMP ?CND6
?CCL8: LESS? C,65 /?CND6
GRTR? C,90 /?CND6
ADD C,32 >C
?CND6: EQUAL? C,107 \?CCL19
SCREEN 2
ICALL CCURSET,4,1
HLIGHT K-H-INV
ZERO? GL-KLAXON-ON /?PRT23
SET 'GL-KLAXON-ON,0
JUMP ?PRE25
?PRT23: SET 'GL-KLAXON-ON,1
?PRE25: ZERO? GL-KLAXON-ON /?CCL22
ADD GL-MOVES,1
ICALL RT-QUEUE,RT-I-KLAXON,STACK
PRINTI "ON "
JUMP ?CND20
?CCL22: ICALL2 RT-DEQUEUE,RT-I-KLAXON
PRINTI "OFF"
?CND20: HLIGHT K-H-NRM
JUMP ?PRG4
?CCL19: EQUAL? C,120 /TRUE
SOUND S-BEEP
JUMP ?PRG4
.FUNCT RT-ROV-MENU:ANY:0:0
CLEAR 2
ICALL1 UPDATE-STATUS-LINE
SCREEN 2
CURSET 1,1
PRINTI "R.O.V. menu"
SCREEN 0
INPUT 1
RTRUE
.FUNCT RT-AIR-MENU:ANY:0:0
CLEAR 2
ICALL1 UPDATE-STATUS-LINE
SCREEN 2
CURSET 1,1
PRINTI "Breathing Mix menu"
ICALL CCURSET,4,1
PRINTI "Oxygen: "
ICALL RT-PRINT-FLOAT,GL-OXYGEN-QTY,K-OXYGEN-FACTOR
PRINTI "% - "
ICALL RT-GAS-LEVEL-MSG,GL-OXYGEN-QTY,K-OXY-LOW-1,K-OXY-HIGH-1,K-OXY-NOM
PRINTI "
Carbon dioxide: "
ICALL RT-PRINT-FLOAT,GL-CO2-QTY,K-CO2-FACTOR
PRINTI "% - "
ICALL RT-GAS-LEVEL-MSG,GL-CO2-QTY,-1,K-CO2-HIGH-1,K-CO2-NOM
PRINTI "
Nitrogen: "
ICALL RT-PRINT-FLOAT,GL-NITROGEN-QTY,K-NITROGEN-FACTOR
PRINTI "% - "
ICALL RT-GAS-LEVEL-MSG,GL-NITROGEN-QTY,K-NIT-LOW-1,K-NIT-HIGH-1,K-NIT-NOM
PRINTI "
Helium: "
ICALL RT-PRINT-FLOAT,GL-HELIUM-QTY,K-HELIUM-FACTOR
PRINTI "%
"
SCREEN 0
INPUT 1
RTRUE
.FUNCT RT-GAS-LEVEL-MSG:ANY:4:4,QTY,LOW,HIGH,NOM
GRTR? QTY,LOW /?CCL3
PRINTI "low"
RTRUE
?CCL3: LESS? QTY,HIGH /?CCL5
PRINTI "high"
RTRUE
?CCL5: EQUAL? QTY,NOM \?CCL7
PRINTI "nominal"
RTRUE
?CCL7: LESS? QTY,NOM \?CCL9
PRINTI "less than nominal"
RTRUE
?CCL9: PRINTI "more than nominal"
RTRUE
.FUNCT RT-POWER-MENU:ANY:0:0
CLEAR 2
ICALL1 UPDATE-STATUS-LINE
SCREEN 2
CURSET 1,1
PRINTI "Power menu"
SCREEN 0
INPUT 1
RTRUE
.FUNCT RT-LIGHT-MENU:ANY:0:0
CLEAR 2
ICALL1 UPDATE-STATUS-LINE
SCREEN 2
CURSET 1,1
PRINTI "Lighting menu"
SCREEN 0
INPUT 1
RTRUE
.FUNCT RT-SUPPORT-MENU:ANY:0:0,X1,Y1,X2,Y2,C,L
SET 'X1,1
CALL2 L-PIXELS,4 >Y1
CALL2 C-PIXELS,28 >X2
CALL2 L-PIXELS,9 >Y2
CLEAR 2
ICALL1 UPDATE-STATUS-LINE
SCREEN 2
CURSET 1,1
PRINTI "Life support menu"
ICALL CCURSET,4,1
HLIGHT K-H-INV
ZERO? GL-SCRUBBERS-ON /?CCL3
PRINTI "ON "
JUMP ?CND1
?CCL3: PRINTI "OFF"
?CND1: HLIGHT K-H-NRM
ICALL CCURSET,4,4
PRINTI "CO2 scrubbers"
ICALL CCURSET,4,27
PRINTC 83
ICALL CCURSET,5,1
HLIGHT K-H-INV
ZERO? GL-HEATERS-ON /?CCL6
PRINTI "ON "
JUMP ?CND4
?CCL6: PRINTI "OFF"
?CND4: HLIGHT K-H-NRM
ICALL CCURSET,5,4
PRINTI "Heaters"
ICALL CCURSET,5,27
PRINTC 72
ICALL CCURSET,6,1
HLIGHT K-H-INV
PRINTI "ON "
HLIGHT K-H-NRM
ICALL CCURSET,6,4
PRINTI "Helium de-scramblers"
ICALL CCURSET,6,27
PRINTC 68
ICALL CCURSET,7,1
HLIGHT K-H-INV
PRINTI "ON "
HLIGHT K-H-NRM
ICALL CCURSET,7,4
PRINTI "De-humidifiers"
ICALL CCURSET,7,27
PRINTC 77
HLIGHT K-H-NRM
ICALL CCURSET,8,4
PRINTI "Exit"
ICALL CCURSET,8,27
PRINTC 88
ICALL CCURSET,4,50
PRINTI "Interior temp:"
ICALL CCURSET,5,50
ICALL RT-PRINT-FLOAT,GL-DEEPCORE-TEMP,K-TEMP-FACTOR
PRINTI " deg. F"
?PRG7: SCREEN 0
INPUT 1 >C
EQUAL? C,K-CLICK1,K-CLICK2 \?CCL11
CALL MOUSE-INPUT?,2,X1,Y1,X2,Y2
ZERO? STACK /?CND9
CALL2 PIXELS-L,GL-MOUSE-Y >L
EQUAL? L,1 \?CCL16
SET 'C,115
JUMP ?CND9
?CCL16: EQUAL? L,2 \?CCL18
SET 'C,104
JUMP ?CND9
?CCL18: EQUAL? L,3 \?CCL20
SET 'C,100
JUMP ?CND9
?CCL20: EQUAL? L,4 \?CCL22
SET 'C,109
JUMP ?CND9
?CCL22: SET 'C,120
JUMP ?CND9
?CCL11: LESS? C,65 /?CND9
GRTR? C,90 /?CND9
ADD C,32 >C
?CND9: EQUAL? C,115 \?CCL28
ZERO? GL-SCRUBBERS-ON /?PRT29
SET 'GL-SCRUBBERS-ON,0
JUMP ?PRE31
?PRT29: SET 'GL-SCRUBBERS-ON,1
?PRE31: SCREEN 2
ICALL CCURSET,4,1
HLIGHT K-H-INV
ZERO? GL-SCRUBBERS-ON /?CCL34
PRINTI "ON "
JUMP ?CND32
?CCL34: PRINTI "OFF"
?CND32: HLIGHT K-H-NRM
JUMP ?PRG7
?CCL28: EQUAL? C,104 \?CCL36
ZERO? GL-HEATERS-ON /?PRT37
SET 'GL-HEATERS-ON,0
JUMP ?PRE39
?PRT37: SET 'GL-HEATERS-ON,1
?PRE39: SCREEN 2
ICALL CCURSET,5,1
HLIGHT K-H-INV
ZERO? GL-HEATERS-ON /?CCL42
PRINTI "ON "
JUMP ?CND40
?CCL42: PRINTI "OFF"
?CND40: HLIGHT K-H-NRM
JUMP ?PRG7
?CCL36: EQUAL? C,100 /?PRG7
EQUAL? C,109 /?PRG7
EQUAL? C,120 /TRUE
SOUND S-BEEP
JUMP ?PRG7
.FUNCT RT-PUMP-MENU:ANY:0:0,X1,Y1,X2,Y2,C,L
SET 'X1,1
CALL2 L-PIXELS,4 >Y1
CALL2 C-PIXELS,24 >X2
CALL2 L-PIXELS,6 >Y2
CLEAR 2
ICALL1 UPDATE-STATUS-LINE
SCREEN 2
CURSET 1,1
PRINTI "Pump and compressor menu"
ICALL CCURSET,4,1
HLIGHT K-H-INV
ZERO? GL-WATER-PUMP-ON /?CCL3
PRINTI "ON "
JUMP ?CND1
?CCL3: PRINTI "OFF"
?CND1: HLIGHT K-H-NRM
ICALL CCURSET,4,4
PRINTI "Fresh water pumps"
ICALL CCURSET,4,23
PRINTC 80
HLIGHT K-H-NRM
ICALL CCURSET,5,4
PRINTI "Exit"
ICALL CCURSET,5,23
PRINTC 88
?PRG4: SCREEN 0
INPUT 1 >C
EQUAL? C,K-CLICK1,K-CLICK2 \?CCL8
CALL MOUSE-INPUT?,2,X1,Y1,X2,Y2
ZERO? STACK /?CND6
CALL2 PIXELS-L,GL-MOUSE-Y >L
EQUAL? L,1 \?CCL13
SET 'C,112
JUMP ?CND6
?CCL13: SET 'C,120
JUMP ?CND6
?CCL8: LESS? C,65 /?CND6
GRTR? C,90 /?CND6
ADD C,32 >C
?CND6: EQUAL? C,112 \?CCL19
SCREEN 2
ICALL CCURSET,4,1
HLIGHT K-H-INV
ZERO? GL-WATER-PUMP-ON /?PRT23
SET 'GL-WATER-PUMP-ON,0
JUMP ?PRE25
?PRT23: SET 'GL-WATER-PUMP-ON,1
?PRE25: ZERO? GL-WATER-PUMP-ON /?CCL22
PRINTI "ON "
JUMP ?CND20
?CCL22: PRINTI "OFF"
?CND20: HLIGHT K-H-NRM
JUMP ?PRG4
?CCL19: EQUAL? C,120 /TRUE
SOUND S-BEEP
JUMP ?PRG4
.FUNCT RT-TH-DESCRAMBLER-CONTROL-BOX:ANY:0:1,CONTEXT
RFALSE
.ENDI