A large commit.
[pdp8.git] / sw / adventure / work / SAVEGM.FT
... / ...
CommitLineData
1C SAVE/RESTORE PROCESSOR\r
2C\r
3C WRITTEN BY BOB SUPNIK\r
4C DISK ENGINEERING\r
5C 25-AUG-78\r
6C\r
7C CURRENT LIMITS:\r
8C 750 TRAVEL OPTIONS (TRAVEL, TRVSIZ).\r
9C 300 VOCABULARY WORDS (KTAB, ATAB, TABSIZ).\r
10C 150 LOCATIONS (LTEXT, STEXT, KEY, COND, ABB, ATLOC, LOCSIZ).\r
11C 100 OBJECTS (PLAC, PLACE, FIXD, FIXED, LINK (TWICE), PTEXT, PROP).\r
12C 35 "ACTION" VERBS (ACTSPK, VRBSIZ).\r
13C 205 RANDOM MESSAGES (RTEXT, RTXSIZ).\r
14C 12 DIFFERENT PLAYER CLASSIFICATIONS (CTEXT, CVAL, CLSMAX).\r
15C 20 HINTS, LESS 3 (HINTLC, HINTED, HINTS, HNTSIZ).\r
16C THERE ARE ALSO LIMITS WHICH CANNOT BE EXCEEDED DUE TO THE STRUCTURE OF\r
17C THE DATABASE. (E.G., THE VOCABULARY USES N/1000 TO DETERMINE WORD TYPE,\r
18C SO THERE CAN'T BE MORE THAN 1000 WORDS.) THESE UPPER LIMITS ARE:\r
19C 1000 NON-SYNONYMOUS VOCABULARY WORDS\r
20C 300 LOCATIONS\r
21C 100 OBJECTS\r
22C\r
23 SUBROUTINE SAVEGM(F1,F2)\r
24 LOGICAL F1\r
25 INTEGER F2\r
26C IMPLICIT INTEGER (A-Z)\r
27 LOGICAL LMWARN,CLOSNG,PANIC,HINTED,\r
28 1 CLOSED,GAVEUP,SCORNG,DSEEN\r
29C\r
30 COMMON /VERSN/ VMAJ, VMIN, VEDIT\r
31 INTEGER VMAJ, VMIN, VEDIT\r
32 COMMON /FILES/ INDXNM, TEXTNM, SAVENM\r
33 INTEGER INDXNM(3), TEXTNM(3), SAVENM(3)\r
34 COMMON /TXTCOM/ RTEXT,LINES,ASCVAR,TXTLOC,DATA\r
35 COMMON /VOCCOM/ KTAB,ATAB,TABSIZ\r
36 COMMON /PLACOM/ ATLOC,LINK,PLACE,FIXED,HOLDNG\r
37 COMMON /PTXCOM/ PTEXT\r
38 COMMON /ABBCOM/ ABB\r
39 COMMON /MISCOM/ LINUSE,TRVS,CLSSES,OLDLOC,LOC,CVAL,TK,NEWLOC,\r
40 1 KEY,PLAC,FIXD,ACTSPK,COND,HINTS,HNTMAX,PROP,TALLY,TALLY2,\r
41 2 HINTLC,CHLOC,CHLOC2,DSEEN,DFLAG,DLOC,DALTLC,KEYS,LAMP,GRATE\r
42 COMMON /MISCOM/\r
43 3 CAGE,ROD,ROD2,STEPS,BIRD,DOOR,PILLOW,SNAKE,FISSUR,TABLET,\r
44 4 CLAM,OYSTER,MAGZIN,DWARF,KNIFE,FOOD,BOTTLE,WATER,OIL,PLANT,\r
45 5 PLANT2,AXE,MIRROR,DRAGON,CHASM,TROLL,TROLL2,BEAR,MESSAG,VEND,\r
46 6 BATTER,NUGGET,COINS,CHEST,EGGS,TRIDNT,VASE,EMRALD,PYRAM\r
47 COMMON /MISCOM/\r
48 7 PEARL,RUG,CHAIN,BACK,LOOK,CAVE,NULL,ENTRNC,DPRSSN,SAY,LOCK,\r
49 8 THROW,FIND,INVENT,TURNS,LMWARN,KNFLOC,DETAIL,ABBNUM,\r
50 9 NUMDIE,MAXDIE,DKILL,FOOBAR,BONUS,CLOCK1,CLOCK2,\r
51 1 CLOSNG,PANIC,CLOSED,GAVEUP,SCORNG,ODLOC,STREAM,SPICES\r
52 COMMON /MISC2/ I,RTXSIZ,CLSMAX,LOCSIZ,CTEXT,STEXT,LTEXT,\r
53 1 SECT,TRAVEL,TRVCON,TRVLOC,TRVSIZ,TABNDX,OBJ,J,K,VERB,HNTSIZ,\r
54 2 MAXTRS,HINTED,HNTLOC,KK\r
55 COMMON/MISC3/ATTACK,DTOTAL,OLDLC2,LIMIT,MXSCOR,SCORE,\r
56 1 STICK,WZDARK\r
57C\r
58 INTEGER LINES(12),DATA(78)\r
59C The TRAVEL, TRVCON, and TRVLOC arrays are\r
60C Packed with words 0,1,2 holding the data. Saves lots\r
61C of wasted space at the expense of some complexity.\r
62 INTEGER TRAVEL(250), TRVCON(250), TRVLOC(250), TRVSIZ\r
63 INTEGER KTAB(300),ATAB(300),TABSIZ\r
64 INTEGER LTEXT(150),STEXT(150),KEY(150),COND(150),ABB(150),\r
65 1 ATLOC(150)\r
66 INTEGER PLAC(100),PLACE(100),FIXD(100),FIXED(100),LINK(200),\r
67 1 PTEXT(100),PROP(100),HOLDNG\r
68 INTEGER ACTSPK(35)\r
69 INTEGER RTEXT(205)\r
70 INTEGER CTEXT(12),CVAL(12)\r
71 INTEGER HINTLC(20),HINTS(20,4)\r
72 DIMENSION HINTED(20)\r
73 INTEGER TK(20),DLOC(6),ODLOC(6)\r
74 DIMENSION DSEEN(6)\r
75 INTEGER ASCVAR, TXTLOC, TRVS, CLSSES, OLDLOC\r
76 INTEGER HNTSIZ, HNTMAX, TALLY, TALLY2, CHLOC, CHLOC2, DFLAG\r
77 INTEGER DALTLC,GRATE,CAGE,ROD,ROD2,STEPS,BIRD,DOOR,PILLOW,SNAKE\r
78 INTEGER FISSUR,TABLET,CLAM,OYSTER,MAGZIN,DWARF,KNIFE,FOOD,BOTTLE\r
79 INTEGER WATER,OIL,PLANT,PLANT2,AXE,MIRROR,DRAGON,CHASM,EMRALD\r
80 INTEGER BEAR,MESSAG,VEND,BATTER,COINS,CHEST,EGGS,TRIDNT,VASE\r
81 INTEGER PYRAM,PEARL,RUG,CHAIN,BACK,LOOK,CAVE,NULL,ENTRNC,DPRSSN\r
82 INTEGER SAY,LOCK,THROW,FIND,INVENT,TURNS,KNFLOC,DETAIL,ABBNUM\r
83 INTEGER NUMDIE,MAXDIE,DKILL,FOOBAR,BONUS,CLOCK1,CLOCK2\r
84 INTEGER TROLL,TROLL2,STREAM,SPICES\r
85 INTEGER RTXSIZ,CLSMAX,LOCSIZ,SECT,TABNDX,OBJ\r
86 INTEGER VERB,HNTLOC,KK\r
87 INTEGER ATTACK,DTOTAL,OLDLC2,LIMIT,MXSCOR,SCORE,STICK,WZDARK\r
88C\r
89 IF (F1) GOTO 10\r
90C\r
91C Normal setup, open AINDX.DA for output\r
92C\r
93 CALL USR(7,INDXNM,3,IERR)\r
94 IF (IERR .EQ. 0) GO TO 20\r
95 CALL SIXOUT('C]AN''T OPEN ',6,2)\r
96 CALL SIXOUT(INDXNM, 9, 3)\r
97 CALL SIXOUT(' ]FOR OUTPUT',6,1)\r
98 F2 = -1\r
99 RETURN\r
100C\r
101C Saving game\r
102C\r
10310 CALL USR(7,SAVENM,3,IERR)\r
104 IF (IERR.EQ.0) GOTO 20\r
105 CALL SIXOUT('C]AN''T OPEN ',6,2)\r
106 CALL SIXOUT(SAVENM,9,3)\r
107 CALL SIXOUT(' ]FOR OUTPUT',6,1)\r
108 F2 = -1\r
109 RETURN\r
110C\r
11120 WRITE(7) VMAJ,VMIN,VEDIT\r
112 WRITE(7) RTEXT,KTAB,ATAB\r
113 WRITE(7) ATLOC,LINK,PLACE,FIXED,HOLDNG\r
114 WRITE(7) PTEXT,ABB,LINUSE,TRVS,CLSSES\r
115 WRITE(7) OLDLOC,LOC,CVAL,NEWLOC,KEY\r
116 WRITE(7) PLAC,FIXD,ACTSPK,COND,HINTS\r
117 WRITE(7) HNTMAX,PROP,TALLY,TALLY2,HINTLC\r
118 WRITE(7) CHLOC,CHLOC2,DSEEN,DFLAG,DLOC,DALTLC\r
119 WRITE(7) TURNS,LMWARN,KNFLOC,DETAIL,ABBNUM\r
120 WRITE(7) NUMDIE,MAXDIE,DKILL,FOOBAR,BONUS\r
121 WRITE(7) CLOCK1,CLOCK2,CLOSNG,PANIC,CLOSED\r
122 WRITE(7) GAVEUP,SCORNG,ODLOC,CTEXT,STEXT,LTEXT\r
123 WRITE(7) TRAVEL,TRVCON,TRVLOC,MAXTRS,HINTED,HNTLOC\r
124 WRITE(7) ATTACK,DTOTAL,OLDLC2,LIMIT,MXSCOR,SCORE,STICK,WZDARK\r
125C\r
126 IF(F1) CALL SIXOUT('S]AVED.',3, 0)\r
127C\r
128C Close the output file\r
129C\r
130 IF(F1) CALL USR(7,SAVENM, 4, IERR)\r
131 IF(.NOT.F1) CALL USR(7, INDXNM, 4, IERR)\r
132 F2=0\r
133 RETURN\r
134 END\r
135\f\r