]>
Commit | Line | Data |
---|---|---|
6a5fa4e0 MG |
1 | /* sim.h: Main include file |
2 | * | |
3 | * Micropolis, Unix Version. This game was released for the Unix platform | |
4 | * in or about 1990 and has been modified for inclusion in the One Laptop | |
5 | * Per Child program. Copyright (C) 1989 - 2007 Electronic Arts Inc. If | |
6 | * you need assistance with this program, you may contact: | |
7 | * http://wiki.laptop.org/go/Micropolis or email micropolis@laptop.org. | |
8 | * | |
9 | * This program is free software: you can redistribute it and/or modify | |
10 | * it under the terms of the GNU General Public License as published by | |
11 | * the Free Software Foundation, either version 3 of the License, or (at | |
12 | * your option) any later version. | |
13 | * | |
14 | * This program is distributed in the hope that it will be useful, but | |
15 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
17 | * General Public License for more details. You should have received a | |
18 | * copy of the GNU General Public License along with this program. If | |
19 | * not, see <http://www.gnu.org/licenses/>. | |
20 | * | |
21 | * ADDITIONAL TERMS per GNU GPL Section 7 | |
22 | * | |
23 | * No trademark or publicity rights are granted. This license does NOT | |
24 | * give you any right, title or interest in the trademark SimCity or any | |
25 | * other Electronic Arts trademark. You may not distribute any | |
26 | * modification of this program using the trademark SimCity or claim any | |
27 | * affliation or association with Electronic Arts Inc. or its employees. | |
28 | * | |
29 | * Any propagation or conveyance of this program must include this | |
30 | * copyright notice and these terms. | |
31 | * | |
32 | * If you convey this program (or any modifications of it) and assume | |
33 | * contractual liability for the program to recipients of it, you agree | |
34 | * to indemnify Electronic Arts for any liability that those contractual | |
35 | * assumptions impose on Electronic Arts. | |
36 | * | |
37 | * You may not misrepresent the origins of this program; modified | |
38 | * versions of the program must be marked as such and not identified as | |
39 | * the original program. | |
40 | * | |
41 | * This disclaimer supplements the one included in the General Public | |
42 | * License. TO THE FULLEST EXTENT PERMISSIBLE UNDER APPLICABLE LAW, THIS | |
43 | * PROGRAM IS PROVIDED TO YOU "AS IS," WITH ALL FAULTS, WITHOUT WARRANTY | |
44 | * OF ANY KIND, AND YOUR USE IS AT YOUR SOLE RISK. THE ENTIRE RISK OF | |
45 | * SATISFACTORY QUALITY AND PERFORMANCE RESIDES WITH YOU. ELECTRONIC ARTS | |
46 | * DISCLAIMS ANY AND ALL EXPRESS, IMPLIED OR STATUTORY WARRANTIES, | |
47 | * INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY, SATISFACTORY QUALITY, | |
48 | * FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT OF THIRD PARTY | |
49 | * RIGHTS, AND WARRANTIES (IF ANY) ARISING FROM A COURSE OF DEALING, | |
50 | * USAGE, OR TRADE PRACTICE. ELECTRONIC ARTS DOES NOT WARRANT AGAINST | |
51 | * INTERFERENCE WITH YOUR ENJOYMENT OF THE PROGRAM; THAT THE PROGRAM WILL | |
52 | * MEET YOUR REQUIREMENTS; THAT OPERATION OF THE PROGRAM WILL BE | |
53 | * UNINTERRUPTED OR ERROR-FREE, OR THAT THE PROGRAM WILL BE COMPATIBLE | |
54 | * WITH THIRD PARTY SOFTWARE OR THAT ANY ERRORS IN THE PROGRAM WILL BE | |
55 | * CORRECTED. NO ORAL OR WRITTEN ADVICE PROVIDED BY ELECTRONIC ARTS OR | |
56 | * ANY AUTHORIZED REPRESENTATIVE SHALL CREATE A WARRANTY. SOME | |
57 | * JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF OR LIMITATIONS ON IMPLIED | |
58 | * WARRANTIES OR THE LIMITATIONS ON THE APPLICABLE STATUTORY RIGHTS OF A | |
59 | * CONSUMER, SO SOME OR ALL OF THE ABOVE EXCLUSIONS AND LIMITATIONS MAY | |
60 | * NOT APPLY TO YOU. | |
61 | */ | |
62 | ||
63 | /* workaround sun c compiler junk */ | |
64 | ||
65 | #ifdef sun | |
66 | ||
67 | #define _TTYCHARS_ | |
68 | #define CTRL(c) (#c[0]&037) | |
69 | ||
70 | #ifndef SOLARIS2 | |
71 | #define __sys_ioccom_h | |
72 | #define _IOCPARM_MASK 0xff /* parameters must be < 256 bytes */ | |
73 | #define _IOC_VOID 0x20000000 /* no parameters */ | |
74 | #define _IOC_OUT 0x40000000 /* copy out parameters */ | |
75 | #define _IOC_IN 0x80000000 /* copy in parameters */ | |
76 | #define _IOC_INOUT (_IOC_IN|_IOC_OUT) | |
77 | #define _IO(x,y) (_IOC_VOID|(#x[0]<<8)|y) | |
78 | #define _IOR(x,y,t) (_IOC_OUT|((sizeof(t)&_IOCPARM_MASK)<<16)|(#x[0]<<8)|y) | |
79 | #define _IORN(x,y,t) (_IOC_OUT|(((t)&_IOCPARM_MASK)<<16)|(#x[0]<<8)|y) | |
80 | #define _IOW(x,y,t) (_IOC_IN|((sizeof(t)&_IOCPARM_MASK)<<16)|(#x[0]<<8)|y) | |
81 | #define _IOWN(x,y,t) (_IOC_IN|(((t)&_IOCPARM_MASK)<<16)|(#x[0]<<8)|y) | |
82 | #define _IOWR(x,y,t) (_IOC_INOUT|((sizeof(t)&_IOCPARM_MASK)<<16)|(#x[0]<<8)|y) | |
83 | #define _IOWRN(x,y,t) (_IOC_INOUT|(((t)&_IOCPARM_MASK)<<16)|(#x[0]<<8)|y) | |
84 | #endif | |
85 | ||
86 | #endif | |
87 | ||
88 | ||
89 | #include <stdio.h> | |
90 | #include <stdlib.h> | |
91 | #include <assert.h> | |
92 | #include <ctype.h> | |
93 | #include <setjmp.h> | |
6a5fa4e0 MG |
94 | #include <errno.h> |
95 | #include <signal.h> | |
96 | #include <math.h> | |
97 | #include <unistd.h> | |
98 | #include <sys/types.h> | |
99 | #include <sys/time.h> | |
100 | #include <sys/stat.h> | |
101 | #include <sys/file.h> | |
102 | #include <sys/ioctl.h> | |
103 | #include <sys/resource.h> | |
104 | #ifndef MSDOS | |
105 | #ifndef HPUX | |
106 | #include <alloca.h> | |
107 | #endif | |
108 | #include <sys/mman.h> | |
109 | #include <netinet/in.h> | |
110 | #include <arpa/inet.h> | |
111 | #endif | |
112 | ||
113 | #ifdef sun | |
114 | #ifdef SOLARIS2 | |
115 | #include <sys/systeminfo.h> | |
116 | #else | |
117 | #include <sys/vadvise.h> | |
118 | #endif | |
119 | #endif | |
120 | ||
121 | #ifdef sgi | |
122 | #if 0 | |
123 | #include <audio.h> | |
124 | #endif | |
125 | #endif | |
126 | ||
127 | #include <sys/ipc.h> | |
128 | #include <sys/shm.h> | |
129 | #include <X11/Xlib.h> | |
130 | #include <X11/Xutil.h> | |
131 | #include <X11/Xatom.h> | |
132 | #include <X11/extensions/XShm.h> | |
133 | ||
134 | //#include <xpmtk.h> | |
135 | #include <X11/xpm.h> | |
136 | ||
137 | /* gcc compat workaround! */ | |
138 | #define _STDDEF_H | |
139 | ||
140 | #include "tclxtend.h" | |
141 | #include "tclint.h" | |
142 | #include "tclunix.h" | |
143 | #include "tkconfig.h" | |
144 | #include "tkint.h" | |
145 | ||
146 | #include "mac.h" | |
147 | #include "view.h" | |
148 | #include "macros.h" | |
149 | ||
150 | /* Constants */ | |
151 | ||
152 | #define TRUE 1 | |
153 | #define FALSE 0 | |
154 | ||
155 | #ifdef MEGA | |
156 | #define SimWidth (120 * MEGA) | |
157 | #define SimHeight (100 * MEGA) | |
158 | #else | |
159 | #define SimWidth 120 | |
160 | #define SimHeight 100 | |
161 | #endif | |
162 | ||
163 | #define WORLD_X SimWidth | |
164 | #define WORLD_Y SimHeight | |
165 | #define HWLDX (SimWidth >>1) | |
166 | #define HWLDY (SimHeight >>1) | |
167 | #define QWX (SimWidth >>2) | |
168 | #define QWY (SimHeight >>2) | |
169 | #define SmX (SimWidth >>3) | |
170 | #define SmY ((SimHeight + 7) >>3) | |
171 | ||
172 | #define EDITOR_W (WORLD_X * 16) | |
173 | #define EDITOR_H (WORLD_Y * 16) | |
174 | #define MAP_W (WORLD_X * 3) | |
175 | #define MAP_H (WORLD_Y * 3) | |
176 | ||
177 | #define NIL 0 | |
178 | #define HORIZ 1 | |
179 | #define VERT 0 | |
180 | ||
181 | #define PROBNUM 10 | |
182 | ||
183 | #define HISTLEN 480 | |
184 | #define MISCHISTLEN 240 | |
185 | ||
186 | #define POWERMAPROW ((WORLD_X + 15) / 16) | |
187 | ||
188 | #ifdef MEGA | |
189 | #define POWERMAPLEN ((QUAD)(2 * POWERMAPROW * WORLD_Y)) | |
190 | #define POWERWORD(x, y) ((((QUAD)(x)) >>4) + (((QUAD)(y)) * POWERMAPROW)) | |
191 | #else | |
192 | #define POWERMAPLEN 1700 /* ??? PWRMAPSIZE */ | |
193 | #define POWERWORD(x, y) (((x) >>4) + ((y) <<3)) | |
194 | #endif | |
195 | ||
196 | #define SETPOWERBIT(x, y) PowerMap[POWERWORD((x), (y))] |= 1 << ((x) & 15) | |
197 | #define PWRMAPSIZE (POWERMAPROW * WORLD_Y) | |
198 | #define PWRSTKSIZE ((WORLD_X * WORLD_Y) / 4) | |
199 | ||
200 | #define ALMAP 0 /* all */ | |
201 | #define REMAP 1 /* residential */ | |
202 | #define COMAP 2 /* commercial */ | |
203 | #define INMAP 3 /* industrial */ | |
204 | ||
205 | #define PRMAP 4 /* power */ | |
206 | #define RDMAP 5 /* road */ | |
207 | ||
208 | #define PDMAP 6 /* population density */ | |
209 | #define RGMAP 7 /* rate of growth */ | |
210 | ||
211 | #define TDMAP 8 /* traffic density */ | |
212 | #define PLMAP 9 /* pollution */ | |
213 | #define CRMAP 10 /* crime */ | |
214 | #define LVMAP 11 /* land value */ | |
215 | ||
216 | #define FIMAP 12 /* fire radius */ | |
217 | #define POMAP 13 /* police radius */ | |
218 | #define DYMAP 14 /* dynamic */ | |
219 | ||
220 | #define NMAPS 15 | |
221 | ||
222 | /* These adjust frequency in Simulate() */ | |
223 | ||
224 | #define VALVERATE 2 | |
225 | #define CENSUSRATE 4 | |
226 | #define TAXFREQ 48 | |
227 | ||
228 | /* These are names of the 16 colors */ | |
229 | #define COLOR_WHITE 0 | |
230 | #define COLOR_YELLOW 1 | |
231 | #define COLOR_ORANGE 2 | |
232 | #define COLOR_RED 3 | |
233 | #define COLOR_DARKRED 4 | |
234 | #define COLOR_DARKBLUE 5 | |
235 | #define COLOR_LIGHTBLUE 6 | |
236 | #define COLOR_BROWN 7 | |
237 | #define COLOR_LIGHTGREEN 8 | |
238 | #define COLOR_DARKGREEN 9 | |
239 | #define COLOR_OLIVE 10 | |
240 | #define COLOR_LIGHTBROWN 11 | |
241 | #define COLOR_LIGHTGRAY 12 | |
242 | #define COLOR_MEDIUMGRAY 13 | |
243 | #define COLOR_DARKGRAY 14 | |
244 | #define COLOR_BLACK 15 | |
245 | ||
246 | /* Status Bits */ | |
247 | ||
248 | #define PWRBIT 32768 /*20 bit 15 */ | |
249 | #define CONDBIT 16384 /*10 bit 14 */ | |
250 | #define BURNBIT 8192 /*8 bit 13 */ | |
251 | #define BULLBIT 4096 /*4 bit 12 */ | |
252 | #define ANIMBIT 2048 /*2 bit 11 */ | |
253 | #define ZONEBIT 1024 /*1 bit 10 */ | |
254 | #define ALLBITS 64512 /* mask for upper 6 bits */ | |
255 | #define LOMASK 1023 /* mask for low 10 bits */ | |
256 | ||
257 | #define BLBNBIT (BULLBIT+BURNBIT) | |
258 | #define BLBNCNBIT (BULLBIT+BURNBIT+CONDBIT) | |
259 | #define BNCNBIT (BURNBIT+CONDBIT) | |
260 | ||
261 | /* Object & Sound Numbers */ | |
262 | ||
263 | #define TRA 1 | |
264 | #define COP 2 | |
265 | #define AIR 3 | |
266 | #define SHI 4 | |
267 | #define GOD 5 | |
268 | #define TOR 6 | |
269 | #define EXP 7 | |
270 | #define BUS 8 | |
271 | ||
272 | /* Max # of Objects */ | |
273 | ||
274 | #define OBJN 9 | |
275 | ||
276 | /* Graph Histories */ | |
277 | #define RES_HIST 0 | |
278 | #define COM_HIST 1 | |
279 | #define IND_HIST 2 | |
280 | #define MONEY_HIST 3 | |
281 | #define CRIME_HIST 4 | |
282 | #define POLLUTION_HIST 5 | |
283 | #define HISTORIES 6 | |
284 | #define ALL_HISTORIES ((1 <<HISTORIES) - 1) | |
285 | ||
286 | /* Character Mapping */ | |
287 | ||
288 | #define DIRT 0 | |
289 | #define RIVER 2 | |
290 | #define REDGE 3 | |
291 | #define CHANNEL 4 | |
292 | #define FIRSTRIVEDGE 5 | |
293 | #define LASTRIVEDGE 20 | |
294 | #define TREEBASE 21 | |
295 | #define LASTTREE 36 | |
296 | #define WOODS 37 | |
297 | #define UNUSED_TRASH1 38 | |
298 | #define UNUSED_TRASH2 39 | |
299 | #define WOODS2 40 | |
300 | #define WOODS3 41 | |
301 | #define WOODS4 42 | |
302 | #define WOODS5 43 | |
303 | #define RUBBLE 44 | |
304 | #define LASTRUBBLE 47 | |
305 | #define FLOOD 48 | |
306 | #define LASTFLOOD 51 | |
307 | #define RADTILE 52 | |
308 | #define UNUSED_TRASH3 53 | |
309 | #define UNUSED_TRASH4 54 | |
310 | #define UNUSED_TRASH5 55 | |
311 | #define FIRE 56 | |
312 | #define FIREBASE 56 | |
313 | #define LASTFIRE 63 | |
314 | #define ROADBASE 64 | |
315 | #define HBRIDGE 64 | |
316 | #define VBRIDGE 65 | |
317 | #define ROADS 66 | |
318 | #define INTERSECTION 76 | |
319 | #define HROADPOWER 77 | |
320 | #define VROADPOWER 78 | |
321 | #define BRWH 79 | |
322 | #define LTRFBASE 80 | |
323 | #define BRWV 95 | |
324 | #define BRWXXX1 111 | |
325 | #define BRWXXX2 127 | |
326 | #define BRWXXX3 143 | |
327 | #define HTRFBASE 144 | |
328 | #define BRWXXX4 159 | |
329 | #define BRWXXX5 175 | |
330 | #define BRWXXX6 191 | |
331 | #define LASTROAD 206 | |
332 | #define BRWXXX7 207 | |
333 | #define POWERBASE 208 | |
334 | #define HPOWER 208 | |
335 | #define VPOWER 209 | |
336 | #define LHPOWER 210 | |
337 | #define LVPOWER 211 | |
338 | #define RAILHPOWERV 221 | |
339 | #define RAILVPOWERH 222 | |
340 | #define LASTPOWER 222 | |
341 | #define UNUSED_TRASH6 223 | |
342 | #define RAILBASE 224 | |
343 | #define HRAIL 224 | |
344 | #define VRAIL 225 | |
345 | #define LHRAIL 226 | |
346 | #define LVRAIL 227 | |
347 | #define HRAILROAD 237 | |
348 | #define VRAILROAD 238 | |
349 | #define LASTRAIL 238 | |
350 | #define ROADVPOWERH 239 /* bogus? */ | |
351 | #define RESBASE 240 | |
352 | #define FREEZ 244 | |
353 | #define HOUSE 249 | |
354 | #define LHTHR 249 | |
355 | #define HHTHR 260 | |
356 | #define RZB 265 | |
357 | #define HOSPITAL 409 | |
358 | #define CHURCH 418 | |
359 | #define COMBASE 423 | |
360 | #define COMCLR 427 | |
361 | #define CZB 436 | |
362 | #define INDBASE 612 | |
363 | #define INDCLR 616 | |
364 | #define LASTIND 620 | |
365 | #define IND1 621 | |
366 | #define IZB 625 | |
367 | #define IND2 641 | |
368 | #define IND3 644 | |
369 | #define IND4 649 | |
370 | #define IND5 650 | |
371 | #define IND6 676 | |
372 | #define IND7 677 | |
373 | #define IND8 686 | |
374 | #define IND9 689 | |
375 | #define PORTBASE 693 | |
376 | #define PORT 698 | |
377 | #define LASTPORT 708 | |
378 | #define AIRPORTBASE 709 | |
379 | #define RADAR 711 | |
380 | #define AIRPORT 716 | |
381 | #define COALBASE 745 | |
382 | #define POWERPLANT 750 | |
383 | #define LASTPOWERPLANT 760 | |
384 | #define FIRESTBASE 761 | |
385 | #define FIRESTATION 765 | |
386 | #define POLICESTBASE 770 | |
387 | #define POLICESTATION 774 | |
388 | #define STADIUMBASE 779 | |
389 | #define STADIUM 784 | |
390 | #define FULLSTADIUM 800 | |
391 | #define NUCLEARBASE 811 | |
392 | #define NUCLEAR 816 | |
393 | #define LASTZONE 826 | |
394 | #define LIGHTNINGBOLT 827 | |
395 | #define HBRDG0 828 | |
396 | #define HBRDG1 829 | |
397 | #define HBRDG2 830 | |
398 | #define HBRDG3 831 | |
399 | #define RADAR0 832 | |
400 | #define RADAR1 833 | |
401 | #define RADAR2 834 | |
402 | #define RADAR3 835 | |
403 | #define RADAR4 836 | |
404 | #define RADAR5 837 | |
405 | #define RADAR6 838 | |
406 | #define RADAR7 839 | |
407 | #define FOUNTAIN 840 | |
408 | #define INDBASE2 844 | |
409 | #define TELEBASE 844 | |
410 | #define TELELAST 851 | |
411 | #define SMOKEBASE 852 | |
412 | #define TINYEXP 860 | |
413 | #define SOMETINYEXP 864 | |
414 | #define LASTTINYEXP 867 | |
415 | #define COALSMOKE1 916 | |
416 | #define COALSMOKE2 920 | |
417 | #define COALSMOKE3 924 | |
418 | #define COALSMOKE4 928 | |
419 | #define FOOTBALLGAME1 932 | |
420 | #define FOOTBALLGAME2 940 | |
421 | #define VBRDG0 948 | |
422 | #define VBRDG1 949 | |
423 | #define VBRDG2 950 | |
424 | #define VBRDG3 951 | |
425 | ||
426 | #define TILE_COUNT 960 | |
427 | ||
428 | /* | |
429 | * These describe the wand values, the object dragged around on the screen. | |
430 | */ | |
431 | ||
432 | #define residentialState 0 | |
433 | #define commercialState 1 | |
434 | #define industrialState 2 | |
435 | #define fireState 3 | |
436 | #define queryState 4 | |
437 | #define policeState 5 | |
438 | #define wireState 6 | |
439 | #define dozeState 7 | |
440 | #define rrState 8 | |
441 | #define roadState 9 | |
442 | #define chalkState 10 | |
443 | #define eraserState 11 | |
444 | #define stadiumState 12 | |
445 | #define parkState 13 | |
446 | #define seaportState 14 | |
447 | #define powerState 15 | |
448 | #define nuclearState 16 | |
449 | #define airportState 17 | |
450 | #define networkState 18 | |
451 | ||
452 | ||
453 | #define firstState residentialState | |
454 | #define lastState networkState | |
455 | ||
456 | #if 0 | |
457 | #define specialState 16 | |
458 | #define monsterGoalState 17 | |
459 | #define helicopterGoalState 18 | |
460 | #define blackState 19 | |
461 | #define whiteState 20 | |
462 | #define redState 21 | |
463 | #define orangeState 23 | |
464 | #define blueState 24 | |
465 | #define greenState 25 | |
466 | #define brownState 26 | |
467 | #endif | |
468 | ||
469 | ||
470 | #define STATE_CMD 0 | |
471 | #define STATE_TILES 1 | |
472 | #define STATE_OVERLAYS 2 | |
473 | #define STATE_GRAPHS 3 | |
474 | ||
475 | ||
476 | extern short *Map[WORLD_X]; /* Main Map 120 x 100 */ | |
477 | extern Byte *PopDensity[HWLDX]; /* 2X2 Maps 60 x 50 */ | |
478 | extern Byte *TrfDensity[HWLDX]; | |
479 | extern Byte *PollutionMem[HWLDX]; | |
480 | extern Byte *LandValueMem[HWLDX]; | |
481 | extern Byte *CrimeMem[HWLDX]; | |
482 | extern Byte *tem[HWLDX]; | |
483 | extern Byte *tem2[HWLDX]; | |
484 | extern Byte *TerrainMem[QWX]; /* 4X4 Maps 30 x 25 */ | |
485 | extern Byte *Qtem[QWX]; | |
486 | extern short RateOGMem[SmX][SmY]; | |
487 | extern short FireStMap[SmX][SmY]; /* 8X8 Maps 15 x 13 */ | |
488 | extern short PoliceMap[SmX][SmY]; | |
489 | extern short PoliceMapEffect[SmX][SmY]; | |
490 | extern short ComRate[SmX][SmY]; | |
491 | extern short FireRate[SmX][SmY]; | |
492 | extern short STem[SmX][SmY]; | |
493 | extern short SpriteXOffset[OBJN]; | |
494 | extern short SpriteYOffset[OBJN]; | |
495 | extern short SMapX, SMapY; | |
496 | extern short CChr, CChr9; | |
497 | extern short RoadTotal, RailTotal, FirePop; | |
498 | extern short ResPop, ComPop, IndPop, TotalPop, LastTotalPop; | |
499 | extern short ResZPop, ComZPop, IndZPop, TotalZPop; | |
500 | extern short HospPop, ChurchPop, StadiumPop; | |
501 | extern short PolicePop, FireStPop; | |
502 | extern short CoalPop, NuclearPop, PortPop, APortPop; | |
503 | extern short NeedHosp, NeedChurch; | |
504 | extern short CrimeAverage, PolluteAverage, LVAverage; | |
505 | extern char *MicropolisVersion; | |
506 | extern char *CityName; | |
507 | extern char *CityFileName; | |
508 | extern char *StartupName; | |
509 | extern short StartingYear; | |
510 | extern QUAD CityTime; | |
511 | extern QUAD LastCityTime; | |
512 | extern QUAD LastCityMonth; | |
513 | extern QUAD LastCityYear; | |
514 | extern QUAD LastFunds; | |
515 | extern QUAD LastR, LastC, LastI; | |
516 | extern short GameLevel; | |
517 | extern short Cycle; | |
518 | extern short ScenarioID; | |
519 | extern short ShakeNow; | |
520 | extern QUAD DonDither; | |
521 | extern int DoOverlay; | |
522 | ||
523 | extern short *ResHis, ResHisMax; | |
524 | extern short *ComHis, ComHisMax; | |
525 | extern short *IndHis, IndHisMax; | |
526 | extern short *MoneyHis, *CrimeHis, *PollutionHis, *MiscHis; | |
527 | extern short *PowerMap; | |
528 | ||
529 | extern float roadPercent, policePercent, firePercent; | |
530 | extern QUAD RoadSpend, PoliceSpend, FireSpend; | |
531 | extern QUAD roadMaxValue, policeMaxValue, fireMaxValue; | |
532 | extern QUAD TaxFund, RoadFund, PoliceFund, FireFund; | |
533 | extern short RoadEffect, PoliceEffect, FireEffect; | |
534 | extern short TaxFlag, CityTax; | |
535 | extern QUAD TotalFunds; | |
536 | ||
537 | extern QUAD costOf[]; | |
538 | ||
539 | extern short flagBlink; | |
540 | extern unsigned char tileSynch; | |
541 | extern short aniTile[]; | |
542 | extern unsigned char aniSynch[]; | |
543 | extern int TilesAnimated; | |
544 | extern int DoAnimation; | |
545 | extern int DoMessages; | |
546 | extern int DoNotices; | |
547 | extern unsigned char ColorIntensities[]; | |
548 | ||
549 | extern short MesX, MesY; | |
550 | extern short MesNum, MessagePort; | |
551 | extern QUAD LastMesTime; | |
552 | ||
553 | extern short SimSpeed; | |
554 | extern short SimMetaSpeed; | |
555 | extern short NoDisasters; | |
556 | extern short autoBulldoze; | |
557 | extern short autoBudget; | |
558 | extern short autoGo; | |
559 | extern short UserSoundOn; | |
560 | ||
561 | extern short DisasterEvent; | |
562 | extern short DisasterWait; | |
563 | ||
564 | extern short ResCap, ComCap, IndCap; | |
565 | extern short RValve, CValve, IValve; | |
566 | extern short PwrdZCnt; | |
567 | extern short unPwrdZCnt; | |
568 | ||
569 | extern char *HomeDir, *ResourceDir, *HostName; | |
570 | ||
571 | extern short Graph10Max, Graph120Max; | |
572 | extern short Res2HisMax, Com2HisMax, Ind2HisMax; | |
573 | extern unsigned char *History10[HISTORIES], *History120[HISTORIES]; | |
574 | extern short CityScore; | |
575 | extern short deltaCityScore; | |
576 | extern short ScoreType; | |
577 | extern short ScoreWait; | |
578 | extern short CityClass; | |
579 | extern short PolMaxX, PolMaxY; | |
580 | extern int PowerStackNum; | |
581 | extern short TrafficAverage; | |
582 | extern short PosStackN; | |
583 | extern short SMapXStack[], SMapYStack[]; | |
584 | extern short Zsource; | |
585 | extern short HaveLastMessage; | |
586 | extern short PdestX, PdestY; | |
587 | extern short CdestX, CdestY; | |
588 | extern int absDist; | |
589 | extern short CopFltCnt; | |
590 | extern short GodCnt; | |
591 | extern short GdestX, GdestY; | |
592 | extern short GorgX, GorgY; | |
593 | extern short GodControl; | |
594 | extern short CopControl; | |
595 | extern short CdestX, CdestY; | |
596 | extern short TrafMaxX, TrafMaxY; | |
597 | extern short CrimeMaxX, CrimeMaxY; | |
598 | extern short FloodX, FloodY; | |
599 | extern short CrashX, CrashY; | |
600 | extern short CCx, CCy; | |
601 | extern QUAD CityPop, deltaCityPop; | |
602 | extern char *cityClassStr[6]; | |
603 | extern short CityYes, CityNo; | |
604 | extern short ProblemTable[PROBNUM]; | |
605 | extern short ProblemVotes[PROBNUM]; | |
606 | extern short ProblemOrder[4]; | |
607 | extern QUAD CityAssValue; | |
608 | ||
609 | extern short InitSimLoad; | |
610 | extern short DoInitialEval; | |
611 | extern int Startup; | |
612 | extern int StartupGameLevel; | |
613 | extern int PerformanceTiming; | |
614 | extern double FlushTime; | |
615 | ||
616 | extern char *optarg; | |
617 | extern int optind; | |
618 | extern struct timeval start_time, now_time, beat_time, last_now_time; | |
619 | extern Sim *sim; | |
620 | extern int WireMode; | |
621 | extern int MultiPlayerMode; | |
622 | extern int SugarMode; | |
623 | extern int sim_delay; | |
624 | extern int sim_skips; | |
625 | extern int sim_skip; | |
626 | extern int sim_paused; | |
627 | extern int sim_paused_speed; | |
628 | extern int sim_tty; | |
629 | #ifdef CAM | |
630 | extern int sim_just_cam; | |
631 | #endif | |
632 | extern int heat_steps; | |
633 | extern int heat_flow; | |
634 | extern int heat_rule; | |
635 | extern int UpdateDelayed; | |
636 | extern int DynamicData[32]; | |
637 | extern int Players; | |
638 | extern int Votes; | |
639 | extern int BobHeight; | |
640 | extern int OverRide; | |
641 | extern int Expensive; | |
642 | extern int PendingTool; | |
643 | extern int PendingX; | |
644 | extern int PendingY; | |
645 | extern int TreeLevel; | |
646 | extern int LakeLevel; | |
647 | extern int CurveLevel; | |
648 | extern int CreateIsland; | |
649 | extern short specialBase; | |
650 | extern short PunishCnt; | |
651 | extern short Dozing; | |
652 | extern short toolSize[]; | |
653 | extern short toolOffset[]; | |
654 | extern QUAD toolColors[]; | |
655 | extern char *Displays; | |
656 | extern char *FirstDisplay; | |
657 | extern char *dateStr[12]; | |
658 | ||
659 | extern short NewMap; | |
660 | extern short NewMapFlags[NMAPS]; | |
661 | extern short NewGraph; | |
662 | extern short ValveFlag; | |
663 | extern short MustUpdateFunds; | |
664 | extern short MustUpdateOptions; | |
665 | extern short CensusChanged; | |
666 | extern short EvalChanged; | |
667 | extern short MeltX, MeltY; | |
668 | extern int NeedRest; | |
669 | extern int ExitReturn; | |
670 | ||
671 | extern Tcl_Interp *tk_mainInterp; | |
672 | extern Tk_Window MainWindow; | |
673 | extern int FlushStyle; | |
674 | extern int GotXError; | |
675 | ||
676 | extern short Rand(short range); | |
677 | extern short RandInt(void); | |
678 | ||
679 | extern Sim *MakeNewSim(); | |
680 | extern SimView *MakeNewView(); | |
681 | extern SimSprite *GetSprite(); | |
682 | extern SimSprite *MakeSprite(); | |
683 | extern SimSprite *MakeNewSprite(); | |
684 | ||
685 | extern int setSpeed(short speed); | |
686 | extern int setSkips(int skips); | |
687 | extern int SetGameLevel(short level); | |
688 | extern int SetGameLevelFunds(short level); | |
689 | ||
690 | extern struct XDisplay *XDisplays; |