⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 initial.c

📁 ct952 source code use for Digital Frame Photo
💻 C
📖 第 1 页 / 共 5 页
字号:
        }    }    // Assign the pre-define disc type    __wDiscType = DISC_TYPE;    // Assign playing mode attribute    // Notice: must be put together with UTL_SetPlayMode()    __bAttrPlayNew = ATTR_PLAY;    if( (__wDiscType & BOOK_DVD) || (__wDiscType & BOOK_SVCD) )    {        HAL_SetAudioDAC ( AUDIO_FREQ_48K );    }    else    {        HAL_SetAudioDAC ( AUDIO_FREQ_44K );    }#endif  // #ifdef SIMP_INITIAL    _INITIAL_gcShowStatus(TRUE);    if ( __wDiscType == NO_DISC_IN_DRIVE )    {        // DVD_172Micky, FLOW_CONTROL begin        // Assume the no disc is interruptted(WaitStable) by SETUP,        // just go ahead do the SETUP, don't need show no_disc too.        // but need re-checking disc after exit setup.#ifdef  SUPPORT_LOADING_SETUP        if (__bISRKey == KEY_SETUP)        {            __bFlowState |= FLOW_RELEASE_DETECTION;            return ERR_NOERR;        }#endif  //#ifdef  SUPPORT_LOADING_SETUP        // else really no disc.        // DVD_172Micky, FLOW_CONTROL end        // Micky1.10, must clear all trigger state when no disc or invalid disc        // Ex. FLOW_KEEP_RESUME/FLOW_RELEASE_DETECTION-> power on->        // encouner title detection error or no disc        __bFlowState = FLOW_NORMAL;        __bTemp= 0xFF;    }    else    {        __bTemp= 3;    }    // LLY.161, let DISCTYPE info display later while CDDA title    // DVD_170Micky, must show abnormal disc for encrypt disc.    // now CD-DA disc type will be shown later, as need distinguish CDDA or DTS CDDA    // DVD_172Micky, FLOW_CONTROL begin    // show disctype except for CD-DA, as need distinguish CDDA or DTS.    if ( !(__wDiscType & BOOK_CDDA) )    {        // if unplayable bit is set(unrecoganize/invalid region code...)        // don't show MSG_DISCTYPE, show ABNORMAL_DISC        if (__bDiscInfo & DISCINFO_UNPLAYABLE)        {            OSD_OUTPUT_MACRO(MSG_ABNORMAL_DISC, __bDiscInfo, 0xff);            // Micky1.10, must clear all trigger state when no disc or invalid disc            // Ex. FLOW_KEEP_RESUME/FLOW_RELEASE_DETECTION-> power on->            // encouner title detection error or no disc            __bFlowState = FLOW_NORMAL;            //LJY1.25, fix MP3 erroneous playback when it detects wrong disc.            // Micky1.25-2, can't clear DVD when region code error            if ( !(__wDiscType & BOOK_DVD) )                __wDiscType = BOOK_UNKNOW;            //CoCo2.56, return to power on menu if no files in the USB disc.#ifdef SUPPORT_POWERON_MENU            // Delay a while let use can see "no playback file" message            OS_DelayTime(COUNT_500_MSEC);            // Exit USB source mode            MEDIA_ExitUSBSRC();            // Re-draw power-on menu.            POWERONMENU_Initial();            return ERR_NOERR;#endif //SUPPORT_POWERON_MENU        }        else        {            OSD_OUTPUT_MACRO (MSG_DISCTYPE, __wDiscType, __bTemp );            // Eric20070518, print startup time#ifdef SUPPORT_SERVO_SOURCE            SRVQA_MpegCallServoPrint(0x01);#endif //            // wyc2.02-909S,            // wyc0.80, need to wait 1s, otherwise user can't see the disc type OSD and will update soon by MM UI.            if (__wDiscType & CDROM_M1)            {                __dwMMJPGBuffEmptyTime = OS_GetSysTimer();                UTL_GetPlayRange(1);                SrcFilter_Seek(__dwTimeBegin, FALSE);            }        }    }    // DVD_172Micky, FLOW_CONTROL end    HAL_SetDiscType(__wDiscType);    //LLY.049, set correct A/V buffer size while playing MP3 w/ LOGO, ie.    //nobody will set it in original control    // LLY0.72, remove it since no related thing will be done for CT909    //HAL_InitVideo();    // LLY.161, display DISCTYPE info after get real CDDA format: pure/DTS    if(__wDiscType & BOOK_CDDA)    {        // LLY.161-2, must give the parameter        UTL_GetCDDAFormat(UTL_GETCDDAFORMAT_INITIAL);        OSD_OUTPUT_MACRO (MSG_DISCTYPE, __wDiscType, 0x3 );                 // Eric20070518, print startup time#ifdef SUPPORT_SERVO_SOURCE        SRVQA_MpegCallServoPrint(0x01);#endif //    }    // LLY0.68, remove the control flow while fix CD/ JVC-CDD power on resume don't work    // since it's unknown reason (CT909 maybe double check.)    // kevin1.05, stop the power on music playing after title detection done.#ifdef SUPPORT_POWERON_MUSIC    HAL_WriteAM(HAL_AM_PCM_SCALE, 0);    HAL_WriteAM(HAL_AM_AUDIO_TYPE, 0);    HAL_Reset(HAL_RESET_AUDIO); //stop playing power on music#endif // #ifdef SUPPORT_POWERON_MUSIC#ifndef SIMP_INITIAL#ifndef NO_MP3    // LLY.274p-3, re-think the procedure to prepare 1st Menu Mode:    // [1] Kodak Picture CD : don't enter Menu Mode    // [2] MP3/ MP3+JPG/ JPG : enter Menu Mode    if( !(__bDiscInfo & DISCINFO_UNPLAYABLE) && (__wDiscType & CDROM_M1) ) // playable CDROM title    {        // LLY0.84, do File Manager initial action for all CDROM title        // It will handle if enter menu or not by itself.        // LLY2.51, porting YC's code since MM_Initial() API is updated.        MM_Initial(__bMMInitMenu);        // LLY0.64, don't do pre-parsing of MP3 title for CT909    }#endif  // #ifndef NO_MP3#endif  // #ifndef SIMP_INITIAL    return ERR_NOERR;}//  *********************************************************************//  Function    :   INITIAL_InitialState//  Description :   Some steps for VCD Starter//                  [1] Show LOGO [2] Check title [3] AUTOPLAY check//  Arguments   :   NONE//  Return      ://  Side Effect : Now called by 1) Game Exit, 2) INITIAL_PowerONStatus(H/W or I/R)//              : 3) 3 cases are called when multi-discs.//  *********************************************************************#ifdef  SIMP_INITIALvoid INITIAL_InitialState(void){    __bModePlay= MODE_PLAYUNKNOW;    _INITIAL_gcShowStatus(FALSE);   // this will clear MSG_WAITING.???    // Don't do disc initial, directly do KEY_OPEN    // LLY0.62, using general abort mainflow API instead of checking POWER/ OPEN_CLOSE key    if( UTL_QueryCapability(QUERY_ABORT_MAINFLOW))        return;    INITIAL_CheckServo ();    //_CC_ImmediateKey();#ifdef  AUTO_POWERDOWN    //DVD_099Micky, Open/Close no disc will check auto power down    __dwTimeWaitPowerDown = OS_GetSysTimer(); //__dwCountSystem;#endif  //#ifdef  AUTO_POWERDOWN}#endif  // #ifdef  SIMP_INITIAL// Following APIs are only supported while non-simple INITIAL module#ifndef SIMP_INITIAL//  *********************************************************************//  Function    :   _INITIAL_gcShowStatus//  Description :   Prepare the ALL data for OSD/PANEL module//  Arguments   :   bFlag   : TRUE means will sends MSG_STOPWAIT to PANEL module//  Return      :   NONE//  Side Effect ://  *********************************************************************// LLY0.60, remove un-necessary element's initial action since STATUS structure has been modified// - bDiscNumber// - wTotalTime// - bSetProgram, bProgram// - bAudioChannel// - bMute// - bKaraokeLevel// - bRepeat// - bRepeatAB// - bRandom// - bTVMODE// - bOsdDisplay// - bSetTime// - bOpen// - bVocal// - bMP3Mode// - bSetSearch, bSearch// - bVolume, bVolumeLevel// - bKey// - bEcho, bEchoLevel// - bSurroundvoid _INITIAL_gcShowStatus(BYTE bFlag){    STATUS StatusInfo;#ifndef NO_DISC_MODE    if ( __wDiscType & BOOK_DVD )        StatusInfo.bPBCMode= __bNVPlayMode;    else#endif  // #ifndef NO_DISC_MODE        StatusInfo.bPBCMode= __btPBC;       //PBC on/off    if (__wDiscType&BOOK_VCD)        StatusInfo.wTotalTracks=__wTrackEnd-1;   //total tracks    else        StatusInfo.wTotalTracks=__wTrackEnd;   //total tracks    StatusInfo.bPlayingMode=MSG_STOP;   //playing mode    StatusInfo.bStill=FALSE;    // LLY2.53, expand the time value from WORD to DWORD unit    // Since, we will use [23:16]:hour, [15:8]:min, [7:0]: sec    //StatusInfo.wCurrentTime=0;    StatusInfo.dwCurrentTime=0;    StatusInfo.wCurrentTrack=0;    StatusInfo.bPowerDown=__btPowerDown;    __bpDataPointer=(BYTE *)(&StatusInfo);    // LLY.172q, it's only "TRUE" or "FALSE" flag to communicate with OSD/ PANEL mode (ARM error)    //OSD_Output ( MSG_STOPWAIT, (WORD)&StatusInfo, 0 );    OSD_Output ( MSG_STOPWAIT, TRUE, 0 );#ifndef NO_PANEL    if (bFlag)    {        PANEL_Output ( MSG_STOPWAIT, TRUE);    }#endif  // #ifndef NO_PANEL}#ifdef SUPPORT_POWER_ON_DISPLAY_LOGOvoid Show_Customer_Logo(void){	if(_bPowerOnFlag)	{     		__bLOGO |= LOGO_CHANGE_TV_TYPE;      		UTL_ShowLogo();		_bPowerOnFlag=0;		__bLOGO=LOGO_NONE;       	#ifdef LED_BackLight //CoCo2.38                 	TFT_BackLight(TRUE);		#endif		OS_DelayTime(COUNT_2_SEC);	}}#endif// wyc1.24a, one function to show first time LOGO.void    _INITIAL_ShowFirstLOGO(void){    // LLY2.77, porting SenShong's code to fix logo display maybe fail while 1st power on    // Notice: only do this procedure for CT950 solution only.#ifdef  CT951_PLATFORM    extern void _ChangeDSPCode(BYTE bType);    BYTE bIndx;    HAL_WriteAM(HAL_AM_PLAY_COMMAND, 0);    for ( bIndx=2; bIndx<17; bIndx++)    {        REG_AIU_GR(bIndx)= 0;    }    HAL_ReloadAudioDecoder(HAL_AUDIO_MP3);    HAL_ResetAudioDecoder();    HAL_WriteAM(HAL_AM_UPSAMPLE_EN, 1);    HAL_WriteAM(HAL_AM_AUDIO_TYPE, 2);    HAL_ResetAudioDecoder();    _ChangeDSPCode(HAL_VIDEO_JPG);#endif  // #ifdef CT951_PLATFORM        #ifdef SUPPORT_POWER_ON_DISPLAY_LOGO    Show_Customer_Logo();    #endif    __bLOGO |= LOGO_CHANGE_TV_TYPE;    UTL_ShowLogo();#ifdef SUPPORT_POWERON_MUSIC    // kevin1.05, power on music    HAL_PlayTone(HAL_TONE_CH_ALL);#endif  // #ifdef SUPPORT_POWERUP_MUSIC}// wyc0.50-909, move from InfoFilter thread to here.//  ***************************************************************************//  Function    :   INITIAL_MediaSetting//  Description :   Do media related setting//  Argument    :   ??//  Return      :   None//  ***************************************************************************BYTE INITIAL_MediaSetting(void){#ifdef AUTO_TEST//Alan2.20, add the following functions for auto-test    _INITIAL_Clear_PNO_Region();#endif    // LLY1.00, enable the flow state w/ resume if detect the resume information    // Notice: can't put the procedure within INITIAL_CheckServo()    //         because INITIAL_MediaSetting() will be done earier than INITIAL_CheckServo()#ifdef SUPPORT_MULTI_DISC_RESUME    if(_Detect_Resume_Information())    {        __bFlowState |= FLOW_KEEP_RESUME;    }    else#endif  // #ifdef SUPPORT_MULTI_DISC_RESUME    {        // Cannot find the RESUME info. or invalid disc media type.        __bFlowState = FLOW_NORMAL;        // Micky1.06, clear __dwResumeTime also        __dwResumeTime = NULL_0;    }    // Initial Multi Subpicture/ Audio/ Angle related variables    __bASTNO= __bASTN= __bASTID= 0;    __bSPSTNO= __bSPSTN= __bSPSTID= 0;    __bAGLN= __bAGL_Ns= 0;#ifndef NO_DISC_MODE    // Initial OGT color palette for CVD/ SVCD    if ( __wDiscType & BOOK_2X )    {        // ** TCH0.29; Record real number, not index from "0".        __bASTNs= 2;        __bSPSTNs= 4;        // LLY0.60, using __bSPPaletteBuffer[] to keep SPST palette        // Initial color palette table for SVCD/ CVD title        // 1        __bSPPaletteBuffer [1]= 0xa2; __bSPPaletteBuffer [3]= 0x2c; __bSPPaletteBuffer [2]= 0x80;        __bSPPaletteBuffer [5]= 0xeb; __bSPPaletteBuffer [7]= 0x80; __bSPPaletteBuffer [6]= 0x80;        __bSPPaletteBuffer [9]= 0xeb; __bSPPaletteBuffer [11]= 0x80; __bSPPaletteBuffer [10]= 0x80;        __bSPPaletteBuffer [13]= 0x70; __bSPPaletteBuffer [15]= 0x48; __bSPPaletteBuffer [14]= 0x3a;        // 5        __bSPPaletteBuffer [17]= 0x54; __bSPPaletteBuffer [19]= 0xb8; __bSPPaletteBuffer [18]= 0xc6;        __bSPPaletteBuffer [21]= 0x41; __bSPPaletteBuffer [23]= 0x64; __bSPPaletteBuffer [22]= 0xd4;        __bSPPaletteBuffer [25]= 0x23; __bSPPaletteBuffer [27]= 0xd4; __bSPPaletteBuffer [26]= 0x72;        __bSPPaletteBuffer [29]= 0x10; __bSPPaletteBuffer [31]= 0x80; __bSPPaletteBuffer [30]= 0x80;        // 9        __bSPPaletteBuffer [33]= 0x6b; __bSPPaletteBuffer [35]= 0x80; __bSPPaletteBuffer [34]= 0x80;        __bSPPaletteBuffer [37]= 0x93; __bSPPaletteBuffer [39]= 0x83; __bSPPaletteBuffer [38]= 0x2e;        __bSPPaletteBuffer [41]= 0x22; __bSPPaletteBuffer [43]= 0x7d; __bSPPaletteBuffer [42]= 0x83;        __bSPPaletteBuffer [45]= 0x61; __bSPPaletteBuffer [47]= 0x3a; __bSPPaletteBuffer [46]= 0x48;        // 13        __bSPPaletteBuffer [49]= 0x64; __bSPPaletteBuffer [51]= 0xc3; __bSPPaletteBuffer [50]= 0xbf;        __bSPPaletteBuffer [53]= 0x41; __bSPPaletteBuffer [55]= 0xd4; __bSPPaletteBuffer [54]= 0x64;        __bSPPaletteBuffer [57]= 0x33; __bSPPaletteBuffer [59]= 0xe4; __bSPPaletteBuffer [58]= 0x82;        __bSPPaletteBuffer [61]= 0x46; __bSPPaletteBuffer [63]= 0x23; __bSPPaletteBuffer [62]= 0xd1;#ifdef  USE_LITTLE_ENDIAN        {            int   

⌨️ 快捷键说明

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