-
-void TapeErase()
-{
- tape.length = 0;
-}
-
-void DrawVideoDisplay(unsigned long state, unsigned long value)
-{
- int i;
- int part1 = 0, part2 = 1;
- int xpos = 0, ypos = 1, xsize = 2, ysize = 3;
- static char *monatsname[12] =
- {
- "JAN", "FEB", "MAR", "APR", "MAY", "JUN",
- "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"
- };
- static int video_pos[10][2][4] =
- {
- VIDEO_PLAY_LABEL_XPOS, VIDEO_PLAY_LABEL_YPOS,
- VIDEO_PLAY_LABEL_XSIZE,VIDEO_PLAY_LABEL_YSIZE,
- VIDEO_PLAY_SYMBOL_XPOS, VIDEO_PLAY_SYMBOL_YPOS,
- VIDEO_PLAY_SYMBOL_XSIZE,VIDEO_PLAY_SYMBOL_YSIZE,
-
- VIDEO_REC_LABEL_XPOS, VIDEO_REC_LABEL_YPOS,
- VIDEO_REC_LABEL_XSIZE,VIDEO_REC_LABEL_YSIZE,
- VIDEO_REC_SYMBOL_XPOS, VIDEO_REC_SYMBOL_YPOS,
- VIDEO_REC_SYMBOL_XSIZE,VIDEO_REC_SYMBOL_YSIZE,
-
- VIDEO_PAUSE_LABEL_XPOS, VIDEO_PAUSE_LABEL_YPOS,
- VIDEO_PAUSE_LABEL_XSIZE,VIDEO_PAUSE_LABEL_YSIZE,
- VIDEO_PAUSE_SYMBOL_XPOS, VIDEO_PAUSE_SYMBOL_YPOS,
- VIDEO_PAUSE_SYMBOL_XSIZE,VIDEO_PAUSE_SYMBOL_YSIZE,
-
- VIDEO_DATE_LABEL_XPOS, VIDEO_DATE_LABEL_YPOS,
- VIDEO_DATE_LABEL_XSIZE,VIDEO_DATE_LABEL_YSIZE,
- VIDEO_DATE_XPOS, VIDEO_DATE_YPOS,
- VIDEO_DATE_XSIZE,VIDEO_DATE_YSIZE,
-
- 0,0,
- 0,0,
- VIDEO_TIME_XPOS, VIDEO_TIME_YPOS,
- VIDEO_TIME_XSIZE,VIDEO_TIME_YSIZE,
-
- VIDEO_BUTTON_PLAY_XPOS, VIDEO_BUTTON_ANY_YPOS,
- VIDEO_BUTTON_XSIZE,VIDEO_BUTTON_YSIZE,
- 0,0,
- 0,0,
-
- VIDEO_BUTTON_REC_XPOS, VIDEO_BUTTON_ANY_YPOS,
- VIDEO_BUTTON_XSIZE,VIDEO_BUTTON_YSIZE,
- 0,0,
- 0,0,
-
- VIDEO_BUTTON_PAUSE_XPOS, VIDEO_BUTTON_ANY_YPOS,
- VIDEO_BUTTON_XSIZE,VIDEO_BUTTON_YSIZE,
- 0,0,
- 0,0,
-
- VIDEO_BUTTON_STOP_XPOS, VIDEO_BUTTON_ANY_YPOS,
- VIDEO_BUTTON_XSIZE,VIDEO_BUTTON_YSIZE,
- 0,0,
- 0,0,
-
- VIDEO_BUTTON_EJECT_XPOS, VIDEO_BUTTON_ANY_YPOS,
- VIDEO_BUTTON_XSIZE,VIDEO_BUTTON_YSIZE,
- 0,0,
- 0,0
- };
-
- for(i=0;i<20;i++)
- {
- if (state & (1<<i))
- {
- int pos = i/2, cx, cy = DOOR_GFX_PAGEY2;
-
- if (i%2) /* i ungerade => STATE_ON / PRESS_OFF */
- cx = DOOR_GFX_PAGEX4;
- else
- cx = DOOR_GFX_PAGEX3; /* i gerade => STATE_OFF / PRESS_ON */
-
- if (video_pos[pos][part1][0])
- XCopyArea(display,pix[PIX_DOOR],drawto,gc,
- cx + video_pos[pos][part1][xpos],
- cy + video_pos[pos][part1][ypos],
- video_pos[pos][part1][xsize],
- video_pos[pos][part1][ysize],
- VX + video_pos[pos][part1][xpos],
- VY + video_pos[pos][part1][ypos]);
- if (video_pos[pos][part2][0])
- XCopyArea(display,pix[PIX_DOOR],drawto,gc,
- cx + video_pos[pos][part2][xpos],
- cy + video_pos[pos][part2][ypos],
- video_pos[pos][part2][xsize],
- video_pos[pos][part2][ysize],
- VX + video_pos[pos][part2][xpos],
- VY + video_pos[pos][part2][ypos]);
- }
- }
-
- 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),FS_SMALL,FC_SPECIAL1);
- DrawText(VX+VIDEO_DATE_XPOS+27,VY+VIDEO_DATE_YPOS,
- monatsname[monat],FS_SMALL,FC_SPECIAL1);
- DrawText(VX+VIDEO_DATE_XPOS+64,VY+VIDEO_DATE_YPOS,
- int2str(jahr,2),FS_SMALL,FC_SPECIAL1);
- }
-
- 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),FS_SMALL,FC_SPECIAL1);
- DrawText(VX+VIDEO_TIME_XPOS+27,VY+VIDEO_TIME_YPOS,
- int2str(sec,2),FS_SMALL,FC_SPECIAL1);
- }
-
- 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;
-}
-
-void DrawSoundDisplay(unsigned long state)
-{
- int pos, cx = DOOR_GFX_PAGEX4, cy = 0;
-
- pos = (state & BUTTON_SOUND_MUSIC ? SOUND_BUTTON_MUSIC_XPOS :
- state & BUTTON_SOUND_LOOPS ? SOUND_BUTTON_LOOPS_XPOS :
- SOUND_BUTTON_SOUND_XPOS);
-
- if (state & BUTTON_ON)
- cy -= SOUND_BUTTON_YSIZE;
-
- if (state & BUTTON_PRESSED)
- cx = DOOR_GFX_PAGEX3;
-
- XCopyArea(display,pix[PIX_DOOR],drawto,gc,
- cx + pos,cy + SOUND_BUTTON_ANY_YPOS,
- SOUND_BUTTON_XSIZE,SOUND_BUTTON_YSIZE,
- DX + pos,DY + SOUND_BUTTON_ANY_YPOS);
-
- redraw_mask |= REDRAW_DOOR_1;
-}
-
-void DrawGameButton(unsigned long state)
-{
- int pos, cx = DOOR_GFX_PAGEX4, cy = -GAME_BUTTON_YSIZE;
-
- pos = (state & BUTTON_GAME_STOP ? GAME_BUTTON_STOP_XPOS :
- state & BUTTON_GAME_PAUSE ? GAME_BUTTON_PAUSE_XPOS :
- GAME_BUTTON_PLAY_XPOS);
-
- if (state & BUTTON_PRESSED)
- cx = DOOR_GFX_PAGEX3;
-
- XCopyArea(display,pix[PIX_DOOR],drawto,gc,
- cx + pos,cy + GAME_BUTTON_ANY_YPOS,
- GAME_BUTTON_XSIZE,GAME_BUTTON_YSIZE,
- DX + pos,DY + GAME_BUTTON_ANY_YPOS);
-
- redraw_mask |= REDRAW_DOOR_1;
-}
-
-void DrawChooseButton(unsigned long state)
-{
- int pos, cx = DOOR_GFX_PAGEX4, cy = 0;
-
- pos = (state & BUTTON_OK ? OK_BUTTON_XPOS : NO_BUTTON_XPOS);
-
- if (state & BUTTON_PRESSED)
- cx = DOOR_GFX_PAGEX3;
-
- XCopyArea(display,pix[PIX_DOOR],drawto,gc,
- cx + pos,cy + OK_BUTTON_GFX_YPOS,
- OK_BUTTON_XSIZE,OK_BUTTON_YSIZE,
- DX + pos,DY + OK_BUTTON_YPOS);
-
- redraw_mask |= REDRAW_DOOR_1;
-}
-
-void DrawConfirmButton(unsigned long state)
-{
- int cx = DOOR_GFX_PAGEX4, cy = 0;
-
- if (state & BUTTON_PRESSED)
- cx = DOOR_GFX_PAGEX3;
-
- XCopyArea(display,pix[PIX_DOOR],drawto,gc,
- cx + CONFIRM_BUTTON_XPOS,cy + CONFIRM_BUTTON_GFX_YPOS,
- CONFIRM_BUTTON_XSIZE,CONFIRM_BUTTON_YSIZE,
- DX + CONFIRM_BUTTON_XPOS,DY + CONFIRM_BUTTON_YPOS);
-
- redraw_mask |= REDRAW_DOOR_1;
-}