1 /* Copyright (C) 1993, 1992 Nathan Sidwell */
2 /* RCS $Id: xmris.h,v 4.20 1995/12/22 11:56:52 nathan Exp $ */
3 #include "common.h"
4 #define COPYRIGHT "Copyright (C) 1995-1992 Nathan Sidwell"
5 /*{{{  function pointers*/
6 /* see xmris.c for explanation */
7 #define PROTOVOID(name) VOIDFUNC (name) NESTEDPROTOARG((VOIDARG))
8 #define PROTOANIMATE(name) PROTOVOID(*name NESTEDPROTOARG((PROTOVOID(*))))
9 #if __STDC__ || FUNCPROTO & 1
10 #define FUNCANIMATE(name, arg) \
11     PROTOVOID(*name (PROTOVOID(*arg)))
12 #else
13 #define FUNCANIMATE(name, arg) PROTOVOID(*name(arg)) PROTOVOID(*arg);
14 #endif
15 /*}}}*/
16 #ifdef TRANSPUTER
17 #undef USELOCKFILE
18 #define USELOCKFILE
19 #endif /* TRANSPUTER */
20 /*{{{  check score*/
21 #ifndef SCORE_DIR
22   #error No default score directory
23 #endif /* SCORE_DIR */
24 /*}}}*/
25 /*{{{  set_euid*/
26 #ifdef TRANSPUTER
27 typedef int uid_t;
28 #else
29 #ifdef __hpux
30 #define set_euid(euid) setresuid((uid_t)-1, euid, (uid_t)-1)
31 #else
32 #define set_euid(euid) seteuid(euid)
33 #endif /* __hpux */
34 #endif /* TRANSPUTER */
35 /*}}}*/
36 /*{{{  defines*/
37 /*{{{  board sizes*/
38 #define KNOCK_THROUGH /* how far we go to knock through a new cell */\
39     ((CELL_WIDTH + CELL_HEIGHT + GAP_WIDTH + GAP_HEIGHT) / 3)
40 #define FLOOD_FILL    32  /* how many branches in the distance flood fill */
41 #define DEFAULT_CHERRY_X  ((CELLS_ACROSS - 1) >> 1)
42 #define DEFAULT_CHERRY_Y  0
43 /*}}}*/
44 /*{{{  frame rate*/
45 /* these are in uS, if it is too fast, the load line
46  * at the bottom will start to grow */
47 #define FRAMES_PER_SECOND 27
48 #define FRAME_RATE    (unsigned long)(1000000 / FRAMES_PER_SECOND)
49 #define ZOOM_RATE (FRAME_RATE / 4)
50 #define SCORE_RATE (FRAME_RATE / 4)
51 #define NAME_RATE (FRAME_RATE / 2)
52 #define FRAME_SCALE 1024    /* precision of frame delay scaling */
53 #define FRAME_RATIO_UPDATE (5 * FRAMES_PER_SECOND) /* frame ratio calc */
54 #define FRAME_MISS_START  15  /* start dilation calc */
55 #define FRAME_MISS_STOP   5   /* stop dilation calc */
56 #define SCORE_SCALE 1024    /* precision of score scaling */
57 /*}}}*/
58 /*{{{  score file*/
59 #ifndef SCORE_DIR
60 #define SCORE_DIR NULL
61 #endif /* SCORE_DIR */
62 #define SCORE_THRESHOLD 10000 /* minimum score for fame */
63 #define SCORE_ROUND     5     /* scores are rounded */
64 #define HIGH_SCORES (CELLS_DOWN - 2)
65 #define NAME_LEN  32
66 /*}}}*/
67 #define START_LIVES     3
68 /*{{{  velocities*/
69 #define VEL_X         GAP_WIDTH             /* how far we move per step */
70 #define VEL_Y         GAP_HEIGHT
71 #define VEL_X_FAST    (VEL_X * 5 / 4)       /* how far a fast stride is */
72 #define VEL_Y_FAST    (VEL_Y * 5 / 4)
73 #define FAST_STEPS    (CELL_WIDTH / VEL_X / 4) /* 1/2 no of fast strides */
74 #define APPLE_VEL_Y   (VEL_Y * 3 / 2)       /* how fast the apple falls */
75 #define APPLE_VEL_X   (VEL_X / 2)           /* how fast it goes sideways */
76 #define APPLE_ACC     (VEL_Y / 2)
77 #define APPLE_SINK_Y  1                     /* sinks to matrix */
78 #define BALL_STEPS    2                     /* relative ball speed */
79 #define BALL_EX       (CELL_WIDTH / 2)      /* how fast we explode */
80 #define BALL_EY       (CELL_HEIGHT / 2)
81 #define ZOOM_X        VEL_X                 /* how fast the zoom is */
82 #define ZOOM_Y        VEL_Y
83 #define STEP_OFF      1                     /* steps taken for granted */
84 /*}}}*/
85 /*{{{  ball stuff*/
86 #define BALL_EXPLODE    (BOARD_WIDTH / BALL_EX) /* how much we explode */
87 #define BALL_DISTANCE   6    /* how close to runaway from the ball */
88 /*}}}*/
89 #define DIE_DELAY       4  /* ticks for death spiral */
90 #define SCORE_SHOW      (2 * FRAMES_PER_SECOND) /* frames for board scores */
91 #define DISPLAY_HOLD    (SCORE_SHOW * 2)
92 #define SCORE_HOLD      (SCORE_SHOW * 12)
93 #define HISTORY_SHOW    3   /* how often we show the history */
94 /*{{{  apple stuff*/
95 #define APPLE_ROCK_DELAY  8    /* ticks for it to rock */
96 #define APPLE_SPLIT_DELAY 8    /* ticks for split */
97 #define APPLE_DECAY_DELAY 8    /* ticks for decay */
98 #define APPLE_ROT_DELAY   8    /* ticks for rot */
99 #define APPLE_FALL_SPLIT  (CELL_HEIGHT + GAP_HEIGHT + APPLE_VEL_Y)
100     /* safe fall distance */
101 #define APPLE_GHOST_DELAY (((CELL_HEIGHT + GAP_HEIGHT) / VEL_Y + \
102     (CELL_WIDTH + GAP_WIDTH) / VEL_X) * 2)
103 /*}}}*/
104 /*{{{  den escape*/
105 #define DEN_ESCAPE_PROB   8     /* normal monster gets out of the den */
106 #define DEN_ESCAPE_DELAY  6     /* how many den flashes before escape */
107 #define DEN_ESCAPE_FLASH  0x8   /* time per den flash */
108 /*}}}*/
109 /*{{{  normal & muncher*/
110 #define GO_MUNCH_PROB      1    /* difficulty scale that normal goes munchy */
111 #define TRAPPED_MUNCH_PROB  8   /* go munch if trapped */
112 #define DIFFICULTY_PEDESTAL 2   /* offset for difficulty */
113 #define STOP_TOGGLE_CONT_PEDESTAL  2
114 #define STOP_TOGGLE_CONT_SCREEN_SCALE  5
115 #define STOP_TOGGLE_CONT_STOP   10
116 #define STOP_TOGGLE_CONT_NEAR   2
117 #define SET_CONT_PEDESTAL      18    /* continue flag set */
118 #define CLEAR_CONT_PEDESTAL    24    /* continue flag clear */
119 #define CLEAR_CONT_VISIT_SCALE (CELLS_ACROSS * CELLS_DOWN / 8)
120 #define CLEAR_CONT_MONSTER_SCALE 3
121 #define PUSH_TURN_PROB    64    /* muncher turns around when pushing */
122 #define MUNCH_CONT_PEDESTAL     18  /* continue munching */
123 #define MUNCH_CONT_SCREEN_SCALE 4   /* continue munching scale */
124 #define GO_MUNCH_DELAY    16    /* pause when we start munching */
125 #define STOP_MUNCH_DELAY  16    /* pause when we stop munching */
126 #define PANIC_COUNT       (CELLS_DOWN * (CELL_HEIGHT + GAP_HEIGHT) / VEL_Y)
127 /*}}}*/
128 /*{{{  xtra & drone*/
129 #define XTRA_NEW_DELAY    (FRAMES_PER_SECOND * 4)
130 #define XTRA_GOT_DELAY    (FRAMES_PER_SECOND * 2)
131 #define XTRA_BIRTH_DELAY  ((CELL_WIDTH + GAP_WIDTH) / VEL_X + 4)
132     /* pause while giving birth to drones */
133 #define XTRA_CONT_OFF_PROB 16   /* that xtra stops continuing */
134 #define CHOMP_DELAY     (CELL_WIDTH / VEL_X * 6)
135     /* how long to eat an apple */
136 #define XTRA_HOME_DELAY   (FRAMES_PER_SECOND * 30)
137 /*}}}*/
138 #define MONSTER_CYCLES    6     /* cycle counter */
139 #define SCORE_CYCLES (MONSTER_CYCLES / 2)
140 #define MONSTER_IMAGES    2     /* how many different images */
141 #define DIAMOND_IMAGES    3
142 #define DIAMOND_CYCLES    2
143 /*{{{  diamond stuff*/
144 #define DIAMOND_PROB      1     /* chance of apple turning to diamond */
145 #define DIAMOND_VEL_Y     ((CELL_HEIGHT + GAP_HEIGHT) / 4)
146 #define DIAMOND_DELAY     (20 * FRAMES_PER_SECOND)
147 #define DIAMOND_GHOSTING  (5 * FRAMES_PER_SECOND)
148 /*}}}*/
149 #define GHOSTING (0x100 | ((GHOSTING_HEIGHT - CELL_HEIGHT) / 2 << 4) | \
150     (GHOSTING_WIDTH - CELL_WIDTH) / 2)
151 /*{{{  limits*/
152 #define APPLES          (APPLE_LIMIT + 8)    /* max number of apples */
153 #define MONSTERS        ((CELLS_DOWN - 2) * 2)  /* max number of monsters */
154 #define BOARD_SCORES    4   /* number of on board displayed scores */
155 #define BACK_UPDATES    64  /* background updates we can cope with */
156 /*}}}*/
157 /*{{{  whizz*/
158 #define WHIZZ_STEPS     32
159 #define WHIZZ_CYCLES    2
160 #define WHIZZ_SIZE      (int)(0xFFFF / (WHIZZ_STEPS - 1))
161 #define WHIZZ_PROB      64
162 /*}}}*/
163 /*{{{  timing states*/
164 #define TIMING_OFF    0
165 #define TIMING_ON     1
166 #define TIMING_PAUSE  2
167 /*}}}*/
168 /*}}}*/
169 /*{{{  macros*/
170 #define LETTERDIR(l)      ((l) & 3)
171 #define LETTERDIST(l)     ((l) >> 2)
172 #define LETTERPATH(d, l)  ((d) | ((l) << 2))
173 #define LETTEREND         0
174 #define LETTERPOS(x, y)   (((x) << 4) | (y))
175 #define LETTERX(l)        ((l) >> 4)
176 #define LETTERY(l)        ((l) & 0xF)
177 #define BOARDCELL(CX, CY) \
178     (&garden[(CY) * CELL_STRIDE + (CX) + (CELL_LEFT + CELL_TOP * CELL_STRIDE)])
179 /*}}}*/
180 /*{{{  structs*/
181 /*{{{  typedef struct Title*/
182 typedef struct Title
183 /* title text */
184 {
185   char CONST *text;       /* the text */
186   unsigned  ix;           /*  key index */
187 } TITLE;
188 /*}}}*/
189 /*{{{  typedef struct Background*/
190 typedef struct Background
191 /* area to update from back to copy to window */
192 {
193   COORD   place;  /* top left area */
194   SIZE    size;   /* size of area */
195 } BACKGROUND;
196 /*}}}*/
197 /*{{{  typedef struct Score*/
198 typedef struct Score
199 /* on board score display */
200 {
201   Pixmap    mask;   /* the mask to use */
202   Pixmap    image;  /* the image to display */
203   COORD     place;  /* where to bung it */
204   unsigned  count;  /* removal countdown */
205 } SCORE;
206 /*}}}*/
207 /*{{{  typedef struct Ball*/
208 typedef struct Ball
209 /* the ball state */
210 {
211   COORD     cell;
212   COORD     offset;
213   COORD     pixel;
214   unsigned  state;  /* state of the ball
215 		     * 0 held by player
216 		     * 1 bouncing
217 		     * 2 exploding
218 		     * 3 exploded
219 		     * 4 imploding
220 		     */
221   unsigned  count;  /* count or direction or player type */
222   unsigned  image;  /* player image */
223 } BALL;
224 /*}}}*/
225 /*{{{  typedef struct Apple*/
226 typedef struct Apple
227 /* non-background apple information */
228 {
229   COORD     cell;       /* apple's cell */
230   COORD     offset;     /* offset from center */
231   COORD     pixel;      /* pixel for sprite */
232   int       push;       /* horizontal push */
233   unsigned  count;      /* general counter */
234   unsigned  state;      /* state
235 			 * 0 stationary
236 			 * 1 rock
237 			 * 2 falling
238 			 * 3 split
239 			 * 4 decay
240 			 * 5 rot
241 			 * 6 delete
242 			 */
243   unsigned  ghost;      /* ghost count */
244   unsigned  distance;   /* distance we've fallen */
245   unsigned  monsters;   /* monsters we've squashed */
246   unsigned  chewed;     /* chewed */
247   int       maypush;    /* temp push vector */
248   struct Monster *list; /* list of monsters for initial fall */
249   COORD     old_pixel;  /* where i was */
250   unsigned  old_state;  /* what I looked like */
251   unsigned  back;       /* background set */
252 } APPLE;
253 /*}}}*/
254 /*{{{  typedef struct Apple_Size*/
255 typedef struct Apple_Size
256 {
257   SIZE    size;
258   COORD   offset;
259 } APPLE_SIZE;
260 /*}}}*/
261 /*{{{  typedef struct Monster*/
262 typedef struct Monster
263 /* monster information */
264 {
265   COORD     cell;     /* board cell we're related to */
266   COORD     offset;   /* offset from this cell */
267   COORD     pixel;    /* pixel coordinate */
268   unsigned  dir;      /* direction we're moving in */
269   unsigned  pause;    /* we're paused for one */
270   unsigned  stop;     /* we're stopped (player only) */
271   unsigned  type;     /* type
272 		       * 0 - normal
273 		       * 1 - munch
274 		       * 2 - xtra
275 		       * 3 - drone
276 		       * 4 - player
277 		       * 5 - delete
278 		       *>5 - demo sprite
279 		       */
280   unsigned  face;     /* direction we're facing
281 		       * 0 up left,
282 		       * 1 down right
283 		       * 2 left
284 		       * 3 right
285 		       * 4 up right
286 		       * 5 down left
287 		       * 6 push left
288 		       * 7 push right
289 		       * 8 squish left
290 		       * 9 squish right
291 		       */
292   int       push;     /* being pushed in this direction */
293   unsigned  gomunch;  /* change munch state */
294   unsigned  ghosting; /* ghosting is occuring */
295   unsigned  cont;     /* continue */
296   unsigned  chew;     /* chewing */
297   unsigned  count;    /* counter */
298   unsigned  panic;    /* help I'm about to be squashed, ghosting for player */
299   unsigned  shot;     /* has been shot */
300   unsigned  cycle;    /* image cycler */
301   unsigned  image;    /* which image to display */
302   unsigned  fast;     /* fast speed */
303   unsigned  pushing;  /* pushing apple */
304   unsigned  squished; /* under an apple */
305   struct Monster *list; /* list of monsters for initial apple fall */
306   struct Monster *tptr; /* temporary pointer */
307   COORD     old_pixel;  /* where we were */
308   int       old_sprite; /* what we looked like */
309   unsigned  back;       /* background set */
310   unsigned  on;         /* visible */
311 } MONSTER;
312 /*}}}*/
313 /*{{{  typedef struct High_Score*/
314 typedef struct High_Score
315 {
316   time_t    stamp;          /* integrity stamp */
317   unsigned  marker;         /* flag */
318   unsigned long score;      /* score */
319   unsigned  screen;         /* final screen */
320   unsigned  elapsed;        /* playing time seconds */
321   char name[NAME_LEN + 1];  /* name of player */
322 } HIGH_SCORE;
323 /*}}}*/
324 /*{{{  typedef struct Cell*/
325 typedef struct Cell
326 /* information about 1 cell on the board */
327 {
328   int       depths[4];    /* depths moved to from cell */
329   int       holes[4];     /* apple holes above and below (tl, tr, bl, br) */
330   unsigned  distance;     /* distance from player */
331   unsigned  xtra;         /* distance from xtra base */
332   unsigned  ball;         /* distance from ball */
333   unsigned  visit;        /* visited */
334   unsigned  sprite;       /* has cherry */
335   unsigned  apple;        /* apple possibility */
336   unsigned  den;          /* is a den */
337   unsigned  spare;        /* pad to 16 words */
338 } CELL;
339 /*}}}*/
340 /*}}}*/
341 /*{{{  board*/
342 EXTERN struct
343 /* board information */
344 {
345   unsigned  boards;           /* number of boards loaded */
346   BOARD CONST *list[BOARD_LIMIT];   /* pointers to them */
347 } board;
348 /*}}}*/
349 /*{{{  player*/
350 EXTERN struct
351 /* player specific information
352  * note, the player place info is stored as monster 0
353  */
354 {
355   unsigned  next;       /* direction at next intersection */
356   unsigned  bashed;     /* we bashed into a wall */
357   BALL      old_ball;   /* what was the ball */
358   BALL      ball;       /* ball information */
359   unsigned  count;      /* ball return dec count */
360   unsigned  thrown;     /* how many times its been thrown */
361   unsigned  cherry;     /* consecutive cherry count */
362   unsigned  distance;   /* distance to next cherry */
363   unsigned  pressed;    /* keys we had pressed */
364 } player;
365 /*}}}*/
366 EXTERN uid_t real_uid;          /* who I really am */
367 EXTERN uid_t effective_uid;     /* who I'm pretending to be */
368 EXTERN uid_t current_uid;       /* who I currently am */
369 EXTERN CELL garden[(CELLS_DOWN + CELL_TOP * 2) * CELL_STRIDE];
370 /*{{{  global*/
371 EXTERN struct
372 {
373   unsigned  pedestal;       /* starting screen number */
374   unsigned  screen;         /* current screen number */
375   unsigned long score;      /* score */
376   unsigned  lives;          /* lives left (including on screen) */
377   unsigned long msec;       /* number of milliseconds this screen */
378   unsigned  dilation;       /* frame delay dilation factor */
379   unsigned  scale;          /* score scale factor */
380   unsigned  difficulty;     /* increments in to make it harder */
381   unsigned  broken;         /* broken through a new path */
382   unsigned  stepped;        /* player moved to new cell */
383   unsigned  cherries;       /* number of cherries left */
384   COORD     start;          /* player starting position */
385   unsigned  dens;           /* number of dens */
386   unsigned  state;          /* den state
387 			     * 0 - den on screen
388 			     * 1 - cake on screen
389 			     * 2 - xtras & drone running around
390 			     * 3 - done xtras
391 			     * 4 - end game
392 			     * 5 - mid game demo
393 			     * 6 - demo
394 			     * 7 - defining keys
395 			     * 8 - zooming
396 			     */
397 #define MODE_GAME_DEMO 5
398 #define MODE_DEMO      6
399 #define MODE_KEY_DEF   7
400 #define MODE_ZOOM      8
401   unsigned  diamond;        /* diamond state */
402   unsigned  missed;         /* missed interrupt count */
403   unsigned  count;          /* general counter */
404   unsigned  visited;        /* amount of cells visited */
405   unsigned  quit;           /* quit selected */
406   unsigned  pause;          /* game paused */
407   unsigned  iconic;         /* game iconized */
408   unsigned  pressed;        /* keys pressed */
409   unsigned  throw;          /* throw key state */
410   KeySym    key;            /* last key pressed */
411 } global;
412 /*}}}*/
413 /*{{{  extra*/
414 EXTERN struct
415 {
416   unsigned  got;      /* one we've got */
417   unsigned  select;   /* the one which is selected */
418   unsigned  escape;   /* its out/homesick */
419   unsigned  score;    /* last checked score */
420   unsigned  count;    /* change countdown */
421 } extra;
422 /*}}}*/
423 /*{{{  apple*/
424 EXTERN struct
425 {
426   APPLE     list[APPLES]; /* apple list */
427   unsigned  apples;       /* number of apples out */
428   unsigned  moving;       /* an apple is moving */
429 } apple;
430 /*}}}*/
431 /*{{{  history*/
432 EXTERN struct
433 {
434   unsigned  prize;        /* did we get the prize? */
435   unsigned  ending;       /* how did the screen end? */
436   unsigned long msec;     /* how many milliseconds have been played? */
437   unsigned long times[CELLS_DOWN];  /* how many milliseconds per screen? */
438 } history;
439 /*}}}*/
440 /*{{{  monster*/
441 EXTERN struct
442 {
443   MONSTER   list[MONSTERS]; /* monsters [0] is player */
444   CELL      *player;        /* where the player is */
445   unsigned  monsters;       /* number of monsters out (inc player) */
446   unsigned  delay;          /* escape delay */
447   unsigned  den;            /* monster spawn count */
448   unsigned  normals;        /* normal monsters alive */
449   unsigned  drones;         /* drones out */
450   unsigned  nearest;        /* what was the nearest distance to player */
451   unsigned  farthest;       /* what was the farthest distance to player */
452 } monster;
453 /*}}}*/
454 /*{{{  update*/
455 EXTERN struct
456 {
457   COORD     tl;       /* top left */
458   COORD     br;       /* bottom right */
459   unsigned  set;      /* tl & br set */
460   struct
461   {
462     unsigned  backs; /* number of areas to update to window */
463     BACKGROUND list[BACK_UPDATES]; /* the area information */
464   } back;
465   struct
466   {
467     unsigned  scores;  /* number of displayed scores */
468     SCORE     list[BOARD_SCORES];   /* the displayed scores */
469   } score;
470 } update;
471 /*}}}*/
472 /*{{{  scoring*/
473 EXTERN struct
474 {
475   HIGH_SCORE high[HIGH_SCORES];
476   HIGH_SCORE today[HIGH_SCORES];
477   HIGH_SCORE personal[HIGH_SCORES];
478   HIGH_SCORE mine;
479   HIGH_SCORE *display;
480   char *alternate;
481 } scoring;
482 /*}}}*/
483 /*{{{  tables*/
484 extern APPLE_SIZE CONST apple_sizes[6];
485 extern COORD ball_hold[16];
486 extern COORD CONST ball_throw[8];
487 #define BALL_RETURNS 3
488 extern unsigned CONST ball_returns[BALL_RETURNS];
489 extern unsigned CONST ball_dir[8];
490 extern unsigned CONST player_dies[8];
491 #define SQUISH_SCORES 7
492 extern unsigned CONST squish_scores[SQUISH_SCORES];
493 extern TITLE title_text[];
494 /*}}}*/
495 /*{{{  prototypes*/
496 /*{{{  apple*/
497 extern int apple_stop PROTOARG((MONSTER *, CELL *));
498 extern VOIDFUNC move_apples PROTOARG((VOIDARG));
499 extern VOIDFUNC panic_monsters PROTOARG((int, int, CELL *));
500 extern APPLE *spawn_apple PROTOARG((int, int, int, int));
501 extern VOIDFUNC squish_monster PROTOARG((MONSTER *));
502 /*}}}*/
503 /*{{{  demo*/
504 extern PROTOANIMATE(animate_demo);
505 extern PROTOANIMATE(animate_diamond);
506 extern PROTOANIMATE(animate_extra_life);
507 extern PROTOANIMATE(animate_history);
508 extern VOIDFUNC list_scores PROTOARG((VOIDARG));
509 /*}}}*/
510 /*{{{  draw*/
511 extern VOIDFUNC add_background PROTOARG((int, int, unsigned, unsigned));
512 extern PROTOANIMATE(animate_zoom);
513 extern VOIDFUNC blank_board PROTOARG((BOARD CONST *, unsigned));
514 extern VOIDFUNC bounding_box PROTOARG((int, int, unsigned, unsigned));
515 extern VOIDFUNC create_boards PROTOARG((VOIDARG));
516 extern VOIDFUNC create_xtra_monster PROTOARG((unsigned));
517 extern VOIDFUNC draw_extra PROTOARG((VOIDARG));
518 extern VOIDFUNC draw_extra_letter PROTOARG((unsigned));
519 extern VOIDFUNC new_board PROTOARG((VOIDARG));
520 extern VOIDFUNC refresh_window PROTOARG((VOIDARG));
521 extern VOIDFUNC set_back_sprite PROTOARG((unsigned, unsigned, unsigned));
522 extern VOIDFUNC show_updates PROTOARG((VOIDARG));
523 /*}}}*/
524 /*{{{  makemris*/
525 extern VOIDFUNC color_cycle PROTOARG((VOIDARG));
526 extern VOIDFUNC color_set PROTOARG((int));
527 extern VOIDFUNC create_widget PROTOARG((VOIDARG));
528 #ifndef NDEBUG
529 extern int error_handler PROTOARG((Display *, XErrorEvent *));
530 #endif /* NDEBUG */
531 extern VOIDFUNC fatal_error PROTOVARARG((char CONST *, VARARG));
532 extern VOIDFUNC list_help PROTOARG((char CONST *));
533 extern VOIDFUNC nadger_widget_colors PROTOARG((Widget, WidgetClass));
534 extern VOIDFUNC open_toolkit PROTOARG((int, String *));
535 /*}}}*/
536 /*{{{  monster*/
537 extern VOIDFUNC extra_dies PROTOARG((VOIDARG));
538 extern MONSTER *extra_escape PROTOARG((VOIDARG));
539 extern VOIDFUNC move_monsters PROTOARG((VOIDARG));
540 extern VOIDFUNC new_xtra PROTOARG((VOIDARG));
541 extern MONSTER *spawn_monster
542     PROTOARG((unsigned, unsigned, unsigned, unsigned, int, int, int, int));
543 /*}}}*/
544 /*{{{  move*/
545 extern VOIDFUNC back_sprite PROTOARG((unsigned, unsigned, int, int));
546 extern unsigned choose_direction PROTOARG((unsigned));
547 extern CELL *drop_apple PROTOARG((APPLE *, CELL *));
548 extern CELL *move_diamond PROTOARG((MONSTER *, CELL *));
549 extern CELL *move_movable PROTOARG((MONSTER *, CELL *));
550 extern CELL *move_muncher PROTOARG((MONSTER *));
551 extern VOIDFUNC munch_hole PROTOARG((CELL *, int, int));
552 extern VOIDFUNC new_face PROTOARG((MONSTER *));
553 extern unsigned run_home PROTOARG((MONSTER *, CELL *));
554 extern unsigned valid_directions PROTOARG((MONSTER *, CELL *));
555 /*}}}*/
556 /*{{{  player*/
557 extern VOIDFUNC bounce_ball PROTOARG((VOIDARG));
558 extern VOIDFUNC killed_player PROTOARG((VOIDARG));
559 extern unsigned move_player PROTOARG((VOIDARG));
560 /*}}}*/
561 /*{{{  scoring*/
562 extern VOIDFUNC check_scores PROTOARG((VOIDARG));
563 extern VOIDFUNC high_score PROTOARG((unsigned long, unsigned, unsigned long));
564 extern VOIDFUNC init_scores PROTOARG((VOIDARG));
565 /*}}}*/
566 /*{{{  timer*/
567 #ifdef TRANSPUTER
568 extern VOIDFUNC sleep PROTOARG((unsigned));
569 #endif /* TRANSPUTER */
570 extern VOIDFUNC timer_close PROTOARG((VOIDARG));
571 extern VOIDFUNC timer_open PROTOARG((VOIDARG));
572 extern unsigned timer_set PROTOARG((unsigned long, unsigned));
573 extern VOIDFUNC timer_wait PROTOARG((VOIDARG));
574 /*}}}*/
575 /*{{{  xmris*/
576 extern PROTOANIMATE(animate_game);
577 extern VOIDFUNC add_score PROTOARG((unsigned, int, int));
578 extern VOIDFUNC calc_distances PROTOARG((VOIDARG));
579 extern VOIDFUNC calc_extra_home PROTOARG((unsigned));
580 extern unsigned chaotic PROTOARG((VOIDARG));
581 extern size_t itoa PROTOARG((char *, unsigned long, unsigned));
582 extern int main PROTOARG((int, char CONST **));
583 /*}}}*/
584 /*}}}*/
585