-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathclues.zap
505 lines (472 loc) · 9.91 KB
/
clues.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
.SEGMENT "HINTS"
.FUNCT DO-HINTS,Q,WIN,FCLR,WCLR,CHR,TMP,MAXC,?TMP1
HLIGHT H-NORMAL
CALL1 INIT-HINT-SCREEN >WIN
WINGET -3,WFSIZE
SHIFT STACK,-8 >Q
WINGET -3,WTOP
SUB STACK,1
DIV STACK,Q
ADD 1,STACK >TOP-HINT-LINE
WINGET -3,WHIGH
DIV STACK,Q
SUB STACK,1 >BOTTOM-HINT-NUM
WINGET -3,WFSIZE
BAND STACK,255 >Q
WINGET -3,WLEFT
SUB STACK,1
DIV STACK,Q
ADD 2,STACK >LEFT-HINT-COLUMN
?PRG1: CLEAR S-TEXT
SCREEN WIN
WINGET WIN,WCOLOR >WCLR
GET 0,0
BTST STACK,1 \?CCL5
ICALL CCURSET,2,9
COLOR 1,-1
JUMP ?CND3
?CCL5: COLOR 1,1
?CND3: ICALL HINT-TITLE,INVISICLUES,WIN
SCREEN S-FULL
WINGET S-FULL,WCOLOR >FCLR
WINGET S-TEXT,WCOLOR
BAND STACK,255 >?TMP1
WINGET S-TEXT,WCOLOR
SHIFT STACK,-8
COLOR ?TMP1,STACK
DIROUT D-TABLE-ON,SLINE
DIROUT D-TABLE-OFF
SET 'GET-HINT-ROUTINE,H-CHAPT-NAME
GET HINTS,0
ICALL2 H-PUT-UP-FROBS,STACK
ICALL2 H-NEW-CURSOR,H-CHAPT-NUM
GET HINTS,0 >MAXC
?PRG6: ZERO? DEMO-VERSION? /?CCL10
CALL2 INPUT-DEMO,1 >CHR
JUMP ?CND8
?CCL10: INPUT 1 >CHR
?CND8: EQUAL? CHR,CLICK1,CLICK2 \?CND11
CALL1 SELECT-HINT-BY-MOUSE >TMP
GRTR? TMP,0 /?CND11
EQUAL? TMP,-1 \?CCL17
SET 'CHR,78
JUMP ?CND11
?CCL17: EQUAL? TMP,-2 \?CCL19
SET 'CHR,80
JUMP ?CND11
?CCL19: EQUAL? TMP,-3 \?CCL21
SET 'CHR,13
JUMP ?CND11
?CCL21: EQUAL? TMP,-4 \?CCL23
SET 'CHR,81
?CND11: EQUAL? CHR,77,109,81 /?CTR25
EQUAL? CHR,113 \?CCL26
?CTR25: SET 'Q,TRUE-VALUE
JUMP ?REP7
?CCL23: SOUND S-BEEP
JUMP ?PRG6
?CCL26: EQUAL? CHR,78,110,DOWN-ARROW \?CCL30
ICALL H-NEW-CURSOR,H-CHAPT-NUM,TRUE-VALUE
EQUAL? H-CHAPT-NUM,MAXC \?CCL33
SET 'H-CHAPT-NUM,1
JUMP ?CND31
?CCL33: INC 'H-CHAPT-NUM
?CND31: SET 'H-QUEST-NUM,1
ICALL2 H-NEW-CURSOR,H-CHAPT-NUM
JUMP ?PRG6
?CCL30: EQUAL? CHR,80,112,UP-ARROW \?CCL35
ICALL H-NEW-CURSOR,H-CHAPT-NUM,TRUE-VALUE
EQUAL? H-CHAPT-NUM,1 \?CCL38
SET 'H-CHAPT-NUM,MAXC
JUMP ?CND36
?CCL38: DEC 'H-CHAPT-NUM
?CND36: SET 'H-QUEST-NUM,1
ICALL2 H-NEW-CURSOR,H-CHAPT-NUM
JUMP ?PRG6
?CCL35: EQUAL? CHR,13,10,32 \?CCL40
CALL1 H-PICK-QUESTION >Q
JUMP ?REP7
?CCL40: EQUAL? CHR,CLICK1,CLICK2 \?CCL42
GRTR? TMP,MAXC \?CCL45
SOUND S-BEEP
JUMP ?PRG6
?CCL45: ICALL H-NEW-CURSOR,H-CHAPT-NUM,TRUE-VALUE
SET 'H-CHAPT-NUM,TMP
SET 'H-QUEST-NUM,1
ICALL2 H-NEW-CURSOR,H-CHAPT-NUM
EQUAL? CHR,CLICK2 \?PRG6
CALL1 H-PICK-QUESTION >Q
?REP7: ZERO? Q /?PRG1
CLEAR -1
SCREEN WIN
BAND WCLR,255 >?TMP1
SHIFT WCLR,-8
COLOR ?TMP1,STACK
SCREEN S-FULL
BAND FCLR,255 >?TMP1
SHIFT FCLR,-8
COLOR ?TMP1,STACK
SCREEN S-TEXT
HLIGHT H-NORMAL
ICALL1 INIT-STATUS-LINE
PRINTI "Back to the story..."
CRLF
RETURN 2
?CCL42: SOUND S-BEEP
JUMP ?PRG6
.FUNCT H-PICK-QUESTION,CHR,MAXQ,Q,WID,TMP
?FCN: CATCH >PARSE-SENTENCE-ACTIVATION
HLIGHT H-NORMAL
CLEAR S-TEXT
GET HINTS,H-CHAPT-NUM
GET STACK,1
ICALL HINT-TITLE,STACK,S-WINDOW
CALL CENTER-LINE,M-MAIN-HINT-MENU,2 >WID
GET HINTS,H-CHAPT-NUM
GET STACK,0
SUB STACK,1 >MAXQ
SCREEN S-FULL
SET 'GET-HINT-ROUTINE,H-GET-QUEST
GET HINTS,H-CHAPT-NUM
GET STACK,0
SUB STACK,1
ICALL2 H-PUT-UP-FROBS,STACK
ICALL2 H-NEW-CURSOR,H-QUEST-NUM
?PRG1: ZERO? DEMO-VERSION? /?CCL5
CALL2 INPUT-DEMO,1 >CHR
JUMP ?CND3
?CCL5: INPUT 1 >CHR
?CND3: EQUAL? CHR,CLICK1,CLICK2 \?CND6
CALL2 SELECT-HINT-BY-MOUSE,WID >TMP
GRTR? TMP,0 /?CND6
EQUAL? TMP,-1 \?CCL12
SET 'CHR,78
JUMP ?CND6
?CCL12: EQUAL? TMP,-2 \?CCL14
SET 'CHR,80
JUMP ?CND6
?CCL14: EQUAL? TMP,-3 \?CCL16
SET 'CHR,13
JUMP ?CND6
?CCL16: EQUAL? TMP,-4 \?CCL18
SET 'CHR,81
JUMP ?CND6
?CCL18: EQUAL? TMP,-5 \?CCL20
SET 'CHR,77
?CND6: EQUAL? CHR,81,113 /TRUE
EQUAL? CHR,77,109 \?CCL25
SET 'Q,TRUE-VALUE
JUMP ?REP2
?CCL20: SOUND S-BEEP
JUMP ?PRG1
?CCL25: EQUAL? CHR,78,110,DOWN-ARROW \?CCL27
ICALL H-NEW-CURSOR,H-QUEST-NUM,TRUE-VALUE
EQUAL? H-QUEST-NUM,MAXQ \?CCL30
SET 'H-QUEST-NUM,1
JUMP ?CND28
?CCL30: INC 'H-QUEST-NUM
?CND28: ICALL2 H-NEW-CURSOR,H-QUEST-NUM
JUMP ?PRG1
?CCL27: EQUAL? CHR,80,112,UP-ARROW \?CCL32
ICALL H-NEW-CURSOR,H-QUEST-NUM,TRUE-VALUE
EQUAL? H-QUEST-NUM,1 \?CCL35
SET 'H-QUEST-NUM,MAXQ
JUMP ?CND33
?CCL35: DEC 'H-QUEST-NUM
?CND33: ICALL2 H-NEW-CURSOR,H-QUEST-NUM
JUMP ?PRG1
?CCL32: EQUAL? CHR,CLICK1,CLICK2 \?CCL37
GRTR? TMP,MAXQ \?CCL40
SOUND S-BEEP
JUMP ?PRG1
?CCL40: ICALL H-NEW-CURSOR,H-QUEST-NUM,TRUE-VALUE
SET 'H-QUEST-NUM,TMP
ICALL2 H-NEW-CURSOR,H-QUEST-NUM
EQUAL? CHR,CLICK2 \?PRG1
ICALL1 DISPLAY-HINT
JUMP ?REP2
?CCL37: EQUAL? CHR,13,10,32 \?CCL44
ICALL1 DISPLAY-HINT
?REP2: ZERO? Q /?FCN
RFALSE
?CCL44: SOUND S-BEEP
JUMP ?PRG1
.FUNCT H-NEW-CURSOR,POS,OFF?,Y,X
ADD TOP-HINT-LINE,POS >Y
SET 'X,LEFT-HINT-COLUMN
GRTR? POS,BOTTOM-HINT-NUM \?CND1
SUB Y,BOTTOM-HINT-NUM >Y
GETB 0,33
DIV STACK,2 >X
?CND1: ICALL CCURSET,Y,X
ZERO? OFF? \?CCL5
HLIGHT H-INVERSE
JUMP ?CND3
?CCL5: HLIGHT H-NORMAL
?CND3: CALL GET-HINT-ROUTINE,POS
PRINT STACK
PRINTC 32
ZERO? OFF? \FALSE
HLIGHT H-NORMAL
RTRUE
.FUNCT SELECT-HINT-BY-MOUSE,WID,VAL,MID,X,Y,?TMP1
WINGET -3,WFSIZE
SHIFT STACK,-8 >VAL
GET 0,27
GET STACK,2 >Y
GET 0,27
GET STACK,1 >X
SUB Y,1
DIV STACK,VAL >VAL
GETB 0,33 >?TMP1
WINGET -3,WFSIZE
BAND STACK,255
MUL ?TMP1,STACK
DIV STACK,2 >MID
SUB TOP-HINT-LINE,1
LESS? VAL,STACK \?CCL3
EQUAL? VAL,1 \?CCL6
DIV WID,2 >VAL
ZERO? VAL /?CCL9
SUB MID,VAL
GRTR? X,STACK \?CCL9
ADD MID,VAL
LESS? X,STACK \?CCL9
RETURN -5
?CCL9: GRTR? X,MID /?CCL14
RETURN -1
?CCL14: RETURN -3
?CCL6: EQUAL? VAL,2 \FALSE
GRTR? X,MID /?CCL19
RETURN -2
?CCL19: RETURN -4
?CCL3: ADD 1,VAL
SUB STACK,TOP-HINT-LINE >VAL
GRTR? X,MID \?CND21
ADD VAL,BOTTOM-HINT-NUM >VAL
?CND21: RETURN VAL
.FUNCT INVERSE-LINE,LN,INV
ASSIGNED? 'INV /?CND1
SET 'INV,H-INVERSE
?CND1: ZERO? LN /?CND3
ICALL CCURSET,LN,1
?CND3: HLIGHT INV
ZERO? INV \?CCL7
ERASE 1
RTRUE
?CCL7: FONT 4
GETB 0,39 >LN
WINGET -3,WWIDE
ADD LN,STACK
DIV STACK,LN
ICALL2 PRINT-SPACES,STACK
FONT 1
HLIGHT H-NORMAL
RTRUE
.FUNCT DISPLAY-HINT,H,MX,CNT,CV,SHIFT?,COUNT-OFFS,WID,CURCX,CURC,FLG,?TMP1
SET 'CNT,2
HLIGHT H-NORMAL
CLEAR S-TEXT
SCREEN S-WINDOW
ICALL INVERSE-LINE,3,H-NORMAL
ICALL RIGHT-LINE,Q-RESUME-STORY,3
ICALL INVERSE-LINE,2,H-NORMAL
ICALL RIGHT-LINE,RETURN-SEE-NEW-HINT,2
GET 0,8
BTST STACK,32 \?CND1
ICALL CENTER-LINE,H-OR-USE-MOUSE,3
?CND1: ICALL INVERSE-LINE,1,H-NORMAL
HLIGHT H-BOLD
GET HINTS,H-CHAPT-NUM >?TMP1
ADD H-QUEST-NUM,1
GET ?TMP1,STACK >H
SUB H-CHAPT-NUM,1
GET HINT-COUNTS,STACK >CV
GET H,1
ICALL CENTER-LINE,STACK,1,H-INVERSE
HLIGHT H-NORMAL
CALL CENTER-LINE,M-SEE-HINT-MENU,2 >WID
GET H,0 >MX
SCREEN S-TEXT
CURSET 1,1
MOD H-QUEST-NUM,2 >SHIFT?
SUB H-QUEST-NUM,1
DIV STACK,2 >COUNT-OFFS
GETB CV,COUNT-OFFS >CURCX
ZERO? SHIFT? /?CCL5
SHIFT CURCX,-4
JUMP ?CND3
?CCL5: PUSH CURCX
?CND3: BAND STACK,15
ADD 2,STACK >CURC
?PRG6: EQUAL? CNT,CURC /?REP7
PRINTC 9
GET H,CNT
PRINT STACK
CRLF
INC 'CNT
JUMP ?PRG6
?REP7: SET 'FLG,TRUE-VALUE
?PRG11: ZERO? FLG /?CND13
SET 'FLG,FALSE-VALUE
GRTR? CNT,MX \?CCL17
PRINT NO-MORE-HINTS
CRLF
SCREEN S-WINDOW
ICALL INVERSE-LINE,2,H-NORMAL
ICALL CENTER-LINE,M-SEE-HINT-MENU,2
SCREEN S-TEXT
JUMP ?CND13
?CCL17: SUB MX,CNT
ADD STACK,1
PRINTN STACK
PRINTI "> "
?CND13: ZERO? DEMO-VERSION? /?CCL20
CALL2 INPUT-DEMO,1 >CURC
JUMP ?CND18
?CCL20: INPUT 1 >CURC
?CND18: EQUAL? CURC,CLICK1,CLICK2 \?CND21
CALL2 SELECT-HINT-BY-MOUSE,WID >CURCX
GRTR? CURCX,0 /?CND21
EQUAL? CURCX,-3 \?CCL27
SET 'CURC,13
JUMP ?CND21
?CCL27: EQUAL? CURCX,-4 \?CCL29
SET 'CURC,81
JUMP ?CND21
?CCL29: EQUAL? CURCX,-5 \?CCL31
SET 'CURC,77
?CND21: EQUAL? CURC,77,109,81 /?CTR33
EQUAL? CURC,113 \?CCL34
?CTR33: ZERO? SHIFT? /?CCL39
GETB CV,COUNT-OFFS
BAND STACK,15 >?TMP1
SUB CNT,2
SHIFT STACK,4
BOR ?TMP1,STACK
PUTB CV,COUNT-OFFS,STACK
JUMP ?CND37
?CCL31: SOUND S-BEEP
JUMP ?PRG11
?CCL39: GETB CV,COUNT-OFFS
BAND STACK,240 >?TMP1
SUB CNT,2
BOR ?TMP1,STACK
PUTB CV,COUNT-OFFS,STACK
?CND37: EQUAL? CURC,81,113 \TRUE
THROW TRUE-VALUE,PARSE-SENTENCE-ACTIVATION
JUMP ?PRG11
?CCL34: EQUAL? CURC,13,10 \?CCL44
GRTR? CNT,MX /?CCL47
SET 'FLG,TRUE-VALUE
GET H,CNT
PRINT STACK
CRLF
IGRTR? 'CNT,MX \?PRG11
SET 'FLG,FALSE-VALUE
PRINT NO-MORE-HINTS
CRLF
SCREEN S-WINDOW
ICALL INVERSE-LINE,2,H-NORMAL
ICALL CENTER-LINE,M-SEE-HINT-MENU,2
SCREEN S-TEXT
JUMP ?PRG11
?CCL47: SOUND S-BEEP
JUMP ?PRG11
?CCL44: SOUND S-BEEP
JUMP ?PRG11
.FUNCT H-CHAPT-NAME,N
GET HINTS,N
GET STACK,1
RSTACK
.FUNCT H-GET-QUEST,N,?TMP1
GET HINTS,H-CHAPT-NUM >?TMP1
ADD N,1
GET ?TMP1,STACK
GET STACK,1
RSTACK
.FUNCT H-PUT-UP-FROBS,MX,ST,X,Y
HLIGHT H-NORMAL
SET 'X,LEFT-HINT-COLUMN
SET 'Y,TOP-HINT-LINE
?PRG1: IGRTR? 'ST,MX /TRUE
INC 'Y
ICALL CCURSET,Y,X
CALL GET-HINT-ROUTINE,ST
PRINT STACK
EQUAL? ST,BOTTOM-HINT-NUM \?PRG1
SET 'Y,TOP-HINT-LINE
GETB 0,33
DIV STACK,2 >X
JUMP ?PRG1
.FUNCT INIT-HINT-SCREEN
CLEAR -1
SCREEN S-FULL
ZERO? BORDER-ON /?CND1
DISPLAY HINT-BORDER,1,1
?CND1: ICALL2 SPLIT-BY-PICTURE,TEXT-WINDOW-PIC-LOC
SCREEN S-TEXT
RETURN S-WINDOW
.FUNCT HINT-TITLE,TITLE,WIN,THIRD
ASSIGNED? 'THIRD /?CND1
SET 'THIRD,TRUE-VALUE
?CND1: SCREEN WIN
ICALL INVERSE-LINE,1,H-NORMAL
ICALL INVERSE-LINE,2,H-NORMAL
ICALL INVERSE-LINE,3,H-NORMAL
HLIGHT H-BOLD
ICALL CENTER-LINE,TITLE,1,H-INVERSE
HLIGHT H-NORMAL
ICALL LEFT-LINE,2,NEXT-HINT
GET 0,8
BTST STACK,32 \?CND3
ICALL CENTER-LINE,H-OR-USE-MOUSE,3
?CND3: ICALL LEFT-LINE,3,PREVIOUS-HINT
ZERO? THIRD /FALSE
ICALL RIGHT-LINE,RETURN-SEE-HINT,2
CALL RIGHT-LINE,Q-RESUME-STORY,3
RSTACK
.FUNCT LEFT-LINE,LN,STR,INV
ICALL CCURSET,LN,1
ZERO? INV /?CND1
HLIGHT INV
?CND1: PRINT STR
ZERO? INV /FALSE
HLIGHT H-NORMAL
RTRUE
.FUNCT RIGHT-LINE,STR,LN,INV,LEN
CALL JUSTIFIED-LINE,STR,LN,INV,LEN,1
RSTACK
.FUNCT CENTER-LINE,STR,LN,INV,LEN
CALL JUSTIFIED-LINE,STR,LN,INV,LEN,2
RSTACK
.FUNCT JUSTIFIED-LINE,STR,LN,INV,LEN,CTR
ZERO? LN \?CCL3
CURGET SLINE
GET SLINE,0 >LN
JUMP ?CND1
?CCL3: DEC 'LN
WINGET -3,WFSIZE
SHIFT STACK,-8
MUL LN,STACK
ADD 1,STACK >LN
?CND1: ZERO? LEN \?CND4
DIROUT D-TABLE-ON,SLINE
PRINT STR
PRINTC 32
DIROUT D-TABLE-OFF
GET 0,24 >LEN
?CND4: WINGET -3,WWIDE
SUB STACK,LEN
DIV STACK,CTR
CURSET LN,STACK
ZERO? INV /?CND6
HLIGHT INV
?CND6: PRINT STR
PRINTC 32
ZERO? INV \?CCL9
RETURN LEN
?CCL9: HLIGHT H-NORMAL
RETURN LEN
.ENDSEG
.ENDI