1 // ----------------------------------------------------------------------------
3 // ----------------------------------------------------------------------------
16 #define ScrollDelta ((int)1)
18 #define ZoomFactor (2)
20 #define StretchWidth (ZoomFactor * 16)
21 #define TwoPixels (ZoomFactor * 2)
24 // ----------------------------------------------------------------------------
25 // elements (stored in file and playfield)
26 // ----------------------------------------------------------------------------
32 #define fiInfotron (4)
34 #define fiHardWare (6)
36 #define fiOrangeDisk (8)
37 #define fiPortRight (9)
38 #define fiPortDown (10)
39 #define fiPortLeft (11)
41 #define fiSpPortRight (13)
42 #define fiSpPortDown (14)
43 #define fiSpPortLeft (15)
44 #define fiSpPortUp (16)
45 #define fiSnikSnak (17)
46 #define fiYellowDisk (18)
47 #define fiTerminal (19)
48 #define fiRedDisk (20)
49 #define fiPortUpAndDown (21)
50 #define fiPortLeftAndRight (22)
51 #define fiPortAllDirections (23)
52 #define fiElectron (24)
54 #define fiRAMLeft (26)
55 #define fiRAMRight (27)
56 #define fiHWFirst (28)
57 #define fiHW0 (fiHWFirst + 0) // fiHWFirst
58 #define fiHW1 (fiHWFirst + 1)
59 #define fiHW2 (fiHWFirst + 2)
60 #define fiHW3 (fiHWFirst + 3)
61 #define fiHW4 (fiHWFirst + 4)
62 #define fiHW5 (fiHWFirst + 5)
63 #define fiHW6 (fiHWFirst + 6)
64 #define fiHW7 (fiHWFirst + 7)
65 #define fiHW8 (fiHWFirst + 8)
66 #define fiHW9 (fiHWFirst + 9) // fiHWLast
69 #define fiRAMBottom (39)
70 #define fiWallSpace (40)
72 #define fiExplosion (0x1F)
78 // ----------------------------------------------------------------------------
79 // graphics and animations (used at runtime to display the elements)
80 // ----------------------------------------------------------------------------
82 // graphics and animations directly related to file elements
84 #define aniSpace IMG_EMPTY_SPACE
85 #define aniZonk IMG_SP_ZONK
86 #define aniBase IMG_SP_BASE
87 #define aniMurphy IMG_SP_MURPHY
88 #define aniInfotron IMG_SP_INFOTRON
89 #define aniRAM IMG_SP_CHIP_SINGLE
90 #define aniHardWare IMG_SP_HARDWARE_GRAY
91 #define aniExit IMG_SP_EXIT_CLOSED
92 #define aniOrangeDisk IMG_SP_DISK_ORANGE
93 #define aniPortRight IMG_SP_PORT_RIGHT
94 #define aniPortDown IMG_SP_PORT_DOWN
95 #define aniPortLeft IMG_SP_PORT_LEFT
96 #define aniPortUp IMG_SP_PORT_UP
97 #define aniSpPortRight IMG_SP_GRAVITY_PORT_RIGHT
98 #define aniSpPortDown IMG_SP_GRAVITY_PORT_DOWN
99 #define aniSpPortLeft IMG_SP_GRAVITY_PORT_LEFT
100 #define aniSpPortUp IMG_SP_GRAVITY_PORT_UP
101 #define aniSnikSnak IMG_SP_SNIKSNAK
102 #define aniYellowDisk IMG_SP_DISK_YELLOW
103 #define aniTerminal IMG_SP_TERMINAL
104 #define aniRedDisk IMG_SP_DISK_RED
105 #define aniPortUpAndDown IMG_SP_PORT_VERTICAL
106 #define aniPortLeftAndRight IMG_SP_PORT_HORIZONTAL
107 #define aniPortAllDirections IMG_SP_PORT_ANY
108 #define aniElectron IMG_SP_ELECTRON
109 #define aniBug IMG_SP_BUGGY_BASE
110 #define aniRAMLeft IMG_SP_CHIP_LEFT
111 #define aniRAMRight IMG_SP_CHIP_RIGHT
112 #define aniHWFirst IMG_SP_HARDWARE_BASE_1
113 #define aniHW0 IMG_SP_HARDWARE_BASE_1
114 #define aniHW1 IMG_SP_HARDWARE_GREEN
115 #define aniHW2 IMG_SP_HARDWARE_BLUE
116 #define aniHW3 IMG_SP_HARDWARE_RED
117 #define aniHW4 IMG_SP_HARDWARE_YELLOW
118 #define aniHW5 IMG_SP_HARDWARE_BASE_2
119 #define aniHW6 IMG_SP_HARDWARE_BASE_3
120 #define aniHW7 IMG_SP_HARDWARE_BASE_4
121 #define aniHW8 IMG_SP_HARDWARE_BASE_5
122 #define aniHW9 IMG_SP_HARDWARE_BASE_6
123 #define aniHWLast IMG_SP_HARDWARE_BASE_6
124 #define aniRAMTop IMG_SP_CHIP_TOP
125 #define aniRAMBottom IMG_SP_CHIP_BOTTOM
126 #define aniWallSpace IMG_INVISIBLE_WALL
132 // graphics and animations related to in-game animations for element actions
134 #define aniMurphyDropping IMG_SP_MURPHY_DROPPING
136 #define aniMurphySleepLeft IMG_SP_MURPHY_SLEEPING_LEFT
137 #define aniMurphySleepRight IMG_SP_MURPHY_SLEEPING_RIGHT
138 #define aniMurphyTouchLeft IMG_SP_MURPHY_SNAPPING_LEFT
139 #define aniMurphyTouchRight IMG_SP_MURPHY_SNAPPING_RIGHT
140 #define aniMurphyTouchUp IMG_SP_MURPHY_SNAPPING_UP
141 #define aniMurphyTouchDown IMG_SP_MURPHY_SNAPPING_DOWN
142 #define aniMurphyYawn IMG_SP_MURPHY_BORING_1
143 #define aniPushLeft IMG_SP_MURPHY_PUSHING_LEFT
144 #define aniPushRight IMG_SP_MURPHY_PUSHING_RIGHT
146 #define aniBugActivating IMG_SP_BUGGY_BASE_ACTIVATING
147 #define aniBugDeactivating IMG_SP_BUGGY_BASE_ACTIVATING
148 #define aniBugActive IMG_SP_BUGGY_BASE_ACTIVE
149 #define aniZonkRollLeft IMG_SP_ZONK_MOVING_LEFT
150 #define aniZonkRollRight IMG_SP_ZONK_MOVING_RIGHT
151 #define aniEatInfotronLeft IMG_SP_MURPHY_COLLECTING_LEFT
152 #define aniEatInfotronRight IMG_SP_MURPHY_COLLECTING_RIGHT
153 #define aniInfotronRollLeft IMG_SP_INFOTRON_MOVING_LEFT
154 #define aniInfotronRollRight IMG_SP_INFOTRON_MOVING_RIGHT
155 #define aniMurphyMoveLeft IMG_SP_MURPHY_MOVING_LEFT
156 #define aniMurphyMoveRight IMG_SP_MURPHY_MOVING_RIGHT
157 #define aniMurphyMoveUpLeft IMG_SP_MURPHY_MOVING_LEFT
158 #define aniMurphyMoveUpRight IMG_SP_MURPHY_MOVING_RIGHT
159 #define aniMurphyDigLeft IMG_SP_MURPHY_DIGGING_LEFT
160 #define aniMurphyDigRight IMG_SP_MURPHY_DIGGING_RIGHT
161 #define aniMurphyDigUpLeft IMG_SP_MURPHY_DIGGING_LEFT
162 #define aniMurphyDigUpRight IMG_SP_MURPHY_DIGGING_RIGHT
163 #define aniMurphyEatLeft IMG_SP_MURPHY_COLLECTING_LEFT
164 #define aniMurphyEatRight IMG_SP_MURPHY_COLLECTING_RIGHT
165 #define aniMurphyEatUpLeft IMG_SP_MURPHY_COLLECTING_LEFT
166 #define aniMurphyEatUpRight IMG_SP_MURPHY_COLLECTING_RIGHT
167 #define aniSplitUpDown IMG_SP_MURPHY
168 #define aniMurphyExit IMG_SP_MURPHY_SHRINKING
169 #define aniElectron IMG_SP_ELECTRON
170 #define aniExplosion IMG_SP_DEFAULT_EXPLODING
171 #define aniTouchBase IMG_SP_BASE_SNAPPING
172 #define aniTouchInfotron IMG_SP_INFOTRON_COLLECTING
173 #define aniTouchRedDisk IMG_SP_DISK_RED_COLLECTING
174 #define aniYellowDisk IMG_SP_DISK_YELLOW
175 #define aniOrangeDisk IMG_SP_DISK_ORANGE
176 #define aniRedDisk IMG_SP_DISK_RED
178 #define aniSnikSnakDown IMG_SP_SNIKSNAK_DOWN
179 #define aniSnikSnakLeft IMG_SP_SNIKSNAK_LEFT
180 #define aniSnikSnakRight IMG_SP_SNIKSNAK_RIGHT
181 #define aniSnikSnakUp IMG_SP_SNIKSNAK_UP
183 #define aniSnikSnakTurnLeftToUp IMG_SP_SNIKSNAK_TURNING_FROM_LEFT_UP
184 #define aniSnikSnakTurnLeftToDown IMG_SP_SNIKSNAK_TURNING_FROM_LEFT_DOWN
185 #define aniSnikSnakTurnRightToUp IMG_SP_SNIKSNAK_TURNING_FROM_RIGHT_UP
186 #define aniSnikSnakTurnRightToDown IMG_SP_SNIKSNAK_TURNING_FROM_RIGHT_DOWN
187 #define aniSnikSnakTurnUpToLeft IMG_SP_SNIKSNAK_TURNING_FROM_UP_LEFT
188 #define aniSnikSnakTurnUpToRight IMG_SP_SNIKSNAK_TURNING_FROM_UP_RIGHT
189 #define aniSnikSnakTurnDownToLeft IMG_SP_SNIKSNAK_TURNING_FROM_DOWN_LEFT
190 #define aniSnikSnakTurnDownToRight IMG_SP_SNIKSNAK_TURNING_FROM_DOWN_RIGHT
192 #define aniTerminalActive IMG_SP_TERMINAL_ACTIVE
194 #define aniDefaultExplosion IMG_SP_DEFAULT_EXPLODING
195 #define aniElectronExplosion IMG_SP_ELECTRON_EXPLODING
197 #define imgFrameCorner IMG_SP_FRAME_CORNER
198 #define imgFrameHorizontal IMG_SP_FRAME_HORIZONTAL
199 #define imgFrameVertical IMG_SP_FRAME_VERTICAL
202 // ----------------------------------------------------------------------------
204 // ----------------------------------------------------------------------------
211 #define keySpaceUp (5)
212 #define keySpaceLeft (6)
213 #define keySpaceDown (7)
214 #define keySpaceRight (8)
218 // ----------------------------------------------------------------------------
220 // ----------------------------------------------------------------------------
222 #ifndef HAS_LevelDescriptor
230 #define HAS_LevelDescriptor
233 #ifndef HAS_SpecialPortType
236 short PortLocation; // = 2*(x+(y*60))
237 byte Gravity; // 1 = turn on, anything else (0) = turn off
238 byte FreezeZonks; // 2 = turn on, anything else (0) = turn off (1=off!)
239 byte FreezeEnemies; // 1 = turn on, anything else (0) = turn off
242 #define HAS_SpecialPortType
245 #ifndef HAS_LevelInfoType
249 byte InitialGravity; // 1=on, anything else (0) = off
250 byte Version; // SpeedFixVersion XOR &H20
252 byte InitialFreezeZonks; // 2=on, anything else (0) = off. (1=off too!)
253 byte InfotronsNeeded;
255 // Number of Infotrons needed. 0 means that Supaplex will count the total
256 // amount of Infotrons in the level, and use the low byte of that number.
257 // (A multiple of 256 Infotrons will then result in 0-to-eat, etc.!)
258 byte SpecialPortCount; // Maximum 10 allowed!
259 SpecialPortType SpecialPort[10];
260 byte SpeedByte; // = Speed XOR Highbyte(RandomSeed)
261 byte CheckSumByte; // = CheckSum XOR SpeedByte
262 short DemoRandomSeed;
264 #define HAS_LevelInfoType
268 extern int GetSI(int X, int Y);
269 extern int GetStretchX(int si);
270 extern int GetStretchY(int si);
271 extern int GetX(int si);
272 extern int GetY(int si);
273 extern void InitGlobals();
275 extern void PrepareLevel();
277 extern int getSequenceLength(int sequence);
278 extern boolean isSnappingSequence(int sequence);
280 extern int Min(int A, int B);
281 extern int Max(int A, int B);
283 extern int fiGraphic[];
284 extern int aniSnikSnakTurningLeft[];
285 extern int aniSnikSnakTurningRight[];
287 extern boolean LevelLoaded;
289 extern boolean DemoAvailable;
290 extern boolean menBorder;
292 extern int *PlayField16;
293 extern byte *PlayField8;
294 extern byte DisPlayField[SP_MAX_PLAYFIELD_SIZE + SP_HEADER_SIZE];
296 extern int FieldHeight;
297 extern int FieldMax, LevelMax;
298 extern int FieldWidth;
299 extern int FreezeZonks;
300 extern int HeaderSize;
302 extern short RandomSeed;
304 extern LevelInfoType LInfo;
305 extern int ScrollMinX, ScrollMaxX, ScrollMinY, ScrollMaxY;
306 extern int ScrollX, ScrollY;
308 extern int AllowRedDiskCheat, AllowEatRightRedDiskBug;
309 extern int Data_SubRest, Data_SubRstFlg;
310 extern int DemoKeyCode;
311 extern int GameBusyFlag;
312 extern int InfotronsNeeded, TotalInfotronsNeeded;
313 extern int KillMurphyFlag, MurphyMoveCounter;
314 extern int MurphyExplodePos, SplitMoveFlag, RedDiskReleaseMurphyPos;
315 extern int MurphyPosIndex, MurphyXPos, MurphyYPos;
316 extern int MurphyScreenXPos, MurphyScreenYPos;
317 extern int MurphyVarFaceLeft;
318 extern int RedDiskCount;
319 extern int RedDiskReleaseFlag, MovingPictureSequencePhase;
320 extern int RedDiskReleasePhase;
321 extern int ScratchGravity, GravityFlag;
322 extern int SnikSnaksElectronsFrozen;
323 extern int YellowDisksExploded;
324 extern int YawnSleepCounter;
326 #endif /* GLOBALS_H */