- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
UiVideoCommon.c
资源名称:SDK_M5661.rar [点击查看]
上传用户:hjhsjcl
上传日期:2020-09-25
资源大小:11378k
文件大小:6k
源码类别:
压缩解压
开发平台:
C++ Builder
- /*==========================================================================
- Copyright (c) 2004 ALi Corporation. All Rights Reserved
- File: UiVideo.c
- content: user interface for play module
- History: Created by Walace 2005/11/16
- ==========================================================================*/
- #define _UI_VIDEO_COMMON_H_
- #include <DP8051XP.H>
- #include "TypeDef.h"
- #include "Const.h"
- #include "Reg5661.h"
- #include "Common.h"
- #include "Key.h"
- #include "SaveSetting.h"
- #include "NandFlash.h"
- #include "Idma.h"
- #include "FileSystem.h"
- #include "UiCommon.h"
- #include "OLED.h"
- #include "IconDefine.h"
- #include "SysStrDef.h"
- #include "UiSysStr.h"
- #include "OledString.h"
- #include "UiPlayCommon.h"
- #include "UiVideoCommon.h"
- #include "UiVideo.h"
- //Walace060926#1 VideoResume start
- #include "Video.h"
- //#if(!_PM_VD_MENU_)
- //extern void CdbGetDbSector(void) large; //tne 2005/12/17
- //#endif
- #if(_PM_VD_LIST_)
- #include "UiVideoFileList.h"
- #endif
- //Walace060926#1 VideoResume end
- #if(SETTING_FOR_ICE_START)
- void UiVideoICEInit(void)
- {
- SettingForIceStart();
- //SM Clock
- obCLKSMDIVF=0x03;
- obCLKSMCTRL=0xB8;
- NandInit();
- FsInit();
- KeyInit();
- #if(!OLED_USE_SM_INTERFEACE)
- OledCtrlEn();
- obPARLCD = 0x31; //Select Parallel Mode & Give CS Hight
- obMODSEL2 |= LCD_PAR_EN; //LCD Parallel mode enable
- obCLKLCDCTRL |= (LCD_CLK_EN | LCD_CLK_3000); //LCD Enable & Set Clock 3MHz
- OledCtrlDis();
- #endif
- OledInit() ;
- FontTableInit();
- LoadStringTableIndex();
- LoadTransTableIndex();
- EnableTimer0();
- gxbDeviceMode = DEV_VIDEO;
- }
- #endif
- //Walace051218
- void UiVideoNormalCheck(void)
- {
- #if(UI_USE_AUTO_POWER_OFF)
- // #if(!PM_VIDEO) // not power save when video playing //Walace060504#4
- if(gxwAutoOff&SYS_PLAY_NOT_OFF_EN)
- // #endif
- {
- gxwAutoOffCounter=0;
- }
- #endif
- //Walace060926#1 VideoResume start
- if(VbusCheck(CHECK_VBUS_ON)) //Walace060901#2
- {
- gxbSettingBuffer[SETTING_NEXT_MODE]=SAVE_AND_USB;
- UiVideoSwitchModule(VIDEO_TO_SAVE);
- }
- //Walace060926#1 VideoResume end
- }
- //Walace060926#1 VideoResume start
- #if(1)
- void UiVideoSwitchModule(BYTE bModuleFlowState) large
- {
- WORD wNextModule;
- #if(_PM_VD_PLAY_)
- VideoEngineSetCmd(VIDEO_CMD_STOP);
- bModuleFlowState|=VIDEO_FROM_PLAY;
- #elif(_PM_VD_MENU_)
- bModuleFlowState|=VIDEO_FROM_MENU;
- #else
- bModuleFlowState|=VIDEO_FROM_FLIST;
- #endif
- SET_VD_MODULE_FLOW(bModuleFlowState);
- switch(GET_VD_MODULE_TO())
- {
- case VIDEO_TO_PLAY:
- wNextModule=PM_VIDEO;
- break;
- case VIDEO_TO_MENU:
- #if(_PM_VD_LIST_)
- wNextModule=PM_VIDEO_MENU;
- #elif(_PM_VD_PLAY_)
- wNextModule=PM_VIDEO_FLIST;
- #endif
- break;
- case VIDEO_TO_SAVE:
- if(gxbSettingBuffer[SETTING_NEXT_MODE]==SAVE_AND_POWER_OFF)
- {
- OLED_CLEAR_ALL(); // Walace051001
- //OledShowIcon(ICON_ALI_LOGO,11,9) ; //Icon AliLogo
- }
- #if(_PM_VD_LIST_)
- SwicthToSaveSetting();
- #endif
- case VIDEO_TO_FLIST_INIT:
- case VIDEO_TO_FLIST:
- wNextModule=PM_VIDEO_FLIST;
- break;
- }
- EA=0;
- obPMSIZE|=0x04;
- SetSysSpeed(VIDEO_MODULE_SWITCH_SPEED);
- LoadProgram(wNextModule,NORMAL_CODE);
- }
- #else
- void UiVideoSwitchSubModule(WORD wNextModule) large
- {
- EA=0;
- obPMSIZE|=0x04;
- #if(_PM_VD_LIST_)
- gxbModuleState=MODULE_FROM_PLAY_FLIST;
- #elif(_PM_VD_MENU_)
- gxbModuleState=MODULE_FROM_PLAY_MENU;
- #else
- gxbModuleState=MODULE_FROM_PLAYBACK;
- #endif
- SetSysSpeed(VIDEO_MODULE_SWITCH_SPEED);
- LoadProgram(wNextModule,NORMAL_CODE);
- }
- #if((!_PM_VD_MENU_)&&(!SETTING_FOR_ICE_START))
- void SwicthToSaveSetting(void) large
- {
- gxbSettingBuffer[SETTING_NEXT_MODE]=SAVE_AND_SEL_MODE;
- gxbLastErrCode=ERR_NO_ERROR;
- SaveSetting();
- }
- #endif
- #endif
- void VideoCommonInitial(void)
- {
- BYTE bTemp;
- //tne 2006/08/08 #1
- IE=0x83;
- #if(ICE_REAL_MODE) //vicky061001#2 Debug Play
- EnableTimer0();
- IE=0x83;
- #endif
- //gxbUiMenuMainStates=obDCV_INT_FLAG;
- #if(ENABLE_SD_FUNCTION&&SD_DET_USE_INT1) //Nick060808
- EX1=1;
- bTemp = obGPIO_INT_FLAG&obGPIO_INT_MASK;//use gbDdmCheck as temp, ok la
- if(bTemp&0x20)//gpiod5 // sd init flase anyway, even SD/MMC plug in
- gfSDinit = FALSE;
- bTemp=0;
- #endif
- SetSysSpeed(VIDEO_UI_SPEED); // Walace060801#1
- bTemp=obDCV_INT_FLAG; //Walace061225#1
- if((gxbModuleState&MODULE_SUB)==MODULE_NAND_RTN_RESOTRE) //Nick061120 //NandRestore
- return;
- #if(USE_SYS_STR_UNICODE)
- gxfSourceUnicode=STRING_TYPE_UNICODE;
- #else
- gxfSourceUnicode=STRING_TYPE_ASCII;
- #endif
- UiFileListFileType=UI_FILE_LIST_PLAYBACK;
- #if(SYS_USE_KEY_HOLD)
- gfLastKeyLocked=KEY_UNLOCK;
- #endif
- gxwAutoOffCounter=0;
- gxbLcdLimitCol=MAX_COLNUM;
- gxbPwOffCounter = 0;
- gxbBtyLowNum=0;
- OLED_DISP_MASK_INIT();
- //tne 2006/08/08 #1
- /*
- #if(SETTING_FOR_ICE_START|UI_USE_ALARM_DISPLAY)
- EX0=1;
- #endif
- EA=1;
- ET0=1;
- */
- }
- #if(0) //Walace060926#1 VideoResume start
- #if(!_PM_VD_MENU_)
- void VideoFileInit(void)
- {
- //Walace060629#2
- if(gbFsUnableUse)
- return;
- gpstFileIndex=&stUiFileListData; // global
- gpstFileIndex->pbFileName=gxbFileName;
- gpstFileIndex->pbLongFileName=gxbLongFileName;
- gpstFileIndex->bPathDepth=0;
- gpstFileIndex->dwDirStartSec=gxdwRoot;
- gpstFileIndex->dwDirSec[0]=gxdwRoot;
- gpstFileIndex->wDirOffset[0]=0;
- stPhoFileInf=stUiFileListData;
- gxbFileMode = VIDEO_FILE;
- #if(DRM_MODE_EN)
- UiSearchMtpPropFile();
- #else
- gxbExceptFileAttrib=(FILE_ATTR_LABEL|FILE_ATTR_SYSTEM|FILE_ATTR_HIDDEN);
- #endif
- CdbGetDbSector();
- UiGetFileListNum(); //determine gxwTotalFileInDir , gxwTotalDirInDir
- gxwFileNumInFileList =0;
- gxwTotalFileInAll=UiCountFileInDir(COUNT_ALL_PLAYBACK);
- gxwCurtFileInAll=0;
- gxwCurrentFileNum=gxwCurtFileInAll;
- gxwNumTotalFiles=gxwTotalFileInAll;
- stUiFileListData=stPhoFileInf; //restore to root
- gdwFileSector=0;
- gfDelFile = FALSE;
- gxbLongFileName[0]=STRING_TYPE_UNICODE;
- UiRndPlayInit();
- }
- #endif //Walace060926#1 VideoResume end
- #endif
- //Walace060712#1 start