xref: /csrg-svn/contrib/dungeon/gdt.F (revision 35973)
1*35973SbosticC GDT- GAME DEBUGGING TOOL
2*35973SbosticC
3*35973SbosticC COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142
4*35973SbosticC ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED
5*35973SbosticC WRITTEN BY R. M. SUPNIK
6*35973SbosticC
7*35973SbosticC DECLARATIONS
8*35973SbosticC
9*35973Sbostic	SUBROUTINE GDT
10*35973Sbostic	IMPLICIT INTEGER (A-Z)
11*35973Sbostic#ifdef PDP
12*35973SbosticC
13*35973SbosticC	no debugging tool available in pdp version
14*35973SbosticC
15*35973Sbostic	call nogdt
16*35973Sbostic	return
17*35973Sbostic#else
18*35973Sbostic	CHARACTER*2 DBGCMD(38),CMD
19*35973Sbostic	INTEGER ARGTYP(38)
20*35973Sbostic	LOGICAL VALID1,VALID2,VALID3
21*35973Sbostic	character*2 ldbgcm(38)
22*35973Sbostic#include "parser.h"
23*35973Sbostic#include "gamestate.h"
24*35973Sbostic#include "state.h"
25*35973Sbostic#include "screen.h"
26*35973Sbostic#include "puzzle.h"
27*35973SbosticC
28*35973SbosticC MISCELLANEOUS VARIABLES
29*35973SbosticC
30*35973Sbostic	COMMON /STAR/ MBASE,STRBIT
31*35973Sbostic#include "io.h"
32*35973Sbostic#include "mindex.h"
33*35973Sbostic#include "debug.h"
34*35973Sbostic#include "rooms.h"
35*35973Sbostic#include "rindex.h"
36*35973Sbostic#include "exits.h"
37*35973Sbostic#include "objects.h"
38*35973Sbostic#include "oindex.h"
39*35973Sbostic#include "clock.h"
40*35973Sbostic#include "villians.h"
41*35973Sbostic#include "advers.h"
42*35973Sbostic#include "flags.h"
43*35973SbosticC
44*35973SbosticC FUNCTIONS AND DATA
45*35973SbosticC
46*35973Sbostic	VALID1(A1,L1)=(A1.GT.0).AND.(A1.LE.L1)
47*35973Sbostic	VALID2(A1,A2,L1)=VALID1(A1,L1).AND.VALID1(A2,L1).AND.
48*35973Sbostic&		(A1.LE.A2)
49*35973Sbostic	VALID3(A1,L1,A2,L2)=VALID1(A1,L1).AND.VALID1(A2,L2)
50*35973Sbostic	DATA CMDMAX/38/
51*35973Sbostic	DATA DBGCMD/'DR','DO','DA','DC','DX','DH','DL','DV','DF','DS',
52*35973Sbostic&		'AF','HE','NR','NT','NC','ND','RR','RT','RC','RD',
53*35973Sbostic&		'TK','EX','AR','AO','AA','AC','AX','AV','D2','DN',
54*35973Sbostic&		'AN','DM','DT','AH','DP','PD','DZ','AZ'/
55*35973Sbostic	DATA ldbgcm/'dr','do','da','dc','dx','dh','dl','dv','df','ds',
56*35973Sbostic&		'af','he','nr','nt','nc','nd','rr','rt','rc','rd',
57*35973Sbostic&		'tk','ex','ar','ao','aa','ac','ax','av','d2','dn',
58*35973Sbostic&		'an','dm','dt','ah','dp','pd','dz','az'/
59*35973Sbostic	DATA ARGTYP/  2 ,  2 ,  2 ,  2 ,  2 ,  0 ,  0 ,  2 ,  2 ,  0 ,
60*35973Sbostic&		  1 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,
61*35973Sbostic&		  1 ,  0 ,  3 ,  3 ,  3 ,  3 ,  1 ,  3 ,  2 ,  2 ,
62*35973Sbostic&		  1 ,  2 ,  1 ,  0 ,  0 ,  0 ,  0 ,  1 /
63*35973SbosticC GDT, PAGE 2
64*35973SbosticC
65*35973SbosticC FIRST, VALIDATE THAT THE CALLER IS AN IMPLEMENTER.
66*35973SbosticC
67*35973Sbostic	FMAX=46
68*35973SbosticC						!SET ARRAY LIMITS.
69*35973Sbostic	SMAX=22
70*35973SbosticC
71*35973Sbostic	IF(GDTFLG.NE.0) GO TO 2000
72*35973SbosticC						!IF OK, SKIP.
73*35973Sbostic	WRITE(OUTCH,100)
74*35973SbosticC						!NOT AN IMPLEMENTER.
75*35973Sbostic	RETURN
76*35973SbosticC						!BOOT HIM OFF
77*35973SbosticC
78*35973Sbostic#ifdef NOCC
79*35973Sbostic100	FORMAT('You are not an authorized user.')
80*35973Sbostic#else NOCC
81*35973Sbostic100	FORMAT(' You are not an authorized user.')
82*35973Sbostic#endif NOCC
83*35973Sbosticc GDT, PAGE 2A
84*35973SbosticC
85*35973SbosticC HERE TO GET NEXT COMMAND
86*35973SbosticC
87*35973Sbostic2000	WRITE(OUTCH,200)
88*35973SbosticC						!OUTPUT PROMPT.
89*35973Sbostic	READ(INPCH,210) CMD
90*35973SbosticC						!GET COMMAND.
91*35973Sbostic	IF(CMD.EQ.'  ') GO TO 2000
92*35973SbosticC						!IGNORE BLANKS.
93*35973Sbostic	DO 2100 I=1,CMDMAX
94*35973SbosticC						!LOOK IT UP.
95*35973Sbostic	  IF(CMD.EQ.DBGCMD(I)) GO TO 2300
96*35973SbosticC						!FOUND?
97*35973SbosticC	  check for lower case command, as well
98*35973Sbostic	  if(cmd .eq. ldbgcm(i)) go to 2300
99*35973Sbostic2100	CONTINUE
100*35973Sbostic2200	WRITE(OUTCH,220)
101*35973SbosticC						!NO, LOSE.
102*35973Sbostic	GO TO 2000
103*35973SbosticC
104*35973Sbostic#ifdef NOCC
105*35973Sbostic200	FORMAT('GDT>',$)
106*35973Sbostic#else NOCC
107*35973Sbostic200	FORMAT(' GDT>',$)
108*35973Sbostic#endif NOCC
109*35973Sbostic210	FORMAT(A2)
110*35973Sbostic#ifdef NOCC
111*35973Sbostic220	FORMAT('?')
112*35973Sbostic#else NOCC
113*35973Sbostic220	FORMAT(' ?')
114*35973Sbostic#endif NOCC
115*35973Sbostic230	FORMAT(2I6)
116*35973Sbostic240	FORMAT(I6)
117*35973Sbostic#ifdef NOCC
118*35973Sbostic225	FORMAT('Limits:   ',$)
119*35973Sbostic235	FORMAT('Entry:    ',$)
120*35973Sbostic245	FORMAT('Idx,Ary:  ',$)
121*35973Sbostic#else NOCC
122*35973Sbostic225	FORMAT(' Limits:   ',$)
123*35973Sbostic235	FORMAT(' Entry:    ',$)
124*35973Sbostic245	FORMAT(' Idx,Ary:  ',$)
125*35973Sbostic#endif NOCC
126*35973Sbosticc
127*35973Sbostic2300	GO TO (2400,2500,2600,2700),ARGTYP(I)+1
128*35973SbosticC						!BRANCH ON ARG TYPE.
129*35973Sbostic	GO TO 2200
130*35973SbosticC						!ILLEGAL TYPE.
131*35973SbosticC
132*35973Sbostic2700	WRITE(OUTCH,245)
133*35973SbosticC						!TYPE 3, REQUEST ARRAY COORDS.
134*35973Sbostic	READ(INPCH,230) J,K
135*35973Sbostic	GO TO 2400
136*35973SbosticC
137*35973Sbostic2600	WRITE(OUTCH,225)
138*35973SbosticC						!TYPE 2, READ BOUNDS.
139*35973Sbostic	READ(INPCH,230) J,K
140*35973Sbostic	IF(K.EQ.0) K=J
141*35973Sbostic	GO TO 2400
142*35973SbosticC
143*35973Sbostic2500	WRITE(OUTCH,235)
144*35973SbosticC						!TYPE 1, READ ENTRY NO.
145*35973Sbostic	READ(INPCH,240) J
146*35973Sbostic2400	GO TO (10000,11000,12000,13000,14000,15000,16000,17000,18000,
147*35973Sbostic&	 19000,20000,21000,22000,23000,24000,25000,26000,27000,28000,
148*35973Sbostic&	 29000,30000,31000,32000,33000,34000,35000,36000,37000,38000,
149*35973Sbostic&	 39000,40000,41000,42000,43000,44000,45000,46000,47000),I
150*35973Sbostic	GO TO 2200
151*35973SbosticC						!WHAT???
152*35973SbosticC GDT, PAGE 3
153*35973SbosticC
154*35973SbosticC DR-- DISPLAY ROOMS
155*35973SbosticC
156*35973Sbostic10000	IF(.NOT.VALID2(J,K,RLNT)) GO TO 2200
157*35973SbosticC						!ARGS VALID?
158*35973Sbostic	WRITE(OUTCH,300)
159*35973SbosticC						!COL HDRS.
160*35973Sbostic	DO 10100 I=J,K
161*35973Sbostic	  WRITE(OUTCH,310) I,(EQR(I,L),L=1,5)
162*35973Sbostic10100	CONTINUE
163*35973Sbostic	GO TO 2000
164*35973SbosticC
165*35973Sbostic#ifdef NOCC
166*35973Sbostic300	FORMAT('RM#  DESC1  EXITS ACTION  VALUE  FLAGS')
167*35973Sbostic310	FORMAT(I3,4(1X,I6),1X,I6)
168*35973Sbostic#else NOCC
169*35973Sbostic300	FORMAT(' RM#  DESC1  EXITS ACTION  VALUE  FLAGS')
170*35973Sbostic310	FORMAT(1X,I3,4(1X,I6),1X,I6)
171*35973Sbostic#endif NOCC
172*35973SbosticC
173*35973SbosticC DO-- DISPLAY OBJECTS
174*35973SbosticC
175*35973Sbostic11000	IF(.NOT.VALID2(J,K,OLNT)) GO TO 2200
176*35973SbosticC						!ARGS VALID?
177*35973Sbostic	WRITE(OUTCH,320)
178*35973SbosticC						!COL HDRS
179*35973Sbostic	DO 11100 I=J,K
180*35973Sbostic	  WRITE(OUTCH,330) I,(EQO(I,L),L=1,14)
181*35973Sbostic11100	CONTINUE
182*35973Sbostic	GO TO 2000
183*35973SbosticC
184*35973Sbostic#ifdef NOCC
185*35973Sbostic320	FORMAT('OB# DESC1 DESC2 DESCO ACT FLAGS1 FLAGS2 FVL TVL
186*35973Sbostic&	  SIZE CAPAC ROOM ADV CON  READ')
187*35973Sbostic330	FORMAT(I3,3I6,I4,2I7,2I4,2I6,1X,3I4,I6)
188*35973Sbostic#else NOCC
189*35973Sbostic320	FORMAT(' OB# DESC1 DESC2 DESCO ACT FLAGS1 FLAGS2 FVL TVL
190*35973Sbostic&	  SIZE CAPAC ROOM ADV CON  READ')
191*35973Sbostic330	FORMAT(1X,I3,3I6,I4,2I7,2I4,2I6,1X,3I4,I6)
192*35973Sbostic#endif NOCC
193*35973SbosticC
194*35973SbosticC DA-- DISPLAY ADVENTURERS
195*35973SbosticC
196*35973Sbostic12000	IF(.NOT.VALID2(J,K,ALNT)) GO TO 2200
197*35973SbosticC						!ARGS VALID?
198*35973Sbostic	WRITE(OUTCH,340)
199*35973Sbostic	DO 12100 I=J,K
200*35973Sbostic	  WRITE(OUTCH,350) I,(EQA(I,L),L=1,7)
201*35973Sbostic12100	CONTINUE
202*35973Sbostic	GO TO 2000
203*35973SbosticC
204*35973Sbostic#ifdef NOCC
205*35973Sbostic340	FORMAT('AD#   ROOM  SCORE  VEHIC OBJECT ACTION  STREN  FLAGS')
206*35973Sbostic350	FORMAT(I3,6(1X,I6),1X,I6)
207*35973Sbostic#else NOCC
208*35973Sbostic340	FORMAT(' AD#   ROOM  SCORE  VEHIC OBJECT ACTION  STREN  FLAGS')
209*35973Sbostic350	FORMAT(1X,I3,6(1X,I6),1X,I6)
210*35973Sbostic#endif NOCC
211*35973SbosticC
212*35973SbosticC DC-- DISPLAY CLOCK EVENTS
213*35973SbosticC
214*35973Sbostic13000	IF(.NOT.VALID2(J,K,CLNT)) GO TO 2200
215*35973SbosticC						!ARGS VALID?
216*35973Sbostic	WRITE(OUTCH,360)
217*35973Sbostic	DO 13100 I=J,K
218*35973Sbostic	  WRITE(OUTCH,370) I,(EQC(I,L),L=1,2),CFLAG(I)
219*35973Sbostic13100	CONTINUE
220*35973Sbostic	GO TO 2000
221*35973SbosticC
222*35973Sbostic#ifdef NOCC
223*35973Sbostic360	FORMAT('CL#   TICK ACTION  FLAG')
224*35973Sbostic370	FORMAT(I3,1X,I6,1X,I6,5X,L1)
225*35973Sbostic#else NOCC
226*35973Sbostic360	FORMAT(' CL#   TICK ACTION  FLAG')
227*35973Sbostic370	FORMAT(1X,I3,1X,I6,1X,I6,5X,L1)
228*35973Sbostic#endif NOCC
229*35973SbosticC
230*35973SbosticC DX-- DISPLAY EXITS
231*35973SbosticC
232*35973Sbostic14000	IF(.NOT.VALID2(J,K,XLNT)) GO TO 2200
233*35973SbosticC						!ARGS VALID?
234*35973Sbostic	WRITE(OUTCH,380)
235*35973SbosticC						!COL HDRS.
236*35973Sbostic	DO 14100 I=J,K,10
237*35973SbosticC						!TEN PER LINE.
238*35973Sbostic	  L=MIN0(I+9,K)
239*35973SbosticC						!COMPUTE END OF LINE.
240*35973Sbostic	  WRITE(OUTCH,390) I,L,(TRAVEL(L1),L1=I,L)
241*35973Sbostic14100	CONTINUE
242*35973Sbostic	GO TO 2000
243*35973SbosticC
244*35973Sbostic#ifdef NOCC
245*35973Sbostic380	FORMAT('  RANGE   CONTENTS')
246*35973Sbostic390	FORMAT(I3,'-',I3,3X,10I7)
247*35973Sbostic#else NOCC
248*35973Sbostic380	FORMAT('   RANGE   CONTENTS')
249*35973Sbostic390	FORMAT(1X,I3,'-',I3,3X,10I7)
250*35973Sbostic#endif NOCC
251*35973SbosticC
252*35973SbosticC DH-- DISPLAY HACKS
253*35973SbosticC
254*35973Sbostic15000	WRITE(OUTCH,400) THFPOS,THFFLG,THFACT,SWDACT,SWDSTA
255*35973Sbostic	GO TO 2000
256*35973SbosticC
257*35973Sbostic#ifdef NOCC
258*35973Sbostic400	FORMAT('THFPOS=',I6,', THFFLG=',L2,',THFACT=',L2/
259*35973Sbostic&	' SWDACT=',L2,', SWDSTA=',I2)
260*35973Sbostic#else NOCC
261*35973Sbostic400	FORMAT(' THFPOS=',I6,', THFFLG=',L2,',THFACT=',L2/
262*35973Sbostic&	' SWDACT=',L2,', SWDSTA=',I2)
263*35973Sbostic#endif NOCC
264*35973SbosticC
265*35973SbosticC DL-- DISPLAY LENGTHS
266*35973SbosticC
267*35973Sbostic16000	WRITE(OUTCH,410) RLNT,XLNT,OLNT,CLNT,VLNT,ALNT,MLNT,R2LNT,
268*35973Sbostic&		MBASE,STRBIT
269*35973Sbostic	GO TO 2000
270*35973SbosticC
271*35973Sbostic#ifdef NOCC
272*35973Sbostic410	FORMAT('R=',I6,', X=',I6,', O=',I6,', C=',I6/
273*35973Sbostic&	'V=',I6,', A=',I6,', M=',I6,', R2=',I5/
274*35973Sbostic&	'MBASE=',I6,', STRBIT=',I6)
275*35973Sbostic#else NOCC
276*35973Sbostic410	FORMAT(' R=',I6,', X=',I6,', O=',I6,', C=',I6/
277*35973Sbostic&	' V=',I6,', A=',I6,', M=',I6,', R2=',I5/
278*35973Sbostic&	' MBASE=',I6,', STRBIT=',I6)
279*35973Sbostic#endif NOCC
280*35973SbosticC
281*35973SbosticC DV-- DISPLAY VILLAINS
282*35973SbosticC
283*35973Sbostic17000	IF(.NOT.VALID2(J,K,VLNT)) GO TO 2200
284*35973SbosticC						!ARGS VALID?
285*35973Sbostic	WRITE(OUTCH,420)
286*35973SbosticC						!COL HDRS
287*35973Sbostic	DO 17100 I=J,K
288*35973Sbostic	  WRITE(OUTCH,430) I,(EQV(I,L),L=1,5)
289*35973Sbostic17100	CONTINUE
290*35973Sbostic	GO TO 2000
291*35973SbosticC
292*35973Sbostic#ifdef NOCC
293*35973Sbostic420	FORMAT('VL# OBJECT   PROB   OPPS   BEST  MELEE')
294*35973Sbostic430	FORMAT(I3,5(1X,I6))
295*35973Sbostic#else NOCC
296*35973Sbostic420	FORMAT(' VL# OBJECT   PROB   OPPS   BEST  MELEE')
297*35973Sbostic430	FORMAT(1X,I3,5(1X,I6))
298*35973Sbostic#endif NOCC
299*35973SbosticC
300*35973SbosticC DF-- DISPLAY FLAGS
301*35973SbosticC
302*35973Sbostic18000	IF(.NOT.VALID2(J,K,FMAX)) GO TO 2200
303*35973SbosticC						!ARGS VALID?
304*35973Sbostic	DO 18100 I=J,K
305*35973Sbostic	  WRITE(OUTCH,440) I,FLAGS(I)
306*35973Sbostic18100	CONTINUE
307*35973Sbostic	GO TO 2000
308*35973SbosticC
309*35973Sbostic#ifdef NOCC
310*35973Sbostic440	FORMAT('Flag #',I2,' = ',L1)
311*35973Sbostic#else NOCC
312*35973Sbostic440	FORMAT(' Flag #',I2,' = ',L1)
313*35973Sbostic#endif NOCC
314*35973SbosticC
315*35973SbosticC DS-- DISPLAY STATE
316*35973SbosticC
317*35973Sbostic19000	WRITE(OUTCH,450) PRSA,PRSO,PRSI,PRSWON,PRSCON
318*35973Sbostic	WRITE(OUTCH,460) WINNER,HERE,TELFLG
319*35973Sbostic	WRITE(OUTCH,470) MOVES,DEATHS,RWSCOR,MXSCOR,MXLOAD,LTSHFT,BLOC,
320*35973Sbostic&		MUNGRM,HS,EGSCOR,EGMXSC
321*35973Sbostic	WRITE(OUTCH,475) FROMDR,SCOLRM,SCOLAC
322*35973Sbostic	GO TO 2000
323*35973SbosticC
324*35973Sbostic#ifdef NOCC
325*35973Sbostic450	FORMAT('Parse vector=',3(1X,I6),1X,L6,1X,I6)
326*35973Sbostic460	FORMAT('Play vector= ',2(1X,I6),1X,L6)
327*35973Sbostic470	FORMAT('State vector=',9(1X,I6)/14X,2(1X,I6))
328*35973Sbostic475	FORMAT('Scol vector= ',1X,I6,2(1X,I6))
329*35973Sbostic#else NOCC
330*35973Sbostic450	FORMAT(' Parse vector=',3(1X,I6),1X,L6,1X,I6)
331*35973Sbostic460	FORMAT(' Play vector= ',2(1X,I6),1X,L6)
332*35973Sbostic470	FORMAT(' State vector=',9(1X,I6)/14X,2(1X,I6))
333*35973Sbostic475	FORMAT(' Scol vector= ',1X,I6,2(1X,I6))
334*35973Sbostic#endif NOCC
335*35973SbosticC GDT, PAGE 4
336*35973SbosticC
337*35973SbosticC AF-- ALTER FLAGS
338*35973SbosticC
339*35973Sbostic20000	IF(.NOT.VALID1(J,FMAX)) GO TO 2200
340*35973SbosticC						!ENTRY NO VALID?
341*35973Sbostic	WRITE(OUTCH,480) FLAGS(J)
342*35973SbosticC						!TYPE OLD, GET NEW.
343*35973Sbostic	READ(INPCH,490) FLAGS(J)
344*35973Sbostic	GO TO 2000
345*35973SbosticC
346*35973Sbostic#ifdef NOCC
347*35973Sbostic480	FORMAT('Old=',L2,6X,'New= ',$)
348*35973Sbostic#else NOCC
349*35973Sbostic480	FORMAT(' Old=',L2,6X,'New= ',$)
350*35973Sbostic#endif NOCC
351*35973Sbostic490	FORMAT(L1)
352*35973SbosticC
353*35973SbosticC 21000-- HELP
354*35973SbosticC
355*35973Sbostic21000	WRITE(OUTCH,900)
356*35973Sbostic	GO TO 2000
357*35973SbosticC
358*35973Sbostic#ifdef NOCC
359*35973Sbostic900	FORMAT('Valid commands are:'/'AA- Alter ADVS'/
360*35973Sbostic&	'AC- Alter CEVENT'/'AF- Alter FINDEX'/'AH- Alter HERE'/
361*35973Sbostic&	'AN- Alter switches'/'AO- Alter OBJCTS'/'AR- Alter ROOMS'/
362*35973Sbostic&	'AV- Alter VILLS'/'AX- Alter EXITS'/
363*35973Sbostic&	'AZ- Alter PUZZLE'/'DA- Display ADVS'/
364*35973Sbostic&	'DC- Display CEVENT'/'DF- Display FINDEX'/'DH- Display HACKS'/
365*35973Sbostic&	'DL- Display lengths'/'DM- Display RTEXT'/
366*35973Sbostic&	'DN- Display switches'/
367*35973Sbostic&	'DO- Display OBJCTS'/'DP- Display parser'/
368*35973Sbostic&	'DR- Display ROOMS'/'DS- Display state'/'DT- Display text'/
369*35973Sbostic&	'DV- Display VILLS'/'DX- Display EXITS'/'DZ- Display PUZZLE'/
370*35973Sbostic&	'D2- Display ROOM2'/'EX- Exit'/'HE- Type this message'/
371*35973Sbostic&	'NC- No cyclops'/'ND- No deaths'/'NR- No robber'/
372*35973Sbostic&	'NT- No troll'/'PD- Program detail'/
373*35973Sbostic&	'RC- Restore cyclops'/'RD- Restore deaths'/
374*35973Sbostic&	'RR- Restore robber'/'RT- Restore troll'/'TK- Take.')
375*35973Sbostic#else NOCC
376*35973Sbostic900	FORMAT(' Valid commands are:'/' AA- Alter ADVS'/
377*35973Sbostic&	' AC- Alter CEVENT'/' AF- Alter FINDEX'/' AH- Alter HERE'/
378*35973Sbostic&	' AN- Alter switches'/' AO- Alter OBJCTS'/' AR- Alter ROOMS'/
379*35973Sbostic&	' AV- Alter VILLS'/' AX- Alter EXITS'/
380*35973Sbostic&	' AZ- Alter PUZZLE'/' DA- Display ADVS'/
381*35973Sbostic&	' DC- Display CEVENT'/' DF- Display FINDEX'/' DH- Display HACKS'/
382*35973Sbostic&	' DL- Display lengths'/' DM- Display RTEXT'/
383*35973Sbostic&	' DN- Display switches'/
384*35973Sbostic&	' DO- Display OBJCTS'/' DP- Display parser'/
385*35973Sbostic&	' DR- Display ROOMS'/' DS- Display state'/' DT- Display text'/
386*35973Sbostic&	' DV- Display VILLS'/' DX- Display EXITS'/' DZ- Display PUZZLE'/
387*35973Sbostic&	' D2- Display ROOM2'/' EX- Exit'/' HE- Type this message'/
388*35973Sbostic&	' NC- No cyclops'/' ND- No deaths'/' NR- No robber'/
389*35973Sbostic&	' NT- No troll'/' PD- Program detail'/
390*35973Sbostic&	' RC- Restore cyclops'/' RD- Restore deaths'/
391*35973Sbostic&	' RR- Restore robber'/' RT- Restore troll'/' TK- Take.')
392*35973Sbostic#endif NOCC
393*35973SbosticC
394*35973SbosticC NR-- NO ROBBER
395*35973SbosticC
396*35973Sbostic22000	THFFLG=.FALSE.
397*35973SbosticC						!DISABLE ROBBER.
398*35973Sbostic	THFACT=.FALSE.
399*35973Sbostic	CALL NEWSTA(THIEF,0,0,0,0)
400*35973SbosticC						!VANISH THIEF.
401*35973Sbostic	WRITE(OUTCH,500)
402*35973Sbostic	GO TO 2000
403*35973SbosticC
404*35973Sbostic#ifdef NOCC
405*35973Sbostic500	FORMAT('No robber.')
406*35973Sbostic#else NOCC
407*35973Sbostic500	FORMAT(' No robber.')
408*35973Sbostic#endif NOCC
409*35973SbosticC
410*35973SbosticC NT-- NO TROLL
411*35973SbosticC
412*35973Sbostic23000	TROLLF=.TRUE.
413*35973Sbostic	CALL NEWSTA(TROLL,0,0,0,0)
414*35973Sbostic	WRITE(OUTCH,510)
415*35973Sbostic	GO TO 2000
416*35973SbosticC
417*35973Sbostic#ifdef NOCC
418*35973Sbostic510	FORMAT('No troll.')
419*35973Sbostic#else NOCC
420*35973Sbostic510	FORMAT(' No troll.')
421*35973Sbostic#endif NOCC
422*35973SbosticC
423*35973SbosticC NC-- NO CYCLOPS
424*35973SbosticC
425*35973Sbostic24000	CYCLOF=.TRUE.
426*35973Sbostic	CALL NEWSTA(CYCLO,0,0,0,0)
427*35973Sbostic	WRITE(OUTCH,520)
428*35973Sbostic	GO TO 2000
429*35973SbosticC
430*35973Sbostic#ifdef NOCC
431*35973Sbostic520	FORMAT('No cyclops.')
432*35973Sbostic#else NOCC
433*35973Sbostic520	FORMAT(' No cyclops.')
434*35973Sbostic#endif NOCC
435*35973SbosticC
436*35973SbosticC ND-- IMMORTALITY MODE
437*35973SbosticC
438*35973Sbostic25000	DBGFLG=1
439*35973Sbostic	WRITE(OUTCH,530)
440*35973Sbostic	GO TO 2000
441*35973SbosticC
442*35973Sbostic#ifdef NOCC
443*35973Sbostic530	FORMAT('No deaths.')
444*35973Sbostic#else NOCC
445*35973Sbostic530	FORMAT(' No deaths.')
446*35973Sbostic#endif NOCC
447*35973SbosticC
448*35973SbosticC RR-- RESTORE ROBBER
449*35973SbosticC
450*35973Sbostic26000	THFACT=.TRUE.
451*35973Sbostic	WRITE(OUTCH,540)
452*35973Sbostic	GO TO 2000
453*35973SbosticC
454*35973Sbostic#ifdef NOCC
455*35973Sbostic540	FORMAT('Restored robber.')
456*35973Sbostic#else NOCC
457*35973Sbostic540	FORMAT(' Restored robber.')
458*35973Sbostic#endif NOCC
459*35973SbosticC
460*35973SbosticC RT-- RESTORE TROLL
461*35973SbosticC
462*35973Sbostic27000	TROLLF=.FALSE.
463*35973Sbostic	CALL NEWSTA(TROLL,0,MTROL,0,0)
464*35973Sbostic	WRITE(OUTCH,550)
465*35973Sbostic	GO TO 2000
466*35973SbosticC
467*35973Sbostic#ifdef NOCC
468*35973Sbostic550	FORMAT('Restored troll.')
469*35973Sbostic#else NOCC
470*35973Sbostic550	FORMAT(' Restored troll.')
471*35973Sbostic#endif NOCC
472*35973SbosticC
473*35973SbosticC RC-- RESTORE CYCLOPS
474*35973SbosticC
475*35973Sbostic28000	CYCLOF=.FALSE.
476*35973Sbostic	MAGICF=.FALSE.
477*35973Sbostic	CALL NEWSTA(CYCLO,0,MCYCL,0,0)
478*35973Sbostic	WRITE(OUTCH,560)
479*35973Sbostic	GO TO 2000
480*35973SbosticC
481*35973Sbostic#ifdef NOCC
482*35973Sbostic560	FORMAT('Restored cyclops.')
483*35973Sbostic#else NOCC
484*35973Sbostic560	FORMAT(' Restored cyclops.')
485*35973Sbostic#endif NOCC
486*35973SbosticC
487*35973SbosticC RD-- MORTAL MODE
488*35973SbosticC
489*35973Sbostic29000	DBGFLG=0
490*35973Sbostic	WRITE(OUTCH,570)
491*35973Sbostic	GO TO 2000
492*35973SbosticC
493*35973Sbostic#ifdef NOCC
494*35973Sbostic570	FORMAT('Restored deaths.')
495*35973Sbostic#else NOCC
496*35973Sbostic570	FORMAT(' Restored deaths.')
497*35973Sbostic#endif NOCC
498*35973SbosticC GDT, PAGE 5
499*35973SbosticC
500*35973SbosticC TK-- TAKE
501*35973SbosticC
502*35973Sbostic30000	IF(.NOT.VALID1(J,OLNT)) GO TO 2200
503*35973SbosticC						!VALID OBJECT?
504*35973Sbostic	CALL NEWSTA(J,0,0,0,WINNER)
505*35973SbosticC						!YES, TAKE OBJECT.
506*35973Sbostic	WRITE(OUTCH,580)
507*35973SbosticC						!TELL.
508*35973Sbostic	GO TO 2000
509*35973SbosticC
510*35973Sbostic#ifdef NOCC
511*35973Sbostic580	FORMAT('Taken.')
512*35973Sbostic#else NOCC
513*35973Sbostic580	FORMAT(' Taken.')
514*35973Sbostic#endif NOCC
515*35973SbosticC
516*35973SbosticC EX-- GOODBYE
517*35973SbosticC
518*35973Sbostic31000	PRSCON=1
519*35973Sbostic	RETURN
520*35973SbosticC
521*35973SbosticC AR--	ALTER ROOM ENTRY
522*35973SbosticC
523*35973Sbostic32000	IF(.NOT.VALID3(J,RLNT,K,5)) GO TO 2200
524*35973SbosticC						!INDICES VALID?
525*35973Sbostic	WRITE(OUTCH,590) EQR(J,K)
526*35973SbosticC						!TYPE OLD, GET NEW.
527*35973Sbostic	READ(INPCH,600) EQR(J,K)
528*35973Sbostic	GO TO 2000
529*35973SbosticC
530*35973Sbostic#ifdef NOCC
531*35973Sbostic590	FORMAT('Old= ',I6,6X,'New= ',$)
532*35973Sbostic#else NOCC
533*35973Sbostic590	FORMAT(' Old= ',I6,6X,'New= ',$)
534*35973Sbostic#endif NOCC
535*35973Sbostic600	FORMAT(I6)
536*35973SbosticC
537*35973SbosticC AO-- ALTER OBJECT ENTRY
538*35973SbosticC
539*35973Sbostic33000	IF(.NOT.VALID3(J,OLNT,K,14)) GO TO 2200
540*35973SbosticC						!INDICES VALID?
541*35973Sbostic	WRITE(OUTCH,590) EQO(J,K)
542*35973Sbostic	READ(INPCH,600) EQO(J,K)
543*35973Sbostic	GO TO 2000
544*35973SbosticC
545*35973SbosticC AA-- ALTER ADVS ENTRY
546*35973SbosticC
547*35973Sbostic34000	IF(.NOT.VALID3(J,ALNT,K,7)) GO TO 2200
548*35973SbosticC						!INDICES VALID?
549*35973Sbostic	WRITE(OUTCH,590) EQA(J,K)
550*35973Sbostic	READ(INPCH,600) EQA(J,K)
551*35973Sbostic	GO TO 2000
552*35973SbosticC
553*35973SbosticC AC-- ALTER CLOCK EVENTS
554*35973SbosticC
555*35973Sbostic35000	IF(.NOT.VALID3(J,CLNT,K,3)) GO TO 2200
556*35973SbosticC						!INDICES VALID?
557*35973Sbostic	IF(K.EQ.3) GO TO 35500
558*35973SbosticC						!FLAGS ENTRY?
559*35973Sbostic	WRITE(OUTCH,590) EQC(J,K)
560*35973Sbostic	READ(INPCH,600) EQC(J,K)
561*35973Sbostic	GO TO 2000
562*35973SbosticC
563*35973Sbostic35500	WRITE(OUTCH,480) CFLAG(J)
564*35973Sbostic	READ(INPCH,490) CFLAG(J)
565*35973Sbostic	GO TO 2000
566*35973SbosticC GDT, PAGE 6
567*35973SbosticC
568*35973SbosticC AX-- ALTER EXITS
569*35973SbosticC
570*35973Sbostic36000	IF(.NOT.VALID1(J,XLNT)) GO TO 2200
571*35973SbosticC						!ENTRY NO VALID?
572*35973Sbostic	WRITE(OUTCH,610) TRAVEL(J)
573*35973Sbostic	READ(INPCH,620) TRAVEL(J)
574*35973Sbostic	GO TO 2000
575*35973SbosticC
576*35973Sbostic#ifdef NOCC
577*35973Sbostic610	FORMAT('Old= ',I6,6X,'New= ',$)
578*35973Sbostic#else NOCC
579*35973Sbostic610	FORMAT(' Old= ',I6,6X,'New= ',$)
580*35973Sbostic#endif NOCC
581*35973Sbostic620	FORMAT(I6)
582*35973SbosticC
583*35973SbosticC AV-- ALTER VILLAINS
584*35973SbosticC
585*35973Sbostic37000	IF(.NOT.VALID3(J,VLNT,K,5)) GO TO 2200
586*35973SbosticC						!INDICES VALID?
587*35973Sbostic	WRITE(OUTCH,590) EQV(J,K)
588*35973Sbostic	READ(INPCH,600) EQV(J,K)
589*35973Sbostic	GO TO 2000
590*35973SbosticC
591*35973SbosticC D2-- DISPLAY ROOM2 LIST
592*35973SbosticC
593*35973Sbostic38000	IF(.NOT.VALID2(J,K,R2LNT)) GO TO 2200
594*35973Sbostic	DO 38100 I=J,K
595*35973Sbostic	  WRITE(OUTCH,630) I,RROOM2(I),OROOM2(I)
596*35973Sbostic38100	CONTINUE
597*35973Sbostic	GO TO 2000
598*35973SbosticC
599*35973Sbostic#ifdef NOCC
600*35973Sbostic630	FORMAT('#',I2,'   Room=',I6,'   Obj=',I6)
601*35973Sbostic#else NOCC
602*35973Sbostic630	FORMAT(' #',I2,'   Room=',I6,'   Obj=',I6)
603*35973Sbostic#endif NOCC
604*35973SbosticC
605*35973SbosticC DN-- DISPLAY SWITCHES
606*35973SbosticC
607*35973Sbostic39000	IF(.NOT.VALID2(J,K,SMAX)) GO TO 2200
608*35973SbosticC						!VALID?
609*35973Sbostic	DO 39100 I=J,K
610*35973Sbostic	  WRITE(OUTCH,640) I,SWITCH(I)
611*35973Sbostic39100	CONTINUE
612*35973Sbostic	GO TO 2000
613*35973SbosticC
614*35973Sbostic#ifdef NOCC
615*35973Sbostic640	FORMAT('Switch #',I2,' = ',I6)
616*35973Sbostic#else NOCC
617*35973Sbostic640	FORMAT(' Switch #',I2,' = ',I6)
618*35973Sbostic#endif NOCC
619*35973SbosticC
620*35973SbosticC AN-- ALTER SWITCHES
621*35973SbosticC
622*35973Sbostic40000	IF(.NOT.VALID1(J,SMAX)) GO TO 2200
623*35973SbosticC						!VALID ENTRY?
624*35973Sbostic	WRITE(OUTCH,590) SWITCH(J)
625*35973Sbostic	READ(INPCH,600) SWITCH(J)
626*35973Sbostic	GO TO 2000
627*35973SbosticC
628*35973SbosticC DM-- DISPLAY MESSAGES
629*35973SbosticC
630*35973Sbostic41000	IF(.NOT.VALID2(J,K,MLNT)) GO TO 2200
631*35973SbosticC						!VALID LIMITS?
632*35973Sbostic	WRITE(OUTCH,380)
633*35973Sbostic	DO 41100 I=J,K,10
634*35973Sbostic	  L=MIN0(I+9,K)
635*35973Sbostic	  WRITE(OUTCH,650) I,L,(RTEXT(L1),L1=I,L)
636*35973Sbostic41100	CONTINUE
637*35973Sbostic	GO TO 2000
638*35973SbosticC
639*35973Sbostic#ifdef NOCC
640*35973Sbostic650	FORMAT(I3,'-',I3,3X,10(1X,I6))
641*35973Sbostic#else NOCC
642*35973Sbostic650	FORMAT(1X,I3,'-',I3,3X,10(1X,I6))
643*35973Sbostic#endif NOCC
644*35973SbosticC
645*35973SbosticC DT-- DISPLAY TEXT
646*35973SbosticC
647*35973Sbostic42000	CALL RSPEAK(J)
648*35973Sbostic	GO TO 2000
649*35973SbosticC
650*35973SbosticC AH--	ALTER HERE
651*35973SbosticC
652*35973Sbostic43000	WRITE(OUTCH,590) HERE
653*35973Sbostic	READ(INPCH,600) HERE
654*35973Sbostic	EQA(1,1)=HERE
655*35973Sbostic	GO TO 2000
656*35973SbosticC
657*35973SbosticC DP--	DISPLAY PARSER STATE
658*35973SbosticC
659*35973Sbostic44000	WRITE(OUTCH,660) ORP,LASTIT,PVEC,SYN
660*35973Sbostic	GO TO 2000
661*35973SbosticC
662*35973Sbostic#ifdef NOCC
663*35973Sbostic660	FORMAT('ORPHS= ',I7,I7,4I7/
664*35973Sbostic&	'PV=    ',I7,4I7/'SYN=   ',6I7/15X,5I7)
665*35973Sbostic#else NOCC
666*35973Sbostic660	FORMAT(' ORPHS= ',I7,I7,4I7/
667*35973Sbostic&	' PV=    ',I7,4I7/' SYN=   ',6I7/15X,5I7)
668*35973Sbostic#endif NOCC
669*35973SbosticC
670*35973SbosticC PD--	PROGRAM DETAIL DEBUG
671*35973SbosticC
672*35973Sbostic45000	WRITE(OUTCH,610) PRSFLG
673*35973SbosticC						!TYPE OLD, GET NEW.
674*35973Sbostic	READ(INPCH,620) PRSFLG
675*35973Sbostic	GO TO 2000
676*35973SbosticC
677*35973SbosticC DZ--	DISPLAY PUZZLE ROOM
678*35973SbosticC
679*35973Sbostic46000	DO 46100 I=1,64,8
680*35973SbosticC						!DISPLAY PUZZLE
681*35973Sbostic	  WRITE(OUTCH,670) (CPVEC(J),J=I,I+7)
682*35973Sbostic46100	CONTINUE
683*35973Sbostic	GO TO 2000
684*35973SbosticC
685*35973Sbostic#ifdef NOCC
686*35973Sbostic670	FORMAT(1X,8I3)
687*35973Sbostic#else NOCC
688*35973Sbostic670	FORMAT(2X,8I3)
689*35973Sbostic#endif NOCC
690*35973SbosticC
691*35973SbosticC AZ--	ALTER PUZZLE ROOM
692*35973SbosticC
693*35973Sbostic47000	IF(.NOT.VALID1(J,64)) GO TO 2200
694*35973SbosticC						!VALID ENTRY?
695*35973Sbostic	WRITE(OUTCH,590) CPVEC(J)
696*35973SbosticC						!OUTPUT OLD,
697*35973Sbostic	READ(INPCH,600) CPVEC(J)
698*35973Sbostic	GO TO 2000
699*35973SbosticC
700*35973Sbostic#endif PDP
701*35973Sbostic	END
702