📄 osdfont1.c
字号:
#include "winav.h"#include "w99av.h"#include "OSD.h"#include "input.h"#include "cc.h"#include "ucode.h" //Kevin2.37// Brian1.25#ifdef SUPPORT_FONT_TABLE_CHECKSUMWORD __wFontableChecksum;WORD OSD_FontableChecksum(void);#endif// Chuan1.20, Use OSD_LoadFontTable instead of OSD_LoadFontTableHDW/OSD_LoadFontTableLDW#ifdef SUPPORT_GZIP_COMPRESSION extern WORD _wOSDTemp; // Brian1.25extern void OSD_LoadFontTableGzip(void); // Brian1.25// Alan2.36 support Unicode#ifdef SUPPORT_UNICODEextern void OSD_LoadLocalFontTableGzip(void);#endif//Kevin2.30, add dummy const code for *.linBYTE code bDummyOSDFONT1;#else BYTE code aFontWidth_1[]={#include "fontwth.def"};BYTE code aCompressFont_l[]={#ifdef CT908_UI#include "encode.l"#else#include "encode.h"#endif};//LJY0.85, to invoke Service_420() while loading font table.// Brian1.07, use INPUT_PATH_HOSTIF to decide if support 420,#ifndef INPUT_PATH_HOSTIF extern void Service_420(void);#endif// Brian1.25extern void OSD_LoadFontTableHDW(void);//Kevin0.84, fill 908 font tableextern DWORD _dwAddr; // keep the region address which current display messageextern WORD _wOSDTemp, _wOSDTemp1;extern WORD _wStartPxl;extern BYTE _bOSDTemp, _bOSDTemp1;extern BYTE *_bpArray;extern BYTE DATA _bIdex;extern BYTE DATA _bPosiIndex;extern BYTE DATA _bItemInfoFormat;//extern BYTE _bShowTime; //--CoCo1.21, remove _bShowTimeextern IDATA WORD __wTemp;//extern WORD DATA _wNum; extern BYTE DATA _bNum;// Brian1.07 no need//#ifdef SHOW_POWERON_BAR //Xuli1.05//extern WORD __wPwrOnTimer; //trigger power-on bar timer//#endifBYTE _OSD_FillDatatoCache1();void _OSD_FillFontTabletoDRAM1(DWORD dwAddr, BYTE* pbArray);void OSD_LoadFontTableLDW(void){#ifndef NO_GDI _OSD_FillFontTabletoDRAM1(OSD_DRAM_FONT_TABLE_START_1, aCompressFont_l);#else _OSD_FillFontTabletoDRAM1(OSD_DRAM_FONT_TABLE1_START, aCompressFont_l);#endif} #ifdef SHOW_POWERON_BAR //Xuli1.05 Defined in OSDVP.cextern void OSD_TriggerPoweronBar(void);#endif//Kevin1.00, enhance decoding//Kevin0.84, fill 908 font tablevoid _OSD_FillFontTabletoDRAM1(DWORD dwAddr, BYTE* pbArray){#ifndef NO_OSD#define FONT_HEIGHT908 32extern BIT start_service_420; //LJY1.05, added //WORD _wFontNO; _wStartPxl=0; _bNum = 0; //_wNum = 0; //_wFontNO = sizeof(aFontWidth)/sizeof(BYTE); /////sizeof OK in 8051? __wTemp = sizeof(aFontWidth_1)/sizeof(BYTE); /////sizeof OK in 8051? // calculate the # of times needed to write a certain line for all fonts //_bOSDTemp= (__wTemp+63)/64; // 64 DWs in one DRAM block cache write (cache size=256Bytes) /////cache size=? for 908 _bOSDTemp= (__wTemp+63)>>6; // 64 DWs in one DRAM block cache write (cache size=256Bytes) //_wOSDTemp = __wTemp*4; // Chuan 172r 2002/03/19: Total Block Cache Size _wOSDTemp = __wTemp<<2; // calculate the # of bytes of each row within one font /////_bPosiIndex=_bOSDFontBytes/FONT_HEIGHT; //FONT_HEIGHT means HEIGHT_PER_FIELD here ///// // LLY.277a, it's unnecessary to calcaluate the starting address // Because, it will be set in next stage //_dwAddr=dwAddr; //for(_bShowTime=0; _bShowTime< FONT_HEIGHT; _bShowTime++) //for(_bShowTime=0; _bShowTime< 2*FONT_HEIGHT908; _bShowTime++) //High DW Half & then Low DW Half //for(_bShowTime=0; _bShowTime< FONT_HEIGHT908; _bShowTime++) //High DW Half or Low DW Half for(_bOSDTemp1=0; _bOSDTemp1< FONT_HEIGHT908; _bOSDTemp1++) //High DW Half or Low DW Half //CoCo1.21, remove _bShowTime {#ifdef SHOW_POWERON_BAR //Xuli1.05 Trigger power-on bar //if(((__dwCountSystem-__wPwrOnTimer)>POWERON_BAR_TRIGGER_TIME)&&(__wPwrOnTimer!=0)) if(((__dwCountSystem-__wTemp)>POWERON_BAR_TRIGGER_TIME)) // Brian1.07, use __wTemp instead __wPwrOnTimer is OK { OSD_TriggerPoweronBar(); //__wPwrOnTimer = __dwCountSystem; __wTemp = __dwCountSystem; // Brian1.07, use __wTemp instead __wPwrOnTimer is OK }#endif // #ifdef SHOW_POWERON_BAR // LLY2.37p, using general abort mainflow API instead of checking OPEN_CLOSE/ POWER key //if (__bISRKey == KEY_POWER || __bISRKey == KEY_OPEN_CLOSE) if(UTL_QueryCapability(QUERY_ABORT_MAINFLOW)) {//LJY1.10, for power-on standby mode, if user press KEY_POWER during loading font, then treat the KEY_POWER as for power-on. // Notice: loading font table action will be done after F/W assign KEY_POWER but not processing the key (not using Gzip case)#ifdef POWERON_STANDBY // LLY2.37p, remove __bISRKeyRead, because we will split IR and F/W key to __bISRKey and __bFWKey // So, it's un-necessary to reference it to decide input key source // extern BYTE __bISRKeyRead; if((__bISRKey == KEY_POWER))//&& __bISRKeyRead) __btPowerDown = TRUE;#endif // #ifdef POWERON_STANDBY start_service_420 = 0; //LJY1.05, disable service 420 to speed up POWER/OPEN_CLOSE response } // calculate the DRAM address for OSD font's next line //_dwAddr=dwAddr+ (DWORD)_bShowTime * 512L; // 512 means H/W always reserve 512 DW for a certain line //_dwAddr=dwAddr+ ((DWORD)_bShowTime << 9);#ifdef ADJUST_FONTABLE_SIZE _dwAddr=dwAddr+ ((DWORD)_bOSDTemp1 * (_wOSDTemp>>2) ); //Kevin2.30, * total font No#else _dwAddr=dwAddr+ ((DWORD)_bOSDTemp1 << 9); //CoCo1.21, remove _bShowTime#endif#ifdef SYSTEM_8051 // Step 0: disable Time0/ INT1 to avoid following procedure will be // destroyed by ISR// LJY0.85, there is no need to disable Timer0 INT, besides, servo needs the timer to be active. // ET0=0; // LLY.0992 EX1=0; // LLY.170#endif // #ifdef SYSTEM_8051//LJY0.85, to invoke Service_420() while loading font table.#ifndef INPUT_PATH_HOSTIF Service_420 () ;#endif // Step 1: clear CACK bit of PSR W99AV_ClearInterrupt(INT_CACK); // set bit(5)--CACKC in ISR // Step 2: Specify the desired DRAM address into CBAR[20:0] W99AV_OutCacheAddr(_dwAddr); // Step 3: Specify the # of bytes which will be moved from Cache to DRAM // into BMSR1 & BMSR0 W99AV_SetCacheRWNo(_wOSDTemp); // Step 4: Set Cache R/W mode=100 to assert an block write cache interrupt to RISC W99AV_SetCacheRWMode(0x04); for(_bItemInfoFormat=0,_wOSDTemp1=0; _bItemInfoFormat<_bOSDTemp; _bItemInfoFormat++) { // Step 5: Decompress Data and Write Data to Cache //if (_wNum) if (_bNum) goto REPEAT; while(1) { _bIdex=pbArray[_wStartPxl++]; if(_bIdex==0xD5) // Chuan 172r 2002/02/05: Check Recognize symbol { // Chuan 276 2002/09/09: Use v1.0 method. _bIdex = pbArray[_wStartPxl++]; _bNum = pbArray[_wStartPxl++]+1; //_wNum = (WORD) pbArray[_wStartPxl++] + 1;REPEAT: while(--_bNum) // Chuan 172r 2002/02/05: _wStartPxl records the repeat times. //while(--_wNum) { // calculate the # of bytes of each row within one font //////_bPosiIndex = aFontWidth_1[_wOSDTemp1>>2]>>2; //*2/8 /* //Low DW Half. the line hasn't been coded. //if ( (_bShowTime>=FONT_HEIGHT908) && (_wOSDTemp1%4)==0 && (_bPosiIndex<=4) ) if ( (_wOSDTemp1%4)==0 && (_bPosiIndex<=4) ) { ///_bNum++; //restore _wNum++; //if (_OSD_FillDatatoCache0()) // goto WAIT_ACK; //continue; } */ if ( !(_wOSDTemp1&0x3) ) { _bPosiIndex = aFontWidth_1[_wOSDTemp1>>2]>>2; //*2/8 if (_bPosiIndex<=4) //_wNum++; _bNum++; } if (_OSD_FillDatatoCache1()) goto WAIT_ACK; } } else { // calculate the # of bytes of each row within one font //////_bPosiIndex = aFontWidth_1[_wOSDTemp1>>2]>>2; //*2/8 /* //Low DW Half. the line hasn't been coded. //if ( (_bShowTime>=FONT_HEIGHT908) && (_wOSDTemp1%4)==0 && (_bPosiIndex<=4) ) if ( (_wOSDTemp1%4)==0 && (_bPosiIndex<=4) ) { _wStartPxl--; //restore //if (_OSD_FillDatatoCache0()) // goto WAIT_ACK; //continue; } */ if ( !(_wOSDTemp1&0x3) ) { _bPosiIndex = aFontWidth_1[_wOSDTemp1>>2]>>2; //*2/8 if (_bPosiIndex<=4) _wStartPxl--; //restore } if (_OSD_FillDatatoCache1()) goto WAIT_ACK; } } // Step 6: Waiting for Command acknowledge WAIT_ACK:#ifdef SUPPORT_ACKSTATUS __bW99AVACKStatus |= OSD_FILL_CFONTTABLE;#endif //LJY0.85, to invoke Service_420() while loading font table.#ifndef INPUT_PATH_HOSTIF Service_420 () ;#endif _W99AV_WaitACK(INT_CACK); }#ifdef SYSTEM_8051 // Step 7: enable Time0/ INT1 ET0=1; // LLY.0992 EX1=1; // LLY.170#endif // #ifdef SYSTEM_8051 } //LJY1.10, no need for poweron standby mode#ifndef POWERON_STANDBY start_service_420 = 1; //LJY1.05, enable service 420.#endif #endif // #ifndef NO_OSD}//Kevin0.84, fill 908 font table// ************************************************************************// Function : _OSD_FillDatatoCache1// Description : Fill OSD font table to Cache// Arguments : bData, specify the desired DRAM address to store FONT_TABLE// bNo, specify total char number in current font table// bByteNum, a point to BYTE array, ie. font table array// Return : TRUE, Cache Full or Data Completed// FALSE, Cache still non-full.// Side Effect :// ************************************************************************BYTE _OSD_FillDatatoCache1(){#ifndef NO_OSD /////#ifdef COMPRESSION_OSD_FONT /* //High DW Half if ( !bLowDW) { if (_bPosiIndex>4) _bPosiIndex=4; } */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -