gdt.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789
  1. /* GDT- GAME DEBUGGING TOOL */
  2. /*COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142*/
  3. /* ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED */
  4. /* WRITTEN BY R. M. SUPNIK */
  5. #include <stdio.h>
  6. #include <ctype.h>
  7. #include "funcs.h"
  8. #include "vars.h"
  9. #include "parse.h"
  10. #ifdef ALLOW_GDT
  11. void gdt_()
  12. {
  13. /* Initialized data */
  14. const integer cmdmax = 38;
  15. const char *dbgcmd =
  16. "DRDODADCDXDHDLDVDFDSAFHENRNTNCNDRRRTRCRDTKEXARAOAAACAXAVD2DNANDMDTAHDPPDDZAZ";
  17. static const integer argtyp[38] = { 2,2,2,2,2,0,0,2,2,0,1,0,0,0,0,0,0,
  18. 0,0,0,1,0,3,3,3,3,1,3,2,2,1,2,1,0,0,0,0,1 };
  19. /* System generated locals */
  20. integer i__1, i__2;
  21. /* Local variables */
  22. integer i, j, k, l, l1;
  23. char cmd[3];
  24. integer fmax, smax;
  25. char buf[80];
  26. char *z;
  27. /* FIRST, VALIDATE THAT THE CALLER IS AN IMPLEMENTER. */
  28. fmax = 46;
  29. /* !SET ARRAY LIMITS. */
  30. smax = 22;
  31. if (debug_1.gdtflg != 0) {
  32. goto L2000;
  33. }
  34. /* !IF OK, SKIP. */
  35. more_output("You are not an authorized user.");
  36. /* !NOT AN IMPLEMENTER. */
  37. return;
  38. /* !BOOT HIM OFF */
  39. /* GDT, PAGE 2A */
  40. /* HERE TO GET NEXT COMMAND */
  41. L2000:
  42. printf("GDT>");
  43. /* !OUTPUT PROMPT. */
  44. (void) fflush(stdout);
  45. (void) fgets(buf, sizeof buf, stdin);
  46. more_input();
  47. cmd[0] = ' ';
  48. cmd[1] = ' ';
  49. sscanf(buf, "%2s", cmd);
  50. /* !GET COMMAND. */
  51. if (cmd[0] == '\0')
  52. goto L2000;
  53. /* !IGNORE BLANKS. */
  54. if (islower(cmd[0]))
  55. cmd[0] = toupper(cmd[0]);
  56. if (islower(cmd[1]))
  57. cmd[1] = toupper(cmd[1]);
  58. i__1 = cmdmax;
  59. for (i = 1; i <= i__1; ++i) {
  60. /* !LOOK IT UP. */
  61. if (cmd[0] == dbgcmd[(i - 1) << 1] &&
  62. cmd[1] == dbgcmd[((i - 1) << 1) + 1]) {
  63. goto L2300;
  64. }
  65. /* !FOUND? */
  66. /* L2100: */
  67. }
  68. L2200:
  69. more_output("?");
  70. /* !NO, LOSE. */
  71. goto L2000;
  72. /* L230: */
  73. /* L240: */
  74. /* L225: */
  75. /* L235: */
  76. /* L245: */
  77. L2300:
  78. switch (argtyp[i - 1] + 1) {
  79. case 1: goto L2400;
  80. case 2: goto L2500;
  81. case 3: goto L2600;
  82. case 4: goto L2700;
  83. }
  84. /* !BRANCH ON ARG TYPE. */
  85. goto L2200;
  86. /* !ILLEGAL TYPE. */
  87. L2700:
  88. printf("Idx,Ary: ");
  89. /* !TYPE 3, REQUEST ARRAY COORDS. */
  90. (void) fflush(stdout);
  91. (void) fgets(buf, sizeof buf, stdin);
  92. more_input();
  93. for (z = buf; *z != '\0'; z++)
  94. if (*z == ',')
  95. *z = ' ';
  96. j = 0;
  97. k = 0;
  98. sscanf(buf, "%d %d", &j, &k);
  99. goto L2400;
  100. L2600:
  101. printf("Limits: ");
  102. /* !TYPE 2, READ BOUNDS. */
  103. (void) fflush(stdout);
  104. (void) fgets(buf, sizeof buf, stdin);
  105. more_input();
  106. for (z = buf; *z != '\0'; z++)
  107. if (*z == ',')
  108. *z = ' ';
  109. j = 0;
  110. k = 0;
  111. sscanf(buf, "%d %d", &j, &k);
  112. if (k == 0) {
  113. k = j;
  114. }
  115. goto L2400;
  116. L2500:
  117. printf("Entry: ");
  118. /* !TYPE 1, READ ENTRY NO. */
  119. (void) fflush(stdout);
  120. (void) fgets(buf, sizeof buf, stdin);
  121. more_input();
  122. j = 0;
  123. sscanf(buf, "%d", &j);
  124. L2400:
  125. switch (i) {
  126. case 1: goto L10000;
  127. case 2: goto L11000;
  128. case 3: goto L12000;
  129. case 4: goto L13000;
  130. case 5: goto L14000;
  131. case 6: goto L15000;
  132. case 7: goto L16000;
  133. case 8: goto L17000;
  134. case 9: goto L18000;
  135. case 10: goto L19000;
  136. case 11: goto L20000;
  137. case 12: goto L21000;
  138. case 13: goto L22000;
  139. case 14: goto L23000;
  140. case 15: goto L24000;
  141. case 16: goto L25000;
  142. case 17: goto L26000;
  143. case 18: goto L27000;
  144. case 19: goto L28000;
  145. case 20: goto L29000;
  146. case 21: goto L30000;
  147. case 22: goto L31000;
  148. case 23: goto L32000;
  149. case 24: goto L33000;
  150. case 25: goto L34000;
  151. case 26: goto L35000;
  152. case 27: goto L36000;
  153. case 28: goto L37000;
  154. case 29: goto L38000;
  155. case 30: goto L39000;
  156. case 31: goto L40000;
  157. case 32: goto L41000;
  158. case 33: goto L42000;
  159. case 34: goto L43000;
  160. case 35: goto L44000;
  161. case 36: goto L45000;
  162. case 37: goto L46000;
  163. case 38: goto L47000;
  164. }
  165. goto L2200;
  166. /* !WHAT??? */
  167. /* GDT, PAGE 3 */
  168. /* DR-- DISPLAY ROOMS */
  169. L10000:
  170. if (! (j > 0 && j <= rooms_1.rlnt && (k > 0 && k <= rooms_1.rlnt) && j <=
  171. k)) {
  172. goto L2200;
  173. }
  174. /* !ARGS VALID? */
  175. more_output("RM# DESC1 DESC2 EXITS ACTION VALUE FLAGS");
  176. /* !COL HDRS. */
  177. i__1 = k;
  178. for (i = j; i <= i__1; ++i) {
  179. more_output(NULL);
  180. printf("%3d", i);
  181. for (l = 1; l <= 6; ++l)
  182. printf(" %6d", eqr[i + l * 200 - 201]);
  183. printf("\n");
  184. /* L10100: */
  185. }
  186. goto L2000;
  187. /* DO-- DISPLAY OBJECTS */
  188. L11000:
  189. if (! (j > 0 && j <= objcts_1.olnt && (k > 0 && k <= objcts_1.olnt) && j
  190. <= k)) {
  191. goto L2200;
  192. }
  193. /* !ARGS VALID? */
  194. more_output("OB# DESC1 DESC2 DESCO ACT FLAGS1 FLAGS2 FVL TVL SIZE CAPAC ROOM ADV CON READ");
  195. /* !COL HDRS */
  196. i__1 = k;
  197. for (i = j; i <= i__1; ++i) {
  198. more_output(NULL);
  199. printf("%3d%6d%6d%6d%4d%7d%7d%4d%4d%6d%6d %4d%4d%4d%6d\n",
  200. i, eqo[i + 1 * 220 - 221], eqo[i + 2 * 220 - 221],
  201. eqo[i + 3 * 220 - 221], eqo[i + 4 * 220 - 221],
  202. eqo[i + 5 * 220 - 221], eqo[i + 6 * 220 - 221],
  203. eqo[i + 7 * 220 - 221], eqo[i + 8 * 220 - 221],
  204. eqo[i + 9 * 220 - 221], eqo[i + 10 * 220 - 221],
  205. eqo[i + 11 * 220 - 221], eqo[i + 12 * 220 - 221],
  206. eqo[i + 13 * 220 - 221], eqo[i + 14 * 220 - 221]);
  207. /* L11100: */
  208. }
  209. goto L2000;
  210. /* DA-- DISPLAY ADVENTURERS */
  211. L12000:
  212. if (! (j > 0 && j <= advs_1.alnt && (k > 0 && k <= advs_1.alnt) && j <= k)
  213. ) {
  214. goto L2200;
  215. }
  216. /* !ARGS VALID? */
  217. more_output("AD# ROOM SCORE VEHIC OBJECT ACTION STREN FLAGS");
  218. i__1 = k;
  219. for (i = j; i <= i__1; ++i) {
  220. more_output(NULL);
  221. printf("%3d", i);
  222. for (l = 1; l <= 7; ++l)
  223. printf(" %6d", eqa[i + (l << 2) - 5]);
  224. printf("\n");
  225. /* L12100: */
  226. }
  227. goto L2000;
  228. /* DC-- DISPLAY CLOCK EVENTS */
  229. L13000:
  230. if (! (j > 0 && j <= cevent_1.clnt && (k > 0 && k <= cevent_1.clnt) && j
  231. <= k)) {
  232. goto L2200;
  233. }
  234. /* !ARGS VALID? */
  235. more_output("CL# TICK ACTION FLAG");
  236. i__1 = k;
  237. for (i = j; i <= i__1; ++i) {
  238. more_output(NULL);
  239. printf("%3d %6d %6d %c\n", i, eqc[i + 1 * 25 - 26],
  240. eqc[i + 2 * 25 - 26],
  241. cevent_1.cflag[i - 1] ? 'T' : 'F');
  242. /* L13100: */
  243. }
  244. goto L2000;
  245. /* DX-- DISPLAY EXITS */
  246. L14000:
  247. if (! (j > 0 && j <= exits_1.xlnt && (k > 0 && k <= exits_1.xlnt) && j <=
  248. k)) {
  249. goto L2200;
  250. }
  251. /* !ARGS VALID? */
  252. more_output(" RANGE CONTENTS");
  253. /* !COL HDRS. */
  254. i__1 = k;
  255. for (i = j; i <= i__1; i += 10) {
  256. /* !TEN PER LINE. */
  257. /* Computing MIN */
  258. i__2 = i + 9;
  259. l = min(i__2,k);
  260. /* !COMPUTE END OF LINE. */
  261. more_output(NULL);
  262. printf("%3d-%3d ", i, l);
  263. for (l1 = i; l1 <= l; ++l1)
  264. printf("%7d", exits_1.travel[l1 - 1]);
  265. printf("\n");
  266. /* L14100: */
  267. }
  268. goto L2000;
  269. /* DH-- DISPLAY HACKS */
  270. L15000:
  271. more_output(NULL);
  272. printf("THFPOS= %d, THFFLG= %c, THFACT= %c\n",
  273. hack_1.thfpos, hack_1.thfflg ? 'T' : 'F',
  274. hack_1.thfact ? 'T' : 'F');
  275. more_output(NULL);
  276. printf("SWDACT= %c, SWDSTA= %d\n", hack_1.swdact ? 'T' : 'F',
  277. hack_1.swdsta);
  278. goto L2000;
  279. /* DL-- DISPLAY LENGTHS */
  280. L16000:
  281. more_output(NULL);
  282. printf("R=%d, X=%d, O=%d, C=%d\n", rooms_1.rlnt, exits_1.xlnt,
  283. objcts_1.olnt, cevent_1.clnt);
  284. more_output(NULL);
  285. printf("V=%d, A=%d, M=%d, R2=%d\n", vill_1.vlnt, advs_1.alnt,
  286. rmsg_1.mlnt, oroom2_1.r2lnt);
  287. more_output(NULL);
  288. printf("MBASE=%d, STRBIT=%d\n", star_1.mbase, star_1.strbit);
  289. goto L2000;
  290. /* DV-- DISPLAY VILLAINS */
  291. L17000:
  292. if (! (j > 0 && j <= vill_1.vlnt && (k > 0 && k <= vill_1.vlnt) && j <= k)
  293. ) {
  294. goto L2200;
  295. }
  296. /* !ARGS VALID? */
  297. more_output("VL# OBJECT PROB OPPS BEST MELEE");
  298. /* !COL HDRS */
  299. i__1 = k;
  300. for (i = j; i <= i__1; ++i) {
  301. more_output(NULL);
  302. printf("%3d", i);
  303. for (l = 1; l <= 5; ++l)
  304. printf(" %6d", eqv[i + (l << 2) - 5]);
  305. printf("\n");
  306. /* L17100: */
  307. }
  308. goto L2000;
  309. /* DF-- DISPLAY FLAGS */
  310. L18000:
  311. if (! (j > 0 && j <= fmax && (k > 0 && k <= fmax) && j <= k)) {
  312. goto L2200;
  313. }
  314. /* !ARGS VALID? */
  315. i__1 = k;
  316. for (i = j; i <= i__1; ++i) {
  317. more_output(NULL);
  318. printf("Flag #%-2d = %c\n", i, flags[i - 1] ? 'T' : 'F');
  319. /* L18100: */
  320. }
  321. goto L2000;
  322. /* DS-- DISPLAY STATE */
  323. L19000:
  324. more_output(NULL);
  325. printf("Parse vector= %6d %6d %6d %c %6d\n",
  326. prsvec_1.prsa, prsvec_1.prso, prsvec_1.prsi,
  327. prsvec_1.prswon ? 'T' : 'F', prsvec_1.prscon);
  328. more_output(NULL);
  329. printf("Play vector= %6d %6d %c\n", play_1.winner, play_1.here,
  330. play_1.telflg ? 'T' : 'F');
  331. more_output(NULL);
  332. printf("State vector= %6d %6d %6d %6d %6d %6d %6d %6d %6d\n",
  333. state_1.moves, state_1.deaths, state_1.rwscor, state_1.mxscor,
  334. state_1.mxload, state_1.ltshft, state_1.bloc, state_1.mungrm,
  335. state_1.hs);
  336. more_output(NULL);
  337. printf(" %6d %6d\n", state_1.egscor, state_1.egmxsc);
  338. more_output(NULL);
  339. printf("Scol vector= %6d %6d %6d\n", screen_1.fromdr,
  340. screen_1.scolrm, screen_1.scolac);
  341. goto L2000;
  342. /* GDT, PAGE 4 */
  343. /* AF-- ALTER FLAGS */
  344. L20000:
  345. if (! (j > 0 && j <= fmax)) {
  346. goto L2200;
  347. }
  348. /* !ENTRY NO VALID? */
  349. printf("Old= %c New= ", flags[j - 1] ? 'T' : 'F');
  350. /* !TYPE OLD, GET NEW. */
  351. (void) fflush(stdout);
  352. (void) fgets(buf, sizeof buf, stdin);
  353. more_input();
  354. for (z = buf; *z != '\0'; z++) {
  355. if (! isspace(*z)) {
  356. if (*z == 't' || *z == 'T')
  357. flags[j - 1] = 1;
  358. else if (*z == 'f' || *z == 'F')
  359. flags[j - 1] = 0;
  360. break;
  361. }
  362. }
  363. goto L2000;
  364. /* 21000-- HELP */
  365. L21000:
  366. more_output("Valid commands are:");
  367. more_output("AA- Alter ADVS DR- Display ROOMS");
  368. more_output("AC- Alter CEVENT DS- Display state");
  369. more_output("AF- Alter FINDEX DT- Display text");
  370. more_output("AH- Alter HERE DV- Display VILLS");
  371. more_output("AN- Alter switches DX- Display EXITS");
  372. more_output("AO- Alter OBJCTS DZ- Display PUZZLE");
  373. more_output("AR- Alter ROOMS D2- Display ROOM2");
  374. more_output("AV- Alter VILLS EX- Exit");
  375. more_output("AX- Alter EXITS HE- Type this message");
  376. more_output("AZ- Alter PUZZLE NC- No cyclops");
  377. more_output("DA- Display ADVS ND- No deaths");
  378. more_output("DC- Display CEVENT NR- No robber");
  379. more_output("DF- Display FINDEX NT- No troll");
  380. more_output("DH- Display HACKS PD- Program detail");
  381. more_output("DL- Display lengths RC- Restore cyclops");
  382. more_output("DM- Display RTEXT RD- Restore deaths");
  383. more_output("DN- Display switches RR- Restore robber");
  384. more_output("DO- Display OBJCTS RT- Restore troll");
  385. more_output("DP- Display parser TK- Take");
  386. goto L2000;
  387. /* NR-- NO ROBBER */
  388. L22000:
  389. hack_1.thfflg = FALSE_;
  390. /* !DISABLE ROBBER. */
  391. hack_1.thfact = FALSE_;
  392. newsta_(oindex_1.thief, 0, 0, 0, 0);
  393. /* !VANISH THIEF. */
  394. more_output("No robber.");
  395. goto L2000;
  396. /* NT-- NO TROLL */
  397. L23000:
  398. findex_1.trollf = TRUE_;
  399. newsta_(oindex_1.troll, 0, 0, 0, 0);
  400. more_output("No troll.");
  401. goto L2000;
  402. /* NC-- NO CYCLOPS */
  403. L24000:
  404. findex_1.cyclof = TRUE_;
  405. newsta_(oindex_1.cyclo, 0, 0, 0, 0);
  406. more_output("No cyclops.");
  407. goto L2000;
  408. /* ND-- IMMORTALITY MODE */
  409. L25000:
  410. debug_1.dbgflg = 1;
  411. more_output("No deaths.");
  412. goto L2000;
  413. /* RR-- RESTORE ROBBER */
  414. L26000:
  415. hack_1.thfact = TRUE_;
  416. more_output("Restored robber.");
  417. goto L2000;
  418. /* RT-- RESTORE TROLL */
  419. L27000:
  420. findex_1.trollf = FALSE_;
  421. newsta_(oindex_1.troll, 0, rindex_1.mtrol, 0, 0);
  422. more_output("Restored troll.");
  423. goto L2000;
  424. /* RC-- RESTORE CYCLOPS */
  425. L28000:
  426. findex_1.cyclof = FALSE_;
  427. findex_1.magicf = FALSE_;
  428. newsta_(oindex_1.cyclo, 0, rindex_1.mcycl, 0, 0);
  429. more_output("Restored cyclops.");
  430. goto L2000;
  431. /* RD-- MORTAL MODE */
  432. L29000:
  433. debug_1.dbgflg = 0;
  434. more_output("Restored deaths.");
  435. goto L2000;
  436. /* GDT, PAGE 5 */
  437. /* TK-- TAKE */
  438. L30000:
  439. if (! (j > 0 && j <= objcts_1.olnt)) {
  440. goto L2200;
  441. }
  442. /* !VALID OBJECT? */
  443. newsta_(j, 0, 0, 0, play_1.winner);
  444. /* !YES, TAKE OBJECT. */
  445. more_output("Taken.");
  446. /* !TELL. */
  447. goto L2000;
  448. /* EX-- GOODBYE */
  449. L31000:
  450. prsvec_1.prscon = 1;
  451. return;
  452. /* AR-- ALTER ROOM ENTRY */
  453. L32000:
  454. if (! (j > 0 && j <= rooms_1.rlnt && (k > 0 && k <= 5))) {
  455. goto L2200;
  456. }
  457. /* !INDICES VALID? */
  458. printf("Old = %6d New = ", eqr[j + k * 200 - 201]);
  459. /* !TYPE OLD, GET NEW. */
  460. (void) fflush(stdout);
  461. (void) fgets(buf, sizeof buf, stdin);
  462. more_input();
  463. sscanf(buf, "%d", &eqr[j + k * 200 - 201]);
  464. goto L2000;
  465. /* AO-- ALTER OBJECT ENTRY */
  466. L33000:
  467. if (! (j > 0 && j <= objcts_1.olnt && (k > 0 && k <= 14))) {
  468. goto L2200;
  469. }
  470. /* !INDICES VALID? */
  471. printf("Old = %6d New = ", eqo[j + k * 200 - 201]);
  472. (void) fflush(stdout);
  473. (void) fgets(buf, sizeof buf, stdin);
  474. more_input();
  475. sscanf(buf, "%d", &eqo[j + k * 220 - 221]);
  476. goto L2000;
  477. /* AA-- ALTER ADVS ENTRY */
  478. L34000:
  479. if (! (j > 0 && j <= advs_1.alnt && (k > 0 && k <= 7))) {
  480. goto L2200;
  481. }
  482. /* !INDICES VALID? */
  483. printf("Old = %6d New = ", eqa[j + (k << 2) - 5]);
  484. (void) fflush(stdout);
  485. (void) fgets(buf, sizeof buf, stdin);
  486. more_input();
  487. sscanf(buf, "%d", &eqa[j + (k << 2) - 5]);
  488. goto L2000;
  489. /* AC-- ALTER CLOCK EVENTS */
  490. L35000:
  491. if (! (j > 0 && j <= cevent_1.clnt && (k > 0 && k <= 3))) {
  492. goto L2200;
  493. }
  494. /* !INDICES VALID? */
  495. if (k == 3) {
  496. goto L35500;
  497. }
  498. /* !FLAGS ENTRY? */
  499. printf("Old = %6d New = ", eqc[j + k * 25 - 26]);
  500. (void) fflush(stdout);
  501. (void) fgets(buf, sizeof buf, stdin);
  502. more_input();
  503. sscanf(buf, "%d", &eqc[j + k * 25 - 26]);
  504. goto L2000;
  505. L35500:
  506. (void) fflush(stdout);
  507. (void) fgets(buf, sizeof buf, stdin);
  508. more_input();
  509. for (z = buf; *z != '\0'; z++) {
  510. if (! isspace(*z)) {
  511. if (*z == 't' || *z == 'T')
  512. cevent_1.cflag[j - 1] = 1;
  513. else if (*z == 'f' || *z == 'F')
  514. cevent_1.cflag[j - 1] = 0;
  515. break;
  516. }
  517. }
  518. goto L2000;
  519. /* GDT, PAGE 6 */
  520. /* AX-- ALTER EXITS */
  521. L36000:
  522. if (! (j > 0 && j <= exits_1.xlnt)) {
  523. goto L2200;
  524. }
  525. /* !ENTRY NO VALID? */
  526. printf("Old= %6d New= ", exits_1.travel[j - 1]);
  527. (void) fflush(stdout);
  528. (void) fgets(buf, sizeof buf, stdin);
  529. more_input();
  530. sscanf(buf, "%d", &exits_1.travel[j - 1]);
  531. goto L2000;
  532. /* AV-- ALTER VILLAINS */
  533. L37000:
  534. if (! (j > 0 && j <= vill_1.vlnt && (k > 0 && k <= 5))) {
  535. goto L2200;
  536. }
  537. /* !INDICES VALID? */
  538. printf("Old = %6d New= ", eqv[j + (k << 2) - 5]);
  539. (void) fflush(stdout);
  540. (void) fgets(buf, sizeof buf, stdin);
  541. more_input();
  542. sscanf(buf, "%d", &eqv[j + (k << 2) - 5]);
  543. goto L2000;
  544. /* D2-- DISPLAY ROOM2 LIST */
  545. L38000:
  546. if (! (j > 0 && j <= oroom2_1.r2lnt && (k > 0 && k <= oroom2_1.r2lnt) &&
  547. j <= k)) {
  548. goto L2200;
  549. }
  550. i__1 = k;
  551. for (i = j; i <= i__1; ++i) {
  552. more_output(NULL);
  553. printf("#%2d Room=%6d Obj=%6d\n", i,
  554. oroom2_1.rroom2[i - 1], oroom2_1.oroom2[i - 1]);
  555. /* L38100: */
  556. }
  557. goto L2000;
  558. /* DN-- DISPLAY SWITCHES */
  559. L39000:
  560. if (! (j > 0 && j <= smax && (k > 0 && k <= smax) && j <= k)) {
  561. goto L2200;
  562. }
  563. /* !VALID? */
  564. i__1 = k;
  565. for (i = j; i <= i__1; ++i) {
  566. more_output(NULL);
  567. printf("Switch #%-2d = %d\n", i, switch_[i - 1]);
  568. /* L39100: */
  569. }
  570. goto L2000;
  571. /* AN-- ALTER SWITCHES */
  572. L40000:
  573. if (! (j > 0 && j <= smax)) {
  574. goto L2200;
  575. }
  576. /* !VALID ENTRY? */
  577. printf("Old= %6d New= ", switch_[j - 1]);
  578. (void) fflush(stdout);
  579. (void) fgets(buf, sizeof buf, stdin);
  580. more_input();
  581. sscanf(buf, "%d", &switch_[j - 1]);
  582. goto L2000;
  583. /* DM-- DISPLAY MESSAGES */
  584. L41000:
  585. if (! (j > 0 && j <= rmsg_1.mlnt && (k > 0 && k <= rmsg_1.mlnt) && j <= k)
  586. ) {
  587. goto L2200;
  588. }
  589. /* !VALID LIMITS? */
  590. more_output(" RANGE CONTENTS");
  591. i__1 = k;
  592. for (i = j; i <= i__1; i += 10) {
  593. more_output(NULL);
  594. /* Computing MIN */
  595. i__2 = i + 9;
  596. l = min(i__2,k);
  597. printf("%3d-%3d ", i, l);
  598. for (l1 = i; l1 <= l; ++l1)
  599. printf(" %6d", rmsg_1.rtext[l1 - 1]);
  600. printf("\n");
  601. /* L41100: */
  602. }
  603. goto L2000;
  604. /* DT-- DISPLAY TEXT */
  605. L42000:
  606. rspeak_(j);
  607. goto L2000;
  608. /* AH-- ALTER HERE */
  609. L43000:
  610. printf("Old= %6d New= ", play_1.here);
  611. (void) fflush(stdout);
  612. (void) fgets(buf, sizeof buf, stdin);
  613. more_input();
  614. sscanf(buf, "%d", &play_1.here);
  615. eqa[0] = play_1.here;
  616. goto L2000;
  617. /* DP-- DISPLAY PARSER STATE */
  618. L44000:
  619. more_output(NULL);
  620. printf("ORPHS= %7d%7d%7d%7d%7d%7d\n",
  621. orp[0], orp[1], orp[2], orp[3], orp[4], last_1.lastit);
  622. more_output(NULL);
  623. printf("PV= %7d%7d%7d%7d%7d\n",
  624. pvec[0], pvec[1], pvec[2], pvec[3], pvec[4]);
  625. more_output(NULL);
  626. printf("SYN= %7d%7d%7d%7d%7d%7d\n",
  627. syn[0], syn[1], syn[2], syn[3], syn[4], syn[5]);
  628. more_output(NULL);
  629. printf(" %7d%7d%7d%7d%7d\n",
  630. syn[6], syn[7], syn[8], syn[9], syn[10]);
  631. goto L2000;
  632. /* PD-- PROGRAM DETAIL DEBUG */
  633. L45000:
  634. printf("Old= %6d New= ", debug_1.prsflg);
  635. /* !TYPE OLD, GET NEW. */
  636. (void) fflush(stdout);
  637. (void) fgets(buf, sizeof buf, stdin);
  638. more_input();
  639. sscanf(buf, "%d", &debug_1.prsflg);
  640. goto L2000;
  641. /* DZ-- DISPLAY PUZZLE ROOM */
  642. L46000:
  643. for (i = 1; i <= 64; i += 8) {
  644. /* !DISPLAY PUZZLE */
  645. more_output(NULL);
  646. printf(" ");
  647. for (j = i; j <= i + 7; ++j)
  648. printf("%3d", puzzle_1.cpvec[j - 1]);
  649. printf("\n");
  650. /* L46100: */
  651. }
  652. goto L2000;
  653. /* AZ-- ALTER PUZZLE ROOM */
  654. L47000:
  655. if (! (j > 0 && j <= 64)) {
  656. goto L2200;
  657. }
  658. /* !VALID ENTRY? */
  659. printf("Old= %6d New= ", puzzle_1.cpvec[j - 1]);
  660. /* !OUTPUT OLD, */
  661. (void) fflush(stdout);
  662. (void) fgets(buf, sizeof buf, stdin);
  663. more_input();
  664. sscanf(buf, "%d", &puzzle_1.cpvec[j - 1]);
  665. goto L2000;
  666. } /* gdt_ */
  667. #endif /* ALLOW_GDT */