short DoInitialEval = 0;
short MeltX, MeltY;
+void CoalSmoke(int mx, int my);
+void DoAirport(void);
+void DrawStadium(int z);
+void DoFire(void);
+int GetBoatDis(void);
+int DoBridge(void);
+void DoRoad(void);
+void DoRadTile(void);
+void DoRail(void);
+void MapScan(int x1, int x2);
+void CollectTax(void);
+void Take2Census(void);
+void TakeCensus(void);
+void ClearCensus(void);
+void SetValves(void);
+void SetCommonInits(void);
+void SimLoadInit(void);
+void InitSimMemory(void);
+void DecROGMem(void);
+void DecTrafficMem(void);
+void Simulate(int mod16);
/* comefrom: doEditWindow scoreDoer doMapInFront graphDoer doNilEvent */
-SimFrame(void)
+void SimFrame(void)
{
- short i;
-
if (SimSpeed == 0)
return;
/* comefrom: SimFrame */
+void
Simulate(int mod16)
{
static short SpdPwr[4] = { 1, 2, 4, 5 };
/* comefrom: Simulate */
+void
DoSimInit(void)
{
Fcycle = 0;
/* comefrom: SimLoadInit */
+void
DoNilPower(void)
{
register short x, y, z;
/* comefrom: Simulate */
+void
DecTrafficMem(void) /* tends to empty TrfDensity */
{
register short x, y, z;
for (x = 0; x < HWLDX; x++)
for (y = 0; y < HWLDY; y++)
- if (z = TrfDensity[x][y]) {
+ if ((z = TrfDensity[x][y])) {
if (z > 24) {
if (z > 200) TrfDensity[x][y] = z - 34;
else TrfDensity[x][y] = z - 24;
/* comefrom: Simulate */
+void
DecROGMem(void) /* tends to empty RateOGMem */
{
register short x, y, z;
/* comefrom: DoSimInit */
+void
InitSimMemory(void)
{
register short x, z;
/* comefrom: DoSimInit */
+void
SimLoadInit(void)
{
static short DisTab[9] = { 0, 2, 10, 5, 20, 3, 5, 5, 2 * 48};
/* comefrom: InitSimMemory SimLoadInit */
+void
SetCommonInits(void)
{
EvalInit();
/* comefrom: Simulate DoSimInit */
+void
SetValves(void)
{
static short TaxTable[21] = {
Births = NormResPop * (.02); /* Birth Rate */
PjResPop = NormResPop + Migration + Births; /* Projected Res.Pop */
- if (temp = (ComHis[1] + IndHis[1])) LaborBase = (ResHis[1] / temp);
+ if ((temp = (ComHis[1] + IndHis[1]))) LaborBase = (ResHis[1] / temp);
else LaborBase = 1;
if (LaborBase > 1.3) LaborBase = 1.3;
if (LaborBase < 0) LaborBase = 0; /* LB > 1 - .1 */
/* comefrom: Simulate DoSimInit */
+void
ClearCensus(void)
{
register short x, y, z;
/* comefrom: Simulate */
+void
TakeCensus(void)
{
short x;
/* comefrom: Simulate */
+void
Take2Census(void) /* Long Term Graphs */
{
short x;
/* comefrom: Simulate */
+void
CollectTax(void)
{
static float RLevels[3] = { 0.7, 0.9, 1.2 };
}
+void
UpdateFundEffects(void)
{
if (RoadFund)
/* comefrom: Simulate DoSimInit */
+void
MapScan(int x1, int x2)
{
register short x, y;
for (x = x1; x < x2; x++) {
for (y = 0; y < WORLD_Y; y++) {
- if (CChr = Map[x][y]) {
+ if ((CChr = Map[x][y])) {
CChr9 = CChr & LOMASK; /* Mask off status bits */
if (CChr9 >= FLOOD) {
SMapX = x;
/* comefrom: MapScan */
+void
DoRail(void)
{
RailTotal++;
/* comefrom: MapScan */
+void
DoRadTile(void)
{
if (!(Rand16() & 4095)) Map[SMapX][SMapY] = 0; /* Radioactive decay */
/* comefrom: MapScan */
+void
DoRoad(void)
{
register short Density, tden, z;
/* comefrom: MapScan */
+int
DoBridge(void)
{
static short HDx[7] = { -2, 2, -2, -1, 0, 1, 2 };
static short VBRTAB2[7] = {
VBRIDGE | BULLBIT, RIVER, VBRIDGE | BULLBIT, VBRIDGE | BULLBIT,
VBRIDGE | BULLBIT, VBRIDGE | BULLBIT, RIVER };
- register z, x, y, MPtem;
+ register int z, x, y, MPtem;
if (CChr9 == BRWV) { /* Vertical bridge close */
if ((!(Rand16() & 3)) &&
/* comefrom: MapScan */
+void
DoFire(void)
{
static short DX[4] = { -1, 0, 1, 0 };
/* comefrom: DoFire MakeFlood */
+void
FireZone(int Xloc, int Yloc, int ch)
{
register short Xtem, Ytem;
/* comefrom: DoSPZone DoHospChur */
+void
RepairZone(short ZCent, short zsize)
{
short cnt;
/* comefrom: DoZone */
+void
DoSPZone(short PwrOn)
{
static short MltdwnTab[3] = { 30000, 20000, 10000 }; /* simadj */
- register z;
+ register int z;
switch (CChr9) {
/* comefrom: DoSPZone */
+void
DrawStadium(int z)
{
register int x, y;
/* comefrom: DoSPZone */
+void
DoAirport(void)
{
if (!(Rand(5))) {
/* comefrom: DoSPZone */
+void
CoalSmoke(int mx, int my)
{
static short SmTb[4] = { COALSMOKE1, COALSMOKE2, COALSMOKE3, COALSMOKE4 };
/* comefrom: DoSPZone MakeMeltdown */
+void
DoMeltdown(int SX, int SY)
{
- register x, y, z, t;
+ register int x, y, z, t;
MeltX = SX; MeltY = SY;
}
+void
RandomlySeedRand()
{
struct timeval time;
SeedRand(time.tv_usec ^ time.tv_sec ^ sim_rand());
}
-
+void
SeedRand(int seed)
{
sim_srand(seed);