podsa.c

来自「一个不错的硬盘播放器程序,包含VFD显示程序,红外线遥控程序,硬盘读写程序,及解」· C语言 代码 · 共 176 行

C
176
字号
/* Copyright 1996, ESS Technology, Inc.					*//* SCCSID @(#)podsa.c	1.23 12/12/97 *//*  * This is based on version 1.74 of 3204 code. *//* * $Log$ */#include "common.h"#include "digest.h"#include "display.h"#include "sysinfo.h"#include "ioport.h"#include "tact.h"#include "tdm.h"#include "timedef.h"#include "util.h"#include "vcxi.h"#include "xport.h"#ifdef BILINGUAL_OSD#include "font.h"#endif/************************************************************************ * Variables of local interest.						* ************************************************************************/PRIVATE	char	power_up = 1;	/* Reset after the first execution.	*//************************************************************************ * Global variables.							* ************************************************************************/char		audioLevel = 16;/* 16 is normal; range is [16..0]	*/unsigned int	clearIgnoreTime = 0xffffffff;/* Time to clear ignoreTDM.*/unsigned int	clearPauseTime = 0xffffffff;/* Time to deassert pause	*/unsigned int	clearSkipTime = 0xffffffff; /* Time to deassert 	*				 * "skip track" signal.			*/#ifdef LATERvolatile char	changeVideoType = 0; /* Video type has been changed.	*/unsigned int	delaySkipAmount = HALF_SECOND; /* When sending a signal	*				 * in respond to a user input, always	*				 * delay by .5 second so the external	*				 * micro controller will not get	*				 * confused. Duration is measure by	*				 * number of video interrupts (different*				 * for PAL/NTSC)			*/char		digestBackground = COLOR_BLUE;				/* Back ground color for digest		*/#endifchar		digestPause = 0;/* Pausing in the middle of digesting	*/char		disableOsd = 0;	/* When set to 1, clear vcx_osd_on	*/char		displayLogo = 0;/* Flag to tell service_dsa to show	*				 * the company logo (for audio CD)	*/char		encSelMode;	/* Encoder selection, can have 3 	*				 * values: PAL, NTSC, AUTO.		*/char		end_of_track;	/* Inc. when it is end of a track (EOF	*				 * in CD's header). User is responsible	*				 * for cleaning it.			*/char		foundVCDversion = 0; /* Set to 1 if we just found the	*				 * VCD version from 0:4:0		*/unsigned char	ignoreTDM = 0;	/* Ignore TDM input (end of digest)	*/char		ignoreTimeOut = 0;/* If we send pause, then we want to	*				 * ignore time out in most cases.	*/char		inDigestShadow = 0; /* In the shadow of digest (i.e.	*				 * screen still showing digest. In which*				 * case, digest key will quit instead	*				 * of entering another digest.		*/char		jumperAuto; 	/* Auto detect NTSC/PAL?		*/int		keepStillType = 0xe2;	/* Still picture to display	*/char		keepVideoType;	/* TDM data type to keep		*/char		msgVCD[] = "VIDEO CD    "; /* Video CD message		*/#ifdef BILINGUAL_OSDchar		c_msgVCD[] = { CN_YING3, ' ', CN_YIN1,			       ' ', 'C', 'D', ' ', ' ', ' ', ' ' };#endifchar		muteAudio = 0;	/* Don't mute				*/#ifdef LATERint		newVideoAddr;	/* Pointer to system buffer when we	*				 * have a new video data type.		*/#endifchar		nextNplay = 0;	/* If 1, then "next" key can lead to 	*				 * play and "next" key is pressed.	*/char		osdSelect = 0;	/* OSD the "select" string.		*/char		pbcON = 1;	/* Play track 1 of 2.0 disk.		*/unsigned int	pauseWidth = QUARTER_SECOND;/* Pulse width for pause signal*				 * (~1/8 sec.) Duration is measure by	*				 * number of video interrupt. The high	*				 * word is number of PAL interrupt while*				 * the low word is number of NTSC intr.	*/int		playMode = MODE_NORMAL; /* Current play mode		*/int		prevVertSz;	/* "Previous" vcx_VertSz (i.e. this	*				 * var is used to keep track of disk	*				 * change so we can set the TV encoder	*				 * accordingly.				*/char		scanMode = 0;	/* 0: normal; 1: I-frame only; 2: digest*/char		showCDtype = 1;	/* Show the CD type with OSD		*/char		skipPauseOsd = 0;/* Skip the "PAUSE" OSD if we are	*				 * sending the pause signal		*/char		skipTk1;	/* 0: don't skip 1: do skip still (tk1)	*/unsigned int	skipWidth = QUARTER_SECOND;/* Pulse width for skip signal	*				 * (~1/8 sec). Measured by number of	*				 * video interrupts.			*/unsigned int	subDigestEndTime; /* Latest time when a sub digest	*				 * screen shall end.			*/volatile char	tdmStopCopy = 0;/* Stop copying when pausing to fix	*				 * problem with Jiang Hai loader.	*/unsigned short	vcdVersion = 0x3131; /* VCD version number from CD;	*				 * power-up default is 1.1 disk		*/char		viewTrack = 0;	/* Similar to digest, but there is	*				 * no jump (i.e. "TRACK VIEW")		*/#if (P1O || P2O)unsigned int	whenDelayPlay = 0xffffffff; /* When to send a delayed	*				 * play signal				*/unsigned int	whenDelaySkip = 0xffffffff; /* When to send a delayed	*				 * skip signal				*/#endif#ifdef IRunsigned int	resend_delay = THREE_SECOND; /* Delay before resend IR	*				 * in digest.				*/#endif/* * "service_dsa" for the play-only machine. This routine will NOT be * controlling DSA. Instead, it will do OSD, logo update, and monitoring * of different switches. */void service_dsa(safe)int safe;{    if (power_up) {	int tmp1;	tmp1 = ((vcx_VertSz == 240) || (vcx_VertSz == 480)) ? 240 : 288;	keepVideoType = vcx_user_video_stream;	prevVertSz = tmp1;	power_up = 0;    }     /* Time to clear skip track */    if (glbTimer >= clearSkipTime) {		PO_RELEASE_SKIP;	/* Release the signal	*/	clearSkipTime = 0xffffffff;    }    /* Time to clear pause signal */    if (glbTimer >= clearPauseTime) {		PO_RELEASE_PAUSE;	/* Release the signal	*/	clearPauseTime = 0xffffffff;    }    if (glbTimer >= clearIgnoreTime) {	/* 20 seconds after 18 digest frames				*/	ignoreTDM = 0;			/* Start to play again.		*/	clearIgnoreTime = 0xffffffff;	showDarkBframe();		/* Ensure a clean transition	*/	/* Playing audio CD or no data, then show logo. */	if (TDM_isCDDA || !XPORT_active) displayLogo = 1;    }    /*     * In digest, the key response is very sluggish because we     * are always unsafe. Therefore, we'll force key to be processed     * even if it is not safe.     */#if 0    if (!safe && !vcx_digest) return;#endif    /* Go to ROM for the non-time-critical services */    slowServices();}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?