4 /* ========================================================================= */
5 /* external functions and definitions imported from main program to game_em */
6 /* ========================================================================= */
8 #include "../engines.h"
11 /* ========================================================================= */
12 /* functions and definitions that are exported from game_em to main program */
13 /* ========================================================================= */
18 /* ========================================================================= */
19 /* internal functions and definitions that are not exported to main program */
20 /* ========================================================================= */
26 /* ------------------------------------------------------------------------- */
27 /* constant definitions */
28 /* ------------------------------------------------------------------------- */
30 /* values for native Emerald Mine game version */
31 #define FILE_VERSION_EM_UNKNOWN 0
32 #define FILE_VERSION_EM_V1 1
33 #define FILE_VERSION_EM_V2 2
34 #define FILE_VERSION_EM_V3 3
35 #define FILE_VERSION_EM_V4 4 /* (there really was no version 4) */
36 #define FILE_VERSION_EM_V5 5
37 #define FILE_VERSION_EM_V6 6
39 #define FILE_VERSION_EM_ACTUAL FILE_VERSION_EM_V6
41 /* level sizes and positions for EM engine */
43 #define WIDTH EM_MAX_CAVE_WIDTH
44 #define HEIGHT EM_MAX_CAVE_HEIGHT
46 /* screen sizes and positions for EM engine */
50 extern int TILESIZE_VAR;
52 #define TILEX TILESIZE_VAR
53 #define TILEY TILESIZE_VAR
55 extern int SCR_FIELDX, SCR_FIELDY;
57 #define MAX_BUF_XSIZE (SCR_FIELDX + 2)
58 #define MAX_BUF_YSIZE (SCR_FIELDY + 2)
60 /* often used screen positions */
64 #define SXSIZE (SCR_FIELDX * TILEX)
65 #define SYSIZE (SCR_FIELDY * TILEY)
68 #define PLAY_ELEMENT_SOUND FALSE
71 /* ------------------------------------------------------------------------- */
72 /* macro function definitions */
73 /* ------------------------------------------------------------------------- */
75 #define ROUNDED_DIVIDE(x, y) (((x) + (y) - 1) / (y))
77 #define SECONDS_TO_FRAMES(x) ((x) * FRAMES_PER_SECOND)
78 #define FRAMES_TO_SECONDS(x) ((x) / FRAMES_PER_SECOND)
80 #define SECONDS_TO_CYCLES(x) ROUNDED_DIVIDE((x) * FRAMES_PER_SECOND, 8)
81 #define CYCLES_TO_SECONDS(x) ROUNDED_DIVIDE((x) * 8, FRAMES_PER_SECOND)
83 #define DISPLAY_TIME(x) ROUNDED_DIVIDE(x, FRAMES_PER_SECOND)
86 /* ------------------------------------------------------------------------- */
87 /* data structure definitions */
88 /* ------------------------------------------------------------------------- */
90 /* ------------------------------------------------------------------------- */
91 /* exported variables */
92 /* ------------------------------------------------------------------------- */
94 extern unsigned int RandomEM;
96 extern struct LEVEL lev;
97 extern struct PLAYER ply[MAX_PLAYERS];
99 extern struct LevelInfo_EM native_em_level;
100 extern struct GraphicInfo_EM graphic_info_em_object[TILE_MAX][8];
101 extern struct GraphicInfo_EM graphic_info_em_player[MAX_PLAYERS][SPR_MAX][8];
108 extern struct GameInfo_EM game_em;
110 extern unsigned char tab_blank[TILE_MAX];
111 extern unsigned char tab_acid[TILE_MAX];
112 extern unsigned char tab_amoeba[TILE_MAX];
113 extern unsigned char tab_android_move[TILE_MAX];
114 extern unsigned short tab_explode_normal[TILE_MAX];
115 extern unsigned short tab_explode_dynamite[TILE_MAX];
117 extern unsigned short map_obj[8][TILE_MAX];
118 extern unsigned short map_spr[2][8][SPR_MAX];
119 extern unsigned short map_ttl[128];
121 extern Bitmap *screenBitmap;
122 extern Bitmap *scoreBitmap;
124 extern Bitmap *objBitmap;
125 extern Bitmap *sprBitmap;
126 extern Bitmap *ttlBitmap;
127 extern Bitmap *botBitmap;
130 /* ------------------------------------------------------------------------- */
131 /* exported functions */
132 /* ------------------------------------------------------------------------- */
134 #endif /* MAIN_EM_H */