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

📄 osdfont0.c

📁 车载电子影音系统dvd播放系统原程序代码
💻 C
📖 第 1 页 / 共 2 页
字号:
#include "winav.h"
#include "w99av.h"
#include "OSD.h"
#include "input.h"
#include "cc.h"


//Kevin1.00, if further declare _wOSDTemp1, _wStartPxl, _bOSDTemp, _bOSDTemp1, _bShowTim, __wTemp as DATA/IDATA, 
//           can reduce the fill font table time significantly
//Kevin0.84, fill 908 font table
extern  DWORD   _dwAddr; // keep the region address which current display message
extern  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 _bShowTime
extern  IDATA WORD    __wTemp;
//WORD    DATA    _wNum;
extern BYTE    DATA    _bNum; 

#ifdef SUPPORT_GZIP_COMPRESSION
WORD code _wOSDFont[]=
{
#include "fontable.txt"
};


// Chuan1.20, Use OSD_LoadFontTable instead of OSD_LoadFontTableHDW/OSD_LoadFontTableLDW
// ************************************************************************
//  Function    :   OSD_LoadFontTableGzip
//  Description :       Fill Font Table Data to DSP through IBFIFO
//  Arguments   :       none
//  Return      :       none
//  Side Effect :
// ************************************************************************
void OSD_LoadFontTableGzip(void) // Brian1.25
{
	//Kevin2.37, modify
	W99AV_FillDataToIABFIFO(_wOSDFont[1], &_wOSDFont[5]);
}                                      

//Kevin2,37, comment                        
/*
#ifdef SUPPORT_UNICODE
// Alan2.36, load local font table
// ************************************************************************
//  Function    :   OSD_LoadLocalFontTableGzip
//  Description :       Fill Font Table Data to DSP through IBFIFO
//  Arguments   :       none
//  Return      :       none
//  Side Effect :
// ************************************************************************
void OSD_LoadLocalFontTableGzip(void)
{


    //_dwAddr = FONTABLE_ADDR;
    //_wOSDTemp = (OSD_DRAM_FONT_TABLE_START_1 - OSD_DRAM_FONT_TABLE_START_0) << 1;
    //OSD_LoadLocalFontTable0(); //_dwAddr, _wOSDTemp);      // Load Font Table 0

}
#endif
*/


#else //#ifdef SUPPORT_GZIP_COMPRESSION

BYTE code aFontWidth_0[]=
{
#include "fontwth.def"
};

BYTE code aCompressFont_h[]=
{
#ifdef CT908_UI
#include "encode.h"
#else
#include "encode.l"
#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  

void OSD_LoadFontTableHDW(void);
BYTE _OSD_FillDatatoCache0();
void  _OSD_FillFontTabletoDRAM0(DWORD dwAddr, BYTE* pbArray);


void OSD_LoadFontTableHDW(void)
{
#ifndef NO_GDI
    _OSD_FillFontTabletoDRAM0(OSD_DRAM_FONT_TABLE_START_0, aCompressFont_h);
#else
    _OSD_FillFontTabletoDRAM0(OSD_DRAM_FONT_TABLE0_START, aCompressFont_h);
#endif

}            

#ifdef SHOW_POWERON_BAR //Xuli1.05 Defined in OSDVP.c
extern void OSD_TriggerPoweronBar(void);
#endif
  
//Kevin1.00, enhance decoding
//Kevin0.84, fill 908 font table
void  _OSD_FillFontTabletoDRAM0(DWORD dwAddr, BYTE* pbArray)
{
#ifndef  NO_OSD
#define     FONT_HEIGHT908         32
extern BIT start_service_420;   //LJY1.05, added.
	//WORD	_wFontNO;
	
    
	_wStartPxl=0;  
	_bNum = 0;
	//_wNum = 0;
	
    //_wFontNO = sizeof(aFontWidth)/sizeof(BYTE); 
    __wTemp = sizeof(aFontWidth_0)/sizeof(BYTE); 
    
    // 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) 
    _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 POWER/ OPEN_CLOSE
        //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   // #ifdef ADJUST_FONTTABLE_SIZE
        _dwAddr=dwAddr+ ((DWORD)_bOSDTemp1 << 9); //CoCo1.21, remove _bShowTime
#endif  // #ifdef ADJUST_FONTABLE_SIZE

#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_0[_wOSDTemp1>>2]>>2; //*2/8   
                        if ( !(_wOSDTemp1&0x3) )
                        {
                            _bPosiIndex = aFontWidth_0[_wOSDTemp1>>2]>>2; //*2/8   
                        }                         

                        //Low DW Half. the line hasn't been coded.
                        //if ( (_bShowTime>=FONT_HEIGHT908) && (_wOSDTemp1%4)==0 && (_bPosiIndex<=4) )
/*                        
                        if ( bLowDW && (_wOSDTemp1%4)==0 && (_bPosiIndex<=4) )
                        {
                            ///_bNum++; //restore 
							_wNum++;
                            //if (_OSD_FillDatatoCache1())
                            //    goto WAIT_ACK;
                            //continue; 
                        }                                     
*/                        
                        if (_OSD_FillDatatoCache0())
                            goto WAIT_ACK;
                    }
                }
                else
                {
                    // calculate the # of bytes of each row within one font
                    //////_bPosiIndex = aFontWidth_0[_wOSDTemp1>>2]>>2; //*2/8    
                

⌨️ 快捷键说明

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