+
+#if 1
+
+#if 0
+ printf("::: InitGfxBuffers_EM: %d, %d => %d\n",
+ MAX_BUF_XSIZE, TILEX, MAX_BUF_XSIZE * TILEX);
+#endif
+
+ ReCreateBitmap(&screenBitmap, MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY,
+ DEFAULT_DEPTH);
+
+ global_em_info.screenbuffer = screenBitmap;
+
+#else
+
+ printf("::: CreateBitmap: %d, %d => %d\n",
+ MAX_BUF_XSIZE, TILEX, MAX_BUF_XSIZE * TILEX);
+
+ screenBitmap = CreateBitmap(MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY,
+ DEFAULT_DEPTH);
+
+ global_em_info.screenbuffer = screenBitmap;
+#endif
+}
+
+void em_open_all()
+{
+ /* pre-calculate some data */
+ tab_generate();
+#if defined(PLATFORM_LINUX) || defined(PLATFORM_BSD)
+ ulaw_generate();
+#endif
+
+ progname = "emerald mine";
+
+ if (open_all() != 0)
+ Error(ERR_EXIT, "em_open_all(): open_all() failed");
+
+ /* after "open_all()", because we need the graphic bitmaps to be defined */
+ tab_generate_graphics_info_em();
+
+ game_init_vars();
+}
+
+void em_close_all(void)
+{
+#if defined(AUDIO_UNIX_NATIVE)