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
74 #define MAX_BUF_XSIZE (SCR_FIELDX + 2)
75 #define MAX_BUF_YSIZE (SCR_FIELDY + 2)
77 /* often used screen positions */
78 #define ORIG_MENU_SX ((ORIG_SCR_MENUX - SCR_MENUX) * TILEX / 2)
79 #define ORIG_MENU_SY 0
83 #define SXSIZE (SCR_FIELDX * TILEX)
84 #define SYSIZE (SCR_FIELDY * TILEY)
87 #define PLAY_ELEMENT_SOUND FALSE
90 /* ------------------------------------------------------------------------- */
91 /* macro function definitions */
92 /* ------------------------------------------------------------------------- */
94 #define ROUNDED_DIVIDE(x, y) (((x) + (y) - 1) / (y))
96 #define SECONDS_TO_FRAMES(x) ((x) * FRAMES_PER_SECOND)
97 #define FRAMES_TO_SECONDS(x) ((x) / FRAMES_PER_SECOND)
99 #define SECONDS_TO_CYCLES(x) ROUNDED_DIVIDE((x) * FRAMES_PER_SECOND, 8)
100 #define CYCLES_TO_SECONDS(x) ROUNDED_DIVIDE((x) * 8, FRAMES_PER_SECOND)
102 #define DISPLAY_TIME(x) ROUNDED_DIVIDE(x, FRAMES_PER_SECOND)
105 /* ------------------------------------------------------------------------- */
106 /* data structure definitions */
107 /* ------------------------------------------------------------------------- */
109 /* ------------------------------------------------------------------------- */
110 /* exported variables */
111 /* ------------------------------------------------------------------------- */
113 extern unsigned long RandomEM;
115 extern struct LEVEL lev;
116 extern struct PLAYER ply[MAX_PLAYERS];
118 extern struct LevelInfo_EM native_em_level;
119 extern struct GraphicInfo_EM graphic_info_em_object[TILE_MAX][8];
120 extern struct GraphicInfo_EM graphic_info_em_player[MAX_PLAYERS][SPR_MAX][8];
127 extern struct GameInfo_EM game_em;
129 extern unsigned char tab_blank[TILE_MAX];
130 extern unsigned char tab_acid[TILE_MAX];
131 extern unsigned char tab_amoeba[TILE_MAX];
132 extern unsigned char tab_android_move[TILE_MAX];
133 extern unsigned short tab_explode_normal[TILE_MAX];
134 extern unsigned short tab_explode_dynamite[TILE_MAX];
136 extern unsigned short map_obj[8][TILE_MAX];
137 extern unsigned short map_spr[2][8][SPR_MAX];
138 extern unsigned short map_ttl[128];
140 extern Bitmap *screenBitmap;
141 extern Bitmap *scoreBitmap;
143 extern Bitmap *objBitmap;
144 extern Bitmap *sprBitmap;
145 extern Bitmap *ttlBitmap;
146 extern Bitmap *botBitmap;
148 extern Pixmap screenPixmap;
149 extern Pixmap scorePixmap;
150 extern Pixmap spriteBitmap;
152 extern Pixmap objmaskBitmap;
153 extern Pixmap sprmaskBitmap;
158 /* ------------------------------------------------------------------------- */
159 /* exported functions */
160 /* ------------------------------------------------------------------------- */
162 #endif /* MAIN_EM_H */