setup_tab_ui1.c
上传用户:caisangzi8
上传日期:2013-10-25
资源大小:15756k
文件大小:54k
源码类别:

DVD

开发平台:

C/C++

  1. /********************************************
  2. *  setup_newstyle_ui.h
  3. *
  4. *  include  in setup_tab.c   
  5. *  when normal setup menu.
  6. *  UI function:
  7. *     LEFT,RIGHT, UP, DOWN,  SELECT, ShowSetupPage. 
  8. * Creator: zhaoyanhua 
  9. * Date:  3-7-25 17:12
  10. *******************************************/
  11. #ifdef SUPPORT_MIDI
  12. #include "fsmidi.h"
  13. #ifdef QISHENG_DEBUG_04_10_09
  14. #include "fsmidiui.h"
  15. #endif
  16. #endif
  17. #ifndef DVDRELEASE
  18. //#define SETUP_UI_DBG
  19. #endif
  20. #ifndef SETUP_UI_DBG
  21. #undef ui_printf
  22. #undef ui_print_block
  23. #define ui_printf(f, a...) do {} while (0)
  24. #define ui_print_block(x,y) do {} while (0)
  25. #else
  26. #define ui_printf printf
  27. #define ui_print_block print_block
  28. #endif
  29. #ifdef PULIANG_SETUP_MENU  //yaowh add 04-12-15
  30.     extern int show_menu_setup_flag;
  31. #endif
  32. #ifdef DVB_MENU_SETUP_STYLE //Maoyong 2004-12-21 20:41 for disable unrealized item of DVB Menu
  33. extern const char *osd_str_dvb_install[N_OSD_LANGS][5];
  34. extern const char *osd_str_dvb_channel[N_OSD_LANGS][5];
  35. #define IsDvbSetupLanguage()    ( (page == INSTALLPAGE) && (setup_item[page][index_y][1] == STR_OS_OSD) )
  36. #define IsDvbSetupTimezone()    ( (page == INSTALLPAGE) && (setup_item[page][index_y][1] == STR_OS_TIME_ZONE) )
  37. #define IsDvbSubItem()          ( (system_state == SYSTEM_TS) && (IsDvbSetupLanguage() || IsDvbSetupTimezone()) )
  38. #define IsDvbSubMenuPageItem()  ( IsDvbSubItem() || ( (page != CHANNELPAGE) && (page != INSTALLPAGE) ) )
  39. #define IsDvbStateHasSubMenu()  ( (system_state == SYSTEM_TS) && IsDvbSubMenuPageItem() && setupLevel )   
  40. #define IsDvbStateNoSubMenu()   ( (system_state == SYSTEM_TS) && !IsDvbSubMenuPageItem() && setupLevel  )    
  41. /*UINT8 IsValidDvbMenuItem(UINT8 i)
  42. {
  43.     UINT8 uRes = 0;
  44.     if(system_state == SYSTEM_TS ) {
  45.         if(((dvbpage == INSTALLPAGE) && (i == ITEM_AUTO_SCAN || i == ITEM_MANUAL_SCAN ))
  46.         || ( (dvbpage == CHANNELPAGE) && (i == ITEM_ADD_CHANNEL || i == ITEM_EDIT_CHANNEL)))
  47.         uRes =  1;
  48.     }      
  49.     return uRes;
  50. }
  51. void GetUpValidDvbMenuItem(void)
  52. {
  53.     
  54.     if(system_state == SYSTEM_TS)
  55.     {
  56.         if(dvbpage == INSTALLPAGE)
  57.         {
  58.             while(index_y == ITEM_AUTO_SCAN || index_y == ITEM_MANUAL_SCAN)
  59.                 index_y--;
  60.         }
  61.         else if(dvbpage == CHANNELPAGE)
  62.         {
  63.             while(index_y == ITEM_ADD_CHANNEL ||index_y == ITEM_EDIT_CHANNEL)
  64.                 index_y--;
  65.         }        
  66.     }
  67. }
  68. void GetDownValidDvbMenuItem(void)
  69. {
  70.     
  71.     if(system_state == SYSTEM_TS)
  72.     {
  73.         if(dvbpage == INSTALLPAGE)
  74.         {           
  75.             while(index_y == ITEM_AUTO_SCAN || index_y == ITEM_MANUAL_SCAN)
  76.             {
  77.                 index_y++; 
  78.                 if(index_y > (MAX_ITEM_SEL - 1))
  79.                     index_y = 0;                
  80.             }
  81.         }
  82.         else if(dvbpage == CHANNELPAGE)
  83.         {
  84.             while(index_y == ITEM_ADD_CHANNEL || index_y == ITEM_EDIT_CHANNEL)
  85.             {
  86.                 index_y++; 
  87.                 if(index_y > (MAX_ITEM_SEL - 1))
  88.                     index_y = 0;
  89.             }
  90.         } 
  91.     }
  92. }
  93. */
  94. //When enter DVB turn off MIC and restore MIC state when in DVD state. Maoyong 2005-1-18 16:58
  95. void ControlDvbDvdMic()
  96. {
  97. if(system_state == SYSTEM_TS)
  98. exe_setup_function(STR_OS_MIC_ONOFF, STR_OS_OFF, 1);
  99. else
  100. {
  101. if(SETUP_MIC_ONF == 2)//AUTO
  102. exe_setup_function(STR_OS_MIC_ONOFF, STR_OS_AUTO, 1);
  103. else
  104. exe_setup_function(STR_OS_MIC_ONOFF, STR_OS_OFF, 1);
  105. }
  106. }
  107. const char *SetDvbItemString(UINT16 idString)
  108. {
  109.     const char* str;
  110.     if(system_state == SYSTEM_TS)
  111.     {
  112.      if(idString == STR_OS_EXIT_MENU || idString == STR_OS_OSD)
  113.      str = _OsdMessegeFont1[osd_font_mode][idString];
  114.      else if(page == INSTALLPAGE)
  115.      {
  116.      str = osd_str_dvb_install[osd_font_mode][idString-STR_OS_DVBT_CONFIG];
  117.      }
  118.      else if(page == CHANNELPAGE)
  119.      {
  120.      str = osd_str_dvb_channel[osd_font_mode][idString-STR_OS_TV_CHANNEL];
  121.      }
  122.      else
  123.      str = _OsdMessegeFont1[osd_font_mode][idString];
  124.     }
  125.     else
  126.      str = _OsdMessegeFont1[osd_font_mode][idString];
  127.     return str;            
  128. }
  129. #endif  //#ifdef DVB_MENU_SETUP_STYLE Maoyong 2004-12-22 13:49 for disable unrealized item of DVB Menu
  130. #ifdef SHOW_SETUPMENU_SETUP     //linrc modify 2004-5-9 20:01
  131. #ifndef DVD_SETUP_REENG
  132. static inline void show_setupmenu(void)
  133. {
  134.      if (full_scrn&CUSTM)   //2004-7-28 11:15?宇P
  135.      return;
  136.      int    menuset;
  137.      const char *setupmenu_str;
  138.      char buf[3]; 
  139.      int j;
  140.      for (j=0; j<MAX_PAGE_ITEM; j++)
  141.      {      
  142.         sel=setup_sel[page][j];     
  143.         id = setup_item[page][j][sel];
  144.         if(page==VIDEOPAGE)                   //LINRC ADD 2004-5-6 0:56 for show the video setup
  145.         {                   
  146.            menuset = SETUP_BRIGHTNESS - 2;
  147.            psprintf(buf,"%02d",menuset);
  148.            osd_DrawString(SETUP_SUB_XSTART+1, 3,buf, S16WHITEFONT, 1); 
  149.            #ifdef PULIANG_SETUP_MENU       //yaowh add 04-12-15
  150.                menuset = SETUP_HUE - 2;
  151.                psprintf(buf,"%02d",menuset);
  152.                osd_DrawString(SETUP_SUB_XSTART+1, 4,buf, S16WHITEFONT, 1);
  153.                menuset = SETUP_CONTRAST - 2;
  154.                psprintf(buf,"%02d",menuset);
  155.                osd_DrawString(SETUP_SUB_XSTART+1, 5,buf, S16WHITEFONT, 1);
  156.            #else
  157.            menuset = SETUP_CONTRAST - 2;
  158.            psprintf(buf,"%02d",menuset);
  159.            osd_DrawString(SETUP_SUB_XSTART+1, 4,buf, S16WHITEFONT, 1);
  160.            menuset = SETUP_HUE - 8;
  161.            psprintf(buf,"%02d",menuset);
  162.            osd_DrawString(SETUP_SUB_XSTART+1, 5,buf, S16WHITEFONT, 1);
  163.            menuset = SETUP_SATURATION - 2;
  164.            psprintf(buf,"%02d",menuset);
  165.            osd_DrawString(SETUP_SUB_XSTART+1, 6,buf, S16WHITEFONT, 1);
  166.             #endif
  167.         } 
  168.         else
  169.         { 
  170.            setupmenu_str = setup_SetItemString();
  171.            osd_DrawString(SETUP_SUB_XSTART+1, j+3, setupmenu_str, S16WHITEFONT, 1);
  172.            #ifdef HANYANG_SETUPMENU
  173.            if(page==AUDPAGE)
  174.            {
  175.               menuset = SETUP_AC3DIGITAL_DYNA - 2;
  176.               psprintf(buf,"%02d",menuset);
  177.               osd_DrawString(SETUP_SUB_XSTART+1, 6,buf, S16WHITEFONT, 1); 
  178.            }     
  179.            #else
  180.            if(page==AC3DIGITALPAGE)
  181.            {
  182.               menuset = SETUP_AC3DIGITAL_DYNA - 2;
  183.               psprintf(buf,"%02d",menuset);
  184.               osd_DrawString(SETUP_SUB_XSTART+1, 4,buf, S16WHITEFONT, 1); 
  185.            }     
  186.            #endif     
  187.          }
  188.      }    
  189. }
  190. #else//#ifndef DVD_SETUP_REENG  //denghg add  2004-9-28 20:29
  191. static inline void show_setupmenu(void)
  192. {
  193.    if (full_scrn&CUSTM)   //denghg  2004-9-27 21:05
  194.      return;
  195.      int  j,VA,k,menuset;
  196.      const char *setupmenu_str;
  197.      char buf[3]; 
  198.      for(j=1; j<=MAX_PAGE_ITEM; j++)
  199.    {  
  200.       VA = setup_item[setup_pos[SETUP_ML1]][j][MAX_ITEM_SEL+1];
  201.     k=setup_item[setup_pos[SETUP_ML1]][j][setup_VA[VA]];
  202.       if((setup_item[setup_pos[SETUP_ML1]][j][0]==SET_SH)||(setup_item[setup_pos[SETUP_ML1]][j][0]==SET_SPACE)||(setup_item[setup_pos[SETUP_ML1]][j][0]==SET_NM)||(setup_item[setup_pos[SETUP_ML1]][j][0]==SET_NE)) {}
  203.       else if(setup_item[setup_pos[SETUP_ML1]][j][0]==SET_FUNC)
  204.       {
  205.          if(VA==SETUP_VA_DEFAULT){}
  206.        else if((VA==SETUP_VA_OSD_LANG)||(VA==SETUP_VA_AUDIO_LANG)||(VA==SETUP_VA_SUBTITLE_LAN)||(VA==SETUP_VA_MENU_LANG))
  207.        {  
  208.           if(k==STR_OS_OFF)
  209.              setupmenu_str = _OsdMessegeFont1[osd_font_mode][k];
  210.               else
  211.                  setupmenu_str = lang_names[osd_font_mode][k];
  212.                  osd_DrawString(SETUP_SUB_XSTART+1, j+2, setupmenu_str, setupFcolorIN, 0);   
  213.            }      
  214.            else
  215.        {
  216.           setupmenu_str= _OsdMessegeFont1[osd_font_mode][k] ;
  217.           osd_DrawString(SETUP_SUB_XSTART+1, j+2, setupmenu_str, setupFcolorIN, 0);
  218.        }   
  219.     } 
  220.     else  //
  221.     {   
  222.        //if((VA==SETUP_VA_BRIGHTNESS)||(VA==SETUP_VA_CONTRAST)||(VA==SETUP_VA_SATURATION)||(VA==SETUP_VA_DYNAMCRANGE)||(VA==SETUP_VA_CSPK_DELAY)||(VA==SETUP_VA_MIC_VOL)||(VA==SETUP_VA_ECHO))  
  223.        if((VA==SETUP_VA_HUE)||(VA==SETUP_VA_KEY)) 
  224.           menuset=setup_VA[VA]-8;      
  225.        else  if(VA==SETUP_VA_SSPK_DELAY) 
  226.           menuset=(setup_VA[VA]-2)*3;
  227.        else
  228.           menuset=setup_VA[VA]-2;                          
  229.           psprintf(buf,"%02d",menuset);
  230.                osd_DrawString(SETUP_SUB_XSTART+1, j+2,buf, setupFcolorIN, 0);     
  231.     }
  232.     
  233.  }
  234. }  
  235. #endif//#ifndef DVD_SETUP_REENG //denghg  end     show_setupmenu  in DVD_SETUP_REEN
  236.     
  237. #endif // end SHOW_SETUPMENU_SETUP
  238. #include "setup_ui_ext_func.h"
  239. #include "setup_ui_def.h"
  240. //=============================================
  241. //for setup re-engineering  //added by JS   20040728    
  242. #ifdef DVD_SETUP_REENG
  243. #include "setup_ui_util.c"
  244. #include "setup_OSD_util.c"
  245. #include "setup_show_page.c"
  246. #include "setup_get_pos.c"
  247. #include "setup_ui_input.c"
  248. #else
  249. #include "setup_ui_down.c"
  250. #include "setup_ui_up.c"
  251. #include "setup_ui_left.c"
  252. #include "setup_ui_right.c"
  253. #include "setup_ui_sel.c"
  254. #endif
  255. //==============================================
  256. //#define SHOW_SYSTEM_CLOCK
  257. //=============================================
  258. //for DVD_SETUP_REENG   //added by JS   //20040728
  259. #ifdef DVD_SETUP_REENG
  260. void ShowSetupPage(BYTE refresh)
  261. {
  262.     if(refresh){
  263.         setup_refresh = 1;
  264.         setup_ShowPageL1();
  265.         setup_ShowPageL2();
  266.         setup_ShowPageL3();
  267.         setup_refresh = 0;
  268.     } else {
  269.         osd_init_setup();
  270.         setup_mDir = SETUP_ENTER;
  271.         setup_GetPos(setup_mDir);
  272.     }
  273. }
  274. #else //==============================================
  275. void ShowSetupPage(BYTE refresh)
  276. {
  277.     int     i;
  278.     BYTE    fontColor, bgColor;
  279.     BYTE    upDown;
  280.     const char   *str;
  281.     #ifdef  SETUP_COLOR_TYPE1   //wangfeng 2003-08-29 17:28
  282.     UINT16 line=SETUP_MAX_WIDTH*16;
  283.     #else
  284.     UINT16 line=SETUP_MAX_WIDTH*16-20;
  285.     #endif
  286.     #ifdef  SHOW_SETUPMENU_SETUP  //linrc add 2004-5-1 20:31
  287.     osd_draw_rect(300, 75, 250, 350, 1);
  288.     #endif
  289.     reset_passwd_cnt();
  290.     #ifdef SELECT_MEDIA_IN_SETUPMENU    //Maoyong 2004-8-10 17:23, just loas as act meida when setup
  291.     setupSettingMediaItem();
  292.     #endif
  293.     #ifdef DVB_MENU_SETUP_STYLE         //Maoyong 2004-12-22 11:06
  294.     SetOsdCol(0, 0, 8,  0xC8C8C8ff);
  295.     #endif
  296.     
  297.     if (full_scrn&CUSTM)
  298.     { //set to CUSTM mode
  299.         osd_init_setup();
  300.         setupLevel = 1;
  301.         
  302.         #ifdef SUPER_DEFAULT_OSD_LANG       //freyman add 2004-2-11 9:11
  303.         if(id==STR_OS_OSD)      
  304.             index_y = CUSTMOSDITEM;             
  305.         else
  306.         #endif        
  307.         index_y = 2;
  308.         
  309.         index_y_start = 0;
  310.     }
  311.     if (refresh)
  312.     {
  313.         //draw main rect
  314.         #ifdef  SETUP_COLOR_TYPE1   //wangfeng 2003-08-29 17:28
  315.         //to move the main rect down for 22 pixels
  316.         osd_draw_rect(0, 0, line, 22, SSHEER);
  317.         osd_draw_rect(0, 0+22, (SETUP_MAX_WIDTH*16), (SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT), SBGCOLOR);//wangfeng 3-8-27 21:44    
  318.                 #elif defined(SETUP_COLOR_TYPE2)        
  319.             #ifdef EASTECH_NEW_SETUP_MENU
  320.             osd_draw_rect(0, /*10+SETUP_BUTTON_HEIGHT*2+10*/0, (SETUP_MAX_WIDTH*16), (SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT), SBGCOLOR);  //modified by Tom              
  321.             #else    
  322.                 osd_draw_rect(0, 10+SETUP_BUTTON_HEIGHT*2+10, (SETUP_MAX_WIDTH*16), (SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT), SBGCOLOR);                
  323.             #endif
  324.         #else
  325.         osd_draw_rect(0, 0, (SETUP_MAX_WIDTH*16), (SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT), SBGCOLOR);
  326.         if (p_scan==1)
  327.         {
  328.             //draw top horizontal line
  329.             #ifndef SPE_SETUP
  330.             osd_DrawLine(12, SETUP_BUTTON_HEIGHT+20, (SETUP_MAX_WIDTH*16-10), SETUP_BUTTON_HEIGHT+20, SWHITECOLOR, 2);
  331.             //draw bottom horizontal line
  332.             osd_DrawLine(10, (SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT-12), (SETUP_MAX_WIDTH*16-10), (SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT-12), SBLACKCOLOR, 2);
  333.            #endif   
  334.     }
  335.         else
  336.         {
  337.              #ifndef SPE_SETUP
  338.             osd_DrawLine(12, SETUP_BUTTON_HEIGHT+20, (SETUP_MAX_WIDTH*16-10), SETUP_BUTTON_HEIGHT+20, SWHITECOLOR, 1);
  339.             osd_DrawLine(10, (SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT-12), (SETUP_MAX_WIDTH*16-10), (SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT-12), SBLACKCOLOR, 1);
  340.              #endif  
  341.         }
  342.          #ifndef SPE_SETUP
  343.         //draw left vertical line
  344.         osd_DrawLine(10, SETUP_BUTTON_HEIGHT+20, 10, (SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT-12), SWHITECOLOR, 1);
  345.         //draw right vertical line
  346.         osd_DrawLine((SETUP_MAX_WIDTH*16-12), SETUP_BUTTON_HEIGHT+20, (SETUP_MAX_WIDTH*16-12), (SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT-12), SBLACKCOLOR, 1);
  347.         //osd_DrawLine((SETUP_MAX_WIDTH*16-10), SETUP_BUTTON_HEIGHT+12, (SETUP_MAX_WIDTH*16-10), (SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT-12), SWHITECOLOR, 1);
  348.         #endif          //end  #ifndef SPE_SETUP
  349.         #endif
  350.         
  351.         if (refresh==2)
  352.         {
  353.             #if !defined(SETUP_COLOR_TYPE1)&& !defined(SETUP_COLOR_TYPE2)&& !defined( QSI_SETUP_MENU_DESIGN)//liweihua 2004-7-4 14:17//wangfeng 2003-08-29 17:28
  354.             #ifdef SPE_SETUP  //2004-4-28 19:03  zhangyu-lorenc
  355.             osd_draw_rect(21, 10, line-18, SETUP_BUTTON_HEIGHT+10, SBARCOLOR);//张宇不会
  356.            #else
  357.                        osd_draw_rect(10, 10, line, SETUP_BUTTON_HEIGHT+10, SBARCOLOR);//张宇
  358.            #endif
  359.             #endif
  360.             #ifdef  SETUP_COLOR_TYPE1   //wangfeng 2003-08-29 17:28
  361.             //draw blue bar for main pages of the menu
  362.             osd_draw_rect(0, 22, line, SETUP_BUTTON_HEIGHT+10, SBARCOLOR);//wangfeng 3-8-27 21:47   
  363.             //draw black bar for the output of main page  
  364.             osd_draw_rect(0, SETUP_BUTTON_HEIGHT+10+10+10+2, line, SETUP_BUTTON_HEIGHT-2, 0);//wangfeng 3-8-27 21:47
  365.             //draw blue bar at the bottom of the menu
  366.             osd_draw_rect(0, SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT-SETUP_BUTTON_HEIGHT, line, SETUP_BUTTON_HEIGHT, SBARCOLOR);
  367.                         #elif defined(SETUP_COLOR_TYPE2)
  368.                         osd_draw_rect(10, 10, line, SETUP_BUTTON_HEIGHT+12,13); 
  369.             #ifndef SKYWORTH_DVD    //3-10-28 3:33张宇P
  370.             osd_draw_rect(0, 10+SETUP_BUTTON_HEIGHT*2+10+(SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT)-100, (SETUP_MAX_WIDTH*16), /*(SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT)*/18, 13);//SBGCOLOR);
  371.             #endif
  372.             osd_draw_rect(0, 10+SETUP_BUTTON_HEIGHT+20, line+20, SETUP_BUTTON_HEIGHT+1, 0);//3-8-25 2:26张宇P
  373.                         #else
  374.                 #ifndef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-2 18:56
  375.                 #ifdef SPE_SETUP
  376.              osd_draw_rect(21, 10, line-18, SETUP_BUTTON_HEIGHT+10, 6); //2004-4-20 09:25张宇P bmmm
  377.               #else           
  378.              osd_draw_rect(10, 10, line, SETUP_BUTTON_HEIGHT+10, 1); //2004-4-20 09:25张宇P bmmm
  379.              #endif   // end #ifndef SPE_SETUP            
  380.                 #endif//#ifndef QSI_SETUP_MENU_DESIGN
  381.             #endif
  382.             
  383.             //#if defined(SAME_DISC_RESUME)||defined(SHOW_STANDBY_TIMER)
  384.             #if defined(NEXTPAGE_SYS)       //freyman 2004-3-26 0:10
  385.             #if!defined(SETUP_COLOR_TYPE1)&&!defined(SETUP_COLOR_TYPE2)&& !defined( QSI_SETUP_MENU_DESIGN)//liweihua 2004-7-4 14:17 //wangfeng 2003-08-29 17:28
  386.             if(page==SysNextPage)
  387.             osd_draw_rect((line*0)/6+10, 10, line/6, SETUP_BUTTON_HEIGHT+10, SBGCOLOR);
  388.             else
  389. #endif 
  390. #endif 
  391. //          #ifndef SETUP_COLOR_TYPE1   //wangfeng 2003-08-29 17:28
  392.                         #if !defined(SETUP_COLOR_TYPE1)&& !defined(SETUP_COLOR_TYPE2)&& !defined( QSI_SETUP_MENU_DESIGN)//liweihua 2004-7-4 14:17
  393.               #ifdef SPE_SETUP   
  394.                 #ifdef HANYANG_SETUPMENU//caoh2004-6-18 11:17
  395.               osd_draw_rect((line*page)/4+21, 10, line/6+1+40, SETUP_BUTTON_HEIGHT+18, SBGCOLOR);//2004-4-20 08:51张宇P bmmm          
  396.                 #else  
  397.          osd_draw_rect((line*page)/6+21, 10, line/6+1, SETUP_BUTTON_HEIGHT+18, SBGCOLOR);//2004-4-20 08:51张宇P bmmm         
  398.                 #endif
  399.              #else
  400. #ifndef DVB_MENU_SETUP_STYLE
  401.             osd_draw_rect((line*page)/6+10, 10, line/6, SETUP_BUTTON_HEIGHT+10, SBGCOLOR);
  402. #else
  403.             osd_draw_rect((line*dvbpage)/6+10, 10, line/6, SETUP_BUTTON_HEIGHT+10, SBGCOLOR);
  404. #endif
  405.            #endif
  406.             
  407.             #ifndef SPE_SETUP     //fengjl edit 2004-04-30 16:59
  408.             for (i=0;i<6;i++)
  409.             {
  410.                 if (p_scan==1)
  411.                   
  412.                   {
  413.                     //#ifndef SPE_SETUP
  414.                     osd_DrawLine((line*i)/6+11, 10, (line*(i+1))/6+10, 10, SWHITECOLOR, 2); // top
  415.                    //#endif
  416.                    
  417.                    printf("----not draw setupline---n"); 
  418.                    }               
  419.                 else
  420.                     osd_DrawLine((line*i)/6+11, 10, (line*(i+1))/6+10, 10, SWHITECOLOR, 1); // top
  421.                 osd_DrawLine((line*i)/6+11, 10, (line*i)/6+11, SETUP_BUTTON_HEIGHT+21, SWHITECOLOR, 1); // left
  422.                 osd_DrawLine((line*(i+1))/6+8, 10, (line*(i+1))/6+8, SETUP_BUTTON_HEIGHT+20, SBLACKCOLOR, 1); // right
  423.             }
  424.                    #endif     //end #ifndef SPE_SETUP      
  425.             //#if defined(SAME_DISC_RESUME)||defined(SHOW_STANDBY_TIMER)
  426.             #if defined(NEXTPAGE_SYS)       //freyman 2004-3-26 0:10
  427.             if(page==SysNextPage)
  428.             osd_DrawLine((line*0)/6+12, SETUP_BUTTON_HEIGHT+20, (line*(0+1))/6+8, SETUP_BUTTON_HEIGHT+20, SBGCOLOR, 2);
  429.             else
  430. #endif 
  431.             #endif//#if !defined(SETUP_COLOR_TYPE1)&& !defined(SETUP_COLOR_TYPE2)
  432.             
  433. #ifdef SETUP_COLOR_TYPE2
  434.  osd_DrawLine((line*page)/6+12, SETUP_BUTTON_HEIGHT+20, line/6-25/*(line*(page+1))/6+8*/, 1, /*SBGCOLOR*/13, 13);
  435. #elif defined(SETUP_COLOR_TYPE1)
  436. printf("==========Delete this line!!");
  437. #else
  438. #ifndef DVB_MENU_SETUP_STYLE
  439.             osd_DrawLine((line*page)/6+12, SETUP_BUTTON_HEIGHT+20, (line*(page+1))/6+8, SETUP_BUTTON_HEIGHT+20, SBGCOLOR, 2);
  440. #else
  441.             osd_DrawLine((line*dvbpage)/6+12, SETUP_BUTTON_HEIGHT+20, (line*(dvbpage+1))/6+8, SETUP_BUTTON_HEIGHT+20, SBGCOLOR, 2);
  442. #endif            
  443. #endif
  444.         }
  445.     }
  446.     else
  447.     {
  448.         #ifdef  SETUP_COLOR_TYPE1   //wangfeng 2003-08-29 17:28
  449.         //refresh the 5 rects
  450.         osd_draw_rect(0, 0+22+SETUP_BUTTON_HEIGHT+10+SETUP_BUTTON_HEIGHT-2, (SETUP_MAX_WIDTH*16), (SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT)-(22+SETUP_BUTTON_HEIGHT+10+SETUP_BUTTON_HEIGHT-2)-(SETUP_BUTTON_HEIGHT), SBGCOLOR);
  451.        // osd_draw_rect(0, 0, line, 22, SSHEER);
  452.         //osd_draw_rect(0, 22, line, SETUP_BUTTON_HEIGHT+10, SBARCOLOR);
  453.         osd_draw_rect(0, SETUP_BUTTON_HEIGHT+10+10+10+2, line, SETUP_BUTTON_HEIGHT-2, 0);//wangfeng 3-8-27 21:47
  454.     
  455.         //osd_draw_rect(0, SETUP_MAX_LINE*SETUP_BUTTON_HEIGHT-SETUP_BUTTON_HEIGHT, line, SETUP_BUTTON_HEIGHT, SBARCOLOR);
  456. #elif defined(SETUP_COLOR_TYPE2)    
  457.         osd_draw_rect(0, 10+SETUP_BUTTON_HEIGHT+20, line+20, SETUP_BUTTON_HEIGHT+1, 0);//3-8-25 2:26张宇P
  458.         osd_draw_rect(20, SETUP_BUTTON_HEIGHT+24+40, (SETUP_MAX_WIDTH*15), 10*SETUP_BUTTON_HEIGHT-12, SBGCOLOR);
  459.     
  460.         #else
  461.         
  462.         osd_draw_rect(20, SETUP_BUTTON_HEIGHT+24, (SETUP_MAX_WIDTH*15), 10*SETUP_BUTTON_HEIGHT-12, SBGCOLOR);
  463.         #endif
  464.         
  465.     }
  466.     if (!(full_scrn&CUSTM)
  467. #if defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD) //axel 2004/1/26 04:01 DSS555 need not OENKEYPASSPAGE         
  468.     && (!one_key_pass_flag)//no draw ICON. zhaoyanhua add 03-11-7 10:17
  469. #endif      
  470. #ifdef  KARAOKE_MENU    
  471.     &&(KARAOKE_MENU_FLAG==0)//WANGFENG 2003-10-29 18:06
  472. #endif
  473.         )
  474.     {
  475. //            int icon_y = (p_scan) ? 13 : 7;
  476. #ifdef SETUP_COLOR_TYPE1 //|| defined(SETUP_COLOR_TYPE2)    //wangfeng 2003-08-29 17:28
  477.             osd_DrawIcon(4, 26,0,page);
  478. //#if defined(SAME_DISC_RESUME)||defined(SHOW_STANDBY_TIMER)
  479. #if defined(NEXTPAGE_SYS)       //freyman 2004-3-26 0:11
  480.         if (page==SysNextPage)  osd_DrawIcon(4,26,0,0);
  481. #endif
  482.             osd_DrawIcon(16,26,1,page);
  483.             osd_DrawIcon(27,26,2,page);
  484.             osd_DrawIcon(38,26,3,page);
  485.             osd_DrawIcon(50,26,4,page);
  486.             osd_DrawIcon(61,26,5,page);
  487. #else//#ifdef SETUP_COLOR_TYPE1            
  488.     #ifdef SETUPMENU_16Mb_NO_ICON
  489.        #ifdef SPE_SETUP
  490.        #ifdef HANYANG_SETUPMENU//caoh2004-6-18 11:17
  491.             osd_DrawSetupIconString(4, 15, "SYS", SBLACKCOLOR, SDEFAULTCOLOR1);
  492.        #else
  493.             osd_DrawSetupIconString(3, 15, "SYS", SBLACKCOLOR, SDEFAULTCOLOR1);
  494.        #endif
  495.     #else
  496.             osd_DrawSetupIconString(2, 15, "SYS", S16WHITEFONT, SDEFAULTCOLOR);
  497.        #endif
  498.     #elif defined(BBK_SIMPLE_SETUP)                //sunzhh add for bbk_dv911s 2004-4-22 15:04
  499.             osd_DrawIcon(8, 13,0,page);
  500.     #else
  501.             #ifdef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-2 17:03
  502.             osd_DrawIcon(10, 13,0,page);
  503.             #else            
  504.             osd_DrawIcon(4, 13,0,page);
  505.             #endif// QSI_SETUP_MENU_DESIGN
  506.         #endif
  507. #ifdef SETUP_ON_OPEN_VALID          //dingzhy for yili 12/26/2003 9:34PM
  508.     //#if defined(SAME_DISC_RESUME)||defined(SHOW_STANDBY_TIMER)
  509.     #if defined(NEXTPAGE_SYS)       //freyman 2004-3-26 0:11
  510.         if (page==SysNextPage)  osd_DrawIcon(10,13,0,0);
  511.     #endif
  512.         osd_DrawIcon(23,13,1,page);
  513.         osd_DrawIcon(43,13,2,page);
  514.         osd_DrawIcon(62,13,3,page);
  515. #else//#ifdef SETUP_ON_OPEN_VALID          //dingzhy for yili 12/26/2003 9:34PM
  516.         //#if defined(SAME_DISC_RESUME)||defined(SHOW_STANDBY_TIMER)
  517.         #if defined(NEXTPAGE_SYS)       //freyman 2004-3-26 0:12
  518. if (page==SysNextPage)  osd_DrawIcon(4,13,0,0);
  519. #endif
  520.     #ifdef SETUPMENU_16Mb_NO_ICON
  521.          #ifdef SPE_SETUP      //2004-4-28 19:10  zhangyu-lorenc
  522.           #ifdef HANYANG_SETUPMENU//caoh2004-6-18 11:17
  523.           osd_DrawSetupIconString(12, 15, "LANG", SBLACKCOLOR, SDEFAULTCOLOR1);
  524.           osd_DrawSetupIconString(21, 15, "AUD", SBLACKCOLOR, SDEFAULTCOLOR1);
  525.           #else
  526.         osd_DrawSetupIconString(8, 15, "LANG", SBLACKCOLOR, SDEFAULTCOLOR1);
  527.         osd_DrawSetupIconString(14, 15, "AUD", SBLACKCOLOR, SDEFAULTCOLOR1);
  528.           #endif
  529.         #else
  530.         osd_DrawSetupIconString(7, 15, "LANG", S16WHITEFONT, SDEFAULTCOLOR);
  531.         osd_DrawSetupIconString(13, 15, "AUD", S16WHITEFONT, SDEFAULTCOLOR);
  532.         #endif
  533.         #ifndef SETUP_DONGLI459
  534.             #ifdef SPE_SETUP  //2004-4-28 19:12 zhangyu-lorenc
  535.             #ifdef HANYANG_SETUPMENU//caoh2004-6-18 11:17
  536.             osd_DrawSetupIconString(29, 15, "VID", SBLACKCOLOR, SDEFAULTCOLOR1);
  537.             #else
  538.             osd_DrawSetupIconString(19, 15, "VID", SBLACKCOLOR, SDEFAULTCOLOR1);
  539.             #endif
  540.             #else
  541.             osd_DrawSetupIconString(19, 15, "VID", S16WHITEFONT, SDEFAULTCOLOR);
  542.         #endif
  543.         #endif
  544.     //#ifdef SETUPMENU_16Mb_NO_ICON
  545.     #elif defined(BBK_SIMPLE_SETUP)           //sunzhh add for bbk_dv911s 2004-4-22 15:04
  546.             osd_DrawIcon(24,13,1,page);
  547.             osd_DrawIcon(40,13,2,page);
  548.         #ifndef SETUP_DONGLI459
  549.             osd_DrawIcon(56,13,3,page);
  550.         #endif
  551.     #elif defined(QSI_SETUP_MENU_DESIGN)//liweihua 2004-7-2 17:08
  552.             osd_DrawIcon(25,13,1,page);
  553.             osd_DrawIcon(40,13,2,page);
  554.             osd_DrawIcon(55,13,3,page);
  555.     #elif defined(EASTECH_NEW_SETUP_MENU)//liweihua 2004-7-2 17:08
  556.             osd_DrawIcon(23,13,1,page);  // modify by Tom  20040714
  557.             osd_DrawIcon(42,13,2,page);            
  558.             osd_DrawIcon(61,13,3,page);
  559.     #elif defined(PULIANG_SETUP_MENU)      //yaowh add 04-12-15
  560.         osd_DrawIcon(17,13,1,page);
  561.         osd_DrawIcon(30,13,2,page);
  562.         osd_DrawIcon(43,13,3,page);
  563.     #else//#ifdef SETUPMENU_16Mb_NO_ICON
  564.             osd_DrawIcon(16,13,1,page);
  565.             osd_DrawIcon(27,13,2,page);
  566.             #ifndef SETUP_DONGLI459
  567.             osd_DrawIcon(38,13,3,page);
  568.             #endif
  569.     #endif//#ifdef SETUPMENU_16Mb_NO_ICON
  570. #endif  //#ifdef SETUP_ON_OPEN_VALID end dingzhy
  571. #ifndef NO_DIGIT_VIDEO_MENU
  572.     #ifdef SETUP_DONGLI459
  573.         osd_DrawIcon(38,13,3,page);//SPEAKER PAGE
  574.         osd_DrawIcon(50,13,4,page);//DOBLY PAGE
  575.     #else//#ifndef SETUP_DONGLI459
  576.         #ifdef SETUPMENU_16Mb_NO_ICON
  577.            #ifdef SPE_SETUP  //2004-4-28 19:15 zhangyu-lorenc
  578.              #ifdef HANYANG_SETUPMENU//caoh2004-6-18 11:17
  579.              osd_DrawSetupIconString(24, 15, "", SBLACKCOLOR, SDEFAULTCOLOR1);
  580.              #else
  581.             osd_DrawSetupIconString(24, 15, "SPKR", SBLACKCOLOR, SDEFAULTCOLOR1);
  582.              #endif
  583.           #else
  584.             osd_DrawSetupIconString(24, 15, "SPKR", S16WHITEFONT, SDEFAULTCOLOR);
  585.         #endif
  586.         #elif !(defined(BBK_SIMPLE_SETUP)||defined(QSI_SETUP_MENU))  //liweihua mod for SQI 2004-6-15//sunzhh add for bbk_dv911s 2004-4-22 15:04      
  587.             #ifdef PULIANG_SETUP_MENU  //yaowh add 04-12-15
  588.                 osd_DrawIcon(56,13,4,page);
  589.          #else
  590.              #if defined(DVB_MENU_SETUP_STYLE)
  591.          if(system_state != SYSTEM_TS)
  592.              #endif
  593.             osd_DrawIcon(50,13,4,page);
  594.          #endif
  595.          
  596.         #endif
  597.         #ifndef PULIANG_SETUP_MENU //yaowh add 04-12-15
  598.     #ifndef NO_AUDIO_PAGE//liweihua add for syber 2003-12-30 20:40
  599.         #ifdef SETUPMENU_16Mb_NO_ICON
  600.             #ifdef SPE_SETUP       //2004-4-28 19:41zhangyu-lorenc
  601.              #ifdef HANYANG_SETUPMENU//caoh2004-6-18 11:17
  602.             osd_DrawSetupIconString(30, 15, "", SBLACKCOLOR, SDEFAULTCOLOR1);
  603.              #else
  604.             osd_DrawSetupIconString(30, 15, "DGT", SBLACKCOLOR, SDEFAULTCOLOR1);
  605.             #endif 
  606.         #else
  607.             osd_DrawSetupIconString(30, 15, "DGT", S16WHITEFONT, SDEFAULTCOLOR);
  608.         #endif
  609.         #elif !(defined(BBK_SIMPLE_SETUP)||defined(QSI_SETUP_MENU))  //liweihua mod for SQI 2004-6-15//sunzhh add for bbk_dv911s 2004-4-22 15:04
  610.                 //SETUPMENU_16Mb_NO_ICON
  611.          #ifndef DVB_MENU_SETUP_STYLE
  612.             osd_DrawIcon(61,13,5,page);
  613.          #else
  614.          if(system_state != SYSTEM_TS)
  615.             osd_DrawIcon(61,13,5,page);
  616.          #endif
  617.          
  618.         #endif//SETUPMENU_16Mb_NO_ICON
  619.     #endif//#ifndef NO_AUDIO_PAGE/
  620.         #endif//#ifndef PULIANG_SETUP_MENU
  621.     #endif//#ifndef SETUP_DONGLI459
  622. #endif//NO_DIGIT_VIDEO_MENU
  623. #endif//SETUP_COLOR_TYPE1
  624.     }
  625.     if (setupLevel == 0)
  626.     {
  627.         BYTE    iItemType;
  628.         #ifndef SPE_SETUP
  629.         show_main_title(setup_MainP[page][0]);
  630.         #endif
  631.         //draw item strings in sub menu
  632.         for (i=index_y_start; i<setupItemNum[1]; i++)
  633.         {
  634.             if ( (i-index_y_start+1) > (SETUP_MAX_LINE-3) ) break;
  635.             iItemType=setup_item[page][i][0];
  636.             if (iItemType == SET_SPACE) continue;
  637.             if (iItemType == SET_NE) break;
  638.             id = setup_item[page][i][1];
  639.             #ifdef BBK_NEW_SETUP    //fengjl edit 4-1-29 13:02
  640.             #if defined(BBK_DSS_555_DVD)||defined(BBK_DV911S)
  641.             if (id==STR_OS_RETURN_MAIN_SETUP)
  642.                 id=STR_OS_EXIT_MENU;
  643.             #endif
  644.             #else       
  645.             if (id==STR_OS_RETURN_MAIN_SETUP)    // no main page, so this item changes to exit_setup_menu
  646.                 id=STR_OS_EXIT_MENU;
  647.             #endif 
  648. #ifndef DVB_MENU_SETUP_STYLE
  649.             str = _OsdMessegeFont1[osd_font_mode][id];
  650.         #else
  651.          str = SetDvbItemString(id);
  652.         
  653.         #endif //DVB_MENU_SETUP_STYLE
  654.             
  655.             bgColor = SBGCOLOR;
  656.             upDown = 0;
  657.             
  658.             /*#ifdef DVB_MENU_SETUP_STYLE //Maoyong 2004-12-22 11:13
  659.             if(IsValidDvbMenuItem(i))
  660.                 fontColor = SGRAYCOLOR;
  661.             else    
  662.             #endif*/
  663.             fontColor = SFONTCOLOR;
  664.             
  665.             #ifndef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-4 15:39            
  666.             osd_draw_setup_button(SETUP_MENU_XSTART, i-index_y_start+SETUP_MENU_YSTART+1, SETUP_SUB_XSTART-SETUP_MENU_XSTART-1, bgColor, upDown);
  667.             #endif
  668.             osd_DrawString(SETUP_MENU_XSTART+1, i-index_y_start+SETUP_MENU_YSTART+1, str, fontColor, bgColor);          
  669.             #ifdef SHOW_SETUPMENU_SETUP     // linrc add 2004-5-1 18:30
  670.             sel=setup_sel[page][i];     
  671.             id = setup_item[page][i][sel];
  672.             str = setup_SetItemString();
  673.             osd_DrawString(SETUP_SUB_XSTART+1, i+3, str, S16WHITEFONT, 1);
  674.             #endif //end SHOW_SETUPMENU_SETUP
  675.         } //end of for each item
  676.         // highlight : draw a frame to identify which tab is enable
  677.     #if !defined(SETUP_COLOR_TYPE2) && !defined(SETUP_COLOR_TYPE1)&& !defined( QSI_SETUP_MENU_DESIGN)//liweihua 2004-7-2 17:38
  678.         SetOsdCol(0,0,SANTIBGCOLOR,0xa346ffff);
  679.          #endif
  680.     #if !defined(SETUP_COLOR_TYPE1)&&!defined(SETUP_COLOR_TYPE2)&& !defined( QSI_SETUP_MENU_DESIGN)//liweihua 2004-7-5 10:04//#ifndef   SETUP_COLOR_TYPE1   //wangfeng 2003-08-29 17:28
  681. //#ifndef   SETUP_COLOR_TYPE1     
  682. #ifndef DVB_MENU_SETUP_STYLE
  683.         setup_Showredframe(page);
  684. #else
  685.         setup_Showredframe(dvbpage);
  686. #endif
  687.         #endif
  688.     } else
  689.     { //second(or third)-level page menu
  690.         BYTE    iItemType;
  691.  
  692.         //find max items in this page
  693.         for (i=0; i<MAX_PAGE_ITEM; i++)
  694.         {
  695.             iItemType=setup_item[page][i][0];
  696.             if (iItemType == SET_SPACE) continue;
  697.             if (iItemType == SET_NE) break;
  698.             #ifdef SHOW_SETUPMENU_SETUP     //linrc modify 2004-5-9 20:02        
  699.             if(index_y!=6)          //2004-6-2 01:56?宇P
  700.             {
  701.                 #ifdef PULIANG_SETUP_MENU   //yaowh add 04-12-15
  702.                 if(show_menu_setup_flag!=1)
  703.                 #endif
  704.             show_setupmenu();
  705.             }
  706.             #endif //end SHOW_SETUPMENU_SETUP
  707.         }
  708.         #ifdef SHOW_SETUPMENU_SETUP     //linrc add 2004-5-5 16:05
  709.         for (i=0; i<MAX_PAGE_ITEM; i++)
  710.         {   
  711.             iItemType=setup_item[page][i][0];
  712.             if (iItemType == SET_SPACE) continue;
  713.             if (iItemType == SET_NE) break;  
  714.             sel=setup_sel[page][i];     
  715.             id = setup_item[page][i][sel];  
  716.             if((id==STR_OS_P_SCAN_YUV||id==STR_OS_YCbCr||id==STR_OS_RESTORE_SETUP)&&(index_y==2||index_y==6)) 
  717.               osd_draw_rect(300, 75, 250, 350, 1);           
  718.         }
  719.         #endif //SHOW_SETUPMENU_SETUP
  720.         setupItemNum[1] = i;
  721.         //draw menu title
  722.         if (full_scrn&CUSTM)
  723. #ifdef BBK_NEW_CUSTM     //fengjl add 2004-03-27 10:58
  724. {   
  725.     BYTE    buf[15];
  726.     psprintf(buf, "%s", VERSION_STRING1);
  727.     osd_DrawString(SETUP_MENU_XSTART+1, SETUP_MENU_YSTART, buf, SFONTCOLOR, SBGCOLOR);
  728. }
  729. //move to ShowCUSTMMsg //20040708//JSLIN
  730. /*
  731. #elif defined(SHOW_SYSTEM_CLOCK)//nono 4-4-6 0:30
  732. {   
  733.     BYTE    buf[5];
  734.     extern int get_sysclk;
  735.     psprintf(buf, "SC:%d", (get_sysclk*675/100));
  736.     osd_DrawString(SETUP_MENU_XSTART+1, SETUP_MENU_YSTART, buf, SFONTCOLOR, SBGCOLOR);
  737. }
  738. */
  739. #else
  740.             //show_main_title(STR_OS_MENU);
  741. {}        
  742. #endif
  743. //#if defined(SAME_DISC_RESUME)||defined(SHOW_STANDBY_TIMER)
  744. #if defined(NEXTPAGE_SYS)       //freyman 2004-3-26 0:12
  745.         else if (page==SysNextPage)
  746.     #ifdef NEXT_PAGE_SHOW_ADVANCED_SETUP            //gerry for gbm,2004-3-12 13:12
  747.         {
  748.             if(IsOSDChinese())
  749.             show_main_title(setup_item[0][6][1]);
  750.             else
  751.             show_main_title(STR_OS_PREV_PAGE);
  752.         }
  753.     #else//NEXT_PAGE_SHOW_ADVANCED_SETUP
  754.             show_main_title(setup_MainP[0][0]);
  755.     #endif//NEXT_PAGE_SHOW_ADVANCED_SETUP
  756. #endif 
  757.         
  758. #ifdef  KARAOKE_MENU
  759.         else if((page==AUDPAGE)&&(KARAOKE_MENU_FLAG))
  760.             show_main_title(STR_OS_KARAOKE_SETUP);
  761. #endif
  762.         else
  763.         #ifdef SETUP_ON_OPEN_VALID      //dingzhy for yili 12/26/2003 9:37PM
  764.             #ifdef NO_DIGIT_VIDEO_MENU
  765.                  if(page==3)
  766.             show_main_title(setup_MainP[4][0]);
  767.             else
  768.             show_main_title(setup_MainP[page][0]);
  769.             #endif
  770.         #else
  771.             show_main_title(setup_MainP[page][0]);
  772.         #endif
  773.         //draw item strings in sub menu
  774.         for (i=index_y_start; i<setupItemNum[1]; i++)
  775.         {
  776.             if ( (i-index_y_start+1) > (SETUP_MAX_LINE-3) ) break;
  777.             iItemType=setup_item[page][i][0];
  778.             if (iItemType == SET_SPACE) continue;
  779.             if (iItemType == SET_NE) break;
  780.             id = setup_item[page][i][1];
  781. #ifdef ONLY_DOWNMIX_IN_SPEAKER_PAGE//liweihua add 2004-1-2 15:05
  782.             if(page == MULTISPKPAGE)
  783.             {
  784.                 if((i>0) && (id!=STR_OS_RETURN_MAIN_SETUP)) 
  785.                     continue;  
  786.             }
  787. #endif
  788.             /*
  789.     #ifndef  BBK_NEW_SETUP//zhaoyanhua add 2003-11-18 17:14
  790.             if (id==STR_OS_RETURN_MAIN_SETUP)  // no main page, so this item changes to exit_setup_menu
  791.                 id=STR_OS_EXIT_MENU;
  792.             #endif
  793.             */
  794.             
  795.             #ifdef BBK_NEW_SETUP    //fengjl edit 4-1-29 13:02
  796.             #if defined(BBK_DSS_555_DVD)||defined(BBK_DV911S)
  797.             if (id==STR_OS_RETURN_MAIN_SETUP)
  798.                 id=STR_OS_EXIT_MENU;
  799.             #endif
  800.             #else       
  801.             if (id==STR_OS_RETURN_MAIN_SETUP)    // no main page, so this item changes to exit_setup_menu
  802.                 id=STR_OS_EXIT_MENU;
  803.             #endif 
  804. #ifndef DVB_MENU_SETUP_STYLE
  805.             str = _OsdMessegeFont1[osd_font_mode][id];
  806.         #else
  807.          str = SetDvbItemString(id);
  808.         
  809.         #endif //DVB_MENU_SETUP_STYLE
  810.             if ( (index_y+index_y_start) == i)
  811.             {
  812.                 #ifdef SETUP_COLOR_TYPE1
  813.                 if (setupLevel)
  814.                 #else
  815.                 if (setupLevel==1)
  816.                 #endif
  817.                 {
  818.                      fontColor = SANTIFONTCOLOR;
  819.                 } else
  820.                 {
  821.                      fontColor = SFONTCOLOR;
  822.                 }
  823.                 bgColor = SANTIBGCOLOR;
  824.                 upDown = 1;
  825.             }else
  826.             {
  827.                 bgColor = SBGCOLOR;
  828.                 upDown = 0;
  829.     #if !defined(SETUP_ALL_VALID)||defined(ONLY_DOWNMIXOFF_CAN_SET_CE_RE)||defined(SUPPORT_APOGEE_AMP)     //xulf 2004-01-07                                           
  830.                 //special case////nonotest 2003-9-5 17:44
  831.                 if ( (page==MULTISPKPAGE) && (SETUP_SPK_DOWNMIX!=AC3DOWNMIXOFF) &&
  832.                             ( (i>=SPKSTART) && (i<=SPKEND) ))
  833.                 {
  834.                     fontColor = SGRAYCOLOR;
  835.                 } else
  836. #endif//    #if !defined(SETUP_ALL_VALID)||defined(ONLY_DOWNMIXOFF_CAN_SET_CE_RE)                        
  837.                 
  838.     #ifdef PROLOGICII_3D_MUTEX//nono 4-2-12 0:58
  839.         
  840.     if ((page==AUDPAGE) && is_EQ_SOUND_set()&&(i==PROLOGIC_II))
  841.     //if (i==PROLOGIC_II)
  842.     {
  843.           fontColor = SGRAYCOLOR;
  844.     }else
  845.     
  846.     #endif//PROLOGICII_3D_MUTEX
  847.                 
  848.     #ifdef PROLOGIC_ON_51CH                            
  849.                  if ((page==AUDPAGE)&&(KARAOKE_MENU_FLAG==0)
  850.                     && !setup_IsSpkDownmixOff()&&(i==1))
  851.                 {
  852.                     fontColor = SGRAYCOLOR;
  853.                 } else
  854.     #endif              
  855.                 
  856.         #ifndef SETUP_ALL_VALID
  857.                 if ( (page==AUDPAGE) &&
  858.                             (
  859.                             ((SETUP_SPK_DOWNMIX==AC3DOWNMIXOFF) &&
  860.                             ( coding_mode_now&(AUDIF_CODING_MODE_AC3|
  861.                             AUDIF_CODING_MODE_DTS|
  862.                             AUDIF_CODING_MODE_DTSCD)
  863.                             )
  864.                             )
  865.                             ||(coding_mode_now==AUDIF_CODING_MODE_LPCM)//terry,0512,currently ,we are not surport LPCM key shift
  866.                             ) &&
  867.                             (i==(KEYITEM) )
  868.                             )
  869.                 {
  870.                         #ifdef SETUP_COLOR_TYPE2
  871.                                    fontColor = SGRAYCOLOR;
  872.                         #elif defined(SETUP_COLOR_TYPE1)
  873.                             fontColor = SGRAYCOLOR;
  874.                            #else                    
  875.                     //wanghaoying 2003-11-26 20:05 changed                  
  876.                     //fontColor = SFONTCOLOR;
  877.                     fontColor = SGRAYCOLOR;
  878.                            #endif
  879.                 }
  880.                 else if ( (page==AUDPAGE) &&
  881.                             (SETUP_SPDIF==SPDIFBITSTREAM) &&
  882.                             ( ( coding_mode_now&(AUDIF_CODING_MODE_AC3|
  883.                             AUDIF_CODING_MODE_DTS|
  884.                             //AUDIF_CODING_MODE_PCM|   //DTSCD-BITSTREAM MODE, Jeff 20020719
  885.                             AUDIF_CODING_MODE_DTSCD)
  886.                             )||(cd_subtype==CD_DTS) )&&      //NONO 2-7-25 17:26
  887.                             ( (i>=VOLCTRLSTART) && (i<=VOLCTRLEND) )
  888.                             )
  889.                 {
  890.                     //fontColor = SGRAYCOLOR;
  891. #ifdef SETUP_COLOR_TYPE2
  892. fontColor = SGRAYCOLOR;     
  893. #elif defined(SETUP_COLOR_TYPE1)
  894. fontColor = SGRAYCOLOR;     
  895. #else                   
  896.                     //wanghaoying 2003-11-26 20:05 changed
  897.                     //fontColor = SFONTCOLOR;
  898.                     fontColor = SGRAYCOLOR;
  899. #endif
  900.                 #ifndef NO_AC3_DYNAMIC_RANGE
  901.                 } else if ( (page==AC3DIGITALPAGE) && //Jeff 20020621
  902.                             (i==AC3DYNAMICITEM1) &&
  903.                             ( (SETUP_AC3DIGITAL_OUTMODE!=AC3DYNAMICITEM2) 
  904. //                            ||(SETUP_SPK_DOWNMIX!=AC3DOWNMIXOFF)
  905.                             )
  906.                             )
  907.                 {
  908.                     fontColor = SFONTCOLOR;
  909. //                  fontColor = SGRAYCOLOR;
  910.                 #endif //NO_AC3_DYNAMIC_RANGE
  911.                 } else
  912.             #endif //SETUP_ALL_VALID
  913.                 {
  914.                     fontColor = SFONTCOLOR;
  915.                 }
  916.                 }
  917.                 if (!refresh)
  918.                 {
  919.                     bgColor=SBGCOLOR;
  920.                     upDown=0;
  921.                     //marked by wangfeng 2003-09-01 19:42
  922.                     if (i==index_y_start) 
  923.                     fontColor=SFONTCOLOR;
  924.                 }
  925.             #ifdef KARAOKE_MENU //wangfeng 2003-10-30 10:19
  926.             if((page==AUDPAGE)&&(KARAOKE_MENU_FLAG)&&((i<2)||(i>5)))//((i<1)||(i>4)))
  927.             {
  928.                 fontColor = SBGCOLOR;
  929.                 
  930.             }
  931.             //wangfeng 2003-11-11 14:06
  932.             else if((page==AUDPAGE)&&(KARAOKE_MENU_FLAG==0)&&((i>=2)&&(i<=5)))
  933.             {
  934.                 fontColor = SBGCOLOR;
  935.             }
  936.             else
  937.             #endif
  938.             
  939.             /*#ifdef DVB_MENU_SETUP_STYLE //Maoyong 2004-12-21 20:41
  940.             if(IsValidDvbMenuItem(i))
  941.             {   
  942.                 fontColor = SGRAYCOLOR;
  943.             }
  944.             #endif*/
  945.     
  946.             #ifndef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-4 15:39    
  947. #ifdef EASTECH_NEW_SETUP_MENU
  948.             if(fontColor==1)  //add by TOM 
  949.                     bgColor=5;
  950. #endif
  951.                 osd_draw_setup_button(SETUP_MENU_XSTART, i-index_y_start+SETUP_MENU_YSTART+1, SETUP_SUB_XSTART-SETUP_MENU_XSTART-1, bgColor, upDown);
  952.             #endif
  953.                 osd_DrawString(SETUP_MENU_XSTART+1, i-index_y_start+SETUP_MENU_YSTART+1, str, fontColor, bgColor);
  954.             #ifdef VIDEO_SETUP_NEW_GUI//zhaoyanhua add 2004-1-7 19:26           
  955.                 if((page == VIDEOPAGE) &&(setup_item[page][i][0] == SET_SCALE))//not draw "EXIT" item,
  956.                 {   
  957.                     setup_VideoItemValue(i,SFONTCOLOR,SBGCOLOR );//show value with HL color.            
  958.                 }
  959.             #endif//VIDEO_SETUP_NEW_GUI
  960.             } //end of for each item
  961.             //some special system information shown in selection area
  962.             if (full_scrn&CUSTM)
  963.             {
  964.                 #if 0
  965.                 BYTE    buf[40];
  966.                 BYTE    *pVersion;
  967.                 extern const UINT8 ServoVersion[];
  968.                 pVersion = (BYTE *)(ROM_BASE_UNCACHED);
  969.                 //show ROM code checksum
  970.                 buf[0]= '[';
  971.                 for (i=0x40; i<0x44; i++)
  972.                 {
  973.                     BYTE    ch[3];
  974.                     psprintf(ch,"%02x",*(pVersion+i));
  975.                     buf[2*i-126]=ch[1];
  976.                     buf[2*i-127]=ch[0];
  977.                 }
  978.                 buf[9]= ']';
  979.                 buf[10]= 0;
  980.                 osd_DrawString(SETUP_SUB_XSTART+6, SETUP_MENU_YSTART+2, buf, SFONTCOLOR, SBGCOLOR);
  981.                 //ServoVersion[16]=0; can't write to const data
  982.                 osd_DrawString(SETUP_SUB_XSTART, SETUP_MENU_YSTART, ServoVersion, SFONTCOLOR, SBGCOLOR);
  983.                 //show some "codes" strings
  984.                 for (i=0x50; i<0x58; i++) { //Extend version string length to 8 Bytes, Jeff 20020715
  985.                     buf[i-0x50] = *(pVersion+i);
  986.                 }
  987.                 buf[8]= 0; //Extend version string length to 8 Bytes, Jeff 20020715
  988.                 osd_DrawString(SETUP_SUB_XSTART, SETUP_MENU_YSTART+1, buf, SFONTCOLOR, SBGCOLOR);
  989.                 //add build version, Jeff 20021008
  990.                 psprintf(buf, "%s", VERSION_STRING);
  991.                 osd_DrawString(SETUP_SUB_XSTART+8, SETUP_MENU_YSTART+1, buf, SFONTCOLOR, SBGCOLOR);
  992.                 //psprintf(buf, "%c SUM:", regs0->stamp+'A');
  993.                 psprintf(buf, "%02x%03x", (regs0->stamp & 0xff),get_iop_b_status()); //2004/11/30 ycwen
  994.                 osd_DrawString(SETUP_SUB_XSTART, SETUP_MENU_YSTART+2, buf, SFONTCOLOR, SBGCOLOR);
  995.                 #endif
  996.                 
  997.                 ShowCUSTMMsg();
  998.             
  999.             #ifdef SUPER_DEFAULT_OSD_LANG       //freyman add 2004-2-11 9:11
  1000.             id = setup_item[page][index_y][1];          
  1001.             if(id==STR_OS_OSD)
  1002.                 index_y = CUSTMOSDITEM;
  1003.             else
  1004.             #endif
  1005.                 index_y = 2;
  1006.             }
  1007.             if (refresh)
  1008.             {
  1009.                 draw_3rd_menu();
  1010.             }
  1011.             return;
  1012.             //draw ">" between sub-mean and it's corresponding selection area
  1013.         //#if defined(SAME_DISC_RESUME)||defined(SHOW_STANDBY_TIMER)
  1014.         #if defined(NEXTPAGE_SYS)       //freyman 2004-3-26 0:13
  1015.             if((id!=STR_OS_NEXT_PAGE)&&(id!=STR_OS_PREV_PAGE))
  1016.             #endif                          
  1017.             
  1018.             #ifdef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-4 17:12
  1019.             osd_DrawString(SETUP_SUB_XSTART-1, index_y+SETUP_MENU_YSTART, Ch_arrorR, SANTIFONTCOLOR, SBGCOLOR);
  1020.             #else                           
  1021.             osd_DrawString(SETUP_SUB_XSTART-1, index_y+SETUP_MENU_YSTART, Ch_arrorR, SFONTCOLOR, SBGCOLOR);
  1022.             #endif// QSI_SETUP_MENU_DESIGN
  1023.             //show first selection menu of third-level menu
  1024. #ifdef  Ti3001_OSD_UI_2
  1025.             if(page!=5&&page!=6)
  1026.             {
  1027.                 for (i=2; i<MAX_ITEM_SEL; i++)
  1028.                 {
  1029.                     //get select item
  1030.                     sel = setup_sel[page][index_y+index_y_start];
  1031.                     id = setup_item[page][index_y+index_y_start][i];
  1032.                     if (id==0) break;
  1033.                     str = setup_SetItemString();
  1034.                     if (sel == i) {
  1035.                         fontColor = SFONTCOLOR;
  1036.                         bgColor = SANTIBGCOLOR;
  1037.                         upDown = 1;
  1038.                     } else {
  1039.                         fontColor = SFONTCOLOR;
  1040.                         bgColor = SBGCOLOR;
  1041.                         upDown = 0;
  1042.                     }
  1043.                     //special item(PASSWORD), page-0, item-4
  1044.                     if (setup_item[page][index_y+index_y_start][0]==SET_NM) {
  1045.                         if (UserSet.parental_ststus==C_LOCK) {
  1046.                             setup_sel[page][index_y+index_y_start] = MIN_ITEM_SEL;
  1047.                             str = _OsdMessegeFont1[osd_font_mode][STR_OS_LOCK];
  1048.                         } else {
  1049.                             setup_sel[page][index_y+index_y_start] = MIN_ITEM_SEL + 1;
  1050.                             str = _OsdMessegeFont1[osd_font_mode][STR_OS_UNLOCK];
  1051.                         }
  1052.                         #ifndef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-4 15:39    
  1053.                         osd_draw_setup_button(SETUP_SUB_XSTART, (submenuStart), SETUP_MAX_WIDTH-SETUP_SUB_XSTART-2, SANTIBGCOLOR, 1);
  1054.                         #endif
  1055.                         osd_DrawString(SETUP_SUB_XSTART+1, (submenuStart), str, SANTIFONTCOLOR, SANTIBGCOLOR);
  1056.                     } else {
  1057.                         #ifndef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-4 15:39    
  1058.                         osd_draw_setup_button(SETUP_SUB_XSTART, (i-2+index_y)+SETUP_MENU_YSTART, SETUP_MAX_WIDTH-SETUP_SUB_XSTART-2, bgColor, upDown);
  1059.                         #endif
  1060.                         osd_DrawString(SETUP_SUB_XSTART+1, (i-2+index_y)+SETUP_MENU_YSTART, str, fontColor, bgColor);
  1061.                     }
  1062.                 }
  1063.                 setupItemNum[2] = i-2;
  1064.             }
  1065.             else
  1066.             {
  1067.                 for (i=1; i<MAX_ITEM_SEL; i++)
  1068.                 {
  1069.                     //get select item
  1070.                     sel = setup_sel[page][index_y+index_y_start];
  1071.                     id = setup_item[page][index_y+index_y_start][i];
  1072.                     if (id==0) break;
  1073.                     str = setup_SetItemString();
  1074.                     if (sel == i)
  1075.                     {
  1076.                         fontColor = SFONTCOLOR;
  1077.                         bgColor = SANTIBGCOLOR;
  1078.                         //bgColor = SBGCOLOR;
  1079.                         upDown = 1;
  1080.                     } else
  1081.                     {
  1082.                         fontColor = SFONTCOLOR;
  1083.                         bgColor = SBGCOLOR;
  1084.                         upDown = 0;
  1085.                     }
  1086.                     if (setup_item[page][index_y+index_y_start][0]==SET_SCALE)
  1087.                     {
  1088.                         setup_PrepareScaleItem(id,upDown);
  1089.                     }
  1090.                 }
  1091.                 setupItemNum[2] = i-2;
  1092.             }
  1093. #else
  1094.             for (i=2; i<MAX_ITEM_SEL; i++)
  1095.             {
  1096.                 //get select item
  1097.                        #if defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD) //axel 2004/1/26 04:01 DSS555 need not OENKEYPASSPAGE         
  1098.                 if(one_key_pass_flag)
  1099.                 {
  1100.                     sel = GetOneKeyPageSel(index_y);
  1101.                     printf("+++++++++++++ 111111111sel = %d,index_y = %d--n");
  1102.                 }
  1103.                 else
  1104.                 sel = setup_sel[page][index_y+index_y_start];
  1105.             #else
  1106.                 sel = setup_sel[page][index_y+index_y_start];
  1107.             #endif  
  1108.                 id = setup_item[page][index_y+index_y_start][i];
  1109.                 if (id==0) break;
  1110.                 str = setup_SetItemString();
  1111.                 if (sel == i)
  1112.                 {
  1113.                     fontColor = SFONTCOLOR;
  1114.                     bgColor = SANTIBGCOLOR;
  1115.                     upDown = 1;
  1116.                 }
  1117.                 else
  1118.                 {
  1119.                     fontColor = SFONTCOLOR;
  1120.                     bgColor = SBGCOLOR;
  1121.                     upDown = 0;
  1122.                 }
  1123.                 //special item(PASSWORD), page-0, item-4
  1124.                 if (setup_item[page][index_y+index_y_start][0]==SET_NM)
  1125.                 {
  1126.                     if (UserSet.parental_ststus==C_LOCK)
  1127.                     {
  1128.                         setup_sel[page][index_y+index_y_start] = MIN_ITEM_SEL;
  1129.                         str = _OsdMessegeFont1[osd_font_mode][STR_OS_LOCK];
  1130.                     } else
  1131.                     {
  1132.                         setup_sel[page][index_y+index_y_start] = MIN_ITEM_SEL + 1;
  1133.                         str = _OsdMessegeFont1[osd_font_mode][STR_OS_UNLOCK];
  1134.                     }
  1135.                     #ifndef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-4 15:39    
  1136.                     osd_draw_setup_button(SETUP_SUB_XSTART, (submenuStart), SETUP_MAX_WIDTH-SETUP_SUB_XSTART-2, SANTIBGCOLOR, 1);
  1137.                     #endif
  1138.                     osd_DrawString(SETUP_SUB_XSTART+1, (submenuStart), str, SANTIFONTCOLOR, SANTIBGCOLOR);
  1139.                 }
  1140.                 else
  1141.                 {
  1142.                     #ifndef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-4 15:39    
  1143.                     osd_draw_setup_button(SETUP_SUB_XSTART, (i-2+index_y)+SETUP_MENU_YSTART, SETUP_MAX_WIDTH-SETUP_SUB_XSTART-2, bgColor, upDown);
  1144.                     #endif
  1145.                     osd_DrawString(SETUP_SUB_XSTART+1, (i-2+index_y)+SETUP_MENU_YSTART, str, fontColor, bgColor);
  1146.                 }
  1147.             }
  1148.             setupItemNum[2] = i-2;
  1149. #endif
  1150.     }
  1151.     #ifdef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-2 18:42
  1152.     osd_DrawLine(0, 86, 280*2, 86, 12, 1);
  1153.     #endif
  1154. }
  1155. #endif  // end of DVD_SETUP_REENG
  1156. //=============================================
  1157. #ifdef QSI_PLATFORM //qsi: added by johnson 20040712
  1158. extern BYTE is_show_full_qsi_version(void);
  1159. #endif
  1160. //=============================================
  1161. //for DVD_SETUP_REENG   //added by JS   //20040728
  1162. #ifndef DVD_SETUP_REENG
  1163. /*
  1164. ** FUNC: to rewrite the infomation in CUSM when Rating_8.
  1165. **
  1166. **  zhaoyanhua 
  1167. **  Date: 3-7-25 17:55 
  1168. */
  1169. void ShowCUSTMMsg(void)
  1170. {
  1171.     BYTE    buf[40];
  1172.     BYTE    *pVersion;
  1173. #ifdef DVD_SERVO
  1174.     extern const UINT8 ServoVersion[];
  1175. #endif
  1176.     extern const UINT8 KernelVersion[];     // moved to libkern.a, leochen 2004/4/19 09:43