+#if 0
+ if (state & VIDEO_STATE_FFWD_OFF)
+ {
+#if 1
+ int cx = DOOR_GFX_PAGEX3, cy = DOOR_GFX_PAGEY2;
+
+ if (value != VIDEO_DISPLAY_SYMBOL_ONLY)
+ BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto,
+ cx + VIDEO_LABEL_XPOS,
+ cy + VIDEO_LABEL_YPOS,
+ VIDEO_LABEL_XSIZE,
+ VIDEO_LABEL_YSIZE,
+ VX + VIDEO_LABEL_XPOS,
+ VY + VIDEO_LABEL_YPOS);
+
+ cx = DOOR_GFX_PAGEX3;
+ cy = DOOR_GFX_PAGEY2;
+
+ if (value != VIDEO_DISPLAY_LABEL_ONLY)
+ BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto,
+ cx + VIDEO_FFWD_SYMBOL_XPOS,
+ cy + VIDEO_SYMBOL_YPOS,
+ VIDEO_FFWD_SYMBOL_XSIZE,
+ VIDEO_FFWD_SYMBOL_YSIZE,
+ VX + VIDEO_SYMBOL_XPOS,
+ VY + VIDEO_SYMBOL_YPOS);
+#else
+ int cx = DOOR_GFX_PAGEX3, cy = DOOR_GFX_PAGEY2;
+
+ BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto,
+ cx + VIDEO_PLAY_SYMBOL_XPOS - 9,
+ cy + VIDEO_PLAY_SYMBOL_YPOS,
+ VIDEO_PLAY_SYMBOL_XSIZE - 2,
+ VIDEO_PLAY_SYMBOL_YSIZE,
+ VX + VIDEO_PLAY_SYMBOL_XPOS - 9,
+ VY + VIDEO_PLAY_SYMBOL_YPOS);
+#endif
+ }
+#endif
+
+#if 0
+ if (state & VIDEO_STATE_PBEND_OFF)
+ {
+#if 1
+ int cx = DOOR_GFX_PAGEX3, cy = DOOR_GFX_PAGEY2;
+
+ if (value != VIDEO_DISPLAY_SYMBOL_ONLY)
+ BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto,
+ cx + VIDEO_LABEL_XPOS,
+ cy + VIDEO_LABEL_YPOS,
+ VIDEO_LABEL_XSIZE,
+ VIDEO_LABEL_YSIZE,
+ VX + VIDEO_LABEL_XPOS,
+ VY + VIDEO_LABEL_YPOS);
+
+ cx = DOOR_GFX_PAGEX3;
+ cy = DOOR_GFX_PAGEY2;
+
+ if (value != VIDEO_DISPLAY_LABEL_ONLY)
+ BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto,
+ cx + VIDEO_PBEND_SYMBOL_XPOS,
+ cy + VIDEO_SYMBOL_YPOS,
+ VIDEO_PBEND_SYMBOL_XSIZE,
+ VIDEO_PBEND_SYMBOL_YSIZE,
+ VX + VIDEO_PBEND_SYMBOL_XPOS,
+ VY + VIDEO_SYMBOL_YPOS);
+#else
+ int cx = DOOR_GFX_PAGEX3, cy = DOOR_GFX_PAGEY2;
+
+ BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto,
+ cx + VIDEO_REC_LABEL_XPOS,
+ cy + VIDEO_REC_LABEL_YPOS,
+ VIDEO_PBEND_LABEL_XSIZE,
+ VIDEO_PBEND_LABEL_YSIZE,
+ VX + VIDEO_REC_LABEL_XPOS,
+ VY + VIDEO_REC_LABEL_YPOS);
+#endif
+ }
+#endif
+
+#if 0
+ if (state & VIDEO_STATE_1STEP_OFF)
+ {
+ int cx = DOOR_GFX_PAGEX3, cy = DOOR_GFX_PAGEY2;
+
+ if (value != VIDEO_DISPLAY_LABEL_ONLY)
+ BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto,
+ cx + VIDEO_1STEP_SYMBOL_XPOS,
+ cy + VIDEO_SYMBOL_YPOS,
+ VIDEO_1STEP_SYMBOL_XSIZE,
+ VIDEO_1STEP_SYMBOL_YSIZE,
+ VX + VIDEO_1STEP_SYMBOL_XPOS,
+ VY + VIDEO_SYMBOL_YPOS);
+ }
+#endif
+
+ for (k = 0; k < NUM_TAPE_FUNCTION_STATES; k++) /* on or off states */
+ {
+ for (i = 0; i < NUM_TAPE_FUNCTIONS; i++) /* record, play, ... */
+ {
+ for (j = 0; j < NUM_TAPE_FUNCTION_PARTS; j++) /* label or symbol */
+ {
+ if (state & (1 << (i * 2 + k)))
+ {
+ int gd_x, gd_y;
+ int skip_value =
+ (j == 0 ? VIDEO_DISPLAY_SYMBOL_ONLY : VIDEO_DISPLAY_LABEL_ONLY);
+
+ if (k == 1) /* on */
+ {
+ gd_x = video_pos[i][j].gd_x1;
+ gd_y = video_pos[i][j].gd_y1;
+ }
+ else /* off */
+ {
+ gd_x = video_pos[i][j].gd_x2;
+ gd_y = video_pos[i][j].gd_y2;
+ }
+
+ if (video_pos[i][j].x != -1 && value != skip_value)
+ BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto,
+ gd_x, gd_y,
+ video_pos[i][j].width,
+ video_pos[i][j].height,
+ VX + video_pos[i][j].x,
+ VY + video_pos[i][j].y);
+ }
+ }
+ }
+ }
+
+#if 0
+ if (state & VIDEO_STATE_FFWD_ON)
+ {
+#if 1
+ int cx = DOOR_GFX_PAGEX6, cy = DOOR_GFX_PAGEY1;
+
+ if (value != VIDEO_DISPLAY_SYMBOL_ONLY)
+ BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto,
+ cx + VIDEO_FFWD_LABEL_XPOS,
+ cy + VIDEO_FFWD_LABEL_YPOS,
+ VIDEO_LABEL_XSIZE,
+ VIDEO_LABEL_YSIZE,
+ VX + VIDEO_LABEL_XPOS,
+ VY + VIDEO_LABEL_YPOS);
+
+ cx = DOOR_GFX_PAGEX6;
+ cy = DOOR_GFX_PAGEY1;
+
+ if (value != VIDEO_DISPLAY_LABEL_ONLY)
+ BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto,
+ cx + VIDEO_FFWD_SYMBOL_XPOS,
+ cy + VIDEO_FFWD_SYMBOL_YPOS,
+ VIDEO_FFWD_SYMBOL_XSIZE,
+ VIDEO_FFWD_SYMBOL_YSIZE,
+ VX + VIDEO_SYMBOL_XPOS,
+ VY + VIDEO_SYMBOL_YPOS);
+#else
+ int cx = DOOR_GFX_PAGEX4, cy = DOOR_GFX_PAGEY2;
+
+ BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto,
+ cx + VIDEO_PLAY_SYMBOL_XPOS,
+ cy + VIDEO_PLAY_SYMBOL_YPOS,
+ VIDEO_PLAY_SYMBOL_XSIZE - 2,
+ VIDEO_PLAY_SYMBOL_YSIZE,
+ VX + VIDEO_PLAY_SYMBOL_XPOS - 9,
+ VY + VIDEO_PLAY_SYMBOL_YPOS);
+#endif
+ }
+#endif
+
+#if 0
+ if (state & VIDEO_STATE_PBEND_ON)
+ {
+#if 1
+ int cx = DOOR_GFX_PAGEX6, cy = DOOR_GFX_PAGEY1;
+
+ if (value != VIDEO_DISPLAY_SYMBOL_ONLY)
+ BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto,
+ cx + VIDEO_PBEND_LABEL_XPOS,
+ cy + VIDEO_PBEND_LABEL_YPOS,
+ VIDEO_LABEL_XSIZE,
+ VIDEO_LABEL_YSIZE,
+ VX + VIDEO_LABEL_XPOS,
+ VY + VIDEO_LABEL_YPOS);
+
+ cx = DOOR_GFX_PAGEX6;
+ cy = DOOR_GFX_PAGEY1;
+
+ if (value != VIDEO_DISPLAY_LABEL_ONLY)
+ BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto,
+ cx + VIDEO_PBEND_SYMBOL_XPOS,
+ cy + VIDEO_PBEND_SYMBOL_YPOS,
+ VIDEO_PBEND_SYMBOL_XSIZE,
+ VIDEO_PBEND_SYMBOL_YSIZE,
+ VX + VIDEO_SYMBOL_XPOS,
+ VY + VIDEO_SYMBOL_YPOS);
+#else
+ int cx = DOOR_GFX_PAGEX6, cy = DOOR_GFX_PAGEY1;
+
+ BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto,
+ cx + VIDEO_PBEND_LABEL_XPOS,
+ cy + VIDEO_PBEND_LABEL_YPOS,
+ VIDEO_PBEND_LABEL_XSIZE,
+ VIDEO_PBEND_LABEL_YSIZE,
+ VX + VIDEO_REC_LABEL_XPOS,
+ VY + VIDEO_REC_LABEL_YPOS);
+#endif
+ }
+#endif
+
+#if 0
+ if (state & VIDEO_STATE_1STEP_ON)
+ {
+ int cx = DOOR_GFX_PAGEX6, cy = DOOR_GFX_PAGEY1;
+
+ if (value != VIDEO_DISPLAY_LABEL_ONLY)
+ BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto,
+ cx + VIDEO_1STEP_SYMBOL_XPOS,
+ cy + VIDEO_1STEP_SYMBOL_YPOS,
+ VIDEO_1STEP_SYMBOL_XSIZE,
+ VIDEO_1STEP_SYMBOL_YSIZE,
+ VX + VIDEO_1STEP_SYMBOL_XPOS,
+ VY + VIDEO_SYMBOL_YPOS);
+ }
+#endif
+
+ if (state & VIDEO_STATE_DATE_ON)
+ {
+ int tag = value % 100;
+ int monat = (value/100) % 100;
+ int jahr = (value/10000);
+
+ DrawText(VX + VIDEO_DATE_XPOS, VY + VIDEO_DATE_YPOS,
+ int2str(tag, 2), FONT_TAPE_RECORDER);
+ DrawText(VX + VIDEO_DATE_XPOS + 27, VY + VIDEO_DATE_YPOS,
+ monatsname[monat], FONT_TAPE_RECORDER);
+ DrawText(VX + VIDEO_DATE_XPOS + 64, VY + VIDEO_DATE_YPOS,
+ int2str(jahr, 2), FONT_TAPE_RECORDER);
+ }
+
+ if (state & VIDEO_STATE_TIME_ON)
+ {
+ int min = value / 60;
+ int sec = value % 60;
+
+ DrawText(VX + VIDEO_TIME_XPOS, VY + VIDEO_TIME_YPOS,
+ int2str(min, 2), FONT_TAPE_RECORDER);
+ DrawText(VX + VIDEO_TIME_XPOS + 27, VY + VIDEO_TIME_YPOS,
+ int2str(sec, 2), FONT_TAPE_RECORDER);
+ }
+
+#if 1
+ redraw_mask |= REDRAW_DOOR_2;
+#else
+ if (state & VIDEO_STATE_DATE)
+ redraw_mask |= REDRAW_VIDEO_1;
+ if ((state & ~VIDEO_STATE_DATE) & VIDEO_STATE)
+ redraw_mask |= REDRAW_VIDEO_2;
+ if (state & VIDEO_PRESS)
+ redraw_mask |= REDRAW_VIDEO_3;
+#endif
+}
+
+void DrawCompleteVideoDisplay()
+{
+ BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto,
+ DOOR_GFX_PAGEX3, DOOR_GFX_PAGEY2,
+ gfx.vxsize, gfx.vysize, gfx.vx, gfx.vy);
+ BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto,
+ DOOR_GFX_PAGEX4 + VIDEO_CONTROL_XPOS,
+ DOOR_GFX_PAGEY2 + VIDEO_CONTROL_YPOS,
+ VIDEO_CONTROL_XSIZE, VIDEO_CONTROL_YSIZE,
+ gfx.vx + VIDEO_CONTROL_XPOS, gfx.vy + VIDEO_CONTROL_YPOS);
+
+ DrawVideoDisplay(VIDEO_ALL_OFF, 0);
+ if (tape.date && tape.length)
+ {
+ DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date);
+ DrawVideoDisplay(VIDEO_STATE_TIME_ON, tape.length_seconds);
+ }
+
+ BlitBitmap(drawto, bitmap_db_door, gfx.vx, gfx.vy, gfx.vxsize, gfx.vysize,
+ DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY2);
+}
+
+void TapeDeactivateDisplayOn()
+{
+ SetDrawDeactivationMask(REDRAW_FIELD);
+ audio.sound_deactivated = TRUE;
+}
+
+void TapeDeactivateDisplayOff(boolean redraw_display)
+{
+ SetDrawDeactivationMask(REDRAW_NONE);
+ audio.sound_deactivated = FALSE;
+
+ if (redraw_display)
+ {
+ RedrawPlayfield(TRUE, 0,0,0,0);
+ DrawGameDoorValues();
+ }
+}
+
+
+/* ========================================================================= */
+/* tape control functions */
+/* ========================================================================= */
+
+static void TapeSetDate()
+{
+ time_t epoch_seconds = time(NULL);
+ struct tm *now = localtime(&epoch_seconds);
+
+ tape.date = 10000 * (now->tm_year % 100) + 100 * now->tm_mon + now->tm_mday;
+}
+
+void TapeErase()
+{
+ int i;