rnd-20020526-1-src
[rocksndiamonds.git] / src / main.c
1 /***********************************************************
2 * Rocks'n'Diamonds -- McDuffin Strikes Back!               *
3 *----------------------------------------------------------*
4 * (c) 1995-2001 Artsoft Entertainment                      *
5 *               Holger Schemel                             *
6 *               Detmolder Strasse 189                      *
7 *               33604 Bielefeld                            *
8 *               Germany                                    *
9 *               e-mail: info@artsoft.org                   *
10 *----------------------------------------------------------*
11 * main.c                                                   *
12 ***********************************************************/
13
14 #include "libgame/libgame.h"
15
16 #include "main.h"
17 #include "init.h"
18 #include "game.h"
19 #include "events.h"
20
21 GC              tile_clip_gc;
22 Bitmap         *pix[NUM_BITMAPS];
23 Pixmap          tile_clipmask[NUM_TILES];
24 DrawBuffer     *fieldbuffer;
25 DrawBuffer     *drawto_field;
26
27 int             game_status = MAINMENU;
28 boolean         level_editor_test_game = FALSE;
29 boolean         network_playing = FALSE;
30
31 int             key_joystick_mapping = 0;
32
33 boolean         redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
34 int             redraw_x1 = 0, redraw_y1 = 0;
35
36 short           Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
37 short           Ur[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
38 short           MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
39 short           MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
40 short           MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
41 short           Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
42 short           Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
43 short           StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
44 short           Frame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
45 boolean         Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
46 short           JustStopped[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
47 short           AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
48 short           AmoebaCnt[MAX_NUM_AMOEBA], AmoebaCnt2[MAX_NUM_AMOEBA];
49 short           ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
50 unsigned long   Elementeigenschaften1[MAX_ELEMENTS];
51 unsigned long   Elementeigenschaften2[MAX_ELEMENTS];
52
53 int             lev_fieldx,lev_fieldy, scroll_x,scroll_y;
54
55 int             FX = SX, FY = SY, ScrollStepSize;
56 int             ScreenMovDir = MV_NO_MOVING, ScreenMovPos = 0;
57 int             ScreenGfxPos = 0;
58 int             BorderElement = EL_BETON;
59 int             GameFrameDelay = GAME_FRAME_DELAY;
60 int             FfwdFrameDelay = FFWD_FRAME_DELAY;
61 int             BX1 = 0, BY1 = 0, BX2 = SCR_FIELDX-1, BY2 = SCR_FIELDY-1;
62 int             SBX_Left, SBX_Right;
63 int             SBY_Upper, SBY_Lower;
64 int             ZX,ZY, ExitX,ExitY;
65 int             AllPlayersGone;
66
67 int             TimeFrames, TimePlayed, TimeLeft;
68
69 boolean         network_player_action_received = FALSE;
70
71 struct LevelInfo        level;
72 struct PlayerInfo       stored_player[MAX_PLAYERS], *local_player = NULL;
73 struct HiScore          highscore[MAX_SCORE_ENTRIES];
74 struct TapeInfo         tape;
75 struct SetupInfo        setup;
76 struct GameInfo         game;
77 struct GlobalInfo       global;
78
79 /* filenames of sound effects */
80 char *sound_name[NUM_SOUNDS] =
81 {
82   "amoebe.wav",
83   "antigrav.wav",
84   "autsch.wav",
85   "blurb.wav",
86   "bong.wav",
87   "buing.wav",
88   "deng.wav",
89   "fuel.wav",
90   "gong.wav",
91   "halloffame.wav",
92   "holz.wav",
93   "hui.wav",
94   "kabumm.wav",
95   "kink.wav",
96   "klapper.wav",
97   "kling.wav",
98   "klopf.wav",
99   "klumpf.wav",
100   "knack.wav",
101   "knurk.wav",
102   "krach.wav",
103   "lachen.wav",
104   "laser.wav",
105   "miep.wav",
106   "njam.wav",
107   "oeffnen.wav",
108   "pling.wav",
109   "pong.wav",
110   "pusch.wav",
111   "quiek.wav",
112   "quirk.wav",
113   "rhythmloop.wav",
114   "roaaar.wav",
115   "roehr.wav",
116   "rumms.wav",
117   "schlopp.wav",
118   "schlurf.wav",
119   "schrff.wav",
120   "schwirr.wav",
121   "sirr.wav",
122   "slurp.wav",
123   "sproing.wav",
124   "warnton.wav",
125   "whoosh.wav",
126   "zisch.wav",
127   "base.wav",
128   "infotron.wav",
129   "zonkdown.wav",
130   "zonkpush.wav",
131   "bug.wav",
132   "boom.wav",
133   "booom.wav",
134   "exit.wav",
135   "empty.wav",
136   "gate.wav"
137 };
138
139 struct SoundEffectInfo sound_effects[] =
140 {
141   /* sounds for Boulder Dash style elements and actions */
142   { "bd_empty_space.digging",           "empty.wav"             },
143   { "bd_sand.digging",                  "schlurf.wav"           },
144   { "bd_diamond.collecting",            "pong.wav"              },
145   { "bd_diamond.impact",                "pling.wav"             },
146   { "bd_rock.pushing",                  "pusch.wav"             },
147   { "bd_rock.impact",                   "klopf.wav"             },
148   { "bd_magic_wall.activating",         "quirk.wav"             },
149   { "bd_magic_wall.changing",           "quirk.wav"             },
150   { "bd_magic_wall.running",            "miep.wav"              },
151   { "bd_amoeba.waiting",                SND_FILE_UNDEFINED      },
152   { "bd_amoeba.creating",               "amoebe.wav"            },
153   { "bd_amoeba.growing",                SND_FILE_UNDEFINED      },
154   { "bd_amoeba.turning_to_gem",         "pling.wav"             },
155   { "bd_amoeba.turning_to_rock",        "klopf.wav"             },
156   { "bd_butterfly.moving",              "klapper.wav"           },
157   { "bd_butterfly.waiting",             "klapper.wav"           },
158   { "bd_firefly.moving",                "roehr.wav"             },
159   { "bd_firefly.waiting",               "roehr.wav"             },
160   { "bd_exit.entering",                 "buing.wav"             },
161
162   /* sounds for Supaplex style elements and actions */
163   { "sp_empty_space.digging",           "empty.wav"             },
164   { "sp_base.digging",                  "base.wav"              },
165   { "sp_buggy_base.digging",            "base.wav"              },
166   { "sp_buggy_base.activating",         "bug.wav"               },
167   { "sp_infotron.collecting",           "infotron.wav"          },
168   { "sp_infotron.impact",               "pling.wav"             },
169   { "sp_zonk.pushing",                  "zonkpush.wav"          },
170   { "sp_zonk.impact",                   "zonkdown.wav"          },
171   { "sp_disk_red.collecting",           "infotron.wav"          },
172   { "sp_disk_orange.pushing",           "zonkpush.wav"          },
173   { "sp_disk_yellow.pushing",           "pusch.wav"             },
174   { "sp_port.passing",                  "gate.wav"              },
175   { "sp_exit.entering",                 "exit.wav"              },
176   { "sp_element.exploding",             "booom.wav"             },
177   { "sp_sniksnak.moving",               SND_FILE_UNDEFINED      },
178   { "sp_sniksnak.waiting",              SND_FILE_UNDEFINED      },
179   { "sp_electron.moving",               SND_FILE_UNDEFINED      },
180   { "sp_electron.waiting",              SND_FILE_UNDEFINED      },
181   { "sp_terminal.activating",           SND_FILE_UNDEFINED      },
182
183   /* sounds for Sokoban style elements and actions */
184   { "sokoban_object.pushing",           "pusch.wav"             },
185   { "sokoban_field.filling",            "deng.wav"              },
186   { "sokoban_field.clearing",           SND_FILE_UNDEFINED      },
187   { "sokoban_game.solving",             "buing.wav"             },
188
189   /* sounds for Emerald Mine style elements and actions */
190   { "empty_space.digging",              "empty.wav"             },
191   { "sand.digging",                     "schlurf.wav"           },
192   { "emerald.collecting",               "pong.wav"              },
193   { "emerald.impact",                   "pling.wav"             },
194   { "diamond.collecting",               "pong.wav"              },
195   { "diamond.impact",                   "pling.wav"             },
196   { "diamond.breaking",                 "quirk.wav"             },
197   { "rock.pushing",                     "pusch.wav"             },
198   { "rock.impact",                      "klopf.wav"             },
199   { "bomb.pushing",                     "pusch.wav"             },
200   { "nut.pushing",                      "knurk.wav"             },
201   { "nut.cracking",                     "knack.wav"             },
202   { "nut.impact",                       "klumpf.wav"            },
203   { "dynamite.collecting",              "pong.wav"              },
204   { "dynamite.placing",                 "deng.wav"              },
205   { "dynamite.burning",                 "zisch.wav"             },
206   { "key.collecting",                   "pong.wav"              },
207   { "gate.passing",                     "gate.wav"              },
208   { "bug.moving",                       "klapper.wav"           },
209   { "bug.waiting",                      "klapper.wav"           },
210   { "spaceship.moving",                 "roehr.wav"             },
211   { "spaceship.waiting",                "roehr.wav"             },
212   { "yamyam.moving",                    SND_FILE_UNDEFINED      },
213   { "yamyam.waiting",                   "njam.wav"              },
214   { "yamyam.eating_diamond",            SND_FILE_UNDEFINED      },
215   { "robot.stepping",                   "schlurf.wav"           },
216   { "robot.waiting",                    SND_FILE_UNDEFINED      },
217   { "robot_wheel.activating",           "deng.wav"              },
218   { "robot_wheel.running",              "miep.wav"              },
219   { "magic_wall.activating",            "quirk.wav"             },
220   { "magic_wall.changing",              "quirk.wav"             },
221   { "magic_wall.running",               "miep.wav"              },
222   { "amoeba.waiting",                   SND_FILE_UNDEFINED      },
223   { "amoeba.creating",                  "amoebe.wav"            },
224   { "amoeba.growing",                   SND_FILE_UNDEFINED      },
225   { "amoeba.dropping",                  SND_FILE_UNDEFINED      },
226   { "acid.splashing",                   "blurb.wav"             },
227   { "quicksand.filling",                SND_FILE_UNDEFINED      },
228   { "quicksand.slipping_through",       SND_FILE_UNDEFINED      },
229   { "quicksand.emptying",               SND_FILE_UNDEFINED      },
230   { "exit.opening",                     "oeffnen.wav"           },
231   { "exit.entering",                    "buing.wav"             },
232
233   /* sounds for Emerald Mine Club style elements and actions */
234   { "balloon.moving",                   SND_FILE_UNDEFINED      },
235   { "balloon.waiting",                  SND_FILE_UNDEFINED      },
236   { "balloon.pushing",                  "schlurf.wav"           },
237   { "balloon_switch.activating",        SND_FILE_UNDEFINED      },
238   { "spring.moving",                    SND_FILE_UNDEFINED      },
239   { "spring.pushing",                   "pusch.wav"             },
240   { "spring.impact",                    "klopf.wav"             },
241   { "wall.growing",                     SND_FILE_UNDEFINED      },
242
243   /* sounds for Diamond Caves style elements and actions */
244   { "pearl.collecting",                 "pong.wav"              },
245   { "pearl.breaking",                   "knack.wav"             },
246   { "pearl.impact",                     "pling.wav"             },
247   { "crystal.collecting",               "pong.wav"              },
248   { "crystal.impact",                   "pling.wav"             },
249   { "envelope.collecting",              "pong.wav"              },
250   { "sand_invisible.digging",           "schlurf.wav"           },
251   { "shield_passive.collecting",        "pong.wav"              },
252   { "shield_passive.activated",         SND_FILE_UNDEFINED      },
253   { "shield_active.collecting",         "pong.wav"              },
254   { "shield_active.activated",          SND_FILE_UNDEFINED      },
255   { "extra_time.collecting",            "gong.wav"              },
256   { "mole.moving",                      SND_FILE_UNDEFINED      },
257   { "mole.waiting",                     SND_FILE_UNDEFINED      },
258   { "mole.eating_amoeba",               "blurb.wav"             },
259   { "switchgate_switch.activating",     SND_FILE_UNDEFINED      },
260   { "switchgate.opening",               "oeffnen.wav"           },
261   { "switchgate.closing",               "oeffnen.wav"           },
262   { "switchgate.passing",               "gate.wav"              },
263   { "timegate_wheel.activating",        "deng.wav"              },
264   { "timegate_wheel.running",           "miep.wav"              },
265   { "timegate.opening",                 "oeffnen.wav"           },
266   { "timegate.closing",                 "oeffnen.wav"           },
267   { "timegate.passing",                 "gate.wav"              },
268   { "conveyor_belt_switch.activating",  SND_FILE_UNDEFINED      },
269   { "conveyor_belt.running",            SND_FILE_UNDEFINED      },
270   { "light_switch.activating",          SND_FILE_UNDEFINED      },
271   { "light_switch.deactivating",        SND_FILE_UNDEFINED      },
272
273   /* sounds for DX Boulderdash style elements and actions */
274   { "dx_bomb.pushing",                  "pusch.wav"             },
275   { "trap_inactive.digging",            "schlurf.wav"           },
276   { "trap.activating",                  SND_FILE_UNDEFINED      },
277   { "tube.passing",                     SND_FILE_UNDEFINED      },
278
279   /* sounds for Rocks'n'Diamonds style elements and actions */
280   { "amoeba.turning_to_gem",            "pling.wav"             },
281   { "amoeba.turning_to_rock",           "klopf.wav"             },
282   { "speed_pill.collecting",            "pong.wav"              },
283   { "dynabomb_nr.collecting",           "pong.wav"              },
284   { "dynabomb_sz.collecting",           "pong.wav"              },
285   { "dynabomb_xl.collecting",           "pong.wav"              },
286   { "dynabomb.placing",                 "deng.wav"              },
287   { "dynabomb.burning",                 "zisch.wav"             },
288   { "satellite.moving",                 SND_FILE_UNDEFINED      },
289   { "satellite.waiting",                SND_FILE_UNDEFINED      },
290   { "satellite.pushing",                "pusch.wav"             },
291   { "lamp.activating",                  "deng.wav"              },
292   { "lamp.deactivating",                "deng.wav"              },
293   { "time_orb_full.collecting",         "gong.wav"              },
294   { "time_orb_full.impact",             "deng.wav"              },
295   { "time_orb_empty.pushing",           "pusch.wav"             },
296   { "time_orb_empty.impact",            "deng.wav"              },
297   { "gameoflife.waiting",               SND_FILE_UNDEFINED      },
298   { "gameoflife.creating",              "amoebe.wav"            },
299   { "gameoflife.growing",               SND_FILE_UNDEFINED      },
300   { "biomaze.waiting",                  SND_FILE_UNDEFINED      },
301   { "biomaze.creating",                 "amoebe.wav"            },
302   { "biomaze.growing",                  SND_FILE_UNDEFINED      },
303   { "pacman.moving",                    SND_FILE_UNDEFINED      },
304   { "pacman.waiting",                   SND_FILE_UNDEFINED      },
305   { "pacman.eating_amoeba",             SND_FILE_UNDEFINED      },
306   { "dark_yamyam.moving",               SND_FILE_UNDEFINED      },
307   { "dark_yamyam.waiting",              "njam.wav"              },
308   { "dark_yamyam.eating_any",           SND_FILE_UNDEFINED      },
309   { "penguin.moving",                   SND_FILE_UNDEFINED      },
310   { "penguin.waiting",                  SND_FILE_UNDEFINED      },
311   { "penguin.entering_exit",            "buing.wav"             },
312   { "pig.moving",                       SND_FILE_UNDEFINED      },
313   { "pig.waiting",                      SND_FILE_UNDEFINED      },
314   { "pig.eating_gem",                   SND_FILE_UNDEFINED      },
315   { "dragon.moving",                    SND_FILE_UNDEFINED      },
316   { "dragon.waiting",                   SND_FILE_UNDEFINED      },
317   { "dragon.attacking",                 SND_FILE_UNDEFINED      },
318
319   /* sounds for generic elements and actions */
320   { "player.dying",                     "autsch.wav"            },
321   { "element.exploding",                "roaaar.wav"            },
322
323   /* sounds for other game actions */
324   { "game.starting",                    SND_FILE_UNDEFINED      },
325   { "game.running_out_of_time",         "gong.wav"              },
326   { "game.leveltime_bonus",             "sirr.wav"              },
327   { "game.losing",                      "lachen.wav"            },
328   { "game.winning",                     SND_FILE_UNDEFINED      },
329
330   /* sounds for other non-game actions */
331   { "menu.door_opening",                "oeffnen.wav"           },
332   { "menu.door_closing",                "oeffnen.wav"           },
333   { "menu.hall_of_fame",                "halloffame.wav"        },
334   { "menu.info_screen",                 "rhythmloop.wav"        },
335
336 #if 0
337   { "[not used]",                       "antigrav.wav"          },
338   { "[not used]",                       "bong.wav"              },
339   { "[not used]",                       "fuel.wav"              },
340   { "[not used]",                       "holz.wav"              },
341   { "[not used]",                       "hui.wav"               },
342   { "[not used]",                       "kabumm.wav"            },
343   { "[not used]",                       "kink.wav"              },
344   { "[not used]",                       "kling.wav"             },
345   { "[not used]",                       "krach.wav"             },
346   { "[not used]",                       "laser.wav"             },
347   { "[not used]",                       "quiek.wav"             },
348   { "[not used]",                       "rumms.wav"             },
349   { "[not used]",                       "schlopp.wav"           },
350   { "[not used]",                       "schrff.wav"            },
351   { "[not used]",                       "schwirr.wav"           },
352   { "[not used]",                       "slurp.wav"             },
353   { "[not used]",                       "sproing.wav"           },
354   { "[not used]",                       "warnton.wav"           },
355   { "[not used]",                       "whoosh.wav"            },
356   { "[not used]",                       "boom.wav"              },
357 #endif
358 };
359
360 struct ElementInfo element_info[] =
361 {
362   { "empty_space",              "empty space"                   },      /* 0 */
363   { "sand",                     "sand"                          },
364   { "wall",                     "normal wall"                   },
365   { "wall",                     "round wall"                    },
366   { "rock",                     "rock"                          },
367   { "key",                      "key"                           },
368   { "emerald",                  "emerald"                       },
369   { "exit",                     "closed exit"                   },
370   { "player",                   "player"                        },
371   { "bug",                      "bug"                           },
372   { "spaceship",                "spaceship"                     },     /* 10 */
373   { "yamyam",                   "yam yam"                       },
374   { "robot",                    "robot"                         },
375   { "wall",                     "steel wall"                    },
376   { "diamond",                  "diamond"                       },
377   { "amoeba",                   "dead amoeba"                   },
378   { "quicksand",                "empty quicksand"               },
379   { "quicksand",                "quicksand with rock"           },
380   { "amoeba",                   "amoeba drop"                   },
381   { "bomb",                     "bomb"                          },
382   { "magic_wall",               "magic wall"                    },     /* 20 */
383   { "speed_pill",               "speed pill"                    },
384   { "acid",                     "acid pool"                     },
385   { "amoeba",                   "dropping amoeba"               },
386   { "amoeba",                   "normal amoeba"                 },
387   { "nut",                      "nut with emerald"              },
388   { "gameoflife",               "Conway's wall of life"         },
389   { "biomaze",                  "biomaze"                       },
390   { "dynamite",                 "burning dynamite"              },
391   { NULL,                       "unknown"                       },
392   { "robot_wheel",              "magic wheel"                   },     /* 30 */
393   { "robot_wheel",              "magic wheel (running)"         },
394   { "key",                      "red key"                       },
395   { "key",                      "yellow key"                    },
396   { "key",                      "green key"                     },
397   { "key",                      "blue key"                      },
398   { "gate",                     "red door"                      },
399   { "gate",                     "yellow door"                   },
400   { "gate",                     "green door"                    },
401   { "gate",                     "blue door"                     },
402   { "gate",                     "gray door (opened by red key)" },     /* 40 */
403   { "gate",                     "gray door (opened by yellow key)"},
404   { "gate",                     "gray door (opened by green key)"},
405   { "gate",                     "gray door (opened by blue key)"},
406   { "dynamite",                 "dynamite"                      },
407   { "pacman",                   "pac man"                       },
408   { "wall",                     "invisible normal wall"         },
409   { "lamp",                     "lamp (off)"                    },
410   { "lamp",                     "lamp (on)"                     },
411   { "wall",                     "wall with emerald"             },
412   { "wall",                     "wall with diamond"             },     /* 50 */
413   { "amoeba",                   "amoeba with content"           },
414   { "bd_amoeba",                "amoeba (BD style)"             },
415   { "time_orb_full",            "time orb (full)"               },
416   { "time_orb_empty",           "time orb (empty)"              },
417   { "wall",                     "growing wall"                  },
418   { "bd_diamond",               "diamond (BD style)"            },
419   { "emerald",                  "yellow emerald"                },
420   { "wall",                     "wall with BD style diamond"    },
421   { "wall",                     "wall with yellow emerald"      },
422   { "dark_yamyam",              "dark yam yam"                  },     /* 60 */
423   { "bd_magic_wall",            "magic wall (BD style)"         },
424   { "wall",                     "invisible steel wall"          },
425   { NULL,                       "-"                             },
426   { "dynabomb_nr",              "increases number of bombs"     },
427   { "dynabomb_sz",              "increases explosion size"      },
428   { "dynabomb_xl",              "increases power of explosion"  },
429   { "sokoban_object",           "sokoban object"                },
430   { "sokoban_field",            "sokoban empty field"           },
431   { "sokoban_field",            "sokoban field with object"     },
432   { "bd_butterfly",             "butterfly (starts moving right)"},    /* 70 */
433   { "bd_butterfly",             "butterfly (starts moving up)"  },
434   { "bd_butterfly",             "butterfly (starts moving left)"},
435   { "bd_butterfly",             "butterfly (starts moving down)"},
436   { "bd_firefly",               "firefly (starts moving right)" },
437   { "bd_firefly",               "firefly (starts moving up)"    },
438   { "bd_firefly",               "firefly (starts moving left)"  },
439   { "bd_firefly",               "firefly (starts moving down)"  },
440   { "bd_butterfly",             "butterfly"                     },
441   { "bd_firefly",               "firefly"                       },
442   { "player",                   "yellow player"                 },     /* 80 */
443   { "player",                   "red player"                    },
444   { "player",                   "green player"                  },
445   { "player",                   "blue player"                   },
446   { "bug",                      "bug (starts moving right)"     },
447   { "bug",                      "bug (starts moving up)"        },
448   { "bug",                      "bug (starts moving left)"      },
449   { "bug",                      "bug (starts moving down)"      },
450   { "spaceship",                "spaceship (starts moving right)"},
451   { "spaceship",                "spaceship (starts moving up)"  },
452   { "spaceship",                "spaceship (starts moving left)"},     /* 90 */
453   { "spaceship",                "spaceship (starts moving down)"},
454   { "pacman",                   "pac man (starts moving right)" },
455   { "pacman",                   "pac man (starts moving up)"    },
456   { "pacman",                   "pac man (starts moving left)"  },
457   { "pacman",                   "pac man (starts moving down)"  },
458   { "emerald",                  "red emerald"                   },
459   { "emerald",                  "purple emerald"                },
460   { "wall",                     "wall with red emerald"         },
461   { "wall",                     "wall with purple emerald"      },
462   { NULL,                       "unknown"                       },    /* 100 */
463   { NULL,                       "unknown"                       },
464   { NULL,                       "unknown"                       },
465   { NULL,                       "unknown"                       },
466   { NULL,                       "unknown"                       },
467   { NULL,                       "normal wall (BD style)"        },
468   { "bd_rock",                  "rock (BD style)"               },
469   { "exit",                     "open exit"                     },
470   { NULL,                       "black orb bomb"                },
471   { "amoeba",                   "amoeba"                        },
472   { "mole",                     "mole"                          },    /* 110 */
473   { "penguin",                  "penguin"                       },
474   { "satellite",                "satellite"                     },
475   { NULL,                       "arrow left"                    },
476   { NULL,                       "arrow right"                   },
477   { NULL,                       "arrow up"                      },
478   { NULL,                       "arrow down"                    },
479   { "pig",                      "pig"                           },
480   { "dragon",                   "fire breathing dragon"         },
481   { "key",                      "red key (EM style)"            },
482   { NULL,                       "letter ' '"                    },    /* 120 */
483   { NULL,                       "letter '!'"                    },
484   { NULL,                       "letter '\"'"                   },
485   { NULL,                       "letter '#'"                    },
486   { NULL,                       "letter '$'"                    },
487   { NULL,                       "letter '%'"                    },
488   { NULL,                       "letter '&'"                    },
489   { NULL,                       "letter '''"                    },
490   { NULL,                       "letter '('"                    },
491   { NULL,                       "letter ')'"                    },
492   { NULL,                       "letter '*'"                    },    /* 130 */
493   { NULL,                       "letter '+'"                    },
494   { NULL,                       "letter ','"                    },
495   { NULL,                       "letter '-'"                    },
496   { NULL,                       "letter '.'"                    },
497   { NULL,                       "letter '/'"                    },
498   { NULL,                       "letter '0'"                    },
499   { NULL,                       "letter '1'"                    },
500   { NULL,                       "letter '2'"                    },
501   { NULL,                       "letter '3'"                    },
502   { NULL,                       "letter '4'"                    },    /* 140 */
503   { NULL,                       "letter '5'"                    },
504   { NULL,                       "letter '6'"                    },
505   { NULL,                       "letter '7'"                    },
506   { NULL,                       "letter '8'"                    },
507   { NULL,                       "letter '9'"                    },
508   { NULL,                       "letter ':'"                    },
509   { NULL,                       "letter ';'"                    },
510   { NULL,                       "letter '<'"                    },
511   { NULL,                       "letter '='"                    },
512   { NULL,                       "letter '>'"                    },    /* 150 */
513   { NULL,                       "letter '?'"                    },
514   { NULL,                       "letter '@'"                    },
515   { NULL,                       "letter 'A'"                    },
516   { NULL,                       "letter 'B'"                    },
517   { NULL,                       "letter 'C'"                    },
518   { NULL,                       "letter 'D'"                    },
519   { NULL,                       "letter 'E'"                    },
520   { NULL,                       "letter 'F'"                    },
521   { NULL,                       "letter 'G'"                    },
522   { NULL,                       "letter 'H'"                    },    /* 160 */
523   { NULL,                       "letter 'I'"                    },
524   { NULL,                       "letter 'J'"                    },
525   { NULL,                       "letter 'K'"                    },
526   { NULL,                       "letter 'L'"                    },
527   { NULL,                       "letter 'M'"                    },
528   { NULL,                       "letter 'N'"                    },
529   { NULL,                       "letter 'O'"                    },
530   { NULL,                       "letter 'P'"                    },
531   { NULL,                       "letter 'Q'"                    },
532   { NULL,                       "letter 'R'"                    },    /* 170 */
533   { NULL,                       "letter 'S'"                    },
534   { NULL,                       "letter 'T'"                    },
535   { NULL,                       "letter 'U'"                    },
536   { NULL,                       "letter 'V'"                    },
537   { NULL,                       "letter 'W'"                    },
538   { NULL,                       "letter 'X'"                    },
539   { NULL,                       "letter 'Y'"                    },
540   { NULL,                       "letter 'Z'"                    },
541   { NULL,                       "letter 'Ä'"                    },
542   { NULL,                       "letter 'Ö'"                    },    /* 180 */
543   { NULL,                       "letter 'Ãœ'"                    },
544   { NULL,                       "letter '^'"                    },
545   { NULL,                       "letter ''"                     },
546   { NULL,                       "letter ''"                     },
547   { NULL,                       "letter ''"                     },
548   { NULL,                       "letter ''"                     },
549   { NULL,                       "letter ''"                     },
550   { NULL,                       "letter ''"                     },
551   { NULL,                       "letter ''"                     },
552   { NULL,                       "letter ''"                     },    /* 190 */
553   { NULL,                       "letter ''"                     },
554   { NULL,                       "letter ''"                     },
555   { NULL,                       "letter ''"                     },
556   { NULL,                       "letter ''"                     },
557   { NULL,                       "letter ''"                     },
558   { NULL,                       "letter ''"                     },
559   { NULL,                       "letter ''"                     },
560   { NULL,                       "letter ''"                     },
561   { NULL,                       "letter ''"                     },
562   { "wall",                     "growing wall (horizontal)"     },    /* 200 */
563   { "wall",                     "growing wall (vertical)"       },
564   { "wall",                     "growing wall (all directions)" },
565   { "gate",                     "red door (EM style)"           },
566   { "gate",                     "yellow door (EM style)"        },
567   { "gate",                     "green door (EM style)"         },
568   { "gate",                     "blue door (EM style)"          },
569   { "key",                      "yellow key (EM style)"         },
570   { "key",                      "green key (EM style)"          },
571   { "key",                      "blue key (EM style)"           },
572   { "empty_space",              "empty space"                   },    /* 210 */
573   { "sp_zonk",                  "zonk"                          },
574   { "sp_base",                  "base"                          },
575   { "player",                   "murphy"                        },
576   { "sp_infotron",              "infotron"                      },
577   { "wall",                     "chip (single)"                 },
578   { "wall",                     "hardware"                      },
579   { "sp_exit",                  "exit"                          },
580   { "sp_disk_orange",           "orange disk"                   },
581   { "sp_port",                  "port (leading right)"          },
582   { "sp_port",                  "port (leading down)"           },    /* 220 */
583   { "sp_port",                  "port (leading left)"           },
584   { "sp_port",                  "port (leading up)"             },
585   { "sp_port",                  "port (leading right)"          },
586   { "sp_port",                  "port (leading down)"           },
587   { "sp_port",                  "port (leading left)"           },
588   { "sp_port",                  "port (leading up)"             },
589   { "sp_sniksnak",              "snik snak"                     },
590   { "sp_disk_yellow",           "yellow disk"                   },
591   { "sp_terminal",              "terminal"                      },
592   { "sp_disk_red",              "red disk"                      },    /* 230 */
593   { "sp_port",                  "port (vertical)"               },
594   { "sp_port",                  "port (horizontal)"             },
595   { "sp_port",                  "port (all directions)"         },
596   { "sp_electron",              "electron"                      },
597   { "sp_buggy_base",            "buggy base"                    },
598   { "wall",                     "chip (left half)"              },
599   { "wall",                     "chip (right half)"             },
600   { "wall",                     "hardware"                      },
601   { "wall",                     "hardware"                      },
602   { "wall",                     "hardware"                      },    /* 240 */
603   { "wall",                     "hardware"                      },
604   { "wall",                     "hardware"                      },
605   { "wall",                     "hardware"                      },
606   { "wall",                     "hardware"                      },
607   { "wall",                     "hardware"                      },
608   { "wall",                     "hardware"                      },
609   { "wall",                     "hardware"                      },
610   { "wall",                     "chip (upper half)"             },
611   { "wall",                     "chip (lower half)"             },
612   { "gate",                     "gray door (EM style, red key)" },    /* 250 */
613   { "gate",                     "gray door (EM style, yellow key)"},
614   { "gate",                     "gray door (EM style, green key)"},
615   { "gate",                     "gray door (EM style, blue key)"},
616   { NULL,                       "unknown"                       },
617   { NULL,                       "unknown"                       },
618
619   /* 256 */
620
621   { "pearl",                    "pearl"                         },  /* (256) */
622   { "crystal",                  "crystal"                       },
623   { "wall",                     "wall with pearl"               },
624   { "wall",                     "wall with crystal"             },
625   { "gate",                     "white door"                    },    /* 260 */
626   { "gate",                     "gray door (opened by white key)"},
627   { "key",                      "white key"                     },
628   { "shield_passive",           "shield (passive)"              },
629   { "extra_time",               "extra time"                    },
630   { "switchgate",               "switch gate (open)"            },
631   { "switchgate",               "switch gate (closed)"          },
632   { "switchgate_switch",        "switch for switch gate"        },
633   { "switchgate_switch",        "switch for switch gate"        },
634   { NULL,                       "-"                             },
635   { NULL,                       "-"                             },    /* 270 */
636   { "conveyor_belt",            "red conveyor belt (left)"      },
637   { "conveyor_belt",            "red conveyor belt (middle)"    },
638   { "conveyor_belt",            "red conveyor belt (right)"     },
639   { "conveyor_belt_switch",     "switch for red conveyor belt (left)"},
640   { "conveyor_belt_switch",     "switch for red conveyor belt (middle)"},
641   { "conveyor_belt_switch",     "switch for red conveyor belt (right)"},
642   { "conveyor_belt",            "yellow conveyor belt (left)"   },
643   { "conveyor_belt",            "yellow conveyor belt (middle)" },
644   { "conveyor_belt",            "yellow conveyor belt (right)"  },
645   { "conveyor_belt_switch",     "switch for yellow conveyor belt (left)"},
646   { "conveyor_belt_switch",     "switch for yellow conveyor belt (middle)"},
647   { "conveyor_belt_switch",     "switch for yellow conveyor belt (right)"},
648   { "conveyor_belt",            "green conveyor belt (left)"    },
649   { "conveyor_belt",            "green conveyor belt (middle)"  },
650   { "conveyor_belt",            "green conveyor belt (right)"   },
651   { "conveyor_belt_switch",     "switch for green conveyor belt (left)"},
652   { "conveyor_belt_switch",     "switch for green conveyor belt (middle)"},
653   { "conveyor_belt_switch",     "switch for green conveyor belt (right)"},
654   { "conveyor_belt",            "blue conveyor belt (left)"     },
655   { "conveyor_belt",            "blue conveyor belt (middle)"   },
656   { "conveyor_belt",            "blue conveyor belt (right)"    },
657   { "conveyor_belt_switch",     "switch for blue conveyor belt (left)"},
658   { "conveyor_belt_switch",     "switch for blue conveyor belt (middle)"},
659   { "conveyor_belt_switch",     "switch for blue conveyor belt (right)"},
660   { "sand",                     "land mine"                     },
661   { "envelope",                 "mail envelope"                 },
662   { "light_switch",             "light switch (off)"            },
663   { "light_switch",             "light switch (on)"             },
664   { "wall",                     "sign (exclamation)"            },
665   { "wall",                     "sign (radio activity)"         },    /* 300 */
666   { "wall",                     "sign (stop)"                   },
667   { "wall",                     "sign (wheel chair)"            },
668   { "wall",                     "sign (parking)"                },
669   { "wall",                     "sign (one way)"                },
670   { "wall",                     "sign (heart)"                  },
671   { "wall",                     "sign (triangle)"               },
672   { "wall",                     "sign (round)"                  },
673   { "wall",                     "sign (exit)"                   },
674   { "wall",                     "sign (yin yang)"               },
675   { "wall",                     "sign (other)"                  },    /* 310 */
676   { "mole",                     "mole (starts moving left)"     },
677   { "mole",                     "mole (starts moving right)"    },
678   { "mole",                     "mole (starts moving up)"       },
679   { "mole",                     "mole (starts moving down)"     },
680   { "wall",                     "steel wall (slanted)"          },
681   { "sand",                     "invisible sand"                },
682   { NULL,                       "dx unknown 15"                 },
683   { NULL,                       "dx unknown 42"                 },
684   { NULL,                       "-"                             },
685   { NULL,                       "-"                             },    /* 320 */
686   { "shield_active",            "shield (active, kills enemies)"},
687   { "timegate",                 "time gate (open)"              },
688   { "timegate",                 "time gate (closed)"            },
689   { "timegate_wheel",           "switch for time gate"          },
690   { "timegate_wheel",           "switch for time gate"          },
691   { "balloon",                  "balloon"                       },
692   { "wall",                     "send balloon to the left"      },
693   { "wall",                     "send balloon to the right"     },
694   { "balloon_switch",           "send balloon up"               },
695   { "balloon_switch",           "send balloon down"             },    /* 330 */
696   { "balloon_switch",           "send balloon in any direction" },
697   { "wall",                     "steel wall"                    },
698   { "wall",                     "steel wall"                    },
699   { "wall",                     "steel wall"                    },
700   { "wall",                     "steel wall"                    },
701   { "wall",                     "normal wall"                   },
702   { "wall",                     "normal wall"                   },
703   { "wall",                     "normal wall"                   },
704   { "wall",                     "normal wall"                   },
705   { "wall",                     "normal wall"                   },    /* 340 */
706   { "wall",                     "normal wall"                   },
707   { "wall",                     "normal wall"                   },
708   { "wall",                     "normal wall"                   },
709   { "tube",                     "tube (all directions)"         },
710   { "tube",                     "tube (vertical)"               },
711   { "tube",                     "tube (horizontal)"             },
712   { "tube",                     "tube (vertical & left)"        },
713   { "tube",                     "tube (vertical & right)"       },
714   { "tube",                     "tube (horizontal & up)"        },
715   { "tube",                     "tube (horizontal & down)"      },    /* 350 */
716   { "tube",                     "tube (left & up)"              },
717   { "tube",                     "tube (left & down)"            },
718   { "tube",                     "tube (right & up)"             },
719   { "tube",                     "tube (right & down)"           },
720   { "spring",                   "spring"                        },
721   { "trap",                     "trap"                          },
722   { "dx_bomb",                  "stable bomb (DX style)"        },
723   { NULL,                       "-"                             }
724
725   /*
726   "-------------------------------",
727   */
728 };
729
730
731 /* ========================================================================= */
732 /* main()                                                                    */
733 /* ========================================================================= */
734
735 int main(int argc, char *argv[])
736 {
737   InitCommandName(argv[0]);
738   InitExitFunction(CloseAllAndExit);
739   InitPlatformDependantStuff();
740
741   GetOptions(argv);
742   OpenAll();
743
744   EventLoop();
745   CloseAllAndExit(0);
746   exit(0);      /* to keep compilers happy */
747 }