// constant definitions
// ----------------------------------------------------------------------------
-/* define these to use additional elements */
-#define EM_ENGINE_USE_ADDITIONAL_ELEMENTS
+#define CAVE_WIDTH MAX_PLAYFIELD_WIDTH
+#define CAVE_HEIGHT MAX_PLAYFIELD_HEIGHT
-/* one border for Zborder elements, one border for steelwall, if needed */
-#define EM_MAX_CAVE_WIDTH (MAX_PLAYFIELD_WIDTH + 2 + 2)
-#define EM_MAX_CAVE_HEIGHT (MAX_PLAYFIELD_HEIGHT + 2 + 2)
+/* additional padding for Zborder elements and linked cave buffer columns */
+#define CAVE_BUFFER_XOFFSET 4
+#define CAVE_BUFFER_YOFFSET 2
+#define CAVE_BUFFER_WIDTH (CAVE_WIDTH + 2 * CAVE_BUFFER_XOFFSET)
+#define CAVE_BUFFER_HEIGHT (CAVE_HEIGHT + 2 * CAVE_BUFFER_YOFFSET)
/*
-----------------------------------------------------------------------------
Xacid_7,
Xacid_8,
-#ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS
- Xfake_acid_1,
+ Xfake_acid_1, /* newly added to EM engine */
Xfake_acid_2,
Xfake_acid_3,
Xfake_acid_4,
Xfake_acid_6,
Xfake_acid_7,
Xfake_acid_8,
-#endif
Xgrass,
Ygrass_nB,
Xfake_grass,
Xfake_grassB,
- Xfake_amoeba, /* dripper */
+ Xfake_amoeba, /* dripper */
Xfake_amoebaB,
Xlenses,
Xsand_stonesand_4,
Xsand_stoneout_1,
Xsand_stoneout_2,
-#ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS
- Xsand_stonesand_quickout_1,
+ Xsand_stonesand_quickout_1, /* newly added to EM engine */
Xsand_stonesand_quickout_2,
-#endif
- Xslidewall_ns, /* growing wall */
+ Xslidewall_ns, /* growing wall */
Yslidewall_ns_blank,
Xslidewall_ew,
Yslidewall_ew_blank,
Xexit_2,
Xexit_3,
+ Xpause,
+
Xwall_1,
Xwall_2,
Xwall_3,
Xalpha_arrow_w,
Xalpha_copyr,
-#ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS
- Ykey_1_blank,
+ Ykey_1_blank, /* newly added to EM engine */
Ykey_2_blank,
Ykey_3_blank,
Ykey_4_blank,
Ymagnify_blank,
Ygrass_blank,
Ydirt_blank,
-#endif
Xboom_bug, /* passed from explode to synchro (linked explosion);
transition to explode_normal */
int width; /* playfield width */
int height; /* playfield height */
+ int left; /* playfield left edge */
+ int top; /* playfield top edge */
+ int right; /* playfield right edge */
+ int bottom; /* playfield bottom edge */
+
int time_seconds; /* available time (seconds) */
int time_initial; /* available time (initial) */
int time; /* time remaining (runtime) */
int num_ball_arrays; /* number of ball data arrays used */
int exit_x, exit_y; /* kludge for playing player exit sound */
+
+ short cavebuf[CAVE_BUFFER_WIDTH][CAVE_BUFFER_HEIGHT];
+ short nextbuf[CAVE_BUFFER_WIDTH][CAVE_BUFFER_HEIGHT];
+ short drawbuf[CAVE_BUFFER_WIDTH][CAVE_BUFFER_HEIGHT];
+ short boombuf[CAVE_BUFFER_WIDTH][CAVE_BUFFER_HEIGHT];
+
+ short *cavecol[CAVE_BUFFER_WIDTH];
+ short *nextcol[CAVE_BUFFER_WIDTH];
+ short *drawcol[CAVE_BUFFER_WIDTH];
+ short *boomcol[CAVE_BUFFER_WIDTH];
+
+ short **cave;
+ short **next;
+ short **draw;
+ short **boom;
};
struct PLAYER