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