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 */
48 #define NEW_TILESIZE 1
50 #define ORIG_TILESIZE 16
56 #define ORIG_GFXMENUFONTX 14
57 #define ORIG_GFXMENUFONTY 16
58 #define ORIG_MENUFONTX 12
59 #define ORIG_MENUFONTY 16
62 #define ZOOM_FACTOR (2 * TILESIZE_VAR / TILESIZE)
70 extern int TILESIZE_VAR;
71 #define TILEX TILESIZE_VAR
72 #define TILEY TILESIZE_VAR
74 #define TILEX (ORIG_TILEX * ZOOM_FACTOR)
75 #define TILEY (ORIG_TILEY * ZOOM_FACTOR)
77 #define SCOREX (ORIG_SCOREX * ZOOM_FACTOR)
78 #define SCOREY (ORIG_SCOREY * ZOOM_FACTOR)
79 #define GFXMENUFONTX (ORIG_GFXMENUFONTX * ZOOM_FACTOR)
80 #define GFXMENUFONTY (ORIG_GFXMENUFONTY * ZOOM_FACTOR)
81 #define MENUFONTX (ORIG_MENUFONTX * ZOOM_FACTOR)
82 #define MENUFONTY (ORIG_MENUFONTY * ZOOM_FACTOR)
84 #define ORIG_SCR_MENUX 20
85 #define ORIG_SCR_MENUY 12
89 extern int SCR_FIELDX, SCR_FIELDY;
94 #define MAX_BUF_XSIZE (SCR_FIELDX + 2)
95 #define MAX_BUF_YSIZE (SCR_FIELDY + 2)
97 /* often used screen positions */
98 #define ORIG_MENU_SX ((ORIG_SCR_MENUX - SCR_MENUX) * TILEX / 2)
99 #define ORIG_MENU_SY 0
106 #define SXSIZE (SCR_FIELDX * TILEX)
107 #define SYSIZE (SCR_FIELDY * TILEY)
110 #define PLAY_ELEMENT_SOUND FALSE
113 /* ------------------------------------------------------------------------- */
114 /* macro function definitions */
115 /* ------------------------------------------------------------------------- */
117 #define ROUNDED_DIVIDE(x, y) (((x) + (y) - 1) / (y))
119 #define SECONDS_TO_FRAMES(x) ((x) * FRAMES_PER_SECOND)
120 #define FRAMES_TO_SECONDS(x) ((x) / FRAMES_PER_SECOND)
122 #define SECONDS_TO_CYCLES(x) ROUNDED_DIVIDE((x) * FRAMES_PER_SECOND, 8)
123 #define CYCLES_TO_SECONDS(x) ROUNDED_DIVIDE((x) * 8, FRAMES_PER_SECOND)
125 #define DISPLAY_TIME(x) ROUNDED_DIVIDE(x, FRAMES_PER_SECOND)
128 /* ------------------------------------------------------------------------- */
129 /* data structure definitions */
130 /* ------------------------------------------------------------------------- */
132 /* ------------------------------------------------------------------------- */
133 /* exported variables */
134 /* ------------------------------------------------------------------------- */
136 extern unsigned int RandomEM;
138 extern struct LEVEL lev;
139 extern struct PLAYER ply[MAX_PLAYERS];
141 extern struct LevelInfo_EM native_em_level;
142 extern struct GraphicInfo_EM graphic_info_em_object[TILE_MAX][8];
143 extern struct GraphicInfo_EM graphic_info_em_player[MAX_PLAYERS][SPR_MAX][8];
150 extern struct GameInfo_EM game_em;
152 extern unsigned char tab_blank[TILE_MAX];
153 extern unsigned char tab_acid[TILE_MAX];
154 extern unsigned char tab_amoeba[TILE_MAX];
155 extern unsigned char tab_android_move[TILE_MAX];
156 extern unsigned short tab_explode_normal[TILE_MAX];
157 extern unsigned short tab_explode_dynamite[TILE_MAX];
159 extern unsigned short map_obj[8][TILE_MAX];
160 extern unsigned short map_spr[2][8][SPR_MAX];
161 extern unsigned short map_ttl[128];
163 extern Bitmap *screenBitmap;
164 extern Bitmap *scoreBitmap;
166 extern Bitmap *objBitmap;
167 extern Bitmap *sprBitmap;
168 extern Bitmap *ttlBitmap;
169 extern Bitmap *botBitmap;
171 extern Pixmap screenPixmap;
172 extern Pixmap scorePixmap;
173 extern Pixmap spriteBitmap;
175 extern Pixmap objmaskBitmap;
176 extern Pixmap sprmaskBitmap;
181 /* ------------------------------------------------------------------------- */
182 /* exported functions */
183 /* ------------------------------------------------------------------------- */
185 #endif /* MAIN_EM_H */