-
Notifications
You must be signed in to change notification settings - Fork 15
/
parser.zap
2335 lines (2236 loc) · 48.1 KB
/
parser.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
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.SEGMENT "0"
.FUNCT INIT-STATUS-LINE:ANY:0:1,PW?,CW,Y,Y1,N,?TMP2,?TMP1
ASSIGNED? 'PW? /?CND1
SET 'PW?,TRUE-VALUE
?CND1: GET 0,18
SUB STACK,GL-FONT-Y >N
ZERO? PW? /?CCL5
DIV N,2
ADD 1,STACK
ADD STACK,GL-FONT-Y >?TMP1
MUL 27,GL-FONT-X
ADD 1,STACK
WINPOS 0,?TMP1,STACK
ADD N,1
DIV STACK,2 >?TMP1
GET 0,17 >?TMP2
MUL 27,GL-FONT-X
SUB ?TMP2,STACK
WINSIZE 0,?TMP1,STACK
ADD 1,GL-FONT-Y >?TMP1
MUL 27,GL-FONT-X
ADD 1,STACK
WINPOS 6,?TMP1,STACK
DIV N,2 >?TMP1
GET 0,17 >?TMP2
MUL 27,GL-FONT-X
SUB ?TMP2,STACK
WINSIZE 6,?TMP1,STACK
JUMP ?CND3
?CCL5: ADD 1,GL-FONT-Y >?TMP1
MUL 27,GL-FONT-X
ADD 1,STACK
WINPOS 0,?TMP1,STACK
GET 0,18
SUB STACK,GL-FONT-Y >?TMP1
GET 0,17 >?TMP2
MUL 27,GL-FONT-X
SUB ?TMP2,STACK
WINSIZE 0,?TMP1,STACK
WINPOS 6,1,1
WINSIZE 6,0,0
?CND3: WINPOS 1,1,1
GET 0,17
WINSIZE 1,GL-FONT-Y,STACK
GET 0,18
SUB STACK,GL-FONT-Y
ADD STACK,1
WINPOS 2,STACK,1
GET 0,17
WINSIZE 2,GL-FONT-Y,STACK
MUL 3,GL-FONT-Y
ADD 1,STACK
WINPOS 3,STACK,1
GET 0,18 >?TMP2
MUL 3,GL-FONT-Y
SUB ?TMP2,STACK >?TMP1
MUL 10,GL-FONT-X
WINSIZE 3,?TMP1,STACK
MUL 3,GL-FONT-Y
ADD 1,STACK >?TMP1
MUL 11,GL-FONT-X
ADD 1,STACK
WINPOS 4,?TMP1,STACK
GET 0,18 >?TMP2
MUL 3,GL-FONT-Y
SUB ?TMP2,STACK >?TMP1
MUL 15,GL-FONT-X
WINSIZE 4,?TMP1,STACK
ADD GL-FONT-Y,1
WINPOS 5,STACK,1
MUL 2,GL-FONT-Y >?TMP1
MUL 27,GL-FONT-X
WINSIZE 5,?TMP1,STACK
WINPOS 7,1,1
GET 0,18 >?TMP1
GET 0,17
WINSIZE 7,?TMP1,STACK
SCREEN 7
HLIGHT K-H-INV
WINGET 3,K-W-YPOS >Y
WINGET 3,K-W-YSIZE
ADD Y,STACK
SUB STACK,1 >Y1
?PRG6: CALL2 C-PIXELS,11
CURSET Y,STACK
PRINTC 32
CALL2 C-PIXELS,27
CURSET Y,STACK
PRINTC 32
ADD Y,GL-FONT-Y >Y
GRTR? Y,Y1 \?PRG6
HLIGHT K-H-NRM
SCREEN 5
WINGET 5,K-W-XSIZE
DIV STACK,GL-SPACE-WIDTH >N
PUTB K-DIROUT-TBL,0,32
ADD K-DIROUT-TBL,1 >?TMP1
SUB 0,N
COPYT K-DIROUT-TBL,?TMP1,STACK
CURSET 1,1
HLIGHT K-H-INV
PRINTT K-DIROUT-TBL,N
CURSET 1,1
PRINTI "EXECUTE"
ICALL CCURSET,1,13
PRINTI "DELETE"
ICALL CCURSET,2,1
PRINTT K-DIROUT-TBL,N
ICALL CCURSET,2,1
PRINTI "UP"
ICALL CCURSET,2,7
PRINTI "DN"
ICALL CCURSET,2,13
PRINTI "UP"
ICALL CCURSET,2,24
PRINTI "DN"
HLIGHT K-H-NRM
SCREEN 1
CURSET 1,1
WINGET 1,K-W-XSIZE
DIV STACK,GL-SPACE-WIDTH >N
PUTB K-DIROUT-TBL,0,32
ADD K-DIROUT-TBL,1 >?TMP1
SUB 0,N
COPYT K-DIROUT-TBL,?TMP1,STACK
HLIGHT H-INVERSE
PRINTT K-DIROUT-TBL,N
HLIGHT H-NORMAL
SCREEN 0
SET 'GL-SL-HERE,FALSE-VALUE
RTRUE
.FUNCT UPDATE-STATUS-LINE:ANY:0:0,C,CW,N,H,M,S,?TMP1
SCREEN 1
HLIGHT K-H-INV
EQUAL? HERE,GL-SL-HERE /?CND1
SET 'GL-SL-HERE,HERE
CURSET 1,1
WINGET 1,K-W-XSIZE >?TMP1
WINGET 1,K-W-XCURPOS
SUB ?TMP1,STACK
DIV STACK,GL-SPACE-WIDTH >N
PUTB K-DIROUT-TBL,0,32
ADD K-DIROUT-TBL,1 >?TMP1
SUB 0,N
COPYT K-DIROUT-TBL,?TMP1,STACK
PRINTT K-DIROUT-TBL,N
CURSET 1,1
DIROUT K-D-TBL-ON,K-DIROUT-TBL
ICALL2 RT-PRINT-DESC,HERE
DIROUT K-D-TBL-OFF
GETB K-DIROUT-TBL,2 >C
LESS? C,97 /?CND3
GRTR? C,122 /?CND3
SUB C,32
PUTB K-DIROUT-TBL,2,STACK
?CND3: ADD K-DIROUT-TBL,2 >?TMP1
GET K-DIROUT-TBL,0
PRINTT ?TMP1,STACK
?CND1: WINGET 1,K-W-XSIZE >?TMP1
MUL 9,GL-FONT-X
SUB ?TMP1,STACK
ADD STACK,1
CURSET 1,STACK
WINGET 1,K-W-XSIZE >?TMP1
WINGET 1,K-W-XCURPOS
SUB ?TMP1,STACK
DIV STACK,GL-SPACE-WIDTH >N
PUTB K-DIROUT-TBL,0,32
ADD K-DIROUT-TBL,1 >?TMP1
SUB 0,N
COPYT K-DIROUT-TBL,?TMP1,STACK
PRINTT K-DIROUT-TBL,N
MOD GL-MOVES,2880 >N
DIV N,120
MOD STACK,24 >H
DIV N,2
MOD STACK,60 >M
MOD N,2
MUL STACK,30 >S
DIROUT K-D-TBL-ON,K-DIROUT-TBL
LESS? H,10 \?CND7
PRINTC 48
?CND7: PRINTN H
PRINTC 58
LESS? M,10 \?CND9
PRINTC 48
?CND9: PRINTN M
PRINTC 58
LESS? S,10 \?CND11
PRINTC 48
?CND11: PRINTN S
DIROUT K-D-TBL-OFF
WINGET 1,K-W-XSIZE >?TMP1
GET 0,24
SUB ?TMP1,STACK
ADD STACK,1
CURSET 1,STACK
ADD K-DIROUT-TBL,2 >?TMP1
GET K-DIROUT-TBL,0
PRINTT ?TMP1,STACK
HLIGHT K-H-NRM
SCREEN 0
RTRUE
.FUNCT RT-PRINT-MENU:ANY:1:1,MN,N,L,TBL,W
ADD 3,MN >W
SCREEN W
CLEAR W
CURSET 1,1
GET K-MENU-TBL,MN >TBL
GETB K-FIRST-ENTRY-TBL,MN >N
WINGET -3,K-W-YSIZE
DIV STACK,GL-FONT-Y
ADD N,STACK
SUB STACK,1 >L
GET TBL,0
LESS? STACK,L \?PRG3
GET TBL,0 >L
?PRG3: GRTR? N,L /TRUE
ICALL RT-PRINT-MENU-ENTRY,MN,N
CRLF
INC 'N
JUMP ?PRG3
.FUNCT RT-PRINT-MENU-ENTRY:ANY:2:2,MN,N,L,ITEM,TBL,W,T
GET K-MENU-TBL,MN >TBL
ZERO? TBL /FALSE
GET TBL,N >ITEM
ZERO? ITEM /FALSE
GETB K-MENU-TBL-TYPE,MN >T
EQUAL? T,K-MENU-ONE-WORD \?CCL8
PRINTB ITEM
RTRUE
?CCL8: EQUAL? T,K-MENU-MANY-WORD \?CCL10
GET ITEM,0 >L
ADD ITEM,2 >ITEM
?PRG11: DLESS? 'L,0 /TRUE
GET ITEM,0 >W
ZERO? W /?CCL18
PRINTB W
JUMP ?CND16
?CCL18: PRINTC 126
?CND16: GRTR? L,0 \?CND19
PRINTC 32
?CND19: ADD ITEM,2 >ITEM
JUMP ?PRG11
?CCL10: EQUAL? T,K-MENU-OBJECT \FALSE
ADD LAST-OBJECT,1
EQUAL? ITEM,STACK \?CCL25
PRINTI "all"
RTRUE
?CCL25: GETP ITEM,P?MENU >W
ZERO? W /?CCL27
PRINT W
RTRUE
?CCL27: CALL2 RT-PRINT-DESC,ITEM
RSTACK
.FUNCT RT-HLIGHT-MENU:ANY:2:3,MN,L,ON?,Y,TBL,N,?TMP1
ASSIGNED? 'ON? /?CND1
SET 'ON?,TRUE-VALUE
?CND1: ADD 3,MN
SCREEN STACK
GETB K-FIRST-ENTRY-TBL,MN
SUB L,STACK
ADD STACK,1 >Y
CALL2 L-PIXELS,Y
CURSET STACK,1
ZERO? ON? /?CND3
HLIGHT K-H-INV
?CND3: ICALL RT-PRINT-MENU-ENTRY,MN,L
ZERO? ON? /?CCL7
WINGET -3,K-W-XSIZE >?TMP1
WINGET -3,K-W-XCURPOS
SUB ?TMP1,STACK
DIV STACK,GL-SPACE-WIDTH >N
PUTB K-DIROUT-TBL,0,32
ADD K-DIROUT-TBL,1 >?TMP1
SUB 0,N
COPYT K-DIROUT-TBL,?TMP1,STACK
PRINTT K-DIROUT-TBL,N
HLIGHT K-H-NRM
RTRUE
?CCL7: ERASE 1
RTRUE
.FUNCT RT-GET-PREPS:ANY:2:3,ACT,TBL,PREP,PTR,L,M,N,P
ASSIGNED? 'PREP /?CND1
SET 'PREP,-1
?CND1: EQUAL? PREP,-1 \?CCL5
SET 'L,1
JUMP ?PRG6
?CCL5: SET 'L,3
?PRG6: EQUAL? L,1 \?CCL10
GET ACT,2 >PTR
JUMP ?CND8
?CCL10: GET ACT,3 >PTR
?CND8: ZERO? PTR /?CND11
GET PTR,0 >M
ADD PTR,2 >PTR
GET TBL,0 >N
?PRG13: DLESS? 'M,0 /?CND11
EQUAL? PREP,-1 \?CCL20
GET PTR,1 >P
JUMP ?CND18
?CCL20: GET PTR,3 >P
?CND18: ZERO? P /?CND21
EQUAL? PREP,-1 /?CCL24
GET PTR,1
EQUAL? PREP,STACK \?CND21
?CCL24: ADD TBL,2
INTBL? P,STACK,N /?CND21
INC 'N
PUT TBL,N,P
PUT TBL,0,N
?CND21: EQUAL? L,1 \?CCL31
ADD PTR,6 >PTR
JUMP ?PRG13
?CCL31: ADD PTR,10 >PTR
JUMP ?PRG13
?CND11: EQUAL? L,1 \TRUE
SET 'L,3
JUMP ?PRG6
.FUNCT RT-GET-OBJS:ANY:1:3,TBL,CONT,SEARCH,OBJ,N,PTR,ADD?
ASSIGNED? 'CONT /?CND1
SET 'CONT,HERE
?CND1: ASSIGNED? 'SEARCH /?CND3
SET 'SEARCH,15
?CND3: FIRST? CONT >OBJ /?PRG6
?PRG6: ZERO? OBJ /TRUE
FSET? OBJ,FL-INVISIBLE /?CND8
IN? CONT,ROOMS \?CCL14
BAND SEARCH,1 >ADD?
JUMP ?CND12
?CCL14: EQUAL? CONT,CH-PLAYER \?CCL16
BAND SEARCH,4 >ADD?
JUMP ?CND12
?CCL16: SET 'ADD?,TRUE-VALUE
?CND12: ZERO? ADD? /?CND17
GET TBL,0
ADD STACK,1 >N
PUT TBL,N,OBJ
PUT TBL,0,N
?CND17: IN? CONT,ROOMS \?PRD22
BTST SEARCH,2 /?CCL20
?PRD22: EQUAL? CONT,CH-PLAYER \?CND8
BTST SEARCH,8 \?CND8
?CCL20: CALL2 CLOSED?,OBJ
ZERO? STACK \?CND8
ICALL RT-GET-OBJS,TBL,OBJ,SEARCH
?CND8: NEXT? OBJ >OBJ /?PRG6
JUMP ?PRG6
.FUNCT RT-DO-OBJECTS:ANY:0:1,SEARCH,PTR,I,N,OBJ,STR
ASSIGNED? 'SEARCH /?CND1
SET 'SEARCH,31
?CND1: BTST SEARCH,16 \?CND3
ADD LAST-OBJECT,1
PUT K-OBJECT-TBL,1,STACK
PUT K-OBJECT-TBL,0,1
?CND3: ICALL RT-GET-OBJS,K-OBJECT-TBL,HERE,SEARCH
GETPT HERE,P?GLOBAL >PTR
PTSIZE PTR
DIV STACK,2 >N
?PRG5: DLESS? 'N,0 /?REP6
GET K-OBJECT-TBL,0
ADD STACK,1 >I
GET PTR,0
PUT K-OBJECT-TBL,I,STACK
PUT K-OBJECT-TBL,0,I
ADD PTR,2 >PTR
JUMP ?PRG5
?REP6: RETURN K-OBJECT-TBL
.FUNCT RT-GET-MEM:ANY:1:1,N,PTR
SET 'PTR,GL-FREE-PTR
ADD N,1
MUL 2,STACK
ADD GL-FREE-PTR,STACK >GL-FREE-PTR
PUT PTR,0,N
RETURN PTR
.FUNCT RT-FREE-MEM:ANY:1:4,PTR,N,P,L
ASSIGNED? 'N /?CND1
SET 'N,-1
?CND1: LESS? N,0 \?CND3
GET PTR,0 >N
?CND3: ADD N,1
MUL 2,STACK >L
ADD PTR,L >P
SUB GL-FREE-PTR,P
COPYT P,PTR,STACK
SUB GL-FREE-PTR,L >GL-FREE-PTR
RETURN GL-FREE-PTR
.FUNCT RT-STOP-READ:ANY:0:0
SET 'GL-INPUT-TIMEOUT,TRUE-VALUE
RTRUE
.FUNCT MOUSE-INPUT?:ANY:0:5,W,X1,Y1,X2,Y2,N
GET 0,27
GET STACK,1 >GL-MOUSE-X
GET 0,27
GET STACK,2 >GL-MOUSE-Y
ASSIGNED? 'W \TRUE
ASSIGNED? 'X1 /?CCL5
EQUAL? W,-1 /TRUE
WINGET W,K-W-XPOS >X1
WINGET W,K-W-YPOS >Y1
WINGET W,K-W-XSIZE
ADD X1,STACK
SUB STACK,1 >X2
WINGET W,K-W-YSIZE
ADD Y1,STACK
SUB STACK,1 >Y2
LESS? GL-MOUSE-X,X1 /FALSE
GRTR? GL-MOUSE-X,X2 /FALSE
LESS? GL-MOUSE-Y,Y1 /FALSE
GRTR? GL-MOUSE-Y,Y2 /FALSE
SUB GL-MOUSE-X,X1
ADD STACK,1 >GL-MOUSE-X
SUB GL-MOUSE-Y,Y1
ADD STACK,1 >GL-MOUSE-Y
RTRUE
?CCL5: EQUAL? W,-1 /?CND16
WINGET W,K-W-XPOS
SUB STACK,1 >N
ADD X1,N >X1
ADD X2,N >X2
WINGET W,K-W-YPOS
SUB STACK,1 >N
ADD Y1,N >Y1
ADD Y2,N >Y2
?CND16: LESS? GL-MOUSE-X,X1 /FALSE
GRTR? GL-MOUSE-X,X2 /FALSE
LESS? GL-MOUSE-Y,Y1 /FALSE
GRTR? GL-MOUSE-Y,Y2 /FALSE
SUB GL-MOUSE-X,X1
ADD STACK,1 >GL-MOUSE-X
SUB GL-MOUSE-Y,Y1
ADD STACK,1 >GL-MOUSE-Y
RTRUE
.FUNCT READ-INPUT:ANY:0:0,C,L,M,N,TBL,ACT,S?,Y,X,W,?TMP1
MOUSE-LIMIT -1
SET 'GL-FREE-PTR,K-JUNK-TBL
SET 'GL-VERB-TBL,K-DEFAULT-VERB-TBL
SET 'GL-PREP-TBL,FALSE-VALUE
CALL1 RT-DO-OBJECTS >GL-NOUN-TBL
PUTB K-FIRST-ENTRY-TBL,0,1
PUTB K-FIRST-ENTRY-TBL,1,1
PUTB K-MENU-TBL-TYPE,0,K-MENU-MANY-WORD
PUTB K-MENU-TBL-TYPE,1,K-MENU-OBJECT
PUT K-MENU-TBL,0,GL-VERB-TBL
PUT K-MENU-TBL,1,GL-NOUN-TBL
SET 'GL-INPUT-WINNER,CH-PLAYER
SET 'GL-INPUT-VERB,FALSE-VALUE
SET 'GL-INPUT-PREP1,FALSE-VALUE
SET 'GL-INPUT-PREP2,FALSE-VALUE
SET 'GL-MENU-NUM,0
SET 'GL-ITEM-NUM,0
SET 'GL-INPUT-STATE,0
ICALL2 RT-PRINT-MENU,0
ICALL2 RT-PRINT-MENU,1
GET K-MENU-TBL,GL-MENU-NUM >TBL
SET 'L,1
SCREEN 0
WINATTR 0,A-BUFFER,O-CLEAR
WINGET 0,K-W-YCURPOS >Y
PRINTC 62
PUTB P-INBUF,1,0
?PRG1: SET 'S?,FALSE-VALUE
ICALL RT-HLIGHT-MENU,GL-MENU-NUM,L
SCREEN 0
READ P-INBUF,P-LEXV >C
GETB P-INBUF,1 >N
EQUAL? C,K-CLICK1,K-CLICK2 \?CND3
SET 'W,3
?PRG5: CALL2 MOUSE-INPUT?,W
ZERO? STACK \?REP6
IGRTR? 'W,5 \?PRG5
SET 'W,-1
?REP6: EQUAL? W,3,4 \?CCL13
SUB W,3 >W
SUB GL-MOUSE-Y,1
DIV STACK,GL-FONT-Y >?TMP1
GETB K-FIRST-ENTRY-TBL,W
ADD ?TMP1,STACK >M
EQUAL? L,M \?CCL15
EQUAL? GL-MENU-NUM,W /?CND14
?CCL15: GET K-MENU-TBL,W
GET STACK,0
GRTR? M,STACK /?CCL20
ICALL RT-HLIGHT-MENU,GL-MENU-NUM,L,FALSE-VALUE
ICALL RT-HLIGHT-MENU,W,M
?CND14: SET 'GL-MENU-NUM,W
GET K-MENU-TBL,GL-MENU-NUM >TBL
SET 'L,M
SET 'C,K-F1
JUMP ?CND3
?CCL20: SOUND S-BEEP
JUMP ?PRG1
?CCL13: EQUAL? W,5 \?CCL22
CALL2 PIXELS-L,GL-MOUSE-Y >Y
CALL2 PIXELS-C,GL-MOUSE-X >X
EQUAL? Y,1 \?CCL25
LESS? X,13 \?CCL28
SET 'C,CR
CRLF
JUMP ?CND3
?CCL28: SET 'C,K-F2
JUMP ?CND3
?CCL25: LESS? X,4 \?CCL31
SET 'C,K-F3
SET 'W,0
JUMP ?CND29
?CCL31: LESS? X,7 /?CCL33
LESS? X,10 \?CCL33
SET 'C,K-F4
SET 'W,0
JUMP ?CND29
?CCL33: LESS? X,13 /?CCL37
LESS? X,16 \?CCL37
SET 'C,K-F3
SET 'W,1
JUMP ?CND29
?CCL37: LESS? X,24 /?CCL41
LESS? X,27 \?CCL41
SET 'C,K-F4
SET 'W,1
?CND29: EQUAL? GL-MENU-NUM,W /?CND3
GET K-MENU-TBL,W >M
GET M,0
GRTR? STACK,0 \?CCL48
ICALL RT-HLIGHT-MENU,GL-MENU-NUM,L,FALSE-VALUE
SET 'TBL,M
GETB K-FIRST-ENTRY-TBL,W >L
SET 'GL-MENU-NUM,W
GET TBL,0
GRTR? L,STACK \?CCL51
GET TBL,0 >L
JUMP ?CND3
?CCL41: SOUND S-BEEP
JUMP ?PRG1
?CCL51: GET TBL,L
ZERO? STACK \?CND3
INC 'L
?CND3: SCREEN 0
EQUAL? C,CR,LF /?REP2
EQUAL? C,32 \?CCL57
ADD P-INBUF,2
PUTB STACK,N,32
PRINTC 32
INC 'N
PUTB P-INBUF,1,N
JUMP ?CND53
?CCL48: SOUND S-BEEP
JUMP ?PRG1
?CCL22: SOUND S-BEEP
JUMP ?PRG1
?CCL57: EQUAL? C,K-F1 \?CCL59
ZERO? TBL /?CCL62
GET TBL,0
GRTR? STACK,0 \?CCL62
DIROUT K-D-TBL-ON,K-DIROUT-TBL
ICALL RT-PRINT-MENU-ENTRY,GL-MENU-NUM,L
DIROUT K-D-TBL-OFF
GET K-DIROUT-TBL,0 >M
SHIFT GL-INPUT-STATE,8
BOR N,STACK
PUT K-ITEM-TBL,GL-ITEM-NUM,STACK
GRTR? N,0 \?CND65
ADD P-INBUF,2 >?TMP1
SUB N,1
GETB ?TMP1,STACK
EQUAL? STACK,32 /?CND65
ADD P-INBUF,2
PUTB STACK,N,32
PRINTC 32
INC 'N
?CND65: ADD K-DIROUT-TBL,2 >?TMP1
ADD 2,N
ADD P-INBUF,STACK
COPYT ?TMP1,STACK,M
ADD K-DIROUT-TBL,2
PRINTT STACK,M
ADD N,M >N
ZERO? GL-INPUT-STATE \?CCL71
EQUAL? GL-MENU-NUM,1 \?CCL71
ADD P-INBUF,2
PUTB STACK,N,44
PRINTC 44
INC 'N
JUMP ?CND69
?CCL71: EQUAL? GL-INPUT-STATE,0,1 \?CND69
ZERO? GL-MENU-NUM \?CND69
GET TBL,L
GET STACK,1
GET STACK,4
BTST STACK,64 \?CND69
ADD P-INBUF,2
PUTB STACK,N,46
PRINTC 46
INC 'N
?CND69: ADD P-INBUF,2
PUTB STACK,N,32
PRINTC 32
INC 'N
PUTB P-INBUF,1,N
LEX P-INBUF,P-LEXV
INC 'GL-ITEM-NUM
INPUT 1,1,RT-STOP-READ
EQUAL? GL-INPUT-STATE,0,1 \?CCL80
ZERO? GL-MENU-NUM \?CCL80
GET TBL,L
GET STACK,1 >GL-INPUT-VERB
GET GL-INPUT-VERB,4
BTST STACK,64 \?CCL85
SET 'GL-INPUT-STATE,0
GETB K-FIRST-ENTRY-TBL,0
EQUAL? STACK,1 \?CCL88
ICALL RT-HLIGHT-MENU,GL-MENU-NUM,L,FALSE-VALUE
JUMP ?CND86
?CCL88: PUTB K-FIRST-ENTRY-TBL,1,1
ICALL2 RT-PRINT-MENU,GL-MENU-NUM
?CND86: SET 'L,1
JUMP ?CND53
?CCL85: SET 'GL-INPUT-STATE,2
GET TBL,L >M
GET M,0
GRTR? STACK,1 \?CND89
GET M,2 >GL-INPUT-PREP1
?CND89: GET GL-INPUT-VERB,3 >ACT
ZERO? GL-PREP-TBL /?CND91
ICALL2 RT-FREE-MEM,GL-PREP-TBL
?CND91: SET 'GL-PREP-TBL,GL-FREE-PTR
PUT GL-PREP-TBL,0,0
ICALL RT-GET-PREPS,ACT,GL-PREP-TBL
GET GL-PREP-TBL,0
ADD STACK,1
MUL STACK,2
ADD GL-FREE-PTR,STACK >GL-FREE-PTR
PUT K-MENU-TBL,0,GL-PREP-TBL
PUTB K-FIRST-ENTRY-TBL,0,1
PUTB K-MENU-TBL-TYPE,0,K-MENU-ONE-WORD
ICALL2 RT-PRINT-MENU,0
SET 'TBL,FALSE-VALUE
GET GL-NOUN-TBL,0
GRTR? STACK,0 \?CND53
SET 'S?,TRUE-VALUE
JUMP ?CND53
?CCL80: ZERO? GL-INPUT-STATE \?CCL96
EQUAL? GL-MENU-NUM,1 \?CND53
SET 'GL-INPUT-STATE,1
SET 'S?,TRUE-VALUE
JUMP ?CND53
?CCL96: EQUAL? GL-INPUT-STATE,2 \?CCL100
EQUAL? GL-MENU-NUM,1 /?CCL102
ZERO? GL-MENU-NUM \?CND53
ZERO? GL-INPUT-PREP1 \?CND53
?CCL102: EQUAL? GL-MENU-NUM,1 \?CCL109
INC 'GL-INPUT-STATE
JUMP ?CND107
?CCL109: GET TBL,L >GL-INPUT-PREP1
GETB K-MENU-TBL-TYPE,GL-MENU-NUM
EQUAL? STACK,K-MENU-MANY-WORD \?CND107
GET GL-INPUT-PREP1,1 >GL-INPUT-PREP1
?CND107: ZERO? GL-PREP-TBL /?CND112
ICALL2 RT-FREE-MEM,GL-PREP-TBL
?CND112: SET 'GL-PREP-TBL,GL-FREE-PTR
PUT GL-PREP-TBL,0,0
GET GL-INPUT-VERB,3
ICALL RT-GET-PREPS,STACK,GL-PREP-TBL,GL-INPUT-PREP1
GET GL-PREP-TBL,0
ADD STACK,1
MUL STACK,2
ADD GL-FREE-PTR,STACK >GL-FREE-PTR
PUT K-MENU-TBL,0,GL-PREP-TBL
PUTB K-FIRST-ENTRY-TBL,0,1
PUTB K-MENU-TBL-TYPE,0,K-MENU-ONE-WORD
ICALL2 RT-PRINT-MENU,0
SET 'S?,TRUE-VALUE
JUMP ?CND53
?CCL100: EQUAL? GL-INPUT-STATE,3 \?CND53
ZERO? GL-MENU-NUM \?CND53
INC 'GL-INPUT-STATE
SET 'S?,TRUE-VALUE
JUMP ?CND53
?CCL62: SOUND S-BEEP
JUMP ?CND53
?CCL59: EQUAL? C,K-F2 \?CCL118
GRTR? GL-ITEM-NUM,0 \?CCL121
DEC 'GL-ITEM-NUM
GET K-ITEM-TBL,GL-ITEM-NUM >N
SHIFT N,-8 >M
BAND N,255 >N
PUTB P-INBUF,1,N
CURGET K-WIN-TBL
GET K-WIN-TBL,0
CURSET STACK,1
ERASE 1
PRINTC 62
ADD P-INBUF,2
PRINTT STACK,N
EQUAL? GL-INPUT-STATE,M /?CND122
EQUAL? M,0,1 \?CCL126
PUTB K-FIRST-ENTRY-TBL,0,1
PUTB K-FIRST-ENTRY-TBL,1,1
PUTB K-MENU-TBL-TYPE,0,K-MENU-MANY-WORD
PUTB K-MENU-TBL-TYPE,1,K-MENU-OBJECT
PUT K-MENU-TBL,0,GL-VERB-TBL
PUT K-MENU-TBL,1,GL-NOUN-TBL
SET 'GL-MENU-NUM,0
JUMP ?CND124
?CCL126: EQUAL? M,2,3,4 \?CND124
ZERO? GL-PREP-TBL /?CND128
ICALL2 RT-FREE-MEM,GL-PREP-TBL
?CND128: SET 'GL-PREP-TBL,GL-FREE-PTR
PUT GL-PREP-TBL,0,0
GET GL-INPUT-VERB,3 >ACT
EQUAL? M,2 \?CCL132
ICALL RT-GET-PREPS,ACT,GL-PREP-TBL
JUMP ?CND130
?CCL132: ICALL RT-GET-PREPS,ACT,GL-PREP-TBL,GL-INPUT-PREP1
?CND130: GET GL-PREP-TBL,0
ADD STACK,1
MUL STACK,2
ADD GL-FREE-PTR,STACK >GL-FREE-PTR
PUTB K-FIRST-ENTRY-TBL,0,1
PUTB K-FIRST-ENTRY-TBL,1,1
PUTB K-MENU-TBL-TYPE,0,K-MENU-ONE-WORD
PUTB K-MENU-TBL-TYPE,1,K-MENU-OBJECT
PUT K-MENU-TBL,0,GL-PREP-TBL
PUT K-MENU-TBL,1,GL-NOUN-TBL
EQUAL? M,3 \?CCL135
SET 'GL-MENU-NUM,0
JUMP ?CND124
?CCL135: SET 'GL-MENU-NUM,1
?CND124: ICALL2 RT-PRINT-MENU,0
ICALL2 RT-PRINT-MENU,1
SET 'GL-INPUT-STATE,M
?CND122: GET K-MENU-TBL,GL-MENU-NUM >TBL
SET 'L,1
JUMP ?CND53
?CCL121: SOUND S-BEEP
JUMP ?CND53
?CCL118: EQUAL? C,K-F3 \?CCL137
ADD 3,GL-MENU-NUM
SCREEN STACK
GETB K-FIRST-ENTRY-TBL,GL-MENU-NUM >M
WINGET -3,K-W-YSIZE
DIV STACK,GL-FONT-Y >N
GRTR? M,1 \?CCL140
SUB M,N
LESS? STACK,1 \?CCL143
PUTB K-FIRST-ENTRY-TBL,GL-MENU-NUM,1
GRTR? L,N \?CND141
SUB L,N >L
JUMP ?CND141
?CCL143: SUB M,N
PUTB K-FIRST-ENTRY-TBL,GL-MENU-NUM,STACK
SUB L,N >L
?CND141: LESS? L,1 \?CCL148
SET 'L,1
JUMP ?CND146
?CCL148: GET TBL,L
ZERO? STACK \?CND146
DEC 'L
?CND146: ICALL2 RT-PRINT-MENU,GL-MENU-NUM
JUMP ?CND53
?CCL140: GRTR? L,1 \?CCL151
ICALL RT-HLIGHT-MENU,GL-MENU-NUM,L,FALSE-VALUE
SET 'L,1
JUMP ?CND53
?CCL151: SOUND S-BEEP
JUMP ?CND53
?CCL137: EQUAL? C,K-F4 \?CCL153
ADD 3,GL-MENU-NUM
SCREEN STACK
GETB K-FIRST-ENTRY-TBL,GL-MENU-NUM >M
WINGET -3,K-W-YSIZE
DIV STACK,GL-FONT-Y >N
GET TBL,0
LESS? M,STACK \?CCL156
ADD M,N >?TMP1
GET TBL,0
GRTR? ?TMP1,STACK \?CCL159
GET TBL,0
PUTB K-FIRST-ENTRY-TBL,GL-MENU-NUM,STACK
GET TBL,0 >L
JUMP ?CND157
?CCL159: ADD M,N
PUTB K-FIRST-ENTRY-TBL,GL-MENU-NUM,STACK
ADD L,N >L
?CND157: GET TBL,0
GRTR? L,STACK \?CCL162
GET TBL,0 >L
JUMP ?CND160
?CCL162: GET TBL,L
ZERO? STACK \?CND160
INC 'L
?CND160: ICALL2 RT-PRINT-MENU,GL-MENU-NUM
JUMP ?CND53
?CCL156: SOUND S-BEEP
JUMP ?CND53
?CCL153: EQUAL? C,K-UP \?CCL165
GRTR? L,1 \?CCL168
ICALL RT-HLIGHT-MENU,GL-MENU-NUM,L,FALSE-VALUE
GETB K-FIRST-ENTRY-TBL,GL-MENU-NUM >M
WINGET -3,K-W-YSIZE
DIV STACK,GL-FONT-Y >N
?PRG169: EQUAL? L,M \?CND171
SUB 0,GL-FONT-Y
SCROLL -3,STACK
DEC 'M
PUTB K-FIRST-ENTRY-TBL,GL-MENU-NUM,M
?CND171: DLESS? 'L,2 /?CND53
GET TBL,L
ZERO? STACK /?PRG169
JUMP ?CND53
?CCL168: SOUND S-BEEP
JUMP ?CND53
?CCL165: EQUAL? C,K-DOWN \?CCL178
GET TBL,0
LESS? L,STACK \?CCL181
ICALL RT-HLIGHT-MENU,GL-MENU-NUM,L,FALSE-VALUE
GETB K-FIRST-ENTRY-TBL,GL-MENU-NUM >M
WINGET -3,K-W-YSIZE
DIV STACK,GL-FONT-Y >N
?PRG182: GET TBL,0
SUB STACK,1
IGRTR? 'L,STACK /?CND53
ADD M,N
EQUAL? L,STACK \?CND186
SCROLL -3,GL-FONT-Y
INC 'M
PUTB K-FIRST-ENTRY-TBL,GL-MENU-NUM,M
?CND186: GET TBL,L
ZERO? STACK /?PRG182
JUMP ?CND53
?CCL181: SOUND S-BEEP
JUMP ?CND53
?CCL178: EQUAL? C,K-LEFT,K-RIGHT \?CND53
ADD GL-MENU-NUM,1
MOD STACK,2 >M
GET K-MENU-TBL,M >N
GET N,0
GRTR? STACK,0 \?CCL193
ICALL RT-HLIGHT-MENU,GL-MENU-NUM,L,FALSE-VALUE
SET 'TBL,N
GETB K-FIRST-ENTRY-TBL,GL-MENU-NUM
SUB L,STACK >?TMP1
GETB K-FIRST-ENTRY-TBL,M
ADD ?TMP1,STACK >L
SET 'GL-MENU-NUM,M
GET TBL,0
GRTR? L,STACK \?CCL196
GET TBL,0 >L
JUMP ?CND53
?CCL196: GET TBL,L
ZERO? STACK \?CND53
INC 'L
JUMP ?CND53
?CCL193: SOUND S-BEEP
?CND53: ZERO? S? /?PRG1
ADD GL-MENU-NUM,1
MOD STACK,2 >M
GET K-MENU-TBL,M
GET STACK,0
GRTR? STACK,0 \?PRG1
ZERO? TBL /?CND202
ICALL RT-HLIGHT-MENU,GL-MENU-NUM,L,FALSE-VALUE
?CND202: SET 'GL-MENU-NUM,M
GETB K-FIRST-ENTRY-TBL,GL-MENU-NUM
EQUAL? STACK,1 /?CND204
PUTB K-FIRST-ENTRY-TBL,GL-MENU-NUM,1
ICALL2 RT-PRINT-MENU,GL-MENU-NUM
?CND204: GET K-MENU-TBL,GL-MENU-NUM >TBL
SET 'L,1
JUMP ?PRG1
?REP2: ICALL1 RT-SCRIPT-INBUF
SCREEN 0
WINATTR 0,A-BUFFER,O-SET
RETURN C
.FUNCT SPECIAL-CONTRACTION?:ANY:1:1,PTR
RFALSE
.FUNCT EXPAND-BE-CONTRACTIONS:ANY:0:0,LEN,PTR,OPTR,N,WD,SPWD,L,?TMP1
GETB P-LEXV,P-LEXWORDS >LEN
SET 'PTR,P-LEXV+2
SET 'OPTR,PTR
SET 'L,LEN
?PRG1: SET 'SPWD,FALSE-VALUE
DLESS? 'L,0 \?CCL5
PUTB P-LEXV,P-LEXWORDS,LEN
RTRUE
?CCL5: GET PTR,0 >WD
ZERO? WD /?CCL7
GET PTR,P-LEXELEN
EQUAL? STACK,W?APOSTROPHE \?CCL7
GET P-QA-WORDS1,0
INTBL? WD,P-QA-WORDS1+2,STACK >N \?PRD12
SUB N,P-QA-WORDS1
DIV STACK,2 >N
GET P-QA-WORDS2,N >?TMP1
GET PTR,4
EQUAL? ?TMP1,STACK /?CTR6
?PRD12: CALL2 SPECIAL-CONTRACTION?,PTR >SPWD
ZERO? SPWD /?CCL7
?CTR6: ZERO? SPWD /?CCL17
PUSH 8
JUMP ?CND15
?CCL17: PUSH 4
?CND15: ADD PTR,STACK >?TMP1
MUL L,4
COPYT ?TMP1,PTR,STACK
ZERO? SPWD /?CCL20
PUT PTR,0,SPWD
DEC 'L
DEC 'LEN
JUMP ?CND18
?CCL20: GET P-QB-WORDS-1,N >WD
PUT PTR,0,WD
GET P-QB-WORDS-2,N >WD
PUT PTR,P-LEXELEN,WD
?CND18: DEC 'L
DEC 'LEN
JUMP ?PRG1
?CCL7: EQUAL? WD,W?APOSTROPHE \?CCL22
GET PTR,P-LEXELEN
EQUAL? STACK,W?S /?CCL22
EQUAL? OPTR,PTR /?CCL22
SUB PTR,4 >WD
ZERO? WD /?CCL22
GETB WD,2
ADD -1,STACK >?TMP1
GETB WD,3
ADD ?TMP1,STACK
GETB P-INBUF,STACK
EQUAL? STACK,115,122 \?CCL22
SUB PTR,P-LEXV
DIV STACK,2
ADD P-LEXELEN,STACK
ICALL MAKE-ROOM-FOR-TOKENS,1,P-LEXV,STACK
PUT PTR,P-LEXELEN,W?S
INC 'L
INC 'LEN
JUMP ?PRG1
?CCL22: ADD PTR,4 >PTR
JUMP ?PRG1
.FUNCT TELL-THE:ANY:1:1,OBJ,TMP
EQUAL? OBJ,PLAYER \?CCL3
PRINTI "you"
RTRUE
?CCL3: CALL2 GET-OWNER,OBJ >TMP
ZERO? TMP /?CCL6
EQUAL? TMP,PLAYER \?CCL9
PRINTI "your "
JUMP ?CND4
?CCL9: EQUAL? TMP,OBJ /?CND4
ICALL2 TELL-THE,TMP
PRINTI "'s "
JUMP ?CND4
?CCL6: FSET? OBJ,NARTICLEBIT /?CND4
PRINTI "the "
?CND4: CALL2 RT-PRINT-DESC,OBJ
RSTACK
.FUNCT TELL-CTHE:ANY:1:1,OBJ,TMP
EQUAL? OBJ,PLAYER \?CCL3
PRINTI "You"
RTRUE
?CCL3: CALL2 GET-OWNER,OBJ >TMP
ZERO? TMP /?CCL6
EQUAL? TMP,PLAYER \?CCL9
PRINTI "Your "
JUMP ?CND4