📄 initial.~c
字号:
else { __bMediaServoState = MEDIA_SERVO_CLOSED; } // Micky0.72, add for servo tray is opened when power on. end __bMediaServoAction = MEDIA_SERVO_ACTION_CLOSE;#endif // #ifdef NO_DISC_MODE // LLY0.76-1, JY says we must give a default value for servo buffer // Otherwise, it will out-of range while disc reading. // LLY2.01, set servo/ parser dump in buffer as normal while power-on // LLY2.20, rename it as UTL_Config_BufferMode() // LLY2.51, porting CoCo's code to config buffer mode as video mode @ CT95x solution#ifdef CT950_STYLE UTL_Config_BufferMode(DUMP_BUFF_MM_VIDEO_ONLY_MODE);#else UTL_Config_BufferMode(DUMP_BUFF_NORMAL_MODE);#endif //CT950_STYLE#endif // #ifdef SIMP_INITIAL//DVD_049MickyPowerDown#ifdef AUTO_POWERDOWN // set the initial time stamp for checking. __dwTimeWaitPowerDown = OS_GetSysTimer(); //__dwCountSystem;#endif // #ifdef AUTO_POWERDOWN#ifdef AUTO_TEST//Alan2.20, add the following functions for auto-test _INITIAL_ShowPNO();#endif}// LLY0.60 create ...// ***************************************************************************************// Function : INITIAL_ThreadInit// Description : Create the desired thread and wake-up it// Argument : bThread, specify the desired thread// Return : None// Notice :// ***************************************************************************************//Micky_PORTING_OSWRAPvoid INITIAL_ThreadInit(BYTE bThread){ // Create the desired thread switch(bThread) {#ifdef SUPPORT_ATAPI_SOURCE case THREAD_ATAPI: ThreadATAPI.priority = 5; ThreadATAPI.fpThreadEntry= ATAPI_Thread; ThreadATAPI.dwEntryData = 0; ThreadATAPI.ThreadName = "ATAPI"; ThreadATAPI.StackBase = (void *)__cATAPIStack; ThreadATAPI.StackSize = ATAPI_THREAD_STACK_SIZE; OS_CreateThread(&ThreadATAPI); OS_ResumeThread(ThreadATAPI.handle); break;#endif // #ifdef SUPPORT_ATAPI_SOURCE // wyc1.01, create USB source thread.#ifdef SUPPORT_USB_SOURCE case THREAD_USBSRC: ThreadUSBSRC.priority = 5; ThreadUSBSRC.fpThreadEntry= USBSRC_Thread; ThreadUSBSRC.dwEntryData = 0; ThreadUSBSRC.ThreadName = "USBSRC"; ThreadUSBSRC.StackBase = (void *)__cUSBSRCStack; ThreadUSBSRC.StackSize = USBSRC_THREAD_STACK_SIZE; OS_CreateThread(&ThreadUSBSRC); break;#endif // #ifdef SUPPORT_ATAPI_SOURCE#ifdef SUPPORT_SERVO_SOURCE#endif // #ifdef SUPPORT_SSERVO_SOURCE case THREAD_PARSER: ThreadPARSER.priority = 5; ThreadPARSER.fpThreadEntry= PARSER_ThreadMain; ThreadPARSER.dwEntryData = 0; ThreadPARSER.ThreadName = "Parser"; ThreadPARSER.StackBase = (void *)__cPARSERStack; ThreadPARSER.StackSize = PARSER_THREAD_STACK_SIZE; OS_CreateThread(&ThreadPARSER); OS_ResumeThread(ThreadPARSER.handle); break;#ifndef SIMP_INITIAL case THREAD_INFO_FILTER: ThreadInfoFilter.priority = 5; ThreadInfoFilter.fpThreadEntry= INFOFILTER_Thread; ThreadInfoFilter.dwEntryData = 0; ThreadInfoFilter.ThreadName = "InfoFilter"; ThreadInfoFilter.StackBase = (void *)__cInfoFilterStack; ThreadInfoFilter.StackSize = INFO_FILTER_THREAD_STACK_SIZE; OS_CreateThread(&ThreadInfoFilter); OS_ResumeThread(ThreadInfoFilter.handle); break;#endif // #ifndef SIMP_INITIAL#if 0 case THREAD_SRC_FILTER: ThreadSrcFilter.priority = 5; cyg_thread_create(ThreadSrcFilter.priority, SRCFILTER_Thread, (cyg_addrword_t) 0, "SrcFilter", (void *) __cSrcFilterStack, SRC_FILTER_THREAD_STACK_SIZE, &ThreadSrcFilter.handle, &ThreadSrcFilter,space); cyg_thread_resume(ThreadSrcFilter.handle); break;#endif // #if 0 case THREAD_MPEG_DECODER: // LLY0.72, delete other video decoder thread first, ex. DivX, JPEG // Since, only one decoder thread will exist at the same time. INITIAL_ThreadDelete(THREAD_DIVX_DECODER); INITIAL_ThreadDelete(THREAD_JPEG_DECODER); ThreadDec.priority = 4; ThreadDec.fpThreadEntry= MPEG2_ThreadMain; ThreadDec.dwEntryData = 3; ThreadDec.ThreadName = "Dec_MPEG"; ThreadDec.StackBase = (void *)__cDecStack; ThreadDec.StackSize = DECODER_THREAD_STACK_SIZE; OS_CreateThread(&ThreadDec); OS_ResumeThread(ThreadDec.handle); break; case THREAD_DIVX_DECODER: // LLY0.72, delete other video decoder thread first, ex. MPEG, JPEG // Since, only one decoder thread will exist at the same time. INITIAL_ThreadDelete(THREAD_MPEG_DECODER); INITIAL_ThreadDelete(THREAD_JPEG_DECODER); // Create thread - DivX ThreadDec.priority = 4; ThreadDec.fpThreadEntry= DivX_ThreadMain; // LLY2.31, porting Chuan's code to give extra buffer address for AVI decoding // Notice: Must co-work w/ >= v2.31 decoder and DRAM layout table ThreadDec.dwEntryData = DS_SIDEINFO_BUF_ST; ThreadDec.ThreadName = "Dec_DivX"; ThreadDec.StackBase = (void *)__cDecStack; ThreadDec.StackSize = DECODER_THREAD_STACK_SIZE; OS_CreateThread(&ThreadDec); OS_ResumeThread(ThreadDec.handle); break; case THREAD_JPEG_DECODER: // LLY0.72, delete other video decoder thread first, ex. DivX, MPEG // Since, only one decoder thread will exist at the same time. INITIAL_ThreadDelete(THREAD_MPEG_DECODER); INITIAL_ThreadDelete(THREAD_DIVX_DECODER); // Create thread - JPEG ThreadDec.priority = 5; ThreadDec.fpThreadEntry= JPEG_ThreadMain; ThreadDec.dwEntryData = 3; ThreadDec.ThreadName = "Dec_JPEG"; ThreadDec.StackBase = (void *)__cDecStack; ThreadDec.StackSize = DECODER_THREAD_STACK_SIZE; OS_CreateThread(&ThreadDec); OS_ResumeThread(ThreadDec.handle); break; }}// LLY0.72 create ...// ********************************************************************************// Function : INITIAL_ThreadDelete// Description : Delete the desired thread if it exist.// Also release the related resource before the thread deleted// Arguments : bThread, specify the desired thread// Return : TRUE, the thread is deleted ok// FALSE, the thread delete action fail// ********************************************************************************BYTE INITIAL_ThreadDelete(BYTE bThread){ switch(bThread) { case THREAD_DIVX_DECODER: // Delete the DivX thread if it exist if( (OS_PeekFlag(&__fThreadInit) & INIT_DEC_THREAD_DIVX_DONE) ) { // [1] call DivX thread exit API // [2] suspend the thread OS_SuspendThread(ThreadDec.handle); // [3] kill the desired thread OS_KillThread(ThreadDec.handle); // [4] clear the thread initial done flag OS_ClearFlag( &__fThreadInit, ~INIT_DEC_THREAD_DIVX_DONE ); } return (TRUE); case THREAD_MPEG_DECODER: // Delete the MPEG thread if it exist if( (OS_PeekFlag(&__fThreadInit) & INIT_DEC_THREAD_MPEG_DONE) ) { // [1] call MPEG thread exit API to release resource MPEG2_ThreadExit(0); // [2] suspend the thread OS_SuspendThread(ThreadDec.handle); // [3] kill the desired thread OS_KillThread(ThreadDec.handle); // [4] clear the thread initial done flag OS_ClearFlag( &__fThreadInit, ~INIT_DEC_THREAD_MPEG_DONE ); } return (TRUE); case THREAD_JPEG_DECODER: // Delete the JPEG thread if it exist if( (OS_PeekFlag(&__fThreadInit) & INIT_DEC_THREAD_JPEG_DONE) ) { // [1] call JPEG thread exit API to release resource JPEG_ThreadExit( 0); // [2] suspend the thread OS_SuspendThread(ThreadDec.handle); // [3] kill the desired thread OS_KillThread(ThreadDec.handle); // [4] clear the thread initial done flag OS_ClearFlag( &__fThreadInit, ~INIT_DEC_THREAD_JPEG_DONE ); } return (TRUE); default: return (FALSE); } return (FALSE);}// *********************************************************************// Function : INITIAL_Variables// Description : The initalization of all variables// Arguments : NONE// Return : NONE// Side Effect : The effect will be the OPEN-CLOSE level// *********************************************************************// DVD_172Micky, FLOW_CONTROL// called when 1) H/W power on, 2) I/R power on, 3) I/R power off, 4) Open tray.void INITIAL_Variables(void){ // Kevin0.85, remove the setting for _bSampleFreq, // Since it's un-necessary to set the freq again when open->close or power off->on //_bSampleFreq = AUDIO_FREQ_NONE; // LLY2.36, porting elmer's code to reset File system as none // while open/ close and IR power. __bFileSystem = FILE_SYSTEM_NONE; // LLY2.38, base on CoCo's suggest to remove this variables since new mechanism don't reference it.#if 0#ifdef PRESTOP_BEFORE_SETUP_AND_PROGRAM __bPreCountStop=0; // Alan2.02#endif // #ifdef PRESTOP_BEFORE_SETUP_AND_PROGRAM#endif // #if 0 __bDiscInfo= DISCINFO_NONE; // ** TCH1.70;//DVD_049MickyPowerDown#ifdef AUTO_POWERDOWN// support auto power down // reset the checking time __dwTimeWaitPowerDown =0xFFFFFFFF;#endif // #ifdef AUTO_POWERDOWN//CoCo1.02, add OSD game from XuLi's code#ifdef SUPPORT_OSDGAME __enGameID = GAME_NONE;#endif __bZoomFactor=VIEW_NORMAL; __wXStart=0; __wYStart=0; __bModeCmd= KEY_STOP; __btPlaying= FALSE; __btPause= FALSE; //Micky2.80, review global variables init. __dwTimeKey = 0; __dwNumberPrevious = 0;#ifdef SUPPORT_BOOKMARK __btBookMark = FALSE;#endif // #ifdef SUPPORT_BOOKMARK // wyc1.24a-2, because this __bSearchMode will be reset in UTL_ModeInitial. So don't need to reset it here. //__bSearchMode = 0;// Micky1.06, remove unnecessary codes, as will be cleared within INITIAL_MediaSetting/* // Micky1.10, support resume after power on for DVD/CDDA/VCD // must keep the __dwResumeTime value // Ming0.80, support multi-disc resume.#if defined(SUPPORT_RESUME_AFTER_POWERON) || defined(SUPPORT_RESUME_AFTER_OPENCLOSE) if ( !( __bFlowState & FLOW_KEEP_RESUME ) )#endif // #if defined(SUPPORT_RESUME_AFTER_POWERON) || defined(SUPPORT_RESUME_AFTER_OPENCLOSE) __dwResumeTime = 0;*///LJY1.05, per CoCo's request for module testing#ifdef AUTO_TEST CC_AutoTestInitial();#endif // LLY.100a, reset audio L/R status to STEREO mode __bModeChannel= AUDIO_STEREO; // DVD_274pMicky, let CHIPS do initial. //__bVocal= VOCAL_ON; // ** TCH1.54; Re-Init the value CHIPS_Initial(CHIPS_INIT_AC3KOKMODE); //Kevin0.90, fix "KEY UP/DOWN for other tiles and then play MP3 => no audio & OSD fails" CHIPS_Initial(CHIPS_INIT_KEY); // wyc.170, initial the de-emohasis variable __bHALDeEmphasis = FALSE; __bAudioType = HAL_AUDIO_NONE; //Kevin2.37-2 // wyc.pro clear the program array and variables LINEAR_Program(LINEAR_PROGRAM_CLEAR, 0); UTL_ModeInitial ( MODE_OPENCLOSE ); __bModePlay= MODE_PLAYUNKNOW; // wyc1.25-2, initial this value //LLY0.72, __bLastModePlay= MODE_PLAYUNKNOW; __bScan= SCAN_NONE; // LLY.275a, clear thumbnail mode __bThumbnailMode= FALSE;#ifndef NO_DISC_MODE //Aron2.17-909S, config DVD information buffer address __dwFWBufUsedSize = DVD_InfoBufSet(DS_FW_BUFFER_ST, (DS_FW_BUFFER_END - DS_FW_BUFFER_ST)); __bDomain= STOP_DOM; __wChapter= 1; __bTitle= 1; // DVD_161Micky, fix SVCD-> can't pause { extern BYTE __bStillTime; // record the Still Time (0: NONE, 0xFF: Infinite; Other: seconds.) extern BYTE __bVOBUStill; __bVOBUStill=FALSE; __bStillTime=0; } //Aron2.31-909R, add for init navigation error concealment parmaters NV_SetErrorConParm(MAXLOADVTSFAILTCNT, SERVOREADYTIMEOUT);#endif // #ifndef NO_DISC_MODE // ** S-TCH; Reset Some __bASTNO = __bASTN = __bASTID = 0; // ** TCH0.451; __bSPSTNO = __bSPSTN = __bSPSTID = 0; // ** TCH0.451; // Chuan0.75, Initial SP2 ID & NO __bSPST2NO = 0; __bSPST2ID = 0xFF; __wDiscType= NO_DISC_IN_DRIVE; // ** LLY.043, remove from above code // LLY.161, clear CDDA format to unknown while open/close __bCDDA_DTS=CDDA_UNKNOWN; // DVD_099Micky, clear repeat status as repeat none // LLY0.80, it's un-necessary to call OSD_Output() w/ zero time-out to clear message // Since OSD moudle will provide OSD_NormalMode() to handle it. // LLY2.38, porting CoCo's code not to reset repeat mode value while support image frame setup#ifndef REPEAT_MODE_REF_SETUP_INFO __bRepeat=REPEAT_NONE;#endif // #ifndef IMAGE_FRAME_SETUP //OSD_OUTPUT_MACRO(MSG_REPEAT, __bRepeat, 0); __btMute= FALSE; //OSD_OUTPUT_MACRO(MSG_MUTE, FALSE, 0);#ifndef NO_DIGEST __btDIGEST= FALSE;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -