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 */
52 #define ORIG_GFXMENUFONTX 14
53 #define ORIG_GFXMENUFONTY 16
54 #define ORIG_MENUFONTX 12
55 #define ORIG_MENUFONTY 16
59 #define TILEX (ORIG_TILEX * ZOOM_FACTOR)
60 #define TILEY (ORIG_TILEY * ZOOM_FACTOR)
61 #define SCOREX (ORIG_SCOREX * ZOOM_FACTOR)
62 #define SCOREY (ORIG_SCOREY * ZOOM_FACTOR)
63 #define GFXMENUFONTX (ORIG_GFXMENUFONTX * ZOOM_FACTOR)
64 #define GFXMENUFONTY (ORIG_GFXMENUFONTY * ZOOM_FACTOR)
65 #define MENUFONTX (ORIG_MENUFONTX * ZOOM_FACTOR)
66 #define MENUFONTY (ORIG_MENUFONTY * ZOOM_FACTOR)
68 #define ORIG_SCR_MENUX 20
69 #define ORIG_SCR_MENUY 12
73 extern int SCR_FIELDX, SCR_FIELDY;
78 #define MAX_BUF_XSIZE (SCR_FIELDX + 2)
79 #define MAX_BUF_YSIZE (SCR_FIELDY + 2)
81 /* often used screen positions */
82 #define ORIG_MENU_SX ((ORIG_SCR_MENUX - SCR_MENUX) * TILEX / 2)
83 #define ORIG_MENU_SY 0
90 #define SXSIZE (SCR_FIELDX * TILEX)
91 #define SYSIZE (SCR_FIELDY * TILEY)
94 #define PLAY_ELEMENT_SOUND FALSE
97 /* ------------------------------------------------------------------------- */
98 /* macro function definitions */
99 /* ------------------------------------------------------------------------- */
101 #define ROUNDED_DIVIDE(x, y) (((x) + (y) - 1) / (y))
103 #define SECONDS_TO_FRAMES(x) ((x) * FRAMES_PER_SECOND)
104 #define FRAMES_TO_SECONDS(x) ((x) / FRAMES_PER_SECOND)
106 #define SECONDS_TO_CYCLES(x) ROUNDED_DIVIDE((x) * FRAMES_PER_SECOND, 8)
107 #define CYCLES_TO_SECONDS(x) ROUNDED_DIVIDE((x) * 8, FRAMES_PER_SECOND)
109 #define DISPLAY_TIME(x) ROUNDED_DIVIDE(x, FRAMES_PER_SECOND)
112 /* ------------------------------------------------------------------------- */
113 /* data structure definitions */
114 /* ------------------------------------------------------------------------- */
116 /* ------------------------------------------------------------------------- */
117 /* exported variables */
118 /* ------------------------------------------------------------------------- */
120 extern unsigned long RandomEM;
122 extern struct LEVEL lev;
123 extern struct PLAYER ply[MAX_PLAYERS];
125 extern struct LevelInfo_EM native_em_level;
126 extern struct GraphicInfo_EM graphic_info_em_object[TILE_MAX][8];
127 extern struct GraphicInfo_EM graphic_info_em_player[MAX_PLAYERS][SPR_MAX][8];
134 extern struct GameInfo_EM game_em;
136 extern unsigned char tab_blank[TILE_MAX];
137 extern unsigned char tab_acid[TILE_MAX];
138 extern unsigned char tab_amoeba[TILE_MAX];
139 extern unsigned char tab_android_move[TILE_MAX];
140 extern unsigned short tab_explode_normal[TILE_MAX];
141 extern unsigned short tab_explode_dynamite[TILE_MAX];
143 extern unsigned short map_obj[8][TILE_MAX];
144 extern unsigned short map_spr[2][8][SPR_MAX];
145 extern unsigned short map_ttl[128];
147 extern Bitmap *screenBitmap;
148 extern Bitmap *scoreBitmap;
150 extern Bitmap *objBitmap;
151 extern Bitmap *sprBitmap;
152 extern Bitmap *ttlBitmap;
153 extern Bitmap *botBitmap;
155 extern Pixmap screenPixmap;
156 extern Pixmap scorePixmap;
157 extern Pixmap spriteBitmap;
159 extern Pixmap objmaskBitmap;
160 extern Pixmap sprmaskBitmap;
165 /* ------------------------------------------------------------------------- */
166 /* exported functions */
167 /* ------------------------------------------------------------------------- */
169 #endif /* MAIN_EM_H */