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_V3 3
32 #define FILE_VERSION_EM_V4 4
33 #define FILE_VERSION_EM_V5 5
34 #define FILE_VERSION_EM_V6 6
36 #define FILE_VERSION_EM_ACTUAL FILE_VERSION_EM_V6
38 /* level sizes and positions for EM engine */
40 #define WIDTH EM_MAX_CAVE_WIDTH
41 #define HEIGHT EM_MAX_CAVE_HEIGHT
43 /* screen sizes and positions for EM engine */
49 #define ORIG_GFXMENUFONTX 14
50 #define ORIG_GFXMENUFONTY 16
51 #define ORIG_MENUFONTX 12
52 #define ORIG_MENUFONTY 16
56 #define TILEX (ORIG_TILEX * ZOOM_FACTOR)
57 #define TILEY (ORIG_TILEY * ZOOM_FACTOR)
58 #define SCOREX (ORIG_SCOREX * ZOOM_FACTOR)
59 #define SCOREY (ORIG_SCOREY * ZOOM_FACTOR)
60 #define GFXMENUFONTX (ORIG_GFXMENUFONTX * ZOOM_FACTOR)
61 #define GFXMENUFONTY (ORIG_GFXMENUFONTY * ZOOM_FACTOR)
62 #define MENUFONTX (ORIG_MENUFONTX * ZOOM_FACTOR)
63 #define MENUFONTY (ORIG_MENUFONTY * ZOOM_FACTOR)
65 #define ORIG_SCR_MENUX 20
66 #define ORIG_SCR_MENUY 12
71 #define MAX_BUF_XSIZE (SCR_FIELDX + 2)
72 #define MAX_BUF_YSIZE (SCR_FIELDY + 2)
74 /* often used screen positions */
75 #define ORIG_MENU_SX ((ORIG_SCR_MENUX - SCR_MENUX) * TILEX / 2)
76 #define ORIG_MENU_SY 0
80 #define SXSIZE (SCR_FIELDX * TILEX)
81 #define SYSIZE (SCR_FIELDY * TILEY)
84 /* ------------------------------------------------------------------------- */
85 /* macro function definitions */
86 /* ------------------------------------------------------------------------- */
88 #define ROUNDED_DIVIDE(x, y) (((x) + (y) - 1) / (y))
90 #define SECONDS_TO_FRAMES(x) ((x) * FRAMES_PER_SECOND)
91 #define FRAMES_TO_SECONDS(x) ((x) / FRAMES_PER_SECOND)
93 #define SECONDS_TO_CYCLES(x) ROUNDED_DIVIDE((x) * FRAMES_PER_SECOND, 8)
94 #define CYCLES_TO_SECONDS(x) ROUNDED_DIVIDE((x) * 8, FRAMES_PER_SECOND)
96 #define DISPLAY_TIME(x) ROUNDED_DIVIDE(x, FRAMES_PER_SECOND)
99 /* ------------------------------------------------------------------------- */
100 /* data structure definitions */
101 /* ------------------------------------------------------------------------- */
103 /* ------------------------------------------------------------------------- */
104 /* exported variables */
105 /* ------------------------------------------------------------------------- */
107 extern unsigned long RandomEM;
109 extern struct LEVEL lev;
110 extern struct PLAYER ply[MAX_PLAYERS];
112 extern struct LevelInfo_EM native_em_level;
113 extern struct GraphicInfo_EM graphic_info_em_object[TILE_MAX][8];
114 extern struct GraphicInfo_EM graphic_info_em_player[MAX_PLAYERS][SPR_MAX][8];
121 extern struct GameInfo_EM game_em;
123 extern unsigned char tab_blank[TILE_MAX];
124 extern unsigned char tab_acid[TILE_MAX];
125 extern unsigned char tab_amoeba[TILE_MAX];
126 extern unsigned char tab_android_move[TILE_MAX];
127 extern unsigned short tab_explode_normal[TILE_MAX];
128 extern unsigned short tab_explode_dynamite[TILE_MAX];
130 extern unsigned short map_obj[8][TILE_MAX];
131 extern unsigned short map_spr[2][8][SPR_MAX];
132 extern unsigned short map_ttl[128];
134 extern Bitmap *screenBitmap;
135 extern Bitmap *scoreBitmap;
137 extern Bitmap *objBitmap;
138 extern Bitmap *sprBitmap;
139 extern Bitmap *ttlBitmap;
140 extern Bitmap *botBitmap;
142 extern Pixmap screenPixmap;
143 extern Pixmap scorePixmap;
144 extern Pixmap spriteBitmap;
146 extern Pixmap objmaskBitmap;
147 extern Pixmap sprmaskBitmap;
152 /* ------------------------------------------------------------------------- */
153 /* exported functions */
154 /* ------------------------------------------------------------------------- */
156 #endif /* MAIN_EM_H */