| 1 |
#ifndef _ATYPES_H_ |
| 2 |
#define _ATYPES_H_ |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
#include "sysdep.h" |
| 13 |
#include "acode.h" |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
#ifndef __mac__ |
| 19 |
#ifndef TRUE |
| 20 |
#define TRUE (0==0) |
| 21 |
#endif |
| 22 |
#ifndef FALSE |
| 23 |
#define FALSE (!TRUE) |
| 24 |
#endif |
| 25 |
#endif |
| 26 |
|
| 27 |
#define ACTMIN (header->actmin) |
| 28 |
#define ACTMAX (header->actmax) |
| 29 |
#define OBJMIN (header->objmin) |
| 30 |
#define OBJMAX (header->objmax) |
| 31 |
#define LOCMIN (header->locmin) |
| 32 |
#define LOCMAX (header->locmax) |
| 33 |
#define CNTMIN (header->cntmin) |
| 34 |
#define CNTMAX (header->cntmax) |
| 35 |
#define LITMIN (header->locmax+1) |
| 36 |
#define LITMAX (header->locmax+1+litCount) |
| 37 |
#define EVTMIN (header->evtmin) |
| 38 |
#define EVTMAX (header->evtmax) |
| 39 |
|
| 40 |
#define HERO ACTMIN |
| 41 |
|
| 42 |
|
| 43 |
#define addrTo(x) (&memory[x]) |
| 44 |
|
| 45 |
|
| 46 |
#define isVerb(word) (word < dictsize && (dict[word].class&((Aword)1L<<WRD_VRB))!=0) |
| 47 |
#define isConj(word) (word < dictsize && (dict[word].class&((Aword)1L<<WRD_CONJ))!=0) |
| 48 |
#define isBut(word) (word < dictsize && (dict[word].class&((Aword)1L<<WRD_BUT))!=0) |
| 49 |
#define isThem(word) (word < dictsize && (dict[word].class&((Aword)1L<<WRD_THEM))!=0) |
| 50 |
#define isIt(word) (word < dictsize && (dict[word].class&((Aword)1L<<WRD_IT))!=0) |
| 51 |
#define isNoun(word) (word < dictsize && (dict[word].class&((Aword)1L<<WRD_NOUN))!=0) |
| 52 |
#define isAdj(word) (word < dictsize && (dict[word].class&((Aword)1L<<WRD_ADJ))!=0) |
| 53 |
#define isPrep(word) (word < dictsize && (dict[word].class&((Aword)1L<<WRD_PREP))!=0) |
| 54 |
#define isAll(word) (word < dictsize && (dict[word].class&((Aword)1L<<WRD_ALL))!=0) |
| 55 |
#define isDir(word) (word < dictsize && (dict[word].class&((Aword)1L<<WRD_DIR))!=0) |
| 56 |
#define isNoise(word) (word < dictsize && (dict[word].class&((Aword)1L<<WRD_NOISE))!=0) |
| 57 |
#define isLiteral(word) (word >= dictsize) |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
#ifndef __mac__ |
| 63 |
typedef int Boolean; |
| 64 |
#endif |
| 65 |
|
| 66 |
|
| 67 |
typedef struct CurVars { |
| 68 |
int |
| 69 |
vrb, |
| 70 |
obj, |
| 71 |
loc, |
| 72 |
act, |
| 73 |
tick, |
| 74 |
score, |
| 75 |
visits; |
| 76 |
} CurVars; |
| 77 |
|
| 78 |
|
| 79 |
typedef struct WrdElem { |
| 80 |
Aaddr wrd; |
| 81 |
Aword class; |
| 82 |
Aword code; |
| 83 |
Aaddr adjrefs; |
| 84 |
Aaddr nounrefs; |
| 85 |
} WrdElem; |
| 86 |
|
| 87 |
typedef struct ActElem { |
| 88 |
Aword loc; |
| 89 |
Abool describe; |
| 90 |
Aaddr nam; |
| 91 |
Aaddr atrs; |
| 92 |
Aword cont; |
| 93 |
Aword script; |
| 94 |
Aaddr scradr; |
| 95 |
Aword step; |
| 96 |
Aword count; |
| 97 |
Aaddr vrbs; |
| 98 |
Aaddr dscr; |
| 99 |
} ActElem; |
| 100 |
|
| 101 |
typedef struct ScrElem { |
| 102 |
Aword code; |
| 103 |
Aaddr dscr; |
| 104 |
Aaddr steps; |
| 105 |
} ScrElem; |
| 106 |
|
| 107 |
typedef struct StepElem { |
| 108 |
Aword after; |
| 109 |
Aaddr exp; |
| 110 |
Aaddr stm; |
| 111 |
} StepElem; |
| 112 |
|
| 113 |
typedef struct LocElem { |
| 114 |
Aaddr nams; |
| 115 |
Aaddr dscr; |
| 116 |
Aaddr does; |
| 117 |
Aword describe; |
| 118 |
Aaddr atrs; |
| 119 |
Aaddr exts; |
| 120 |
Aaddr vrbs; |
| 121 |
} LocElem; |
| 122 |
|
| 123 |
typedef struct ExtElem { |
| 124 |
Abool done; |
| 125 |
Aword code; |
| 126 |
Aaddr checks; |
| 127 |
Aaddr action; |
| 128 |
Aword next; |
| 129 |
} ExtElem; |
| 130 |
|
| 131 |
typedef struct ChkElem { |
| 132 |
Aaddr exp; |
| 133 |
Aaddr stms; |
| 134 |
} ChkElem; |
| 135 |
|
| 136 |
typedef struct VrbElem { |
| 137 |
Aword code; |
| 138 |
Aaddr alts; |
| 139 |
} VrbElem; |
| 140 |
|
| 141 |
typedef struct StxElem { |
| 142 |
Aword code; |
| 143 |
Aaddr elms; |
| 144 |
} StxElem; |
| 145 |
|
| 146 |
typedef struct ElmElem26 { |
| 147 |
Aword code; |
| 148 |
Abool multiple; |
| 149 |
Aaddr next; |
| 150 |
|
| 151 |
} ElmElem26; |
| 152 |
|
| 153 |
typedef struct ElmElem { |
| 154 |
Aword code; |
| 155 |
Aword flags; |
| 156 |
|
| 157 |
Aaddr next; |
| 158 |
|
| 159 |
} ElmElem; |
| 160 |
|
| 161 |
typedef struct ClaElem { |
| 162 |
Aword code; |
| 163 |
Aword classes; |
| 164 |
Aaddr stms; |
| 165 |
} ClaElem; |
| 166 |
|
| 167 |
typedef struct AltElem { |
| 168 |
Abool done; |
| 169 |
Aword param; |
| 170 |
Aword qual; |
| 171 |
Aaddr checks; |
| 172 |
Aaddr action; |
| 173 |
} AltElem; |
| 174 |
|
| 175 |
typedef struct AtrElem { |
| 176 |
Aword val; |
| 177 |
Aaddr stradr; |
| 178 |
} AtrElem; |
| 179 |
|
| 180 |
typedef struct ObjElem25 { |
| 181 |
Aword loc; |
| 182 |
Abool describe; |
| 183 |
Aaddr atrs; |
| 184 |
Aword cont; |
| 185 |
Aaddr vrbs; |
| 186 |
Aaddr dscr1; |
| 187 |
Aaddr dscr2; |
| 188 |
} ObjElem25; |
| 189 |
|
| 190 |
typedef struct ObjElem { |
| 191 |
Aword loc; |
| 192 |
Abool describe; |
| 193 |
Aaddr atrs; |
| 194 |
Aword cont; |
| 195 |
Aaddr vrbs; |
| 196 |
Aaddr dscr1; |
| 197 |
Aaddr art; |
| 198 |
|
| 199 |
Aaddr dscr2; |
| 200 |
} ObjElem; |
| 201 |
|
| 202 |
typedef struct CntElem { |
| 203 |
Aaddr lims; |
| 204 |
Aaddr header; |
| 205 |
Aaddr empty; |
| 206 |
Aword parent; |
| 207 |
Aaddr nam; |
| 208 |
} CntElem; |
| 209 |
|
| 210 |
typedef struct LimElem { |
| 211 |
Aword atr; |
| 212 |
Aword val; |
| 213 |
Aaddr stms; |
| 214 |
} LimElem; |
| 215 |
|
| 216 |
typedef struct RulElem { |
| 217 |
Abool run; |
| 218 |
Aaddr exp; |
| 219 |
Aaddr stms; |
| 220 |
} RulElem; |
| 221 |
|
| 222 |
typedef struct EvtElem { |
| 223 |
Aaddr stradr; |
| 224 |
Aaddr code; |
| 225 |
} EvtElem; |
| 226 |
|
| 227 |
typedef struct EvtqElem { |
| 228 |
int time; |
| 229 |
int event; |
| 230 |
int where; |
| 231 |
} EvtqElem; |
| 232 |
|
| 233 |
typedef struct IniElem { |
| 234 |
Aword fpos; |
| 235 |
Aword len; |
| 236 |
Aword adr; |
| 237 |
} IniElem; |
| 238 |
|
| 239 |
typedef struct MsgElem26 { |
| 240 |
Aword fpos; |
| 241 |
Aword len; |
| 242 |
} MsgElem26; |
| 243 |
|
| 244 |
typedef struct MsgElem { |
| 245 |
Aaddr stms; |
| 246 |
|
| 247 |
} MsgElem; |
| 248 |
|
| 249 |
|
| 250 |
typedef struct ParamElem { |
| 251 |
Aword code; |
| 252 |
Aword firstWord; |
| 253 |
Aword lastWord; |
| 254 |
} ParamElem; |
| 255 |
|
| 256 |
typedef enum Type {TYPNUM, TYPSTR} Type; |
| 257 |
|
| 258 |
typedef struct LitElem { |
| 259 |
Type type; |
| 260 |
Aptr value; |
| 261 |
} LitElem; |
| 262 |
|
| 263 |
#define MAXPARAMS 9 |
| 264 |
#define MAXENTITY (header->actmax) |
| 265 |
|
| 266 |
#endif |