?? osddraw.c
字號:
twdWr_Burst_D(cAttribute);
twdWr_Burst_P();
}
void OSDShowVideoData(void)
{
#ifdef T112
uCHAR gauge_y =cTotal+1;
#else
uCHAR gauge_y =cTotal+2;
#endif
switch(m_cOSDFunc){
case idBRIGHTMENU:
OSDDrawGauge(EepVideo.cBright,V_BRIGHT_MAX,0,gauge_y,COL_GAUGE);
OSDDrawNum(EepVideo.cBright,V_BRIGHT_MAX,NUM_STAT,gauge_y,COL_TITLE,DRAW_BLANK|0x03);
break;
case idCONTRASTMENU:
OSDDrawGauge(EepVideo.cContrast,V_CONTRAST_MAX,0,gauge_y,COL_GAUGE);
OSDDrawNum(EepVideo.cContrast,V_CONTRAST_MAX,NUM_STAT,gauge_y,COL_TITLE,DRAW_BLANK|0x03);
break;
case idSHARPMENU:
OSDDrawGauge(EepVideo.cSharp,V_SHARP_MAX,0,gauge_y,COL_GAUGE);
OSDDrawNum(EepVideo.cSharp,0,NUM_STAT,gauge_y,COL_TITLE,DRAW_BLANK|0x03);
break;
case idSATMENU:
OSDDrawGauge(EepVideo.cSat,V_SAT_MAX,0,gauge_y,COL_GAUGE);
OSDDrawNum(EepVideo.cSat,V_SAT_MAX,NUM_STAT,gauge_y,COL_TITLE,DRAW_BLANK|0x03);
break;
case idHUEMENU:
OSDDrawGauge(EepVideo.cHue,V_HUE_MAX,0,gauge_y, COL_GAUGE);
OSDDrawNum(EepVideo.cHue,V_HUE_MAX,NUM_STAT,gauge_y,COL_TITLE,DRAW_BLANK|0x03);
break;
#ifdef T112
case idRGBMENU: // add by Sherman 06'01'18
OSDDrawGauge(EepVideo.cRGB,V_RGB_MAX,0,gauge_y, COL_GAUGE);
OSDDrawNum(EepVideo.cRGB,0/*V_RGB_MAX*/,NUM_STAT,gauge_y,COL_TITLE,DRAW_BLANK|0x03);
break;
case idVCOMAMENU: // add by Sherman 06'01'23
OSDDrawGauge(EepVideo.cVCOMA,V_VCOMA_MAX,0,gauge_y, COL_GAUGE);
OSDDrawNum(EepVideo.cVCOMA,0,NUM_STAT,gauge_y,COL_TITLE,DRAW_BLANK|0x03);
break;
case idVCOMDMENU: // add by Sherman 06'01'23
OSDDrawGauge(EepVideo.cVCOMD,V_VCOMD_MAX,0,gauge_y, COL_GAUGE);
OSDDrawNum(EepVideo.cVCOMD,0,NUM_STAT,gauge_y,COL_TITLE,DRAW_BLANK|0x03);
break;
#endif
default: break;
}
}
/*
#ifdef AU_35
#define GAUGE_TOTAL_FONT_L 10 //Long
#else
#define GAUGE_TOTAL_FONT_L 25 //Long
#endif
*/
#ifdef _160_234
#define GAUGE_TOTAL_FONT_L 20 // for test by Sherman 06'02'08 //10 //Long
#else
#define GAUGE_TOTAL_FONT_L 25 //Long
#endif
void OSDDrawGauge(uCHAR cVal, uCHAR cMax, uCHAR x, uCHAR y, uCHAR cColor)
{
int index,i,j;
int step_size=100/GAUGE_TOTAL_FONT_L;
OSDSetRamAddr(MENU_RAM_START_ADDRESS+((int)y<< 5)+x);
twdWr_Burst_A(OSD_RAM_DL); // Write OSD index
index= (int)cVal*GAUGE_TOTAL_FONT_L/(int)cMax;
for(i=0;i<index;i++){
twdWr_Burst_D(1);//34); // full
twdWr_Burst_D(cColor);
}
j=((int)cVal*100/(int)cMax)-index*step_size;
j=j/2;//2.5;
twdWr_Burst_D(j+2);//35); // residue
twdWr_Burst_D(cColor);
for(i=index+1;i<GAUGE_TOTAL_FONT_L;i++)
{
twdWr_Burst_D(2);//35); // empty
twdWr_Burst_D(cColor);
}
twdWr_Burst_P();
}
//Maximum three initiger, percentage
void OSDDrawNum(uWORD wVal, uCHAR cMax, uCHAR x, uCHAR y, uCHAR cColor, uCHAR cAttr)
{
//Init Part
uCHAR cTemp;
if(cMax!=0)
{
m_wBuff[0]=(unsigned long)wVal*100;
m_wBuff[0]=m_wBuff[0]/cMax;
}
else //Non percentage
{
m_wBuff[0]=wVal;
}
if(m_wBuff[0]<10)
m_cBuff[1]=1;
else if(m_wBuff[0]<100)
m_cBuff[1]=2;
else
m_cBuff[1]=3;
OSDSetRamAddr(MENU_RAM_START_ADDRESS+((int)y << 5)+x);
twdWr_Burst_A(OSD_RAM_DL); // Write OSD index
if((cAttr&0xF0)==DRAW_BLANK)
{
switch(m_cBuff[1]){
case 1:
if((cAttr&0x0F)==3||(cAttr&0x0F)==2)
{
twdWr_Burst_D(BLANK);
twdWr_Burst_D(cColor);
}
case 2:
if((cAttr&0x0F)==3)
{
twdWr_Burst_D(BLANK);
twdWr_Burst_D(cColor);
}
}
}
else if((cAttr&0xF0)==DRAW_ZERO)
{
switch(m_cBuff[1]){
case 1:
if((cAttr&0x0F)==3||(cAttr&0x0F)==2)
{
twdWr_Burst_D('0'-IndexNumOffset);
twdWr_Burst_D(cColor);
}
case 2:
if((cAttr&0x0F)==3)
{
twdWr_Burst_D('0'-IndexNumOffset);
twdWr_Burst_D(cColor);
}
}
}
while(m_cBuff[1]>0)
{
if(m_cBuff[1]==3)
cTemp=m_wBuff[0]/100;
else if(m_cBuff[1]==2)
cTemp=(m_wBuff[0]%100)/10;
else if(m_cBuff[1]==1)
cTemp=m_wBuff[0]%10;
OSDNumConvert(cTemp);
twdWr_Burst_D(cColor );
m_cBuff[1]--;
}
twdWr_Burst_P();
}
void OSDNumConvert(uCHAR cNum)
{
switch(cNum){
case 9: twdWr_Burst_D('9'-IndexNumOffset); break;
case 8: twdWr_Burst_D('8'-IndexNumOffset); break;
case 7: twdWr_Burst_D('7'-IndexNumOffset); break;
case 6: twdWr_Burst_D('6'-IndexNumOffset); break;
case 5: twdWr_Burst_D('5'-IndexNumOffset); break;
case 4: twdWr_Burst_D('4'-IndexNumOffset); break;
case 3: twdWr_Burst_D('3'-IndexNumOffset); break;
case 2: twdWr_Burst_D('2'-IndexNumOffset); break;
case 1: twdWr_Burst_D('1'-IndexNumOffset); break;
case 0: twdWr_Burst_D('0'-IndexNumOffset); break;
default: break;
}
}
//Ruby add 2004-06-08
extern uCHAR idata m_cScaleratio;
void OSDShowRatio(void)
{
uCHAR i;
for(i=0;i<10;i++)
{
OSDCleanLine(0,i,0,30);
OSDSetLineAttribute(i,0x80);
}
OSDPosition(RIGHT_TOP);
switch(m_cScaleratio)
{
case ScaleFULL:
OSDShowLine(iScaleFULL,16,1,COL_GAUGE,OSD_LENGTH);
break;
case Scale16_9:
OSDShowLine(iScale16_9,16,1,COL_GAUGE,OSD_LENGTH);
break;
#if (ZOOM_MODES >=2)
case ZOOM_1:
OSDShowLine(iZoom_1,16,1,COL_GAUGE,OSD_LENGTH);
break;
#endif
#if (ZOOM_MODES >=3) //Bruce, 2006/01/10
case ZOOM_2:
OSDShowLine(iZoom_2,16,1,COL_GAUGE,OSD_LENGTH);
break;
#endif
#if (ZOOM_MODES >=4)
case Scale4_3:
OSDShowLine(iScale4_3,16,1,COL_GAUGE,OSD_LENGTH);
break;
#endif
#if (ZOOM_MODES >=5)
case ZOOM_3:
OSDShowLine(iZoom_3,16,1,COL_GAUGE,OSD_LENGTH);
break;
#endif
#if (ZOOM_MODES >=6)
case ZOOM_4:
OSDShowLine(iZoom_4,16,1,COL_GAUGE,OSD_LENGTH);
break;
#endif
#if (ZOOM_MODES >=7)
case ZOOM_5:
OSDShowLine(iZoom_5,16,1,COL_GAUGE,OSD_LENGTH);
break;
#endif
#if (ZOOM_MODES >=8)
case ZOOM_6:
OSDShowLine(iZoom_6,16,1,COL_GAUGE,OSD_LENGTH);
break;
#endif
#if (ZOOM_MODES >=9)
case ZOOM_7:
OSDShowLine(iZoom_1,16,1,COL_GAUGE,OSD_LENGTH);
break;
#endif
/*#ifdef T515
case Scale1_1:
OSDShowLine(iScale1_1,16,1,COL_GAUGE,OSD_LENGTH);
break;
#endif*/
}
OSDEnable();
/*
uCHAR i;
for(i=0;i<8;i++)
{
OSDCleanLine(0,i,0,30);
OSDSetLineAttribute(i,0x80);
}
OSDPosition(RIGHT_TOP);
switch(m_cScaleratio)
{
case ScaleFULL:
OSDShowLine(iScaleFULL,16,1,COL_GAUGE,OSD_LENGTH);
break;
case Scale16_9:
OSDShowLine(iScale16_9,16,1,COL_GAUGE,OSD_LENGTH);
break;
case Scale4_3:
OSDShowLine(iScale4_3,16,1,COL_GAUGE,OSD_LENGTH);
break;
}
OSDEnable();
*/
}
void OSDShowSource(void)
{
uCHAR i;
// add by kenny on 941115
OSDDisable();
//=========================
for(i=0;i<10;i++)
{
OSDCleanLine(0,i,0,30);
OSDSetLineAttribute(i,0x80);
}
OSDPosition(RIGHT_TOP);
OSDShowLine(OSDSource[m_cSource-1],16,1,COL_GAUGE,OSD_LENGTH);
OSDEnable();
}
extern uCHAR idata m_cStandard;
void OSDShowNTSC_PAL(void)
{
uCHAR i;
// add by kenny on 941115
OSDDisable();
for(i=0;i<10;i++)
{
OSDCleanLine(0,i,0,30);
OSDSetLineAttribute(i,0x80);
}
OSDPosition(RIGHT_TOP);
//=======================
if(m_cStandard==S_PAL) OSDShowLine(iPAL ,16,1,COL_GAUGE,OSD_LENGTH);
else if(m_cStandard==S_NTSC) OSDShowLine(iNTSC ,16,1,COL_GAUGE,OSD_LENGTH);
else if(m_cStandard==S_SECAM) OSDShowLine(iSECAM ,16,1,COL_GAUGE,OSD_LENGTH);
// add by Sherman 06'01'26
#ifdef OtherSignals
else if(m_cStandard==S_NTSC_4) OSDShowLine(iNTSC_4,16,1,COL_GAUGE,OSD_LENGTH);
else if(m_cStandard==S_PAL_M) OSDShowLine(iPAL_M ,16,1,COL_GAUGE,OSD_LENGTH);
else if(m_cStandard==S_PAL_CN) OSDShowLine(iPAL_CN ,16,1,COL_GAUGE,OSD_LENGTH);
#endif
OSDEnable();
}
void OSDClearCursor(void)
{
pOSDLangPtr=&MultiLangOSD[OSD_cOSDLang];
pOSDMenuPtr=pOSDLangPtr->osdMenuPtr;
OSDShowLine(pOSDMenuPtr[m_cOSDMenu-1][m_cOSDFunc-1].txtStr,TXT_STAT,m_cOSDFunc,COL_NORMAL,OSD_LENGTH);
return;
}
void OSDMoveCursor(void)
{
pOSDLangPtr=&MultiLangOSD[OSD_cOSDLang];
pOSDMenuPtr=pOSDLangPtr->osdMenuPtr;
OSDShowLine(pOSDMenuPtr[m_cOSDMenu-1][m_cOSDFunc-1].txtStr,TXT_STAT,m_cOSDFunc,BLUE_PURPLE,OSD_LENGTH);
return;
}
void OSDPosition(uCHAR cPos)
{
if(cPos==RIGHT_TOP){
OSDCfgWr(CHAR_DLY_0,Y0RightTop); //V[10:8] bit 6-4; H[10:8] bit2-0 23 12
OSDCfgWr(CHAR_DLY_1,Y1RightTop); //H[7:0] 80 80
OSDCfgWr(CHAR_DLY_2,Y2RightTop); //v[7:0] 64 30
}
if(cPos==CENTER){
OSDCfgWr(CHAR_DLY_0,Y0Center); //V[10:8] bit 6-4; H[10:8] bit2-0
OSDCfgWr(CHAR_DLY_1,Y1Center); //H[7:0]
OSDCfgWr(CHAR_DLY_2,Y2Center); //v[7:0]
}
else if(cPos==LEFT_BOTTOM){//not define yet!
OSDCfgWr(CHAR_DLY_0,Y0LeftBottom); //V[10:8] bit 6-4; H[10:8] bit2-0
OSDCfgWr(CHAR_DLY_1,Y1LeftBottom); //H[7:0]
OSDCfgWr(CHAR_DLY_2,Y2LeftBottom); //v[7:0] //00
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -