📄 cc.bak.c
字号:
// Micky1.22, reference audio remainder?
/*
// Micky1.11, define one variable for CELL reference
BYTE __bEnableAntiShock;
*/
// Micky1.23 support resume info from EEPROM
BYTE _bAPPAction;
//LJY1.23, LJY1.11d, for antishock reset recover
#ifdef SUPPORT_ANTISHOCK
BIT __btResetBuffer;
DWORD __dwTimeRecover;
#endif
// ** TCH1.24a; Move Some APIs to this files. It's a extenstion of CC Module
/*
void _ShowDebug ()
void _CC_DebugInfo(DWORD dwVal, BYTE bSec)
BYTE _AutoVocal(BYTE bValidKey)
void _CC_ShowIRMap()
void _CC_AutoTest(void)
void CC_AutoTestInitial(void)
BOOL CC_Initial ()
void CC_SendKey ( BYTE bKey )
*/
#include "cc1.c"
#ifdef SUPPORT_DVD_T
//Kevin1.24aDVD_T, TRUE: SERVO_Seek/No load font table & bitmap/Restore TOC, for use when STB->DVD; FASLE: SERVO_Reset/load font table & bimap/re-read TOC
BYTE __bReduceSTBtoDVDtime;
//Kevin1.25, reserve a absolute DWORD (STB will not use) for the decision of __bReduceSTBtoDVDtime flag
DWORD xdata __dwReservedDWORD _at_ 0xa000;
#endif
// CoCo2.32
#ifdef SUPPORT_TUNE_DRAM_CLOCK_PHASE //CoCo2.32, add the code to support tuning the DRAM clock phase.
DWORD __dwDRAMClockPhaseValue;
extern BYTE _bVolDisplayed;
#endif
// Ming2.36, support multi-disc resume from EEPROM.
#ifdef SUPPORT_RESUME_FROM_EEPROM
// Use __pbDiscUID to save the unique ID for every VCD and DVD.
BYTE __pbDiscUID[3];
#endif
// Micky1.24b_power_off
DWORD __dwPreRSM;
//jyliu.scan, fix SCB/SCF time incorrect issue
#ifdef SUPPORT_ANTISHOCK
BYTE __bScanTime=0;
DWORD __dwScanTime;
#endif
// *********************************************************************
// Function : main ()
// Description : The Firmware Entry point
// Arguments : NONE
// Return : NONE
// Side Effect : What ???
// *********************************************************************
//ccc begin
#ifdef SYSTEM_8051
main ()
#else
void CC_Trigger()
#endif
{
BYTE bValidKey;
// Brian.276-5, for system hang control
// initialize the progress count to 0
__dwProgressCount = 0;
//Micky2.80, review global variables init
_dwTimerCount_MainLoop=0;
// wyc1.25, add one variable to record flow when detected as wrong disc for debug usage,
__bTestFlow = 0;
// ==============================================================
/// Power On Initialization
/// Only need do it once for System.
// ==============================================================
#ifdef SYSTEM_8051 // only system will use
INITIAL_System(INITIAL_SYSTEM | HARDWARE_SHUTDOWN);
//alex1.26,20040527, Seperate DRAM SCAN and Dram Read Write Test
//alex1.26-2,move CC_ScanDramPowerOn, before NITIAL_PowerONStatus to reduce time
//-------------------------------------//
#if defined (SUPPORT_TEST_SINGLE_MUTI_RW_FOR_BANK) || defined (SUPPORT_DRAM_SCAN_POWERON) ////alex908
CC_ScanDramPowerOn();
#endif //#ifdef SUPPORT_TEST_SINGLE_MUTI_RW_FOR_BANK
//-------------------------------------//
// DVD_100Micky, merge I/R power on sequence with h/w power on.
INITIAL_PowerONStatus(INITIAL_POWER_HARDWARE);
#endif //#ifdef SYSTEM_8051
// The main monitor loop in player.
// Program will always run in this loop except real Power-ON.
#ifdef SYSTEM_8051
while ( 1 )
#endif //#ifdef SYSTEM_8051
{
// Brian.276-5, for system hang control
// update the progress count
__dwProgressCount = UTL_GetSysTimer();
// ==============================================================
/// Section[1] : Polling the data in Rx buffer.
/// Comments : SYSDEBUG need to be active always
/// : Must be put before 1st position that will leave the main loop.
// ==============================================================
// User presses AutoUpgrade button-> SYSDEBUG_Poll will issue KEY_STOP
// After the KEY_STOP is done, SYSDEBUG_Poll will set _bAutoUpgrade
// During the upgrade, none of the flow can be activated.
#ifdef SERIAL_DEBUG
do
{
SYSDEBUG_Poll(); //coco.sd
} while (_bAutoUpgrade);
#endif
// Micky1.05, add auto test for IC sorting by CoCo
#ifdef AUTO_TEST
_CC_AutoTest();
#endif
/// End Of Section[1] : Polling the data in Rx buffer.
// ==============================================================
/// Section[2] : Show IR Key codes
/// : To display the IR Key code before the key was processed
// ==============================================================
#ifdef _SHOW_IR_MAP
{
void _CC_ShowIRMap();
_CC_ShowIRMap();
}
#endif //#ifdef _SHOW_IR_MAP
/// End Of Section[2] : Show IR Key codes
// ==============================================================
/// Section[3] : Process the input Key
/// : Process the IR input key or F/W key.
/// 3.1) When key is from IR, will transfer the key to proper value,
/// and do OSD message map.
// ==============================================================
// check F/W generate key or IR Key
// BTW, only the key from IR need doing _CC_PreProcessKey.
// LLY2.37p, need to process the input key while IR key or F/W key exist
// if ( __bISRKey != KEY_NO_KEY )
if( __bISRKey != KEY_NO_KEY || __bFWKey != KEY_NO_KEY)
{
// LLY2.37p, collect all procedure for decide the final processing key, key source ... into the API
// And, clear the un-reference key variable
// Notice: F/W key is high priority than ISR key
/*
// DVD_099cMicky, record if the key is from IR
// when key ise received by IR or keypad, it will be set.
if (__bISRKeyRead )
{
__bKeySource = KEY_FROM_ISR;
__bISRKeyRead=FALSE;
}
else
__bKeySource = KEY_FROM_FW;
__bKey= __bISRKey;
__bISRKey= KEY_NO_KEY; // Set it; means __bISRKey is being processed.
*/
#ifdef YHTANG_DEBUG
// _printf("\n cc.c get isr key 0x%x",(WORD)__bISRKey);
#endif
_CC_AssignActionKey();
bValidKey=KEY_ACCEPT;
//Alex1.25,20040312,SUPPORT_TEST_SINGLE_MUTI_RW_FOR_BANK
// after scan DRAM, user can open tray-> put autoupgrade disc-> close
//---------------------------------------------------//
#ifdef SUPPORT_TEST_SINGLE_MUTI_RW_FOR_BANK
{
void _CC_ProcessDRAMScanKey();
_CC_ProcessDRAMScanKey();
}
if (__bKey != KEY_OPEN_CLOSE)
{
__bKey= KEY_NO_KEY;
}
#endif//#ifdef SUPPORT_TEST_SINGLE_MUTI_RW_FOR_BANK
//--------------------------------------------------//
if(__bKey==KEY_FREEZE)
{
__bKey=KEY_NO_KEY;
#ifdef YHTANG_DEBUG
_printf("\n get key_freeze");
#endif
}
#ifdef SUPPORT_PORTABLE_PROJECT
__bKeyInputEnable=TRUE; // Added for portable, KCHong, 20031117
#endif
// DVD_099cMicky, support show OSD only when IR key is pressed
// Only key from IR need do key transfer
if (__bKeySource==KEY_FROM_ISR)
{
#ifndef NO_SCREEN_SAVER
// LLY.040-1, wake up form screen saver mode
// LLY.042, recover to OSD font mode only when _OSD_ShowBitmap has been called
// to avoid "OSD flash" problem in "Stop --> any key press"
// only when I/R key is received, need release screen saver.
if ( __bScreenSaver!=NONE_SCREEN_SAVER )
{
MONITOR_SCRSleep(FALSE); // LLY.099, merge all control to this function
}
#endif // #ifndef NO_SCREEN_SAVER
//Kevin0.86, process keys for GDI mode Virtual IR/Program mode UI
#ifdef SUPPORT_VIRTUAL_IR
__bKey=OSDVIR_ProcessKey(__bKey);
#endif //#ifdef SUPPORT_VIRTUAL_IR
#ifdef CT908_UI
//Kevin1.10, all disc use same program UI when SUPPORT_SIMPLE_GM_PROGRAM is defined
// otherwise, CDROM_M1 use itself program UI
//
if ( __btInputProgram
#ifndef SUPPORT_SIMPLE_FM_PROGRAM
&& !(__wDiscType & CDROM_M1)
#endif
)
__bKey=OSDPRGM_ProcessKey(__bKey);
#endif //#ifdef CT908_UI
/// 3.1) When key is from IR, will transfer the key to proper value,
/// and do OSD message map.
// Can transfer the KEY to the actual operation KEY
#ifdef TFT_CONTROL
__bKey = _TFT_ProcessKey(__bKey);
#endif
bValidKey = _CC_PreProcessKey ();
#ifdef SHOW_IR_KEY_OSD_ONLY
// Micky2.81, only do key message mapping from INPUT_KEY_GROUP2
// composite keys are not included.
// MIcky2.31, reduce codes.
// only support Group2~7.
if ( (bValidKey==KEY_ACCEPT) && (__bKey >= INPUT_KEY_GROUP2) && (__bKey < INPUT_KEY_GROUP8) )
{
__bKeyMessage=_bMessageMap[__bKey-INPUT_KEY_GROUP2];
#ifdef SAME_FAST_AS_SCF2 // must use as KEY_SCF
if (__bKey==KEY_FF)
__bKeyMessage=_bMessageMap[KEY_SCF-INPUT_KEY_GROUP2];
#endif //#ifdef SAME_FAST_AS_SCF2 // must use as KEY_SCF
}
#else //#ifndef SHOW_IR_KEY_OSD_ONLY
__bKeyMessage=MSG_ALL;
#endif //#ifndef SHOW_IR_KEY_OSD_ONLY
} // if (__bKeySource==KEY_FROM_ISR)
} // if ( __bISRKey != KEY_NO_KEY || __bFWKey != KEY_NO_KEY)
#ifdef SUPPORT_ANTISHOCK //Kevin2.37-2
if (__bWrongPartNo)
{
CT_strcpy(__bMsgString, "Wrong Part No");
OSD_Output(MSG_STRING, NULL, 0xff);
#ifdef SUPPORT_PORTABLE_DVD_TOP_LOADING
if (__TopOpening==FALSE)
__bKey = KEY_STOP;
#else
if (!__btDriveOpen)
__bKey = KEY_OPEN_CLOSE;
#endif
else
__bKey = KEY_NO_KEY;
}
#endif
// DVD_172Micky, just process the key, no matter it's from ISR of F/W.
// the bValidKey is decided by _CC_PreProcessKey or _AutoVocal.
if ( __bKey != KEY_NO_KEY )
{
// DVD_101bMicky, reference KEY_ACCEPT/REJECT/IGNORE
if ( bValidKey == KEY_DISALLOW)
{
// DVD_172Micky, let it show invalid.Same flow as after CC_DoKeyAction
__bTemp = INVALID_KEY;
}
else if ( bValidKey==KEY_ACCEPT)
{
// Micky2.81, re-arrange the sequence of XXX_ProcessKey and parameter
// LLY.277a-2, process the tuner mode key
// Notice: Must put this procedure before THUMBNAIL_Action() & FM_Processkey()
// Because, AMP relative is highest priority than thumbnail/ MP3 menu
#ifdef SUPPORT_AV_SYSTEM
__bKey=AVSYS_ProcessKey(__bKey);
#endif // #ifdef SUPPORT_AV_SYSTEM
#ifdef _WINDVD
#ifndef NO_SETUP
__bKey = SETUP_ProcessKey(__bKey);
#endif // ifndef NO_SETUP
#endif // _WINDVD
#ifdef SUPPORT_PSCAN_PROMPT_OSD
//Alex1.07a PSCAN PROMPT 20031013
// use OSDPROMPT_ProcessKey function to get the key
__bKey = OSDPROMPT_ProcessKey(__bKey);
#endif // SUPPORT_PSCAN_PROMPT_OSD
if (__bThumbnailMode)
__bKey = THUMBNAIL_ProcessKey(__bKey); //CoCo.jpeg
#ifndef NO_MP3
if (__wDiscType & CDROM_M1)
{
// MIcky2.80, remove 2nd parameter od FM_ProcessKey.
__bKey = FM_ProcessKey(__bKey);//, NULL);
}
#endif
#ifdef SUPPORT_BOOKMARK
_CC_ProcessBookMark ();
#endif //#ifdef SUPPORT_BOOKMARK
// Micky2.37, add CC_DVD_ProcessKey function
__bKey = CC_DVD_ProcessKey(__bKey);
// Micky2.37, add CC_VCD_ProcessKey function
__bKey = CC_VCD_ProcessKey(__bKey);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -