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

📄 osdmenu.lst

📁 此程序为twell8806驱动程序
💻 LST
📖 第 1 页 / 共 5 页
字号:
 236   1              for (i=1; ;i++)
 237   1                      if( struct_InputSelection[i].Id==inputs )  break;
 238   1              len=strlen(struct_InputSelection[i].Name);
 239   1              WriteStringToAddr(OSDMENU_SUBADDR+MENU_WIDTH*(0+title)+OSD_INFO_SUB_X, struct_InputSelection[i].Name, len
             - ); 
 240   1      
C51 COMPILER V7.50   OSDMENU                                                               08/20/2007 10:23:32 PAGE 5   

 241   1              // Display ColorSystem
 242   1              #if defined( SUPPORT_PC ) || defined( SUPPORT_DTV )
 243   1              i = GetInputSelection();
 244   1              if( i==PC || i==DTV ){
 245   2                      len=strlen(GetPCInputSourceName());
 246   2                      WriteStringToAddr(OSDMENU_SUBADDR+MENU_WIDTH*(1+title)+OSD_INFO_SUB_X, GetPCInputSourceName(), len ); 
 247   2              }
 248   1              else
 249   1              #endif
 250   1              {
 251   2                      len=strlen(struct_VInputStd[GetVInputStdInx()].Name);
 252   2                      WriteStringToAddr(OSDMENU_SUBADDR+MENU_WIDTH*(1+title)+OSD_INFO_SUB_X, struct_VInputStd[GetVInputStdInx(
             -)].Name, len ); 
 253   2              }
 254   1              //IHF
 255   1              MeasureAndWait(3);
 256   1      
 257   1              ltoa_K(GetIHF(), mstr, 1);
 258   1              len=strlen(mstr);
 259   1              WriteStringToAddr(OSDMENU_SUBADDR+MENU_WIDTH*(2+title)+OSD_INFO_SUB_X, mstr, len ); 
 260   1      
 261   1              utoa(GetIVF(),mstr,10);
 262   1              len=strlen(mstr);
 263   1              WriteStringToAddr(OSDMENU_SUBADDR+MENU_WIDTH*(3+title)+OSD_INFO_SUB_X, mstr, len ); 
 264   1      
 265   1              //FWRev
 266   1              i = ReadEEP(EEP_FWREV_MAJOR);
 267   1              mstr[0] = i + '0';
 268   1              mstr[1] = '.';
 269   1              i = ReadEEP(EEP_FWREV_MINOR);
 270   1              mstr[2] = (i/0x10) + '0';
 271   1              mstr[3] = (i%0x10) + '0';
 272   1              mstr[4] = '\0';
 273   1              
 274   1              WriteStringToAddr(OSDMENU_SUBADDR+MENU_WIDTH*(4+title)+OSD_INFO_SUB_X, mstr, 4 ); 
 275   1      
 276   1      }
 277          
 278          
 279          //********************************************************************
 280          //
 281          //      Functions for BAR.
 282          //
 283          //********************************************************************
 284          #define VOLBAR_LENGTH 21+3
 285          void DisplayVolumebar(BYTE val)
 286          {
 287   1              CODE BYTE BAR_ROM_TABLE[] = {
 288   1                      0x01, // ...
 289   1                      0x02,0x02, // |..
 290   1                      0x05,0x05, // ||.
 291   1                      0x03, // |
 292   1                      0x04, // |||
 293   1              };
 294   1      
 295   1              BYTE i;
 296   1              BYTE Bar_str[VOLBAR_LENGTH]={ 0x04, 0x04, 0x04, 0x04, 0x04,
 297   1                                                                 0x04, 0x04, 0x04, 0x04, 0x04,
 298   1                                                                 0x04, 0x04, 0x04, 0x04, 0x04,
 299   1                                                                 0x04, 0x04, 0x04, 0x04, 0x04, 0x03,' ',' ',' ' };
 300   1              WORD addr;
 301   1              
C51 COMPILER V7.50   OSDMENU                                                               08/20/2007 10:23:32 PAGE 6   

 302   1              if(val < 100)
 303   1              {
 304   2                      Bar_str[val/5] = BAR_ROM_TABLE[val%5];
 305   2                      for(i = val/5 + 1; i < 20; i++)
 306   2                              Bar_str[i] = BAR_ROM_TABLE[0];
 307   2              }
 308   1      
 309   1              if( Bar_str[0] == 0x01 ) Bar_str[0] = 0x02;     // |..
 310   1      
 311   1              // Number
 312   1          Bar_str[23] = val % 10 + '0';    val /= 10;
 313   1          Bar_str[22] =  val % 10 + '0';    val /= 10;
 314   1          Bar_str[21] = val + '0';
 315   1              if( Bar_str[21] == '0' ) Bar_str[21] = ' ';
 316   1      
 317   1              addr = OSDMENU_BARADDR + 1 + VOLBAR_LENGTH;     // 
 318   1      
 319   1              WriteStringToAddr(addr, Bar_str, VOLBAR_LENGTH ); 
 320   1      
 321   1      }
 322          
 323          BYTE Get_cursor_item(BYTE id)
 324          {
 325   1              BYTE i=NIL, tid;
 326   1      
 327   1              #ifdef DEBUG_OSD
                      dPrintf("\r\n++(Get_cursor_item) id:%d", (WORD)id);
                      #endif
 330   1      
 331   1              
 332   1              switch ( id ) {
 333   2              case INPUTSELECTION:    tid = GetInputSelection(); 
 334   2                                                              break;
 335   2      
 336   2              default:                                return 0;// The first one
 337   2              }
 338   1      
 339   1              i = GetTargetChild( tid );
 340   1      
 341   1              if( i==NIL ) {  //couldn't find
 342   2                      dPuts("___Couldn't find cursor!!");
 343   2                      i=0;
 344   2              }
 345   1      
 346   1              #ifdef DEBUG_OSD
                      dPrintf("___Cursor:%d\r\n__(GetDefaultForChoiceMenu)", (WORD)i);
                      #endif
 349   1      
 350   1              return i;
 351   1      }
 352          
 353          //==================================================================================================
 354          // Func: DisplayOSDMenuOneItem
 355          //
 356          //
 357          void DisplayOSDMenuOneItem( winno, CODE_P struct DefineMenu *DMp, BYTE x, BYTE y, BYTE NOTViewflag )
 358          {
 359   1              BYTE i,j,k,IconColor;
 360   1              WORD addr;
 361   1              CODE_P BYTE *Str;
 362   1              CODE BYTE RightSign_str[]=      { 0x1c,' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',0 };// RIGHT mark
 363   1      
C51 COMPILER V7.50   OSDMENU                                                               08/20/2007 10:23:32 PAGE 7   

 364   1              #ifdef DEBUG_OSD
                      dPrintf("\r\n++(DisplayOSDMenuOneItem) ");
                      #endif
 367   1      
 368   1              if( cur_osdwin == OSDMENU_TOPWIN) addr = OSDMENU_MAINADDR;
 369   1              else addr = OSDMENU_SUBADDR;
 370   1      
 371   1              addr = addr + x + y*MenuFormat->width;
 372   1      
 373   1              #ifdef DEBUG_OSD
                      Printf("\r\nStartaddr:%d", addr);
                      #endif
 376   1      
 377   1              if( DMp->IconColor !=NIL ) {            // Draw Icon
 378   2                      //if(OnChangingValue) IconColor = BG_COLOR_BLACK|CH_COLOR_WHITE|EXTENDED_COLOR; 
 379   2                      //else
 380   2                              IconColor =  DMp->IconColor;
 381   2      
 382   2                      Str = DMp->Icon;
 383   2                      j=strlen(Str);
 384   2                      WriteStringToAddr(addr, Str, j);
 385   2      
 386   2                      x += ICON_CH_SZ;
 387   2              }
 388   1      
 389   1              if( DMp->DescColor !=NIL ) {            // Draw Desc.
 390   2      
 391   2                      Str = DMp->Desc[OSDLang];
 392   2                      j=strlen(Str);
 393   2      
 394   2                      for( i=0,k=0; i<j; i++ )
 395   2                              if( *(Str+i) == ROMFONT || *(Str+i) == RAMFONT ) k++;
 396   2      
 397   2                      #ifdef DEBUG_OSD
                              Printf("\r\naddr:%d x:%d y:%d MenuFormat->width:%d", addr, (WORD)x, (WORD)y, (WORD)MenuFormat->width );
                              #endif
 400   2      
 401   2                      WriteStringToAddr(addr, Str, j);
 402   2      
 403   2                      if( (j-k ) < MAX_DESC ) 
 404   2                              ClearDataCnt(addr+j-k, MAX_DESC-j+k);
 405   2              
 406   2                      addr+=MAX_DESC;
 407   2      
 408   2              }
 409   1      
 410   1              if( OSDMenuLevel < 3) // Main Menu Item.
 411   1               if ( NOTViewflag==1 )  return; // In case of not need diplay contents. ex, BAR windows, top menu display.
 412   1              
 413   1              // Menu contents view
 414   1              /*if( x < (MenuFormat->width) )
 415   1                      if( x <  (MAX_DESC + ICON_CH_SZ) ){
 416   1                      //x+=2;
 417   1                      ClearDataCnt(addr, 2);
 418   1                      addr+=2;
 419   1              }*/
 420   1      
 421   1              switch (DMp->Type ) {
 422   2              case BAR:       // Draw Bar and Number value
 423   2                      DisplayViewBar( addr, GetItemValue(DMp->Id));
 424   2                      break;
 425   2      
C51 COMPILER V7.50   OSDMENU                                                               08/20/2007 10:23:32 PAGE 8   

 426   2              case NUMBER: // Draw Number value
 427   2                      {
 428   3                              CODE_P BYTE *ptr;
 429   3                              ptr = DMp->TypeData;
 430   3                              switch ( DMp->Id ) {
 431   4                              #if defined( PAL_TV )
                                      case MANUAL_TUNE_CHANNEL:
                                              WriteStringToAddr(addr, RightSign_str, BARNUM_LENGTH); 
                                              break;
                                      #endif
 436   4                              default:
 437   4                                      DrawNum( addr, (CODE_P struct NumType *)ptr, GetItemValue(DMp->Id) );
 438   4                                      break;
 439   4                              }
 440   3                      }
 441   2                      break;
 442   2              case ENUM_STRING:               
 443   2                      {
 444   3                              CODE_P BYTE *ptr;
 445   3      
 446   3                              ptr = DMp->TypeData;
 447   3                              DrawStringByLang( addr, (CODE_P struct EnumType *)ptr, GetItemValue(DMp->Id) );
 448   3      
 449   3                      }
 450   2                      break;
 451   2      
 452   2              case NUMBER_STRING:
 453   2              case CHOICEMENU:
 454   2              case OSDMENU:
 455   2              case ACTION:
 456   2                              WriteStringToAddr(addr, RightSign_str, BARNUM_LENGTH); 
 457   2                              break;
 458   2      
 459   2              }
 460   1        
 461   1      }
 462          
 463          void ClearCursor(void)
 464          {
 465   1              //BYTE cursor_x;
 466   1              BYTE cursor_y;
 467   1              WORD addr;
 468   1      
 469   1              if( cursor_item==NIL )
 470   1                      return;
 471   1      
 472   1              //cursor_x = MenuFormat->CursorStart;
 473   1              cursor_y = cursor_item + ( MenuFormat->TitleColor ==NIL ? 0 : 1 );
 474   1              if( cur_osdwin == 4 ) addr = 0;
 475   1              else addr = 10;

⌨️ 快捷键说明

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