1 // ----------------------------------------------------------------------------
3 // ----------------------------------------------------------------------------
10 boolean DemoAvailable;
13 int FieldWidth; // standard size = 60
14 int FieldHeight; // standard size = 24
15 int HeaderSize; // standard size = 96
16 int FieldMax, LevelMax;
20 int PlayField16[SP_MAX_PLAYFIELD_SIZE + SP_HEADER_SIZE];
21 byte PlayField8[SP_MAX_PLAYFIELD_SIZE + SP_HEADER_SIZE];
22 byte DisPlayField[SP_MAX_PLAYFIELD_SIZE + SP_HEADER_SIZE];
40 int ScrollMinX, ScrollMaxX, ScrollMinY, ScrollMaxY;
43 int MurphyPosIndex, MurphyXPos, MurphyYPos;
44 int MurphyScreenXPos, MurphyScreenYPos;
45 int MurphyExplodePos, SplitMoveFlag, RedDiskReleaseMurphyPos;
46 int KillMurphyFlag, MurphyMoveCounter;
47 long YawnSleepCounter;
48 int MurphyVarFaceLeft;
49 int ScratchGravity, GravityFlag;
50 int RedDiskReleaseFlag, MovingPictureSequencePhase;
52 int YellowDisksExploded;
53 int AllowRedDiskCheat, AllowEatRightRedDiskBug;
56 int InfotronsNeeded, TotalInfotronsNeeded;
58 int SnikSnaksElectronsFrozen;
62 int RedDiskReleasePhase;
109 int aniSnikSnakTurningLeft[] =
111 aniSnikSnakTurnUpToLeft,
112 aniSnikSnakTurnLeftToDown,
113 aniSnikSnakTurnDownToRight,
114 aniSnikSnakTurnRightToUp
117 int aniSnikSnakTurningRight[] =
119 aniSnikSnakTurnUpToRight,
120 aniSnikSnakTurnRightToDown,
121 aniSnikSnakTurnDownToLeft,
122 aniSnikSnakTurnLeftToUp
126 int getSequenceLength(int sequence)
137 case aniTouchInfotron:
151 boolean isSnappingSequence(int sequence)
156 case aniTouchInfotron:
157 case aniTouchRedDisk:
167 AutoScrollFlag = True;
173 FieldMax = (FieldWidth * FieldHeight) + HeaderSize - 1;
174 LevelMax = (FieldWidth * FieldHeight) - 1;
179 /* these defaults will be changed after reading a Supaplex level file */
180 PlayField8 = REDIM_1D(sizeof(byte), 0, FieldMax);
181 DisPlayField = REDIM_1D(sizeof(byte), 0, FieldMax);
182 PlayField16 = REDIM_1D(sizeof(int), 0, FieldMax);
184 AnimationPosTable = REDIM_1D(sizeof(int), 0, LevelMax);
185 AnimationSubTable = REDIM_1D(sizeof(byte), 0, LevelMax);
186 TerminalState = REDIM_1D(sizeof(byte), 0, FieldMax);
190 int GetSI(int X, int Y)
192 return Y * FieldWidth + X;
197 return si % FieldWidth;
202 return si / FieldWidth;
205 int GetStretchX(int si)
207 return StretchWidth * (si % FieldWidth);
210 int GetStretchY(int si)
212 return StretchWidth * (si / FieldWidth);
217 copyInternalEngineVars_SP();
228 void Trace(char *Source, char *Message)
230 printf("::: Trace: Source == '%s', Message == '%s'\n", Source, Message);
233 void ReportError(char *Source, char *Message)
235 printf("::: ReportError: Source == '%s', Message == '%s'\n", Source, Message);
239 int Min(int A, int B)
241 return (A < B ? A : B);
244 int Max(int A, int B)
246 return (A < B ? B : A);