📄 osddraw.lst
字号:
208 1 OSDMoveCursor();
209 1 OSDEnable();
210 1 }
C51 COMPILER V8.08 OSDDRAW 11/08/2007 00:32:37 PAGE 5
211
212 void OSDSetLineAttribute(uCHAR cLine,uCHAR cAttribute)
213 {
214 1 OSDSetRamAddr(MENU_RAM_START_ADDRESS+((int)cLine << 6)+OSD_LENGTH);
215 1 twdWr_Burst_A(OSD_RAM_DL); // Write OSD index
216 1 twdWr_Burst_D(0);
217 1 twdWr_Burst_D(cAttribute);
218 1 twdWr_Burst_P();
219 1 }
220
221
222 #ifdef lucy_edition
#ifdef TV //lucy for tv add
extern bit m_bTV_Num_Bits;
void OSDShowTV_Num(uCHAR cTemp)
{
uCHAR cTemp1;
OSDExit();
OSDPosition(RIGHT_TOP);
cTemp1=I2CReadByte(EEPVIDEOBLOCK, idVIDEO_FLAG_INDEX)&0x06;
OSDSetRamAddr(MENU_RAM_START_ADDRESS+((int)1<<6)+19);
twdWr_Burst_A(OSD_RAM_DL);
switch((cTemp|cTemp1))
{
case 0: OSDNumConvert(m_cTV_Num);
twdWr_Burst_D(COL_NORMAL);//Kuo
break;
case 2: if(m_bTV_Num_Bits)
{
OSDNumConvert(m_cTV_Num/10);
twdWr_Burst_D(COL_NORMAL);
OSDNumConvert(m_cTV_Num%10);
twdWr_Burst_D(COL_NORMAL);
}
else
{
OSDNumConvert(m_cTV_Num);
twdWr_Burst_D(COL_NORMAL);
twdWr_Burst_D(0x1B);
twdWr_Burst_D(COL_NORMAL);
}
break;
case 4: OSDNumConvert(1);
twdWr_Burst_D(COL_NORMAL);
if(m_bTV_Num_Bits)
{
OSDNumConvert((m_cTV_Num%100)/10);
twdWr_Burst_D(COL_NORMAL);//Kuo
OSDNumConvert(m_cTV_Num%10);
twdWr_Burst_D(COL_NORMAL);//Kuo
}
else
{
OSDNumConvert(m_cTV_Num%10);
twdWr_Burst_D(COL_NORMAL);//Kuo
twdWr_Burst_D(0x1B);
twdWr_Burst_D(COL_NORMAL);//Kuo
}
break;
case 6:if(cTemp1==4)
{
C51 COMPILER V8.08 OSDDRAW 11/08/2007 00:32:37 PAGE 6
OSDNumConvert(1);
twdWr_Burst_D(COL_NORMAL);//Kuo
twdWr_Burst_D(0x1B);
twdWr_Burst_D(COL_NORMAL);
twdWr_Burst_D(0x1B);
twdWr_Burst_D(COL_NORMAL);
}
else if(cTemp1==2)
{
twdWr_Burst_D(0x1B);
twdWr_Burst_D(COL_NORMAL);
twdWr_Burst_D(0x1B);
twdWr_Burst_D(COL_NORMAL);
}
else
{
twdWr_Burst_D(0x1B);
twdWr_Burst_D(COL_NORMAL);
}
}
}
void OSDShowRESET(bit bTemp)
{
if(bTemp)
{
OSDShowLine(iBlankLine,0,6,COL_TITLE,OSD_LENGTH);
OSDShowLine(iRecall_E,3,6,COL_TITLE,OSD_LENGTH);
OSDShowLine(iOK,19,6,COL_TITLE,OSD_LENGTH);//Kuo
}
else
{
OSDShowLine(iBlankLine,0,6,COL_TITLE,OSD_LENGTH);
OSDShowLine(iRecalling_E,3,6,COL_TITLE,OSD_LENGTH);//Kuo
}
}
#endif
#endif
310
311
312
313
314 #ifdef _160_234
#define GAUGE_TOTAL_FONT_L 20 //10 //Long
#else
317 #define GAUGE_TOTAL_FONT_L 25 //Long
318 #endif
319
320 void OSDShowItem(uCHAR *str, uCHAR x,uCHAR y)
321 {
322 1 if(str !=NULL)
323 1 OSDShowLine(str,x,y,COL_GAUGE,OSD_LENGTH);
324 1 return;
325 1 }
326
327 void OSDDrawGauge(uCHAR cVal, uCHAR cMax, uCHAR x, uCHAR y, uCHAR cColor)
328 {
329 1 int index,i,j;
330 1 int step_size=100/GAUGE_TOTAL_FONT_L;
331 1
332 1 OSDSetRamAddr(MENU_RAM_START_ADDRESS+((int)y<< 6)+x);
333 1 twdWr_Burst_A(OSD_RAM_DL); // Write OSD index
334 1 index= (int)cVal*GAUGE_TOTAL_FONT_L/(int)cMax;
C51 COMPILER V8.08 OSDDRAW 11/08/2007 00:32:37 PAGE 7
335 1 for(i=0;i<index;i++){
336 2 twdWr_Burst_D(Gauge_Full);
337 2 twdWr_Burst_D(cColor);
338 2 twdDelay(1);
339 2 }
340 1 j=((int)cVal*100/(int)cMax)-index*step_size;
341 1 j=j/2; // 2. 5;
342 1
343 1
344 1 //twdWr_Burst_D(Gauge_Empty+j);
345 1
346 1
347 1 //twdWr_Burst_D(cColor);
348 1
349 1 for(i=index+1;i<GAUGE_TOTAL_FONT_L;i++)
350 1 {
351 2 twdWr_Burst_D(Gauge_Empty);
352 2 twdWr_Burst_D(cColor);
353 2 twdDelay(1);
354 2 }
355 1 twdWr_Burst_P();
356 1
357 1
358 1 }
359
360 //Maximum three initiger, percentage
361 void OSDDrawNum(uWORD wVal, uCHAR cMax, uCHAR x, uCHAR y, uCHAR cColor, uCHAR cAttr)
362 {
363 1 //Init Part
364 1 uCHAR cTemp;
365 1 if(cMax!=0)
366 1 {
367 2 m_wBuff[0]=(unsigned long)wVal*100;
368 2 m_wBuff[0]=m_wBuff[0]/cMax;
369 2 }
370 1 else //Non percentage
371 1 {
372 2 m_wBuff[0]=wVal;
373 2 }
374 1
375 1 if(m_wBuff[0]<10)
376 1 m_cBuff[1]=1;
377 1 else if(m_wBuff[0]<100)
378 1 m_cBuff[1]=2;
379 1 else
380 1 m_cBuff[1]=3;
381 1
382 1 OSDSetRamAddr(MENU_RAM_START_ADDRESS+((int)y << 6)+x);
383 1 twdWr_Burst_A(OSD_RAM_DL); // Write OSD index
384 1
385 1 if((cAttr&0xF0)==DRAW_BLANK)
386 1 {
387 2 switch(m_cBuff[1]){
388 3 case 1:
389 3 if((cAttr&0x0F)==3||(cAttr&0x0F)==2)
390 3 {
391 4 twdWr_Burst_D(BLANK);
392 4 twdWr_Burst_D(cColor);
393 4 }
394 3 case 2:
395 3 if((cAttr&0x0F)==3)
396 3 {
C51 COMPILER V8.08 OSDDRAW 11/08/2007 00:32:37 PAGE 8
397 4 twdWr_Burst_D(BLANK);
398 4 twdWr_Burst_D(cColor);
399 4 }
400 3 }
401 2 }
402 1 else if((cAttr&0xF0)==DRAW_ZERO)
403 1 {
404 2 switch(m_cBuff[1]){
405 3 case 1:
406 3 if((cAttr&0x0F)==3||(cAttr&0x0F)==2)
407 3 {
408 4 twdWr_Burst_D('0'-IndexNumOffset);
409 4 twdWr_Burst_D(cColor);
410 4 }
411 3 case 2:
412 3 if((cAttr&0x0F)==3)
413 3 {
414 4 twdWr_Burst_D('0'-IndexNumOffset);
415 4 twdWr_Burst_D(cColor);
416 4 }
417 3 }
418 2 }
419 1
420 1
421 1 while(m_cBuff[1]>0)
422 1 {
423 2 if(m_cBuff[1]==3)
424 2 cTemp=m_wBuff[0]/100;
425 2 else if(m_cBuff[1]==2)
426 2 cTemp=(m_wBuff[0]%100)/10;
427 2 else if(m_cBuff[1]==1)
428 2 cTemp=m_wBuff[0]%10;
429 2
430 2 OSDNumConvert(cTemp);
431 2 twdWr_Burst_D(cColor );
432 2 m_cBuff[1]--;
433 2 }
434 1 twdWr_Burst_P();
435 1 }
436
437
438 void OSDNumConvert(uCHAR cNum)
439 {
440 1 switch(cNum){
441 2 case 9: twdWr_Burst_D('9'-IndexNumOffset); break;
442 2 case 8: twdWr_Burst_D('8'-IndexNumOffset); break;
443 2 case 7: twdWr_Burst_D('7'-IndexNumOffset); break;
444 2 case 6: twdWr_Burst_D('6'-IndexNumOffset); break;
445 2 case 5: twdWr_Burst_D('5'-IndexNumOffset); break;
446 2 case 4: twdWr_Burst_D('4'-IndexNumOffset); break;
447 2 case 3: twdWr_Burst_D('3'-IndexNumOffset); break;
448 2 case 2: twdWr_Burst_D('2'-IndexNumOffset); break;
449 2 case 1: twdWr_Burst_D('1'-IndexNumOffset); break;
450 2 case 0: twdWr_Burst_D('0'-IndexNumOffset); break;
451 2 default: break;
452 2 }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -