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 byte DisPlayField[SP_MAX_PLAYFIELD_SIZE + SP_HEADER_SIZE];
29 int ScrollMinX, ScrollMaxX, ScrollMinY, ScrollMaxY;
32 int MurphyPosIndex, MurphyXPos, MurphyYPos;
33 int MurphyScreenXPos, MurphyScreenYPos;
34 int MurphyExplodePos, SplitMoveFlag, RedDiskReleaseMurphyPos;
35 int KillMurphyFlag, MurphyMoveCounter;
37 int MurphyVarFaceLeft;
38 int ScratchGravity, GravityFlag;
39 int RedDiskReleaseFlag, MovingPictureSequencePhase;
41 int YellowDisksExploded;
42 int AllowRedDiskCheat, AllowEatRightRedDiskBug;
45 int InfotronsNeeded, TotalInfotronsNeeded;
47 int SnikSnaksElectronsFrozen;
51 int RedDiskReleasePhase;
98 int aniSnikSnakTurningLeft[] =
100 aniSnikSnakTurnUpToLeft,
101 aniSnikSnakTurnLeftToDown,
102 aniSnikSnakTurnDownToRight,
103 aniSnikSnakTurnRightToUp
106 int aniSnikSnakTurningRight[] =
108 aniSnikSnakTurnUpToRight,
109 aniSnikSnakTurnRightToDown,
110 aniSnikSnakTurnDownToLeft,
111 aniSnikSnakTurnLeftToUp
115 int getSequenceLength(int sequence)
126 case aniTouchInfotron:
140 boolean isSnappingSequence(int sequence)
145 case aniTouchInfotron:
146 case aniTouchRedDisk:
154 void InitGlobals(void)
156 InitPrecedingPlayfieldMemory();
158 AutoScrollFlag = True;
164 FieldMax = (FieldWidth * FieldHeight) + HeaderSize - 1;
165 LevelMax = (FieldWidth * FieldHeight) - 1;
169 // add preceding playfield buffer (as large as preceding memory area)
170 PlayField16 = checked_calloc((game_sp.preceding_buffer_size +
171 SP_MAX_PLAYFIELD_SIZE +
172 SP_HEADER_SIZE) * sizeof(int));
173 PlayField16 = &PlayField16[game_sp.preceding_buffer_size];
175 // add preceding playfield buffer (as large as one playfield row)
176 PlayField8 = checked_calloc((SP_MAX_PLAYFIELD_WIDTH +
177 SP_MAX_PLAYFIELD_SIZE +
178 SP_HEADER_SIZE) * sizeof(byte));
179 PlayField8 = &PlayField8[SP_MAX_PLAYFIELD_WIDTH];
182 int GetSI(int X, int Y)
184 return Y * FieldWidth + X;
189 return si % FieldWidth;
194 return si / FieldWidth;
197 int GetStretchX(int si)
199 return StretchWidth * (si % FieldWidth);
202 int GetStretchY(int si)
204 return StretchWidth * (si / FieldWidth);
207 void PrepareLevel(void)
209 copyInternalEngineVars_SP();
217 int Min(int A, int B)
219 return (A < B ? A : B);
222 int Max(int A, int B)
224 return (A < B ? B : A);