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;
21 // int PlayField16[SP_MAX_PLAYFIELD_SIZE + SP_HEADER_SIZE];
22 byte PlayField8[SP_MAX_PLAYFIELD_SIZE + SP_HEADER_SIZE];
23 byte DisPlayField[SP_MAX_PLAYFIELD_SIZE + SP_HEADER_SIZE];
41 int ScrollMinX, ScrollMaxX, ScrollMinY, ScrollMaxY;
44 int MurphyPosIndex, MurphyXPos, MurphyYPos;
45 int MurphyScreenXPos, MurphyScreenYPos;
46 int MurphyExplodePos, SplitMoveFlag, RedDiskReleaseMurphyPos;
47 int KillMurphyFlag, MurphyMoveCounter;
48 long YawnSleepCounter;
49 int MurphyVarFaceLeft;
50 int ScratchGravity, GravityFlag;
51 int RedDiskReleaseFlag, MovingPictureSequencePhase;
53 int YellowDisksExploded;
54 int AllowRedDiskCheat, AllowEatRightRedDiskBug;
57 int InfotronsNeeded, TotalInfotronsNeeded;
59 int SnikSnaksElectronsFrozen;
63 int RedDiskReleasePhase;
110 int aniSnikSnakTurningLeft[] =
112 aniSnikSnakTurnUpToLeft,
113 aniSnikSnakTurnLeftToDown,
114 aniSnikSnakTurnDownToRight,
115 aniSnikSnakTurnRightToUp
118 int aniSnikSnakTurningRight[] =
120 aniSnikSnakTurnUpToRight,
121 aniSnikSnakTurnRightToDown,
122 aniSnikSnakTurnDownToLeft,
123 aniSnikSnakTurnLeftToUp
127 int getSequenceLength(int sequence)
138 case aniTouchInfotron:
152 boolean isSnappingSequence(int sequence)
157 case aniTouchInfotron:
158 case aniTouchRedDisk:
168 InitPrecedingPlayfieldMemory();
170 AutoScrollFlag = True;
176 FieldMax = (FieldWidth * FieldHeight) + HeaderSize - 1;
177 LevelMax = (FieldWidth * FieldHeight) - 1;
181 PlayField16 = checked_calloc((game_sp.preceding_buffer_size +
182 SP_MAX_PLAYFIELD_SIZE +
183 SP_HEADER_SIZE) * sizeof(int));
184 PlayField16 = &PlayField16[game_sp.preceding_buffer_size];
187 /* these defaults will be changed after reading a Supaplex level file */
188 PlayField8 = REDIM_1D(sizeof(byte), 0, FieldMax);
189 DisPlayField = REDIM_1D(sizeof(byte), 0, FieldMax);
190 PlayField16 = REDIM_1D(sizeof(int), 0, FieldMax);
192 AnimationPosTable = REDIM_1D(sizeof(int), 0, LevelMax);
193 AnimationSubTable = REDIM_1D(sizeof(byte), 0, LevelMax);
194 TerminalState = REDIM_1D(sizeof(byte), 0, FieldMax);
198 int GetSI(int X, int Y)
200 return Y * FieldWidth + X;
205 return si % FieldWidth;
210 return si / FieldWidth;
213 int GetStretchX(int si)
215 return StretchWidth * (si % FieldWidth);
218 int GetStretchY(int si)
220 return StretchWidth * (si / FieldWidth);
225 copyInternalEngineVars_SP();
236 void Trace(char *Source, char *Message)
238 printf("::: Trace: Source == '%s', Message == '%s'\n", Source, Message);
241 void ReportError(char *Source, char *Message)
243 printf("::: ReportError: Source == '%s', Message == '%s'\n", Source, Message);
247 int Min(int A, int B)
249 return (A < B ? A : B);
252 int Max(int A, int B)
254 return (A < B ? B : A);