1 C SAVE/RESTORE PROCESSOR
3 C WRITTEN BY BOB SUPNIK
8 C 750 TRAVEL OPTIONS (TRAVEL, TRVSIZ).
9 C 300 VOCABULARY WORDS (KTAB, ATAB, TABSIZ).
10 C 150 LOCATIONS (LTEXT, STEXT, KEY, COND, ABB, ATLOC, LOCSIZ).
11 C 100 OBJECTS (PLAC, PLACE, FIXD, FIXED, LINK (TWICE), PTEXT, PROP).
12 C 35 "ACTION" VERBS (ACTSPK, VRBSIZ).
13 C 205 RANDOM MESSAGES (RTEXT, RTXSIZ).
14 C 12 DIFFERENT PLAYER CLASSIFICATIONS (CTEXT, CVAL, CLSMAX).
15 C 20 HINTS, LESS 3 (HINTLC, HINTED, HINTS, HNTSIZ).
16 C THERE ARE ALSO LIMITS WHICH CANNOT BE EXCEEDED DUE TO THE STRUCTURE OF
17 C THE DATABASE. (E.G., THE VOCABULARY USES N/1000 TO DETERMINE WORD TYPE,
18 C SO THERE CAN'T BE MORE THAN 1000 WORDS.) THESE UPPER LIMITS ARE:
19 C 1000 NON-SYNONYMOUS VOCABULARY WORDS
23 SUBROUTINE RSTRGM(F1,F2)
26 C IMPLICIT INTEGER (A-Z)
27 LOGICAL LMWARN,CLOSNG,PANIC,HINTED,
28 1 CLOSED,GAVEUP,SCORNG,DSEEN
30 COMMON /VERSN/ VMAJ, VMIN, VEDIT
31 INTEGER VMAJ, VMIN, VEDIT
32 COMMON /FILES/ INDXNM, TEXTNM, SAVENM
33 INTEGER INDXNM(3), TEXTNM(3), SAVENM(3)
34 COMMON /TXTCOM/ RTEXT,LINES,ASCVAR,TXTLOC,DATA
35 COMMON /VOCCOM/ KTAB,ATAB,TABSIZ
36 COMMON /PLACOM/ ATLOC,LINK,PLACE,FIXED,HOLDNG
39 COMMON /MISCOM/ LINUSE,TRVS,CLSSES,OLDLOC,LOC,CVAL,TK,NEWLOC,
40 1 KEY,PLAC,FIXD,ACTSPK,COND,HINTS,HNTMAX,PROP,TALLY,TALLY2,
41 2 HINTLC,CHLOC,CHLOC2,DSEEN,DFLAG,DLOC,DALTLC,KEYS,LAMP,GRATE
43 3 CAGE,ROD,ROD2,STEPS,BIRD,DOOR,PILLOW,SNAKE,FISSUR,TABLET,
44 4 CLAM,OYSTER,MAGZIN,DWARF,KNIFE,FOOD,BOTTLE,WATER,OIL,PLANT,
45 5 PLANT2,AXE,MIRROR,DRAGON,CHASM,TROLL,TROLL2,BEAR,MESSAG,VEND,
46 6 BATTER,NUGGET,COINS,CHEST,EGGS,TRIDNT,VASE,EMRALD,PYRAM
48 7 PEARL,RUG,CHAIN,BACK,LOOK,CAVE,NULL,ENTRNC,DPRSSN,SAY,LOCK,
49 8 THROW,FIND,INVENT,TURNS,LMWARN,KNFLOC,DETAIL,ABBNUM,
50 9 NUMDIE,MAXDIE,DKILL,FOOBAR,BONUS,CLOCK1,CLOCK2,
51 1 CLOSNG,PANIC,CLOSED,GAVEUP,SCORNG,ODLOC,STREAM,SPICES
52 COMMON /MISC2/ I,RTXSIZ,CLSMAX,LOCSIZ,CTEXT,STEXT,LTEXT,
53 1 SECT,TRAVEL,TRVCON,TRVLOC,TRVSIZ,TABNDX,OBJ,J,K,VERB,HNTSIZ,
54 2 MAXTRS,HINTED,HNTLOC,KK
55 COMMON /MISC3/ATTACK,DTOTAL,OLDLC2,LIMIT,MXSCOR,SCORE,
58 INTEGER LINES(12),DATA(78)
59 C The TRAVEL, TRVCON, and TRVLOC arrays are
60 C Packed with words 0,1,2 holding the data. Saves lots
61 C of wasted space at the expense of some complexity.
62 INTEGER TRAVEL(250), TRVCON(250), TRVLOC(250), TRVSIZ
63 INTEGER KTAB(300),ATAB(300),TABSIZ
64 INTEGER LTEXT(150),STEXT(150),KEY(150),COND(150),ABB(150),
66 INTEGER PLAC(100),PLACE(100),FIXD(100),FIXED(100),LINK(200),
67 1 PTEXT(100),PROP(100),HOLDNG
70 INTEGER CTEXT(12),CVAL(12)
71 INTEGER HINTLC(20),HINTS(20,4)
73 INTEGER TK(20),DLOC(6),ODLOC(6)
75 INTEGER ASCVAR, TXTLOC, TRVS, CLSSES, OLDLOC
76 INTEGER HNTSIZ, HNTMAX, TALLY, TALLY2, CHLOC, CHLOC2, DFLAG
77 INTEGER DALTLC,GRATE,CAGE,ROD,ROD2,STEPS,BIRD,DOOR,PILLOW,SNAKE
78 INTEGER FISSUR,TABLET,CLAM,OYSTER,MAGZIN,DWARF,KNIFE,FOOD,BOTTLE
79 INTEGER WATER,OIL,PLANT,PLANT2,AXE,MIRROR,DRAGON,CHASM,EMRALD
80 INTEGER BEAR,MESSAG,VEND,BATTER,COINS,CHEST,EGGS,TRIDNT,VASE
81 INTEGER PYRAM,PEARL,RUG,CHAIN,BACK,LOOK,CAVE,NULL,ENTRNC,DPRSSN
82 INTEGER LOCK,THROW,FIND,INVENT,TURNS,KNFLOC,DETAIL,ABBNUM,SAY
83 INTEGER NUMDIE,MAXDIE,DKILL,FOOBAR,BONUS,CLOCK1,CLOCK2
84 INTEGER TROLL,TROLL2,STREAM,SPICES
85 INTEGER RTXSIZ,CLSMAX,LOCSIZ,SECT,TABNDX,OBJ
86 INTEGER VERB,HNTLOC,KK
87 INTEGER ATTACK,DTOTAL,OLDLC2,LIMIT,MXSCOR,SCORE,STICK,WZDARK
89 C USR call - FORTRAN unit, filename, operation, error flag
90 C Operation is 2, open input; 3 open output; 4 close output.
91 C Calling "CLOSE" on an input file causes it to be deleted!
95 C Attempt to restore saved database
97 CALL USR(7, SAVENM, 2, IERR)
98 IF (IERR.NE.0) GOTO 60
101 C Attempt to restore initial database
103 10 CALL USR(7, INDXNM, 2, IERR)
104 IF (IERR.EQ.0) GOTO 20
109 IF((I1.NE.VMAJ).OR.(I2.NE.VMIN)) GO TO 50
110 READ(7) RTEXT,KTAB,ATAB
111 READ(7) ATLOC,LINK,PLACE,FIXED,HOLDNG
112 READ(7) PTEXT,ABB,LINUSE,TRVS,CLSSES
113 READ(7) OLDLOC,LOC,CVAL,NEWLOC,KEY
114 READ(7) PLAC,FIXD,ACTSPK,COND,HINTS
115 READ(7) HNTMAX,PROP,TALLY,TALLY2,HINTLC
116 READ(7) CHLOC,CHLOC2,DSEEN,DFLAG,DLOC,DALTLC
117 READ(7) TURNS,LMWARN,KNFLOC,DETAIL,ABBNUM
118 READ(7) NUMDIE,MAXDIE,DKILL,FOOBAR,BONUS
119 READ(7) CLOCK1,CLOCK2,CLOSNG,PANIC,CLOSED
120 READ(7) GAVEUP,SCORNG,ODLOC,CTEXT,STEXT,LTEXT
121 READ(7) TRAVEL,TRVCON,TRVLOC,MAXTRS,HINTED,HNTLOC
122 READ(7) ATTACK,DTOTAL,OLDLC2,LIMIT,MXSCOR,SCORE,STICK,WZDARK
125 IF(F1) CALL SIXOUT('R]ESTORED.@',5,0)
128 50 IF(F1) CALL SIXOUT('F]ILE IS OBSOLETE, [RESTORE] FAILS.',18,0)
131 60 CALL SIXOUT('C]AN''T OPEN SAVE FILE, [RESTORE] FAILS.', 22, 0)