Lcd_osd.lst
上传用户:xmyjxjd
上传日期:2013-05-04
资源大小:1517k
文件大小:725k
开发平台:

C/C++

  1. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 1   
  2. C51 COMPILER V7.06, COMPILATION OF MODULE LCD_OSD
  3. OBJECT MODULE PLACED IN .OutputLcd_osd.obj
  4. COMPILER INVOKED BY: C:KeilC51BINC51.EXE CodeLcd_osd.c OPTIMIZE(9,SPEED) BROWSE DEBUG OBJECTEXTEND CODE SYMBOLS PRI
  5.                     -NT(.OutputLcd_osd.lst) PREPRINT(.OutputLcd_osd.i) OBJECT(.OutputLcd_osd.obj)
  6. stmt level    source
  7.    1          #define __OSD__
  8.    2          
  9.    3          #include "reg52.h" 
  10.    4          
  11.    5          #include "HeaderMAIN_DEF.H"
  12.    6          #include "HeaderCONFIG.H"
  13.    7          #include "HeaderACCESS.H"
  14.    8          #include "HeaderLCD_FUNC.H"
  15.    9          #include "HeaderLCD_AUTO.H"
  16.   10          #include "HeaderLCD_MSG.H"
  17.   11          #include "HeaderLCD_MAIN.H"
  18.   12          #include "HeaderLCD_OSD.H"
  19.   13          #include "HeaderFONT.H"
  20.   14          #include "HeaderOSD.H"
  21.   15          #include "HeaderSRC_CTRL.H"
  22.   16          #include "HeaderOSD_TREE.H"
  23.   17          
  24.   18          #include "Headerrgb_echo.H"
  25.   19          
  26.   20          #if (TV_CHIP != TV_NONE)
  27.               #include "TUNER.H"
  28.               #endif
  29.   23          
  30.   24          //////////////////////////////////////////////////////////////////////////////////////////////////////////
  31.              -////
  32.   25          // OSD Process Dispatch Table
  33.   26          // In this code, when input source is not VGA, AUTO CONFIG page will not be shown.
  34.   27          //////////////////////////////////////////////////////////////////////////////////////////////////////////
  35.              -////
  36.   28          
  37.   29          unsigned char GetNextPageIdx(unsigned char ucPageCurr)
  38.   30          {
  39.   31   1          switch (stGUD1.INPUT_SOURCE & 0x07)
  40.   32   1          {
  41.   33   2          case SOURCE_VGA :
  42.   34   2              return (5 <= ucPageCurr) ? 1 : ucPageCurr + 1;
  43.   35   2          case SOURCE_DVI :
  44.   36   2              return (5 <= ucPageCurr) ? 1 : ucPageCurr + 1;
  45.   37   2          case SOURCE_AV  :
  46.   38   2              return (5 <= ucPageCurr) ? 1 : ucPageCurr + 1;
  47.   39   2          case SOURCE_SV  :
  48.   40   2              return (5 <= ucPageCurr) ? 1 : ucPageCurr + 1;
  49.   41   2          case SOURCE_YUV :
  50.   42   2              return (5 <= ucPageCurr) ? 1 : ucPageCurr + 1;
  51.   43   2          default :
  52.   44   2              return 1;
  53.   45   2          }
  54.   46   1          
  55.   47   1      }
  56.   48          
  57.   49          unsigned char GetPrevPageIdx(unsigned char ucPageCurr)
  58.   50          {
  59.   51   1         switch (stGUD1.INPUT_SOURCE & 0x07)
  60.   52   1          {
  61. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 2   
  62.   53   2          case SOURCE_VGA :
  63.   54   2              return (1 >= ucPageCurr) ? 5 : ucPageCurr - 1;
  64.   55   2          case SOURCE_DVI :
  65.   56   2              return (1 >= ucPageCurr) ? 5 : ucPageCurr - 1;
  66.   57   2          case SOURCE_AV  :
  67.   58   2              return (1 >= ucPageCurr) ? 5 : ucPageCurr - 1;
  68.   59   2          case SOURCE_SV  :
  69.   60   2              return (1 >= ucPageCurr) ? 5 : ucPageCurr - 1;
  70.   61   2          case SOURCE_YUV :
  71.   62   2              return (1 >= ucPageCurr) ? 5 : ucPageCurr - 1;
  72.   63   2          default :
  73.   64   2              return 1;
  74.   65   2          }
  75.   66   1      
  76.   67   1      }
  77.   68          
  78.   69          //////////////////////////////////////////////////////////////////////////////////////////////////////////
  79.              -////
  80.   70          // OSD Process Public Function
  81.   71          //////////////////////////////////////////////////////////////////////////////////////////////////////////
  82.              -////
  83.   72          
  84.   73          //  OSD Window : Control OSD Windows
  85.   74          //  win_no     : bit 2 ~ 0   Window Number 0 ~ 7
  86.   75          //  row_start  : bit 10 ~ 0  Window Row Start Address
  87.   76          //  row_end    : bit 10 ~ 0  Window Row End Address
  88.   77          //  col_start  : bit 10 ~ 0  Window Column Start Address
  89.   78          //  col_end    : bit 10 ~ 0  Window Column End Address
  90.   79          //  width      : bit 2 ~ 0   shadow/border width or 3D button thickness in pixel unit 1~8 pixel
  91.   80          //  height     : bit 2 ~ 0   shadow/border height in line unit , it must the same with width for 3D button
  92.              - thickness
  93.   81          //  color      : bit 3 ~ 0   window color index in 16-color LUT
  94.   82          //  color_sb   : bit 7 ~ 4   shadow color or left-top/bottom border color for 3D window
  95.   83          //             : bit 3 ~ 0   border color or right-bottom/top border color
  96.   84          //  gradient   : bit 7       R Gradient Polarity 0 : Decrease  1 : Increase
  97.   85          //             : bit 6       G Gradient Polarity 0 : Decrease  1 : Increase
  98.   86          //             : bit 5       B Gradient Polarity 0 : Decrease  1 : Increase
  99.   87          //             : bit 4 ~ 3   Gradient level      00~11 : 1 step ~ 4 setp per level
  100.   88          //             : bit 2       Enable Red Color Gradient
  101.   89          //             : bit 1       Enable Green Color Gradient
  102.   90          //             : bit 0       Enable Blue Color Gradient
  103.   91          //  gra_level  : bit 2~0     111 ~ 001 : 7 level ~ 1 level per gradient, 000 : 8 level per gradient
  104.   92          //  attr       : bit 6       1 - Enable Gradient function      0 - Disable Gradient function
  105.   93          //             : bit 5       1 - Vertical Gradient             0 - Horizontal Gradient
  106.   94          //             : bit 4       1 - Enable Shadow/Border/3D button   0 - Disable
  107.   95          //             : bit 3 ~ 1   000 : Shadow Type 1
  108.   96          //                           001 : Shadow Type 2
  109.   97          //                           010 : Shadow Type 3
  110.   98          //                           011 : Shadow Type 4
  111.   99          //                           100 : 3D Button Type 1
  112.  100          //                           101 : 3D Button Type 2
  113.  101          //                           110 : Reserved
  114.  102          //                           111 : Border
  115.  103          //             : bit 0       1 - Enable Window            0 - Disable Window
  116.  104          void OSD_Window(unsigned char win_no, unsigned int row_start, unsigned int row_end, unsigned int col_start
  117.              -, unsigned int col_end,
  118.  105                                                  unsigned char width, unsigned char height, unsigned char color, unsigned char color_sb, unsigned char
  119.              - gradient,
  120.  106                                                  unsigned char gray_level,unsigned char attr)
  121.  107          {
  122.  108   1              if(win_no > 7)  
  123.  109   1                      return;
  124. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 3   
  125.  110   1      
  126.  111   1              Data[0]     = 5;
  127.  112   1              Data[1]     = Y_INC;
  128.  113   1              Data[2]     = OSD_ADDR_MSB_90;
  129.  114   1              Data[3]     = 0xc1;
  130.  115   1              Data[4]     = (win_no << 2);
  131.  116   1              Data[5]     = 0;
  132.  117   1              RTDWrite(Data);
  133.  118   1              Data[0]     = 6;
  134.  119   1              Data[1]     = N_INC;
  135.  120   1              Data[2]     = OSD_DATA_92;
  136.  121   1              Data[3]     = ((width & 0x07) << 3) | (height & 0x07);
  137.  122   1              Data[4]     = color_sb;
  138.  123   1              Data[5]     = gradient;
  139.  124   1              Data[6]     = 0;
  140.  125   1              RTDWrite(Data);
  141.  126   1      
  142.  127   1              Data[0]     = 5;
  143.  128   1              Data[1]     = Y_INC;
  144.  129   1              Data[2]     = OSD_ADDR_MSB_90;
  145.  130   1              Data[3]     = 0xe1;
  146.  131   1              Data[4]     = (win_no << 2) + 1;
  147.  132   1              Data[5]     = 0;
  148.  133   1              RTDWrite(Data);
  149.  134   1              Data[0]     = 9;
  150.  135   1              Data[1]     = N_INC;
  151.  136   1              Data[2]     = OSD_DATA_92;
  152.  137   1              Data[3]     = (unsigned char)((unsigned int)(row_start & 0x003f) << 2);
  153.  138   1              Data[4]     = (unsigned char)((unsigned int)(col_start & 0x0007) << 5) | 
  154.  139   1                                    (unsigned char)((unsigned int)(row_start & 0x07c0) >> 6);
  155.  140   1              Data[5]     = (unsigned char)((unsigned int)(col_start & 0x07f8) >> 3);
  156.  141   1      
  157.  142   1              Data[6]     = (unsigned char)((unsigned int)(row_end & 0x003f) << 2);
  158.  143   1              Data[7]    = (unsigned char)((unsigned int)(col_end & 0x0007) << 5) | 
  159.  144   1                                        (unsigned char)((unsigned int)(row_end & 0x07c0) >> 6);
  160.  145   1              Data[8]    = (unsigned char)((unsigned int)(col_end & 0x07f8) >> 3);
  161.  146   1              Data[9]     = 0;
  162.  147   1              RTDWrite(Data);
  163.  148   1      
  164.  149   1              Delay_Xms(25);
  165.  150   1              
  166.  151   1              /*
  167.  152   1              do
  168.  153   1              {
  169.  154   1                      RTDRead(0x94, 0x01, Y_INC);
  170.  155   1              }
  171.  156   1              while( ((Data[0] >> 5) & 0x01) );
  172.  157   1              */
  173.  158   1              
  174.  159   1              Data[0]     = 5;
  175.  160   1              Data[1]     = Y_INC;
  176.  161   1              Data[2]     = OSD_ADDR_MSB_90;
  177.  162   1              Data[3]     = 0xc1;
  178.  163   1              Data[4]     = (win_no << 2) + 3;
  179.  164   1              Data[5]     = 0;
  180.  165   1              RTDWrite(Data);
  181.  166   1              Data[0]     = 6;
  182.  167   1              Data[1]     = N_INC;
  183.  168   1              Data[2]     = OSD_DATA_92;
  184.  169   1              Data[3]    = 0x00;
  185.  170   1              Data[4]    = (unsigned char)((gray_level & 0x07) << 4) |( color & 0x0f);
  186.  171   1              Data[5]    = attr;
  187. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 4   
  188.  172   1              Data[6]    = 0;
  189.  173   1              RTDWrite(Data);
  190.  174   1      
  191.  175   1      }
  192.  176          
  193.  177          /////////////////////////////////////////////////////////////////////////////////////
  194.  178          //anson
  195.  179          /////////////////////////////////////////////////////////////////////////////////////
  196.  180          void OSD_Fact_Line(unsigned char row, unsigned char col, unsigned char length,
  197.  181                        unsigned char value, unsigned char indicate)
  198.  182          {
  199.  183   1              unsigned int idata usStart_Addr;
  200.  184   1              unsigned char idata ucTemp;
  201.  185   1      
  202.  186   1              usStart_Addr = FONT_SELECT_ADDRESS;
  203.  187   1      
  204.  188   1              //The address of the first character Cn1 in Row n = FONT_SELECT_ADDRESS + Row0_length + Row1_length +...+
  205.              -Row(n-1)_length
  206.  189   1              for(ucTemp = 1; ucTemp < row+1; ucTemp ++)
  207.  190   1                      usStart_Addr += FactRow_Info[0][ucTemp];
  208.  191   1      
  209.  192   1              Data[0] = 5;
  210.  193   1              Data[1] = Y_INC;
  211.  194   1              Data[2] = OSD_ADDR_MSB_90;
  212.  195   1      
  213.  196   1              if( (col+1) > FactRow_Info[0][row + 1]) // if column_start > row_length, then return
  214.  197   1                      return;
  215.  198   1              else if((col + 1 + length) > FactRow_Info[0][row + 1])  // if column_start + length > row_length, then re-
  216.              -calculate the length
  217.  199   1                      length = FactRow_Info[0][row + 1] - col;
  218.  200   1      
  219.  201   1              // indicate : 0, 1, 2, 3 set byte 0, 1, 2 and all byte
  220.  202   1              Data[3] = (unsigned char)( ((usStart_Addr + col)  & 0x0fff) >> 8 ) | (((indicate << 2) + 1) << 4);
  221.  203   1              Data[4] = (unsigned char)((usStart_Addr + col) & 0x00ff);
  222.  204   1              Data[5] = 0;
  223.  205   1              RTDWrite(Data);
  224.  206   1      
  225.  207   1              Data[0]     = (indicate == 3) ? length * 3 + 3 : length + 3;
  226.  208   1              Data[1]     = BURST;
  227.  209   1              Data[2]     = OSD_DATA_92;
  228.  210   1              Data[3]     = value;
  229.  211   1              Data[4]     = 0;
  230.  212   1              RTDWrite(Data);
  231.  213   1      
  232.  214   1      }
  233.  215          
  234.  216          void OSD_Fact_Clear(unsigned char row_start, unsigned char height, unsigned char col_start, unsigned char 
  235.              -width)
  236.  217          {
  237.  218   1              width = width;
  238.  219   1              if (height)
  239.  220   1              {
  240.  221   2                      do
  241.  222   2                      {
  242.  223   3                              OSD_Fact_Line(row_start, col_start, FactRow_Info[0][row_start+1], 0x00, 3);
  243.  224   3                              //OSD_Line(row_start, col_start, width, 0x00, 3);
  244.  225   3                              row_start++;
  245.  226   3                      }
  246.  227   2                      while (--height);
  247.  228   2              }
  248.  229   1      }
  249.  230          
  250. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 5   
  251.  231          void ShowValue(unsigned char row, unsigned char col,unsigned char value, unsigned char color)
  252.  232          {
  253.  233   1              unsigned int idata usStart_Addr;
  254.  234   1              unsigned char idata ucTemp;
  255.  235   1      
  256.  236   1              usStart_Addr = FONT_SELECT_ADDRESS;
  257.  237   1      
  258.  238   1              //The address of the first character Cn1 in Row n = FONT_SELECT_ADDRESS + Row0_length + Row1_length +...+
  259.              -Row(n-1)_length
  260.  239   1              for(ucTemp = 1; ucTemp < row+1; ucTemp ++)
  261.  240   1                      usStart_Addr += FactRow_Info[0][ucTemp];
  262.  241   1      
  263.  242   1              Data[10] = value/100;
  264.  243   1              Data[11] = (value - (Data[10]*100))/10;
  265.  244   1              Data[12] = value - (Data[10]*100) - (Data[11]*10);
  266.  245   1              if(0 != Data[10])
  267.  246   1              {
  268.  247   2                      Data[10] += _0_;
  269.  248   2                      Data[11] += _0_;
  270.  249   2              }
  271.  250   1              else
  272.  251   1              {
  273.  252   2                      if(0 != Data[11])       Data[11] += _0_;
  274.  253   2              }
  275.  254   1              Data[12] += _0_;
  276.  255   1              //Byte1
  277.  256   1              Data[0] = 5;
  278.  257   1              Data[1] = Y_INC;
  279.  258   1              Data[2] = OSD_ADDR_MSB_90;
  280.  259   1              Data[3] = (unsigned char)( ((usStart_Addr + col)  & 0x0fff) >> 8 ) | 0x50;
  281.  260   1              Data[4] = (unsigned char)((usStart_Addr + col) & 0x00ff);
  282.  261   1              Data[5] = 0;
  283.  262   1              RTDWrite(Data);
  284.  263   1              Data[0]     = 6;
  285.  264   1              Data[1]     = N_INC;
  286.  265   1              Data[2]     = OSD_DATA_92;
  287.  266   1              Data[3]     = Data[10];
  288.  267   1              Data[4]     = Data[11];
  289.  268   1              Data[5]     = Data[12];
  290.  269   1              Data[6]     = 0;
  291.  270   1              RTDWrite(Data);
  292.  271   1              //Byte2
  293.  272   1              Data[0] = 5;
  294.  273   1              Data[1] = Y_INC;
  295.  274   1              Data[2] = OSD_ADDR_MSB_90;
  296.  275   1              Data[3] = (unsigned char)( ((usStart_Addr + col)  & 0x0fff) >> 8 ) | 0x90;
  297.  276   1              Data[4] = (unsigned char)((usStart_Addr + col) & 0x00ff);
  298.  277   1              Data[5] = 0;
  299.  278   1              RTDWrite(Data);
  300.  279   1              Data[0]     = 6;
  301.  280   1              Data[1]     = N_INC;
  302.  281   1              Data[2]     = OSD_DATA_92;
  303.  282   1              Data[3]     = color;
  304.  283   1              Data[4]     = color;
  305.  284   1              Data[5]     = color;
  306.  285   1              Data[6]     = 0;
  307.  286   1              RTDWrite(Data);
  308.  287   1      }
  309.  288          
  310.  289          void Value_Adjust(unsigned char *Var, unsigned char Key, unsigned char VMax, unsigned char VMin)
  311.  290          {
  312.  291   1              if(NOTIFY_LEFT_KEY == Key)
  313. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 6   
  314.  292   1              {
  315.  293   2                      if(bKeyTurbo)
  316.  294   2                              *Var   = (*Var < (VMax - 1)) ? (*Var + 2) : VMax;
  317.  295   2                      else
  318.  296   2                              *Var   = (*Var < VMax) ? (*Var + 1) : VMax;
  319.  297   2              }
  320.  298   1              else
  321.  299   1              {
  322.  300   2                      if(bKeyTurbo)
  323.  301   2                              *Var   = (*Var > (VMin + 1)) ? *Var - 2 : VMin;
  324.  302   2                      else
  325.  303   2                              *Var   = (*Var > VMin) ? (*Var - 1) : VMin;
  326.  304   2              }
  327.  305   1      }
  328.  306          
  329.  307          void SPREAD_Adjust(unsigned char* variable,unsigned char Key)
  330.  308          {
  331.  309   1              if (NOTIFY_LEFT_KEY == Key)
  332.  310   1              {
  333.  311   2                      if (15 <= *variable)
  334.  312   2                              return;
  335.  313   2       
  336.  314   2                      if (!bKeyTurbo)
  337.  315   2                              *variable   = 15 > *variable ? *variable + 1 : 15;
  338.  316   2                      else
  339.  317   2                              *variable   = 14 > *variable ? *variable + 2 : 15;
  340.  318   2              }
  341.  319   1              else
  342.  320   1              {
  343.  321   2                      if (0 == *variable)
  344.  322   2                              return;
  345.  323   2      
  346.  324   2                      if (!bKeyTurbo)
  347.  325   2                              *variable   = 0 < *variable ? *variable - 1 : 0;
  348.  326   2                      else
  349.  327   2                              *variable   = 1 < *variable ? *variable - 2 : 0;
  350.  328   2              }
  351.  329   1      }
  352.  330          
  353.  331          
  354.  332          /////////////////////////////////////////////////////////////////////////////////////
  355.  333          /////////////////////////////////////////////////////////////////////////////////////
  356.  334          
  357.  335          void Get_OSD_Margin(void)
  358.  336          {
  359.  337   1              unsigned char ucH_Min, ucH_Max, ucV_Max;
  360.  338   1      
  361.  339   1      #if (DISP_ALIGN)
  362.                       RTDRead(DH_ACT_STA_27, 0x02, Y_INC);
  363.                       Data[2] = Data[1] & 0x07;
  364.                       Data[3] = Data[0];
  365.               
  366.                       ucH_Min = (((unsigned int *)Data)[1] / 4) + 1;
  367.                       ucH_Max = OSD_HMAX;
  368.               #else
  369.  347   1              RTDRead(DH_ACT_END_29, 0x02, Y_INC);
  370.  348   1              Data[2] = Data[1] & 0x07;
  371.  349   1              Data[3] = Data[0];
  372.  350   1      
  373.  351   1              //ucH_Max = ((((unsigned int *)Data)[1] - 312 - 8 - 16) / 4) + 1;
  374.  352   1              ucH_Max = ((((unsigned int *)Data)[1] - 512) / 4) + 1; 
  375.  353   1              ucH_Min = OSD_HMIN;
  376. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 7   
  377.  354   1      #endif
  378.  355   1      
  379.  356   1              RTDRead(DV_ACT_END_34, 0x02, Y_INC);
  380.  357   1              Data[2] = Data[1] & 0x07;
  381.  358   1              Data[3] = Data[0];
  382.  359   1      
  383.  360   1              ucV_Max = (((unsigned int *)Data)[1] - DV_ACT_STA_POS - 250 - 14) / 4;
  384.  361   1      
  385.  362   1              Data[0] = ucH_Min;
  386.  363   1              Data[1] = ucH_Max;
  387.  364   1              Data[2] = OSD_VMIN;
  388.  365   1              Data[3] = ucV_Max;
  389.  366   1              
  390.  367   1      }
  391.  368          
  392.  369          // OSD_Position : Restore OSD position according to global settings
  393.  370          // para : OSD font parameter
  394.  371          // OSD_GLOBAL_BLINK    : 0x10
  395.  372          // OSD_DISP_ZONE_LEFT  : 0x04
  396.  373          // OSD_DISP_ZONE_RIGHT : 0x08
  397.  374          // OSD_ROTATE          : 0x02
  398.  375          // OSD_ENABLE          : 0x01
  399.  376          
  400.  377          void OSD_Position(unsigned char para)
  401.  378          {
  402.  379   1              Get_OSD_Margin();
  403.  380   1      
  404.  381   1              if (Data[0] > stGUD1.OSD_POSH || Data[1] < stGUD1.OSD_POSH ||
  405.  382   1                      Data[2] > stGUD1.OSD_POSV || Data[3] < stGUD1.OSD_POSV)
  406.  383   1              {
  407.  384   2                      stGUD1.OSD_POSV = OSD_VMID;
  408.  385   2                      stGUD1.OSD_POSH = OSD_HMID;
  409.  386   2                      Save_GUD1();
  410.  387   2              }
  411.  388   1      
  412.  389   1                      if(ucOSD_Page_Index == PAGE_Factory)            //anson
  413.  390   1                      {
  414.  391   2                              stGUD1.OSD_POSH = 230;
  415.  392   2                              stGUD1.OSD_POSV = 100;
  416.  393   2                      }
  417.  394   1      
  418.  395   1              Wait_For_Event(EVENT_DEN_STOP);
  419.  396   1      
  420.  397   1              Data[0]     = 5;
  421.  398   1              Data[1]     = Y_INC;
  422.  399   1              Data[2]     = OSD_ADDR_MSB_90;
  423.  400   1              Data[3]     = 0xc0;
  424.  401   1              Data[4]     = 0x00;
  425.  402   1              Data[5]     = 6;
  426.  403   1              Data[6]     = N_INC;
  427.  404   1              Data[7]     = OSD_DATA_92;
  428.  405   1              Data[8]     = stGUD1.OSD_POSV >> 1;
  429.  406   1              Data[9]     = (unsigned char)(stGUD1.OSD_POSH >> 2);
  430.  407   1              Data[10]    = ((unsigned char)(stGUD1.OSD_POSH & 0x0003) << 6) | ((stGUD1.OSD_POSV & 0x01) << 5) | para;
  431.  408   1                                      //+ (unsigned char)(OSD_Enable[10] & 0x1e) + osd_en;
  432.  409   1              Data[11]    = 0;
  433.  410   1              RTDWrite(Data);
  434.  411   1      
  435.  412   1      }
  436.  413          
  437.  414          void OSD_Line(unsigned char row, unsigned char col, unsigned char length,
  438.  415                        unsigned char value, unsigned char indicate)
  439. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 8   
  440.  416          {
  441.  417   1              unsigned int idata usStart_Addr;
  442.  418   1              unsigned char idata ucTemp;
  443.  419   1      
  444.  420   1              usStart_Addr = FONT_SELECT_ADDRESS;
  445.  421   1      
  446.  422   1              //The address of the first character Cn1 in Row n = FONT_SELECT_ADDRESS + Row0_length + Row1_length +...+
  447.              -Row(n-1)_length
  448.  423   1              for(ucTemp = 1; ucTemp < row+1; ucTemp ++)
  449.  424   1                      usStart_Addr += Row_Info[0][ucTemp];
  450.  425   1      
  451.  426   1              Data[0] = 5;
  452.  427   1              Data[1] = Y_INC;
  453.  428   1              Data[2] = OSD_ADDR_MSB_90;
  454.  429   1      
  455.  430   1              if( (col+1) > Row_Info[0][row + 1])     // if column_start > row_length, then return
  456.  431   1                      return;
  457.  432   1              else if((col + 1 + length) > Row_Info[0][row + 1])      // if column_start + length > row_length, then re-calc
  458.              -ulate the length
  459.  433   1                      length = Row_Info[0][row + 1] - col;
  460.  434   1              
  461.  435   1              // indicate : 0, 1, 2, 3 set byte 0, 1, 2 and all byte
  462.  436   1              Data[3] = (unsigned char)( ((usStart_Addr + col)  & 0x0fff) >> 8 ) | (((indicate << 2) + 1) << 4);
  463.  437   1              Data[4] = (unsigned char)((usStart_Addr + col) & 0x00ff);
  464.  438   1              Data[5] = 0;  
  465.  439   1              RTDWrite(Data);
  466.  440   1      
  467.  441   1              Data[0]     = (indicate == 3) ? length * 3 + 3 : length + 3;
  468.  442   1              Data[1]     = BURST; 
  469.  443   1              Data[2]     = OSD_DATA_92;
  470.  444   1              Data[3]     = value;
  471.  445   1              Data[4]     = 0;
  472.  446   1              RTDWrite(Data);
  473.  447   1              
  474.  448   1      }     
  475.  449          
  476.  450          
  477.  451          void OSD_Slider(unsigned char row, unsigned char col, unsigned char length, unsigned char value, unsigned 
  478.              -char range,
  479.  452                          unsigned char color, unsigned char color_slider)
  480.  453          {
  481.  454   1              unsigned int idata usStart_Addr;
  482.  455   1              unsigned char idata ucTemp;
  483.  456   1              unsigned int bound;
  484.  457   1      
  485.  458   1              usStart_Addr = FONT_SELECT_ADDRESS;
  486.  459   1      
  487.  460   1              for(ucTemp = 1; ucTemp < row+1; ucTemp ++)
  488.  461   1                      usStart_Addr += Row_Info[0][ucTemp];
  489.  462   1      
  490.  463   1              length = length -5;
  491.  464   1              bound   = ((length-2)*6 + 2*3) * value;
  492.  465   1      
  493.  466   1              // Set color
  494.  467   1              Data[0] = 6;
  495.  468   1              Data[1] = Y_INC;
  496.  469   1              Data[2] = OSD_ADDR_MSB_90;
  497.  470   1              Data[3] = (unsigned char)((((usStart_Addr + col) >>8 ) & 0x0f ) | 0x90);
  498.  471   1              Data[4] = (unsigned char)( (usStart_Addr + col) & 0x00ff);
  499.  472   1              Data[5] = (color << 4) & 0xf0;          
  500.  473   1              Data[6] = 0;
  501.  474   1              RTDWrite(Data);
  502. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 9   
  503.  475   1      
  504.  476   1              Data[0] = 5;
  505.  477   1              Data[1] = N_INC;
  506.  478   1              Data[2] = OSD_DATA_92;
  507.  479   1              Data[3] = (color << 4) & 0xf0;          
  508.  480   1              Data[4] = (color << 4) & 0xf0;          
  509.  481   1              Data[5] = 0;
  510.  482   1              RTDWrite(Data);
  511.  483   1      
  512.  484   1              OSD_Line(row,col+5,12,((color_slider<<4) & 0xf0),2);
  513.  485   1              Data[0] = 6;
  514.  486   1              Data[1] = Y_INC;
  515.  487   1              Data[2] = OSD_ADDR_MSB_90;
  516.  488   1      
  517.  489   1              Data[6] = 0;
  518.  490   1      
  519.  491   1              for (row = 0; row < length; row++)
  520.  492   1              {
  521.  493   2                      Data[3] = (unsigned char)((((usStart_Addr + col + row + 5) >> 8 ) & 0x0f ) | 0x50);
  522.  494   2                      Data[4] = (unsigned char)( (usStart_Addr + col + row + 5) & 0x00ff);
  523.  495   2      
  524.  496   2                      if( row == 0 || row == (length-1) )
  525.  497   2                      {
  526.  498   3                              if( bound )
  527.  499   3                              {
  528.  500   4                                      if( bound >= (range*3) )
  529.  501   4                                      {
  530.  502   5                                              Data[5] = (row==0) ? 0x13 : 0x1e;
  531.  503   5                                              bound = bound - range*3;
  532.  504   5                                      }
  533.  505   4                                      else
  534.  506   4                                      {
  535.  507   5                                      color   = (bound << 4) / (range*3);
  536.  508   5                                              bound = 0;
  537.  509   5              
  538.  510   5                                              if (4 > color)
  539.  511   5                                                      Data[5] = (row==0) ? 0x10 : 0x1b;       
  540.  512   5                                              else if (8 > color)
  541.  513   5                                                      Data[5] = (row==0) ? 0x11 : 0x1c;
  542.  514   5                                              else if (12 > color)
  543.  515   5                                                      Data[5] = (row==0) ? 0x12 : 0x1d;
  544.  516   5                                              else
  545.  517   5                                                      Data[5] = (row==0) ? 0x13 : 0x1e;
  546.  518   5                                      }
  547.  519   4                              }
  548.  520   3                              else
  549.  521   3                              {
  550.  522   4                                      Data[5] = (row==0) ? 0x10 : 0x1b;       
  551.  523   4                              }
  552.  524   3                      }
  553.  525   2                      else
  554.  526   2                      {
  555.  527   3                              if( bound )
  556.  528   3                              {
  557.  529   4                                      if( bound >= (range*6) )
  558.  530   4                                      {
  559.  531   5                                              Data[5] = 0x1a;
  560.  532   5                                              bound = bound - range*6;
  561.  533   5                                      }
  562.  534   4                                      else
  563.  535   4                                      {
  564.  536   5                                              color   = (bound << 4) / (range*6);
  565. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 10  
  566.  537   5                                              bound = 0;
  567.  538   5              
  568.  539   5                                              if (1 > color)
  569.  540   5                                                      Data[5] = 0x14;
  570.  541   5                                              else if (4 > color)
  571.  542   5                                                      Data[5] = 0x15;
  572.  543   5                                              else if (6 > color)
  573.  544   5                                                      Data[5] = 0x16;
  574.  545   5                                              else if (9 > color)
  575.  546   5                                                      Data[5] = 0x17;
  576.  547   5                                              else if (11 > color)
  577.  548   5                                                      Data[5] = 0x18;
  578.  549   5                                              else if (14 > color)
  579.  550   5                                                      Data[5] = 0x19;
  580.  551   5                                              else
  581.  552   5                                                      Data[5] = 0x1a;
  582.  553   5                                      }
  583.  554   4                              }
  584.  555   3                              else
  585.  556   3                              {
  586.  557   4                                      Data[5] = 0x14;
  587.  558   4                              }
  588.  559   3                      
  589.  560   3                      }
  590.  561   2      
  591.  562   2                      RTDWrite(Data);
  592.  563   2                      
  593.  564   2              }
  594.  565   1      
  595.  566   1              range   = value / 10;
  596.  567   1              row             = value - (range * 10); // x1
  597.  568   1              color   = range / 10;                   // x100
  598.  569   1              range   = range - (color * 10); // x10
  599.  570   1      
  600.  571   1              row             = row + 0x01;
  601.  572   1              range   = (range || color) ? range + 0x01 : 0x00;
  602.  573   1              color   = color ? color + 0x01 : 0x00;
  603.  574   1      
  604.  575   1              Data[0] = 5;
  605.  576   1              Data[1] = Y_INC;
  606.  577   1              Data[2] = OSD_ADDR_MSB_90;
  607.  578   1              Data[3] = (unsigned char)((((usStart_Addr + col) >>8 ) & 0x0f ) | 0x50);
  608.  579   1              Data[4] = (unsigned char)( (usStart_Addr + col ) & 0x00ff);
  609.  580   1              Data[5] = 0;
  610.  581   1              RTDWrite(Data);
  611.  582   1      
  612.  583   1              Data[0] = 6;
  613.  584   1              Data[1] = N_INC;
  614.  585   1              Data[2] = OSD_DATA_92;
  615.  586   1              Data[3] = color;                // Number x100
  616.  587   1              Data[4] = range;                // Number x10
  617.  588   1              Data[5] = row;          // Number x1
  618.  589   1              Data[6] = 0;
  619.  590   1              RTDWrite(Data);
  620.  591   1      
  621.  592   1      }
  622.  593          
  623.  594          
  624.  595          void Init_Page(unsigned char index)
  625.  596          {
  626.  597   1              index = index;
  627.  598   1              OSD_Position(OSD_ENABLE);
  628. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 11  
  629.  599   1              OSD_Clear(5, 11, 15, 1);        //Need to be modified case by case.
  630.  600   1              if( ucOSD_Page_Index == 1)
  631.  601   1                      RTDOSDW(OSD_Window_Setting);
  632.  602   1      }
  633.  603          
  634.  604          void Show_Osd_Page(unsigned char Page_Num,unsigned char* Page_Attr,unsigned char OSD_Table_Num)
  635.  605          {
  636.  606   1              Init_Page(Page_Num);
  637.  607   1              RTDOSDW(Page_All_Atb);
  638.  608   1              RTDOSDW(OSD_PAGE_All_TABLE[0][stGUD1.FUNCTION & 0x07]);
  639. *** WARNING C214 IN LINE 608 OF CODELCD_OSD.C: 'Argument': conversion: non-pointer to pointer
  640.  609   1              RTDOSDW(Page_Attr);
  641.  610   1              RTDOSDW(OSD_PAGE_TABLE[OSD_Table_Num][stGUD1.FUNCTION & 0x07]);
  642. *** WARNING C214 IN LINE 610 OF CODELCD_OSD.C: 'Argument': conversion: non-pointer to pointer
  643.  611   1              Show_Mode();
  644.  612   1      }
  645.  613          
  646.  614          void OSD_Clear(unsigned char row_start, unsigned char height, unsigned char col_start, unsigned char width
  647.              -)
  648.  615          {
  649.  616   1              width = width;
  650.  617   1              if (height)
  651.  618   1              {
  652.  619   2                      do
  653.  620   2                      {
  654.  621   3                              OSD_Line(row_start, col_start, Row_Info[0][row_start+1], 0x00, 3);
  655.  622   3                              //OSD_Line(row_start, col_start, width, 0x00, 3);
  656.  623   3                              row_start++;
  657.  624   3                      }
  658.  625   2                      while (--height);
  659.  626   2              }
  660.  627   1      }
  661.  628          
  662.  629          void Bright_Contrast_Adjust(unsigned char* variable,unsigned char Key)
  663.  630          {
  664.  631   1      //      if (NOTIFY_RIGHT_KEY == Key)
  665.  632   1          if (NOTIFY_LEFT_KEY == Key)
  666.  633   1              {
  667.  634   2                      if (100 <= *variable)
  668.  635   2                              return;
  669.  636   2       
  670.  637   2                      if (KEY_TURBO_ENABLE > ucKey_Issued)
  671.  638   2                              *variable   = 100 > *variable ? *variable + 1 : 100;
  672.  639   2                      else
  673.  640   2                              *variable   = 99 > *variable ? *variable + 2 : 100;
  674.  641   2              }
  675.  642   1              else
  676.  643   1              {
  677.  644   2                      if (0 == *variable)
  678.  645   2                              return;
  679.  646   2      
  680.  647   2                      if (KEY_TURBO_ENABLE > ucKey_Issued)
  681.  648   2                              *variable   = 0 < *variable ? *variable - 1 : 0;
  682.  649   2                      else
  683.  650   2                              *variable   = 1 < *variable ? *variable - 2 : 0;
  684.  651   2              }
  685.  652   1      }
  686.  653          
  687.  654          void Osd_Change_Item(unsigned char Pess_Key,unsigned char Item_Num)
  688.  655          {
  689.  656   1              if (ucOSD_Item_Index0)
  690.  657   1              {
  691. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 12  
  692.  658   2                      // Select and highlight the next/previous item
  693.  659   2                      //OSD_Window( 6, 150, 282, (54 + (ucOSD_Item_Index0-1)*(29+4)), (84 + (ucOSD_Item_Index0-1)*(29+4))
  694.  660   2                      //      , 0, 0, 14, 251, 0, 1, 0);
  695.  661   2                      if (NOTIFY_RIGHT_KEY == Pess_Key)
  696.  662   2                              ucOSD_Item_Index0   = (Item_Num == ucOSD_Item_Index0) ? 1 : (ucOSD_Item_Index0 + 1);
  697.  663   2                      else
  698.  664   2                              ucOSD_Item_Index0   = (1 == ucOSD_Item_Index0) ? Item_Num : (ucOSD_Item_Index0 - 1);
  699.  665   2      
  700.  666   2                      // Move window 6
  701.  667   2                      OSD_Window( 6, 150, 282, (54 + (ucOSD_Item_Index0-1)*(29+4)), (84 + (ucOSD_Item_Index0-1)*(29+4))
  702.  668   2                              , 1, 1, 14, 251, 0, 1, 25);
  703.  669   2              }
  704.  670   1              else
  705.  671   1              {
  706.  672   2                      // Change to next/previous main page
  707.  673   2                      //OSD_Window( 5, 150, 282, (54 + (ucOSD_Page_Index-1)*(29+4)), (84 + (ucOSD_Page_Index-1)*(29+4))
  708.  674   2                      //      , 0, 0, 14, 251, 0, 1, 0);
  709.  675   2                      if (NOTIFY_RIGHT_KEY == Pess_Key)
  710.  676   2                              ucOSD_Page_Index    = GetNextPageIdx(ucOSD_Page_Index);
  711.  677   2                      else
  712.  678   2                              ucOSD_Page_Index    = GetPrevPageIdx(ucOSD_Page_Index);
  713.  679   2              } 
  714.  680   1      }
  715.  681          
  716.  682          void Show_Mode(void)
  717.  683          {
  718.  684   1              unsigned int idata usStart_Addr;
  719.  685   1              unsigned char idata ucTemp;
  720.  686   1      
  721.  687   1              OSD_Line(3, 12, 15, 0, 1);                       // Attribute
  722.  688   1              usStart_Addr = FONT_SELECT_ADDRESS;
  723.  689   1      
  724.  690   1              //The address of the first character Cn1 in Row n = FONT_SELECT_ADDRESS + Row0_length + Row1_length +...+
  725.              -Row(n-1)_length
  726.  691   1              for(ucTemp = 1; ucTemp < 3+1; ucTemp ++)
  727.  692   1                      usStart_Addr += Row_Info[0][ucTemp];
  728.  693   1      
  729.  694   1              Data[0] = 5;
  730.  695   1              Data[1] = Y_INC;
  731.  696   1              Data[2] = OSD_ADDR_MSB_90;
  732.  697   1              Data[3] = (unsigned char)( (((usStart_Addr + 12)  & 0x0fff) >> 8 ) | 0x50);
  733.  698   1              Data[4] = (unsigned char)( (usStart_Addr + 12) & 0x00ff);
  734.  699   1              Data[5] = 0;
  735.  700   1              RTDWrite(Data);
  736.  701   1              
  737.  702   1              
  738.  703   1      
  739.  704   1              switch (ucMode_Curr)
  740.  705   1              {   
  741.  706   2              /*
  742.  707   2                      case MODE_NOSIGNAL:     // NO SIGNAL
  743.  708   2                              OSD_Line(11, 2, 24, CHINESE_T <= (stGUD1.FUNCTION & 0x07) ? 0x80 | COLOR_BLUE : COLOR_BLUE, 0);
  744.  709   2      
  745.  710   2                              if ((SOURCE_VGA == (stGUD1.INPUT_SOURCE & 0x07)) && (VGA_ONLINE != bVGA_CONNECT))
  746.  711   2                                      RTDOSDW(OSD_REMK_TABLE[0][stGUD1.FUNCTION & 0x07]);
  747.  712   2                              else
  748.  713   2                                      RTDOSDW(OSD_REMK_TABLE[1][stGUD1.FUNCTION & 0x07]);
  749.  714   2                              break;
  750.  715   2      
  751.  716   2                      case MODE_UNDEFINED0:
  752.  717   2                      case MODE_UNDEFINED1:
  753.  718   2                      case MODE_NOSUPPORT:
  754. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 13  
  755.  719   2                              OSD_Line(11, 2, 24, CHINESE_T <= (stGUD1.FUNCTION & 0x07) ? 0x80 | COLOR_BLUE : COLOR_BLUE, 0);
  756.  720   2                              RTDOSDW(OSD_REMK_TABLE[2][stGUD1.FUNCTION & 0x07]);
  757.  721   2                              break;
  758.  722   2      
  759.  723   2                      case MODE_VIDEO60HZ:    // NTSC 60HZ
  760.  724   2                              OSD_Line(11, 2, 24, COLOR_BLUE, 0);     // Set characters to blue
  761.  725   2                              RTDCodeW(Remark_Mode);
  762.  726   2      
  763.  727   2                              switch(ucAV_Mode)
  764.  728   2                              {
  765.  729   2                                      case 0x01:  RTDCodeW(Remark_V60_0); break;
  766.  730   2                                      case 0x11:  RTDCodeW(Remark_V60_1); break;
  767.  731   2                                      case 0x21:  RTDCodeW(Remark_V60_2); break;
  768.  732   2                                      case 0x31:  RTDCodeW(Remark_V60_3); break;
  769.  733   2                                      case 0x41:  RTDCodeW(Remark_V60_4); break;
  770.  734   2                                      case 0x03:  RTDCodeW(Remark_V60_5); break;
  771.  735   2                              }
  772.  736   2                              break;
  773.  737   2                              
  774.  738   2                      case MODE_VIDEO50HZ:    // PAL 50HZ
  775.  739   2                              OSD_Line(11, 2, 24, COLOR_BLUE, 0);     // Set characters to blue
  776.  740   2                              RTDCodeW(Remark_Mode);
  777.  741   2      
  778.  742   2                              switch(ucAV_Mode)
  779.  743   2                              {   
  780.  744   2                                      case 0x02:  RTDCodeW(Remark_V50_0); break;
  781.  745   2                                      case 0x12:  RTDCodeW(Remark_V50_1); break;
  782.  746   2                                      case 0x22:  RTDCodeW(Remark_V50_2); break;
  783.  747   2                                      case 0x32:  RTDCodeW(Remark_V50_3); break;
  784.  748   2                                      case 0x03:  RTDCodeW(Remark_V50_5); break;
  785.  749   2                              }
  786.  750   2                              break;
  787.  751   2      
  788.  752   2                      case MODE_YUV60HZ:
  789.  753   2                      case MODE_YUV50HZ:
  790.  754   2                      break;
  791.  755   2      */
  792.  756   2                      default :
  793.  757   2                              //OSD_Line(11, 2, 24, COLOR_BLUE, 0);     // Set characters to blue
  794.  758   2      
  795.  759   2                              {
  796.  760   3                              unsigned int    usHwid;
  797.  761   3                              unsigned char   ucTemp;
  798.  762   3      
  799.  763   3                              usHwid  = usIPH_ACT_WID;
  800.  764   3      
  801.  765   3                              if (SOURCE_VGA == (stGUD1.INPUT_SOURCE & 0x07))
  802.  766   3                              {
  803.  767   4                                      if (MODE_1600x1200x60HZ == ucMode_Curr)
  804.  768   4                                      {
  805.  769   5                                              usHwid  = 1600;
  806.  770   5                                      }
  807.  771   4                                      else 
  808.  772   4                                      {
  809.  773   5                                              if (MODE_1600x1200x60HZ > ucMode_Curr)
  810.  774   5                                              {
  811.  775   6                                                      if (MODE_1280x0960x60HZ <= ucMode_Curr)
  812.  776   6                                                              usHwid  = 1280;
  813.  777   6                                                      else if (MODE_1152x0864x75HZ <= ucMode_Curr)
  814.  778   6                                                      usHwid  = 1152;
  815.  779   6                                              }
  816.  780   5                                              else
  817. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 14  
  818.  781   5                                              {
  819.  782   6                                                      if (MODE_USER1600x1200 == ucMode_Curr)
  820.  783   6                                                              usHwid  = 1600;
  821.  784   6                                                      else if (MODE_USER1280x960 <= ucMode_Curr)
  822.  785   6                                                              usHwid  = 1280;
  823.  786   6                                                      else if (MODE_USER1152x864 <= ucMode_Curr)
  824.  787   6                                                              usHwid  = 1152;
  825.  788   6                                              }
  826.  789   5                                      }
  827.  790   4                                              //anson 050512
  828.  791   4                                      if      ((MODE_0640x0400x70HZ == ucMode_Curr)||(MODE_0720x0400x70HZ == ucMode_Curr))
  829.  792   4                                      {
  830.  793   5                                              if(stGUD1.FUNCTION & 0x10)
  831.  794   5                                                      usHwid  = 640;
  832.  795   5                                              else
  833.  796   5                                                      usHwid  = 720;
  834.  797   5                                      }
  835.  798   4                              }
  836.  799   3      
  837.  800   3                              //RTDCodeW(Remark_Mode);
  838.  801   3      
  839.  802   3                              Data[0] = 12;
  840.  803   3                              Data[1] = N_INC;
  841.  804   3                              Data[2] = OSD_DATA_92;
  842.  805   3      
  843.  806   3                              ucTemp  = usHwid / 100;
  844.  807   3      
  845.  808   3                              if (10 <= ucTemp)
  846.  809   3                              {
  847.  810   4                                      Data[3] = _1_;
  848.  811   4                                      Data[4] = ucTemp - 10 + _0_;
  849.  812   4                              }
  850.  813   3                              else
  851.  814   3                              {
  852.  815   4                                      Data[3] = 0;
  853.  816   4                                      Data[4] = ucTemp + _0_;
  854.  817   4                              }
  855.  818   3      
  856.  819   3                              ucTemp  = usHwid - ((unsigned int)100 * ucTemp);
  857.  820   3              
  858.  821   3                              Data[5] = ucTemp / 10;
  859.  822   3                              
  860.  823   3                              Data[6] = ucTemp - (10 * Data[5]) + _0_;
  861.  824   3                              Data[5] = Data[5] + _0_;
  862.  825   3                              Data[7] = 0x0e;
  863.  826   3      
  864.  827   3                              ucTemp      = usIPV_ACT_LEN / 100;
  865.  828   3                              Data[12]    = usIPV_ACT_LEN - ((unsigned int)100 * ucTemp);
  866.  829   3      
  867.  830   3                              if (10 <= ucTemp)
  868.  831   3                              {
  869.  832   4                                      Data[0]     = 13;
  870.  833   4                                      Data[8]     = _1_;
  871.  834   4                                      Data[9]     = ucTemp - 10 + _0_;
  872.  835   4                                      Data[10]    = Data[12] / 10;
  873.  836   4                                      Data[11]    = Data[12] - (10 * Data[10]) + _0_;
  874.  837   4                                      Data[10]    = Data[10] + _0_;
  875.  838   4                                      Data[12]    = 0x00;
  876.  839   4                                      Data[13]    = 0;
  877.  840   4                              }
  878.  841   3                              else
  879.  842   3                              {
  880. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 15  
  881.  843   4                                      Data[8]     = ucTemp + _0_;
  882.  844   4                                      Data[9]     = Data[12] / 10;
  883.  845   4                                      Data[10]    = Data[12] - (10 * Data[9]) + _0_;
  884.  846   4                                      Data[9]     = Data[9] + _0_;
  885.  847   4                                      Data[11]    = 0x00;
  886.  848   4                                      Data[12]    = 0;
  887.  849   4                              }
  888.  850   3      
  889.  851   3                              Data[12]    = 0;
  890.  852   3                              RTDWrite(Data);
  891.  853   3      
  892.  854   3                              // Show Refresh Rate
  893.  855   3                              //RTDCodeW(Remark_Rate);
  894.  856   3      
  895.  857   3                              Data[0] = 7;
  896.  858   3                              Data[1] = N_INC;
  897.  859   3                              Data[2] = OSD_DATA_92;
  898.  860   3                              Data[3] = ucRefresh / 10;
  899.  861   3                              Data[4] = ucRefresh - (Data[3] * 10) + _0_;
  900.  862   3                              Data[3] = Data[3] + _0_;
  901.  863   3                              Data[5] = 0x27;
  902.  864   3                              Data[6] = 0x59;
  903.  865   3                              Data[7] = 0;
  904.  866   3                              RTDWrite(Data);
  905.  867   3                              if (10 <= ucTemp)
  906.  868   3                                      OSD_Line( 3, 21, 1, 0x8c, 0);
  907.  869   3                              else
  908.  870   3                                      OSD_Line( 3, 20, 1, 0x8c, 0);
  909.  871   3                              }
  910.  872   2      
  911.  873   2                              break;
  912.  874   2                              
  913.  875   2              }
  914.  876   1      }   
  915.  877          
  916.  878          ///////////////////////////////////////////////////////////////////////////////////////////
  917.  879          //anson
  918.  880          ///////////////////////////////////////////////////////////////////////////////////////////
  919.  881          void FACTORY_Key_Key(void)
  920.  882          {
  921.  883   1              ucOSD_Page_Index = PAGE_Factory;
  922.  884   1              ucOSD_Item_Index0 = PAGEFact_ITEM_Recall;
  923.  885   1      }
  924.  886          ///////////////////////////////////////////////////////////////////////////////////////////
  925.  887          ///////////////////////////////////////////////////////////////////////////////////////////
  926.  888          
  927.  889          void Page0_Left_Right_Key(unsigned char Key)
  928.  890          {
  929.  891   1      //    RTDSetByte(HOSTCTRL_02, 0x40);  // Wake RTD up
  930.  892   1      // Although you can add ending animation here, I don't think it is necessary.
  931.  893   1      //    RTDSetBit(OVL_CTRL_6D, 0xfe, 0x00);
  932.  894   1      //    RTDOSDW(OSD_Reset);            // Clear OSD
  933.  895   1              //usOSD_Timer         = 5;     // 20 sec
  934.  896   1          if (!b_rgb_VOLUME_STATUS)
  935.  897   1          {
  936.  898   2            OSD_Position(OSD_ENABLE);
  937.  899   2            RTDOSDW(rgb_OSD_VOLUME);
  938.  900   2              RTDOSDW(strTabVOLUME_Atb[stGUD1.FUNCTION & 0x07]);              //anson
  939. *** WARNING C214 IN LINE 900 OF CODELCD_OSD.C: 'Argument': conversion: non-pointer to pointer
  940.  901   2            RTDSetBit(OVL_CTRL_6D, 0xfe, 0x01);
  941.  902   2            b_rgb_VOLUME_STATUS = 1;
  942.  903   2          }
  943. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 16  
  944.  904   1              //OSD_Window( 5, 10, 136, 54, 84, 1, 1, 14, 251, 0, 1, 25);
  945.  905   1              if(NOTIFY_LEFT_KEY == Key)
  946.  906   1              {
  947.  907   2              if (stGUD3.VOLUME > 0x00) stGUD3.VOLUME--;
  948.  908   2              SetVolume();
  949.  909   2              Save_GUD3();
  950.  910   2                      rgb_OSD_Slider(0, 7, 24, 0x1f - stGUD3.VOLUME, 0x1f, 4, 14);
  951.  911   2              }
  952.  912   1      
  953.  913   1              else if(NOTIFY_RIGHT_KEY == Key)
  954.  914   1              {
  955.  915   2              if (stGUD3.VOLUME < 0x1f) stGUD3.VOLUME++;
  956.  916   2              SetVolume();
  957.  917   2              Save_GUD3();
  958.  918   2                      rgb_OSD_Slider(0, 7, 24, 0x1f - stGUD3.VOLUME, 0x1f, 4, 14);
  959.  919   2          }
  960.  920   1      
  961.  921   1      
  962.  922   1      }
  963.  923          
  964.  924          void Page0_Enter_Key(void)
  965.  925          {
  966.  926   1              if((stGUD3.TV_SETTING & 0x08) == 0x08 )//Factory Mode           //anson
  967.  927   1              {
  968.  928   2                      //Into Factory mode
  969.  929   2                      ucOSD_Page_Index    = PAGE_Factory;
  970.  930   2                      ucOSD_Item_Index0   = PAGEFact_ITEM_Recall;
  971.  931   2                      ucOSD_Item_Index1   = 0;
  972.  932   2                      ucOSD_Item_Index2   = 0;
  973.  933   2              }
  974.  934   1              else
  975.  935   1              {
  976.  936   2                      // Change to OSD Main Page 1 and Main Program will show it
  977.  937   2                      ucOSD_Page_Index    = 1;
  978.  938   2                      ucOSD_Item_Index0   = 0;
  979.  939   2                      ucOSD_Item_Index1   = 0;
  980.  940   2                      ucOSD_Item_Index2   = 0;
  981.  941   2                      b_rgb_VOLUME_STATUS = 0;
  982.  942   2              }
  983.  943   1      }
  984.  944          
  985.  945          void Page0_LR_Key(void)
  986.  946          {
  987.  947   1              // Go to Hidden Function Page
  988.  948   1              if (SOURCE_VGA == (stGUD1.INPUT_SOURCE & 0x07))
  989.  949   1              {
  990.  950   2                      ucOSD_Page_Index    = 8;
  991.  951   2                      ucOSD_Item_Index0   = 1;
  992.  952   2                      ucOSD_Item_Index1   = 0;
  993.  953   2                      ucOSD_Item_Index2   = 0;
  994.  954   2              }
  995.  955   1      }
  996.  956          
  997.  957          void Page1_Enter_Key(void)
  998.  958          {
  999.  959   1              if (0 == ucOSD_Item_Index0)
  1000.  960   1              {
  1001.  961   2                      if (MODE_NOSIGNAL != ucMode_Curr && MODE_NOSUPPORT != ucMode_Curr)
  1002.  962   2                      {
  1003.  963   3                              // Select and highlight the first item
  1004.  964   3                              ucOSD_Item_Index0   = PAGE1_ITEM_CONTRAST;
  1005.  965   3                              ucOSD_Item_Index1   = 0;
  1006. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 17  
  1007.  966   3      
  1008.  967   3                              //Enable window 6 and draw it
  1009.  968   3                              //OSD_Window( 6, 150, 282, 54, 84, 1, 1, 14, 251, 0, 1, 25);
  1010.  969   3      // win_no, row_start, row_end,col_start,col_end, width, height, color, color_sb, gradient, gray_level, att
  1011.              -r
  1012.  970   3                  OSD_Window( 6, 150, 282, 54, 84, 1, 1, 14, 251, 0, 1, 25);
  1013.  971   3                      }
  1014.  972   2              }
  1015.  973   1              else
  1016.  974   1              {
  1017.  975   2                      if (ucOSD_Item_Index1)
  1018.  976   2                      {
  1019.  977   3                              // Leave the item and reset text color
  1020.  978   3                              switch (ucOSD_Item_Index0)
  1021.  979   3                              {
  1022.  980   4                                      case PAGE1_ITEM_AUTOBAL :
  1023.  981   4                          if (ucOSD_Item_Index1 == 1 ) //1 : Yes  ,   2 : No
  1024.  982   4                          {
  1025.  983   5                                                      if (ERROR_INPUT == Auto_Balance())
  1026.  984   5                                                      {
  1027.  985   6                                                              ucMode_Curr = MODE_OSDFORCE;
  1028.  986   6                                                              return ;
  1029.  987   6                                                      }
  1030.  988   5                          }
  1031.  989   4                                              OSD_Line( 13, 36 + (ucOSD_Item_Index1-1)*(6+1), 4, 0x40, 2);
  1032.  990   4                                              break;
  1033.  991   4      
  1034.  992   4                                      case PAGE1_ITEM_CONTRAST :
  1035.  993   4                                              // Redraw slider and make the number become black.
  1036.  994   4                                              OSD_Slider(5, 31, 17, stGUD0.CONTRAST, 100, 4, 14);
  1037.  995   4                                              break;
  1038.  996   4      
  1039.  997   4                                      case PAGE1_ITEM_BRIGHT :
  1040.  998   4                                              // Redraw slider and make the number become black.
  1041.  999   4                                              OSD_Slider(7, 31, 17, stGUD0.BRIGHT, 100, 4, 14);
  1042. 1000   4                                              break;
  1043. 1001   4      
  1044. 1002   4                                      case PAGE1_ITEM_COLORTEMP :
  1045. 1003   4                                              //Set words color to black
  1046. 1004   4                                              OSD_Line( 11, 36 + (ucOSD_Item_Index1-1)*(4+1), 4, 0x40, 2);
  1047. 1005   4                                              break;
  1048. 1006   4      
  1049. 1007   4                                      case PAGE1_ITEM_GAMMA :
  1050. 1008   4                                              //Set words color to black
  1051. 1009   4                                              OSD_Line( 9, 36 + (ucOSD_Item_Index1-1)*(2+1), 1, 0x40, 2);
  1052. 1010   4                                              break;
  1053. 1011   4                              }
  1054. 1012   3      
  1055. 1013   3                              ucOSD_Item_Index1   = 0;
  1056. 1014   3      
  1057. 1015   3                      }
  1058. 1016   2                      else
  1059. 1017   2                      {
  1060. 1018   3                              if (PAGE1_ITEM_EXIT == ucOSD_Item_Index0)
  1061. 1019   3                              {
  1062. 1020   4                                      // Disable highlight window 6
  1063. 1021   4                                      OSD_Window( 6, 150, 282, (54 + (ucOSD_Item_Index0-1)*(29+4)), (84 + (ucOSD_Item_Index0-1)*(29+4))
  1064. 1022   4                                              , 0, 0, 14, 251, 0, 1, 0);
  1065. 1023   4                                      // De-select the page item and disable the hightlight window
  1066. 1024   4                                      ucOSD_Item_Index0   = 0;
  1067. 1025   4                                      ucOSD_Item_Index1   = 0;
  1068. 1026   4                              }
  1069. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 18  
  1070. 1027   3                              else if (MODE_NOSIGNAL != ucMode_Curr && MODE_NOSUPPORT != ucMode_Curr)
  1071. 1028   3                              {
  1072. 1029   4                                      switch (ucOSD_Item_Index0)
  1073. 1030   4                                      {
  1074. 1031   5                                              case PAGE1_ITEM_AUTOBAL :
  1075. 1032   5                              ucOSD_Item_Index1  = 2;
  1076. 1033   5                                                      OSD_Line( 13, 36 + (ucOSD_Item_Index1-1)*(6+1), 4, 0x20, 2);
  1077. 1034   5                                                      break;
  1078. 1035   5      
  1079. 1036   5                                              case PAGE1_ITEM_CONTRAST :
  1080. 1037   5                                                      ucOSD_Item_Index1   = 1;
  1081. 1038   5      
  1082. 1039   5                                                      // Redraw slider and make the number become Red.
  1083. 1040   5                                                      OSD_Slider(5, 31, 17, stGUD0.CONTRAST, 100, 2, 14);
  1084. 1041   5                                                      break;
  1085. 1042   5      
  1086. 1043   5                                              case PAGE1_ITEM_BRIGHT :
  1087. 1044   5                                                      ucOSD_Item_Index1   = 1;
  1088. 1045   5      
  1089. 1046   5                                                      // Redraw slider and make the number become Red.
  1090. 1047   5                                                      OSD_Slider(7, 31, 17, stGUD0.BRIGHT, 100, 2, 14);
  1091. 1048   5                                                      break;
  1092. 1049   5      
  1093. 1050   5                                              case PAGE1_ITEM_COLORTEMP :
  1094. 1051   5                                                      ucOSD_Item_Index1 = ((stGUD1.INPUT_SOURCE & 0x18) >> 3) + 1;
  1095. 1052   5      
  1096. 1053   5                                                      //Here we can only change the color in Byte 2 for necessary words
  1097. 1054   5                                                      OSD_Line( 11, 36 + (ucOSD_Item_Index1-1)*(4+1), 4, 0x20, 2);
  1098. 1055   5                                                      break;
  1099. 1056   5      
  1100. 1057   5                                              case PAGE1_ITEM_GAMMA :
  1101. 1058   5                                                      ucOSD_Item_Index1   = ((stGUD1.FUNCTION >> 5) & 0x03) + 1;
  1102. 1059   5      
  1103. 1060   5                                                      //Here we can only change the color in Byte 2 for necessary words
  1104. 1061   5                                                      OSD_Line( 9, 36 + (ucOSD_Item_Index1-1)*(2+1), 1, 0x20, 2);
  1105. 1062   5                                                      break;
  1106. 1063   5      
  1107. 1064   5                                              case PAGE1_ITEM_RGBADJ :
  1108. 1065   5                                                      OSD_Window( 6, 150, 282, (54 + (ucOSD_Item_Index0-1)*(29+4)), (84 + (ucOSD_Item_Index0-1)*(29+4))
  1109. 1066   5                                                              , 0, 0, 14, 251, 0, 1, 0);
  1110. 1067   5                                                      ucOSD_Item_Index1   = PAGE1B_ITEM_RED;
  1111. 1068   5                                                      ucOSD_Item_Index2   = 0;
  1112. 1069   5                                                      OSD_Proc_B(NOTIFY_SHOW);       // Show the sub-page
  1113. 1070   5                                                      break;
  1114. 1071   5                                      }
  1115. 1072   4                              }
  1116. 1073   3                      }
  1117. 1074   2              }
  1118. 1075   1      }
  1119. 1076          
  1120. 1077          void Page1_Left_Right_Key(unsigned char Key)
  1121. 1078          {
  1122. 1079   1              if (ucOSD_Item_Index1)
  1123. 1080   1              {
  1124. 1081   2                      switch (ucOSD_Item_Index0)
  1125. 1082   2                      {
  1126. 1083   3                      case PAGE1_ITEM_AUTOBAL :
  1127. 1084   3      //                      ucOSD_Item_Index1   = (NOTIFY_LEFT_KEY == Key) ? 1 : 2;
  1128. 1085   3                              ucOSD_Item_Index1   = (NOTIFY_RIGHT_KEY == Key) ? 1 : 2;
  1129. 1086   3                                      OSD_Line( 13, 36, 14, 0x40, 2); //Set color to black
  1130. 1087   3                                      OSD_Line( 13, 36 + (ucOSD_Item_Index1-1)*(6+1), 4, 0x20, 2);
  1131. 1088   3                                      break;
  1132. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 19  
  1133. 1089   3      
  1134. 1090   3                              case PAGE1_ITEM_CONTRAST :
  1135. 1091   3                                      Bright_Contrast_Adjust(&stGUD0.CONTRAST,Key);
  1136. 1092   3      
  1137. 1093   3                                      OSD_Slider(5, 31, 17, stGUD0.CONTRAST, 100, 2, 14);
  1138. 1094   3      
  1139. 1095   3      #if(ANALOG_CONTRAST)
  1140. 1096   3                                      if((stGUD1.INPUT_SOURCE & 0x07) == SOURCE_VGA)
  1141. 1097   3                                              SetADC_Gain();
  1142. 1098   3                                      else
  1143. 1099   3                                              Set_Bright_Contrast();
  1144. 1100   3      #else
  1145.                                               Set_Bright_Contrast();
  1146.               #endif
  1147. 1103   3      
  1148. 1104   3                                      Save_GUD0();
  1149. 1105   3                                      break;
  1150. 1106   3      
  1151. 1107   3                              case PAGE1_ITEM_BRIGHT :
  1152. 1108   3                                      Bright_Contrast_Adjust(&stGUD0.BRIGHT,Key);
  1153. 1109   3                      
  1154. 1110   3                                      OSD_Slider(7, 31, 17, stGUD0.BRIGHT, 100, 2, 14);
  1155. 1111   3                                      Set_Bright_Contrast();
  1156. 1112   3                                      Save_GUD0();
  1157. 1113   3                                      break;
  1158. 1114   3      
  1159. 1115   3                              case PAGE1_ITEM_COLORTEMP:
  1160. 1116   3      //                              if(NOTIFY_RIGHT_KEY == Key)
  1161. 1117   3                                      if(NOTIFY_LEFT_KEY == Key)
  1162. 1118   3                                              ucOSD_Item_Index1 = (ucOSD_Item_Index1 == 4) ? 4 : ucOSD_Item_Index1 + 1;
  1163. 1119   3                                      else
  1164. 1120   3                                              ucOSD_Item_Index1 = (ucOSD_Item_Index1 == 1) ? 1 : ucOSD_Item_Index1 - 1;
  1165. 1121   3      
  1166. 1122   3                                      stGUD1.INPUT_SOURCE = (stGUD1.INPUT_SOURCE & 0xe7 ) | ((ucOSD_Item_Index1 - 1) << 3);
  1167. 1123   3      
  1168. 1124   3                                      //Here we can only change the color in Byte 2 for necessary words
  1169. 1125   3                                      OSD_Line( 11, 36, 20, 0x40, 2); //Set color to black
  1170. 1126   3                                      OSD_Line( 11, 36 + (ucOSD_Item_Index1-1)*(4+1), 4, 0x20, 2);
  1171. 1127   3      
  1172. 1128   3                                      Set_Bright_Contrast();
  1173. 1129   3                                      Save_GUD1();
  1174. 1130   3                                      break;
  1175. 1131   3                                      
  1176. 1132   3                              case PAGE1_ITEM_GAMMA :
  1177. 1133   3      //                              if (NOTIFY_RIGHT_KEY == Key)
  1178. 1134   3                                      if (NOTIFY_LEFT_KEY == Key)
  1179. 1135   3                                      {
  1180. 1136   4                                              if (4 <= ucOSD_Item_Index1)
  1181. 1137   4                                                      break;
  1182. 1138   4      
  1183. 1139   4                                              ucOSD_Item_Index1   = ucOSD_Item_Index1 + 1;
  1184. 1140   4                                      }
  1185. 1141   3                                      else
  1186. 1142   3                                      {
  1187. 1143   4                                              if (1 >= ucOSD_Item_Index1)
  1188. 1144   4                                                      break;
  1189. 1145   4      
  1190. 1146   4                                              ucOSD_Item_Index1   = ucOSD_Item_Index1 - 1;
  1191. 1147   4                                      }
  1192. 1148   3      
  1193. 1149   3                                      stGUD1.FUNCTION = (stGUD1.FUNCTION & 0x9f) | ((ucOSD_Item_Index1 - 1) << 5);
  1194. 1150   3                                      //Here we can only change the color in Byte 2 for necessary words
  1195. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 20  
  1196. 1151   3                                      OSD_Line( 9, 36, 14, 0x40, 2);  //Set color to black
  1197. 1152   3                                      OSD_Line( 9, 36 + (ucOSD_Item_Index1-1)*(2+1), 1, 0x20, 2);
  1198. 1153   3      
  1199. 1154   3                                      Set_Gamma();
  1200. 1155   3                                      Save_GUD1();
  1201. 1156   3                                      break;
  1202. 1157   3                  
  1203. 1158   3                      }
  1204. 1159   2              }
  1205. 1160   1              else
  1206. 1161   1              {
  1207. 1162   2                      Osd_Change_Item(Key,PAGE1_ITEM_NUM);
  1208. 1163   2                      
  1209. 1164   2              }
  1210. 1165   1      }
  1211. 1166          
  1212. 1167          void Page1_Show(void)
  1213. 1168          {
  1214. 1169   1              Show_Osd_Page(0,Page1_Atb,0);
  1215. 1170   1      
  1216. 1171   1              //Set Window 5 to select "Colour"
  1217. 1172   1              OSD_Window( 5, 10, 136, 54, 84, 1, 1, 14, 251, 0, 1, 25);
  1218. 1173   1      
  1219. 1174   1              if (MODE_NOSIGNAL == ucMode_Curr || MODE_NOSUPPORT == ucMode_Curr)
  1220. 1175   1              {
  1221. 1176   2                      //ucOSD_Item_Index0   = 0;
  1222. 1177   2                      //ucOSD_Item_Index1   = 0;
  1223. 1178   2              }
  1224. 1179   1      
  1225. 1180   1              OSD_Slider(5, 31, 17, stGUD0.CONTRAST, 100, 4, 14);
  1226. 1181   1              OSD_Slider(7, 31, 17, stGUD0.BRIGHT, 100, 4, 14);
  1227. 1182   1              
  1228. 1183   1              switch (ucOSD_Item_Index0)
  1229. 1184   1              {
  1230. 1185   2                      case PAGE1_ITEM_CONTRAST :
  1231. 1186   2                              break;
  1232. 1187   2                              
  1233. 1188   2                      case PAGE1_ITEM_BRIGHT :
  1234. 1189   2                              break;
  1235. 1190   2                              
  1236. 1191   2                      case PAGE1_ITEM_GAMMA :
  1237. 1192   2                              break;
  1238. 1193   2                              
  1239. 1194   2                      case PAGE1_ITEM_RGBADJ :
  1240. 1195   2                              OSD_Window( 6, 150, 282, (54 + (ucOSD_Item_Index0-1)*(29+4)), (84 + (ucOSD_Item_Index0-1)*(29+4))
  1241. 1196   2                                      , 1, 1, 14, 251, 0, 1, 25);
  1242. 1197   2                              break;
  1243. 1198   2              }
  1244. 1199   1      }
  1245. 1200          
  1246. 1201          void Page1B_Enter_Key(void)
  1247. 1202          {
  1248. 1203   1              ucOSD_Page_Index = 7;
  1249. 1204   1              if (PAGE1B_ITEM_EXIT == ucOSD_Item_Index1)
  1250. 1205   1              {
  1251. 1206   2                      // De-select the page item and disable the hightlight window
  1252. 1207   2                      OSD_Window( 6, 150, 282, (54 + (ucOSD_Item_Index0-1)*(29+4)), (84 + (ucOSD_Item_Index0-1)*(29+4))
  1253. 1208   2                              , 0, 0, 14, 251, 0, 1, 0);
  1254. 1209   2                      ucOSD_Item_Index1   = 0;
  1255. 1210   2                      ucOSD_Item_Index2   = 0;
  1256. 1211   2              }
  1257. 1212   1              else
  1258. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 21  
  1259. 1213   1              {
  1260. 1214   2                      if (ucOSD_Item_Index2)
  1261. 1215   2                      {
  1262. 1216   3                              ucOSD_Item_Index2   = 0;        // Leave the item
  1263. 1217   3                              switch (ucOSD_Item_Index1)
  1264. 1218   3                              {
  1265. 1219   4                                      case PAGE1B_ITEM_RED :
  1266. 1220   4                                              OSD_Slider(5, 31, 17, stGUD0.RTD_R_CONTRAST, 100, 4, 2);
  1267. 1221   4                                              break;
  1268. 1222   4                                      
  1269. 1223   4                                      case PAGE1B_ITEM_GREEN :
  1270. 1224   4                                              OSD_Slider(7, 31, 17, stGUD0.RTD_G_CONTRAST, 100, 4, 12);
  1271. 1225   4                                              break;
  1272. 1226   4                                      
  1273. 1227   4                                      case PAGE1B_ITEM_BLUE :
  1274. 1228   4                                              OSD_Slider(9, 31, 17, stGUD0.RTD_B_CONTRAST, 100, 4, 3);
  1275. 1229   4                                              break;
  1276. 1230   4                              }
  1277. 1231   3                      }
  1278. 1232   2                      else if (MODE_NOSIGNAL != ucMode_Curr && MODE_NOSUPPORT != ucMode_Curr)
  1279. 1233   2                      {
  1280. 1234   3                              ucOSD_Item_Index2   = 1;        // Enter the item
  1281. 1235   3      
  1282. 1236   3                              //Draw the selected slider
  1283. 1237   3                              switch (ucOSD_Item_Index1)
  1284. 1238   3                              {
  1285. 1239   4                                      case PAGE1B_ITEM_RED :
  1286. 1240   4                                              OSD_Slider(5, 31, 17, stGUD0.RTD_R_CONTRAST, 100, 2, 2);
  1287. 1241   4                                              break;
  1288. 1242   4                                      
  1289. 1243   4                                      case PAGE1B_ITEM_GREEN :
  1290. 1244   4                                              OSD_Slider(7, 31, 17, stGUD0.RTD_G_CONTRAST, 100, 12, 12);
  1291. 1245   4                                              break;
  1292. 1246   4                                      
  1293. 1247   4                                      case PAGE1B_ITEM_BLUE :
  1294. 1248   4                                              OSD_Slider(9, 31, 17, stGUD0.RTD_B_CONTRAST, 100, 3, 3);
  1295. 1249   4                                              break;
  1296. 1250   4                              }
  1297. 1251   3                      }
  1298. 1252   2              }
  1299. 1253   1              ucOSD_Page_Index = 1;
  1300. 1254   1      }
  1301. 1255          
  1302. 1256          void Page1B_Left_Right_Key(unsigned char Key)
  1303. 1257          {
  1304. 1258   1              ucOSD_Page_Index = 7;
  1305. 1259   1              if (ucOSD_Item_Index2)
  1306. 1260   1              {
  1307. 1261   2                      switch (ucOSD_Item_Index1)
  1308. 1262   2                      {
  1309. 1263   3                              case PAGE1B_ITEM_RED :
  1310. 1264   3                                      Bright_Contrast_Adjust(&stGUD0.RTD_R_CONTRAST,Key);
  1311. 1265   3                      
  1312. 1266   3                                      OSD_Slider(5, 31, 17, stGUD0.RTD_R_CONTRAST, 100, 2, 2);
  1313. 1267   3                                      break;
  1314. 1268   3                                      
  1315. 1269   3                              case PAGE1B_ITEM_GREEN :
  1316. 1270   3                                      Bright_Contrast_Adjust(&stGUD0.RTD_G_CONTRAST,Key);
  1317. 1271   3                              
  1318. 1272   3                                      OSD_Slider(7, 31, 17, stGUD0.RTD_G_CONTRAST, 100, 12, 12);
  1319. 1273   3                                      break;
  1320. 1274   3                                      
  1321. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 22  
  1322. 1275   3                              case PAGE1B_ITEM_BLUE :
  1323. 1276   3                                      Bright_Contrast_Adjust(&stGUD0.RTD_B_CONTRAST,Key);
  1324. 1277   3                              
  1325. 1278   3                                      OSD_Slider(9, 31, 17, stGUD0.RTD_B_CONTRAST, 100, 3, 3);
  1326. 1279   3                                      break;
  1327. 1280   3                      }
  1328. 1281   2      
  1329. 1282   2                      Set_Bright_Contrast();
  1330. 1283   2                      Save_GUD0();
  1331. 1284   2                      
  1332. 1285   2              }
  1333. 1286   1              else
  1334. 1287   1              {
  1335. 1288   2                      // Select and highlight the next/previous item
  1336. 1289   2                      if (NOTIFY_RIGHT_KEY == Key)
  1337. 1290   2                              ucOSD_Item_Index1   = (PAGE1B_ITEM_NUM == ucOSD_Item_Index1) ? 1 : (ucOSD_Item_Index1 + 1);
  1338. 1291   2                      else
  1339. 1292   2                              ucOSD_Item_Index1   = (1 == ucOSD_Item_Index1) ? PAGE1B_ITEM_NUM : (ucOSD_Item_Index1 - 1);
  1340. 1293   2                  
  1341. 1294   2                      OSD_Window( 6, 150, 282, (54 + (ucOSD_Item_Index1-1)*(29+4)), (84 + (ucOSD_Item_Index1-1)*(29+4))
  1342. 1295   2                              , 1, 1, 14, 251, 0, 1, 25);
  1343. 1296   2              }
  1344. 1297   1              ucOSD_Page_Index = 1;
  1345. 1298   1      }
  1346. 1299          
  1347. 1300          void Page1B_Show(void)
  1348. 1301          {
  1349. 1302   1              Show_Osd_Page(0,Page7_Atb,6);
  1350. 1303   1      
  1351. 1304   1              // Set window 6 to Highlight the select item
  1352. 1305   1              OSD_Window( 6, 150, 282, 54, 84, 1, 1, 14, 251, 0, 1, 25);
  1353. 1306   1              
  1354. 1307   1              if (MODE_NOSIGNAL == ucMode_Curr || MODE_NOSUPPORT == ucMode_Curr)      
  1355. 1308   1                      ucOSD_Item_Index2   = 0;
  1356. 1309   1      
  1357. 1310   1              if (0 == ucOSD_Item_Index2)
  1358. 1311   1              {
  1359. 1312   2                      ucOSD_Page_Index = 7;
  1360. 1313   2                      OSD_Slider(5, 31, 17, stGUD0.RTD_R_CONTRAST, 100, 4, 2);
  1361. 1314   2                      OSD_Slider(7, 31, 17, stGUD0.RTD_G_CONTRAST, 100, 4, 12);
  1362. 1315   2                      OSD_Slider(9, 31, 17, stGUD0.RTD_B_CONTRAST, 100, 4, 3);
  1363. 1316   2                      ucOSD_Page_Index = 1;
  1364. 1317   2              }
  1365. 1318   1              else
  1366. 1319   1              {
  1367. 1320   2                      //Set the active slider (Red, Greed, Blue)
  1368. 1321   2                      /*
  1369. 1322   2                      OSD_Slider(11, 2, 20,
  1370. 1323   2                              (PAGE1B_ITEM_RED == ucOSD_Item_Index1) ? stGUD0.RTD_R_CONTRAST 
  1371. 1324   2                              : (PAGE1B_ITEM_GREEN == ucOSD_Item_Index1) ? stGUD0.RTD_G_CONTRAST
  1372. 1325   2                              : stGUD0.RTD_B_CONTRAST, 100, 0x61);
  1373. 1326   2      
  1374. 1327   2                      */
  1375. 1328   2              }
  1376. 1329   1      }
  1377. 1330          
  1378. 1331          void Page2_Enter_Key()
  1379. 1332          {
  1380. 1333   1              if (0 == ucOSD_Item_Index0)
  1381. 1334   1              {
  1382. 1335   2                      if (MODE_NOSIGNAL != ucMode_Curr && MODE_NOSUPPORT != ucMode_Curr)
  1383. 1336   2                      {
  1384. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 23  
  1385. 1337   3                              // Select and highlight the first item
  1386. 1338   3                              ucOSD_Item_Index0   = PAGE2_ITEM_POSH;
  1387. 1339   3                              ucOSD_Item_Index1   = 0;
  1388. 1340   3      
  1389. 1341   3                              //Enable Window 6 and Draw it
  1390. 1342   3                              OSD_Window( 6, 150, 282, 54, 84, 1, 1, 14, 251, 0, 1, 25);
  1391. 1343   3                      }
  1392. 1344   2              }
  1393. 1345   1              else
  1394. 1346   1              {
  1395. 1347   2                      if (ucOSD_Item_Index1)
  1396. 1348   2                      {
  1397. 1349   3                              switch (ucOSD_Item_Index0)
  1398. 1350   3                              {
  1399. 1351   4                                      case PAGE2_ITEM_POSH :
  1400. 1352   4                                              OSD_Slider(5, 31, 17, ucH_Max_Margin - stMUD.H_POSITION, ucH_Max_Margin - ucH_Min_Margin, 4, 14);
  1401. 1353   4                                              break;
  1402. 1354   4      
  1403. 1355   4                                      case PAGE2_ITEM_POSV :
  1404. 1356   4                                              OSD_Slider(7, 31, 17, (unsigned int)(stMUD.V_POSITION - ucV_Min_Margin) * 50 / (128 - ucV_Min_Margin)
  1405.              -, 100, 4, 14);
  1406. 1357   4                                              break;
  1407. 1358   4                                              
  1408. 1359   4                                      case PAGE2_ITEM_PHASE :
  1409. 1360   4      #if(MORE_PHASE)
  1410.                                                       OSD_Slider(11, 31, 17, stMUD.PHASE, 127, 4, 14);
  1411.               #else
  1412. 1363   4                                              OSD_Slider(11, 31, 17, (stMUD.PHASE & 0x7c) >> 2, 31, 4, 14);
  1413. 1364   4      #endif
  1414. 1365   4                                              break;
  1415. 1366   4                                              
  1416. 1367   4                                      case PAGE2_ITEM_CLOCK :
  1417. 1368   4      
  1418. 1369   4      #if(ALIGN_LEFT == CLOCK_ALIGN)
  1419. 1370   4                          OSD_Slider(13, 31, 17, stMUD.CLOCK - 78, 100, 4, 14);
  1420. 1371   4      #else
  1421.                                                       OSD_Slider(13, 31, 17, stMUD.CLOCK - 28, 200, 4, 14);
  1422.               #endif
  1423. 1374   4                                              break;
  1424. 1375   4      
  1425. 1376   4                                      case PAGE2_ITEM_SHARP :
  1426. 1377   4                                              OSD_Line( 9, 36 + (ucOSD_Item_Index1-1)*(2+1), 1, 0x40, 2);
  1427. 1378   4                                              break;
  1428. 1379   4                                                                                                      
  1429. 1380   4                              }
  1430. 1381   3      
  1431. 1382   3                              ucOSD_Item_Index1   = 0;    // Leave the item
  1432. 1383   3                              
  1433. 1384   3                      }
  1434. 1385   2                      else
  1435. 1386   2                      {
  1436. 1387   3                              if (PAGE2_ITEM_EXIT == ucOSD_Item_Index0)
  1437. 1388   3                              {
  1438. 1389   4                                      // Disable Window 6 and Draw it
  1439. 1390   4                                      OSD_Window( 6, 150, 282, (54 + (ucOSD_Item_Index0-1)*(29+4)), (84 + (ucOSD_Item_Index0-1)*(29+4))
  1440. 1391   4                                              , 0, 0, 14, 251, 0, 1, 0);
  1441. 1392   4                                      // De-select the page item and disable the hightlight window
  1442. 1393   4                                      ucOSD_Item_Index0   = 0;
  1443. 1394   4                                      ucOSD_Item_Index1   = 0;
  1444. 1395   4                              }
  1445. 1396   3                              else if (MODE_NOSIGNAL != ucMode_Curr && MODE_NOSUPPORT != ucMode_Curr)
  1446. 1397   3                              {
  1447. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 24  
  1448. 1398   4                                      if (SOURCE_VGA == (stGUD1.INPUT_SOURCE & 0x07) || PAGE2_ITEM_SHARP == ucOSD_Item_Index0)
  1449. 1399   4                                      {
  1450. 1400   5                                              switch (ucOSD_Item_Index0)
  1451. 1401   5                                              {
  1452. 1402   6                                                      case PAGE2_ITEM_POSH :
  1453. 1403   6                                                              ucOSD_Item_Index1   = 1;    // Enter the item
  1454. 1404   6                                                              OSD_Slider(5, 31, 17, ucH_Max_Margin - stMUD.H_POSITION, ucH_Max_Margin - ucH_Min_Margin, 2, 14);
  1455. 1405   6                                                              break;
  1456. 1406   6                                                              
  1457. 1407   6                                                      case PAGE2_ITEM_POSV :
  1458. 1408   6                                                              ucOSD_Item_Index1   = 1;    // Enter the item
  1459. 1409   6                                                              OSD_Slider(7, 31, 17, (unsigned int)(stMUD.V_POSITION - ucV_Min_Margin) * 50 / (128 - ucV_Min_Margi
  1460.              -n), 100, 2, 14);
  1461. 1410   6                                                              break;
  1462. 1411   6                                                              
  1463. 1412   6                                                      case PAGE2_ITEM_PHASE :
  1464. 1413   6                                                              ucOSD_Item_Index1   = 1;    // Enter the item
  1465. 1414   6      #if(MORE_PHASE)
  1466.                                                                       OSD_Slider(11, 31, 17, stMUD.PHASE, 127, 2, 14);
  1467.               #else
  1468. 1417   6                                                              OSD_Slider(11, 31, 17, (stMUD.PHASE & 0x7c) >> 2, 31, 2, 14);
  1469. 1418   6      #endif
  1470. 1419   6                                                              break;
  1471. 1420   6                                                              
  1472. 1421   6                                                      case PAGE2_ITEM_CLOCK :
  1473. 1422   6                                                              ucOSD_Item_Index1   = 1;    // Enter the item
  1474. 1423   6      #if(ALIGN_LEFT == CLOCK_ALIGN)
  1475. 1424   6                                  OSD_Slider(13, 31, 17, stMUD.CLOCK - 78, 100, 2, 14);
  1476. 1425   6      #else
  1477.                                                                       OSD_Slider(13, 31, 17, stMUD.CLOCK - 28, 200, 2, 14);
  1478.               #endif
  1479. 1428   6                                                              break;
  1480. 1429   6      
  1481. 1430   6                                                      case PAGE2_ITEM_SHARP :
  1482. 1431   6                                                              ucOSD_Item_Index1   = stGUD1.FILTER + 1;
  1483. 1432   6                                                              OSD_Line( 9, 36 + (ucOSD_Item_Index1-1)*(2+1), 1, 0x20, 2);
  1484. 1433   6                                                              break;
  1485. 1434   6                                                                                                      
  1486. 1435   6                                              }
  1487. 1436   5                                      }
  1488. 1437   4                              }
  1489. 1438   3                      }
  1490. 1439   2              }
  1491. 1440   1      }
  1492. 1441          
  1493. 1442          void Page2_Left_Right_Key(unsigned char Key)
  1494. 1443          {
  1495. 1444   1              if (ucOSD_Item_Index1)
  1496. 1445   1              {
  1497. 1446   2                      switch (ucOSD_Item_Index0)
  1498. 1447   2                      {
  1499. 1448   3                              case PAGE2_ITEM_POSH :
  1500. 1449   3      //                              if (NOTIFY_RIGHT_KEY == Key)
  1501. 1450   3                                      if (NOTIFY_LEFT_KEY == Key)
  1502. 1451   3                                      {
  1503. 1452   4                                              if (ucH_Min_Margin >= stMUD.H_POSITION)
  1504. 1453   4                                                      break;
  1505. 1454   4      
  1506. 1455   4                                              if (KEY_TURBO_ENABLE > ucKey_Issued)
  1507. 1456   4                                                      stMUD.H_POSITION    = stMUD.H_POSITION > ucH_Min_Margin ? stMUD.H_POSITION - 1 : ucH_Min_Margin;
  1508. 1457   4                                              else
  1509. 1458   4                                                      stMUD.H_POSITION    = stMUD.H_POSITION > (ucH_Min_Margin + 2) ? stMUD.H_POSITION - 3 : ucH_Min_Margi
  1510. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 25  
  1511.              -n;
  1512. 1459   4                                      }
  1513. 1460   3                                      else
  1514. 1461   3                                      {
  1515. 1462   4                                              if (ucH_Max_Margin <= stMUD.H_POSITION)
  1516. 1463   4                                                      break;
  1517. 1464   4      
  1518. 1465   4                                              if (KEY_TURBO_ENABLE > ucKey_Issued)
  1519. 1466   4                                                      stMUD.H_POSITION    = stMUD.H_POSITION < ucH_Max_Margin ? stMUD.H_POSITION + 1 : ucH_Max_Margin;
  1520. 1467   4                                              else
  1521. 1468   4                                                      stMUD.H_POSITION    = stMUD.H_POSITION < (ucH_Max_Margin - 2) ? stMUD.H_POSITION + 3 : ucH_Max_Margi
  1522.              -n;
  1523. 1469   4                                      }
  1524. 1470   3      
  1525. 1471   3                                      OSD_Slider(5, 31, 17, ucH_Max_Margin - stMUD.H_POSITION, ucH_Max_Margin - ucH_Min_Margin, 2, 14);
  1526. 1472   3                                      Set_H_Position();
  1527. 1473   3                                      Set_Phase(stMUD.PHASE);
  1528. 1474   3                                      Save_MUD(ucMode_Curr);
  1529. 1475   3                                      break;
  1530. 1476   3                                      
  1531. 1477   3                              case PAGE2_ITEM_POSV :
  1532. 1478   3      //                              if (NOTIFY_RIGHT_KEY == Key)
  1533. 1479   3                                      if (NOTIFY_LEFT_KEY == Key)
  1534. 1480   3                                      {
  1535. 1481   4                                              if ((unsigned int)256 - ucV_Min_Margin <= stMUD.V_POSITION)
  1536. 1482   4                                                      break;
  1537. 1483   4      
  1538. 1484   4                                              stMUD.V_POSITION    += 1;
  1539. 1485   4                                      }
  1540. 1486   3                                      else
  1541. 1487   3                                      {
  1542. 1488   4                                              if (ucV_Min_Margin >= stMUD.V_POSITION)
  1543. 1489   4                                                      break;
  1544. 1490   4      
  1545. 1491   4                                              stMUD.V_POSITION    -= 1;
  1546. 1492   4                                      }
  1547. 1493   3      
  1548. 1494   3                                      OSD_Slider(7, 31, 17, (unsigned int)(stMUD.V_POSITION - ucV_Min_Margin) * 50 / (128 - ucV_Min_Margin),
  1549.              - 100, 2, 14);
  1550. 1495   3                                      Set_V_Position();
  1551. 1496   3                                      Save_MUD(ucMode_Curr);
  1552. 1497   3                                      break;
  1553. 1498   3                                                                      
  1554. 1499   3                              case PAGE2_ITEM_PHASE :
  1555. 1500   3      #if(MORE_PHASE)
  1556.               //                              if (NOTIFY_RIGHT_KEY == Key)
  1557.                                               if (NOTIFY_LEFT_KEY == Key)
  1558.                                               {
  1559.                                                       if (0x7f <= stMUD.PHASE)
  1560.                                                               break;
  1561.               
  1562.                                                       stMUD.PHASE += 1;
  1563.                                               }
  1564.                                               else
  1565.                                               {
  1566.                                                       if (0x00 == stMUD.PHASE)
  1567.                                                               break;
  1568.               
  1569.                                                       stMUD.PHASE -= 1;
  1570.                                               }
  1571.               
  1572.                                               OSD_Slider(11, 31, 17, stMUD.PHASE, 127, 2, 14);
  1573. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 26  
  1574.               #else
  1575. 1519   3                                      stMUD.PHASE     &= 0x7c;
  1576. 1520   3      //                              if (NOTIFY_RIGHT_KEY == Key)
  1577. 1521   3                                      if (NOTIFY_LEFT_KEY == Key)
  1578. 1522   3                                      {
  1579. 1523   4                                              if (0x7c <= stMUD.PHASE)
  1580. 1524   4                                                      break;
  1581. 1525   4      
  1582. 1526   4                                              stMUD.PHASE += 4;
  1583. 1527   4                                      }
  1584. 1528   3                                      else
  1585. 1529   3                                      {
  1586. 1530   4                                              if (0x00 == stMUD.PHASE)
  1587. 1531   4                                                      break;
  1588. 1532   4      
  1589. 1533   4                                              stMUD.PHASE -= 4;
  1590. 1534   4                                      }
  1591. 1535   3                                              
  1592. 1536   3                                      OSD_Slider(11, 31, 17, (stMUD.PHASE & 0x7c) >> 2, 31, 2, 14);
  1593. 1537   3      #endif
  1594. 1538   3                                      Set_Phase(stMUD.PHASE);
  1595. 1539   3                                      Save_MUD(ucMode_Curr);
  1596. 1540   3                                      break;
  1597. 1541   3                                              
  1598. 1542   3                              case PAGE2_ITEM_CLOCK :
  1599. 1543   3      #if(ALIGN_LEFT == CLOCK_ALIGN)
  1600. 1544   3      //                              if (NOTIFY_RIGHT_KEY == Key)
  1601. 1545   3                                      if (NOTIFY_LEFT_KEY == Key)
  1602. 1546   3                                      {
  1603. 1547   4                                              if (178 <= stMUD.CLOCK)
  1604. 1548   4                                                      break;
  1605. 1549   4      
  1606. 1550   4                                              if (KEY_TURBO_ENABLE > ucKey_Issued)
  1607. 1551   4                                                      stMUD.CLOCK = (177 >= stMUD.CLOCK) ? stMUD.CLOCK + 1 : 178;
  1608. 1552   4                                              else
  1609. 1553   4                                                      stMUD.CLOCK = (176 >= stMUD.CLOCK) ? stMUD.CLOCK + 2 : 178;
  1610. 1554   4                          
  1611. 1555   4                                              Set_Clock();
  1612. 1556   4                                              Set_H_Position();
  1613. 1557   4                                      }
  1614. 1558   3                                      else
  1615. 1559   3                                      {
  1616. 1560   4                                              if (78 >= stMUD.CLOCK)
  1617. 1561   4                                                      break;
  1618. 1562   4      
  1619. 1563   4                                              if (KEY_TURBO_ENABLE > ucKey_Issued)
  1620. 1564   4                                                      stMUD.CLOCK = (79 <= stMUD.CLOCK) ? stMUD.CLOCK - 1 : 78;
  1621. 1565   4                                              else
  1622. 1566   4                                                      stMUD.CLOCK = (80 <= stMUD.CLOCK) ? stMUD.CLOCK - 2 : 78;
  1623. 1567   4      
  1624. 1568   4                                              Set_H_Position();
  1625. 1569   4                                              Set_Clock();
  1626. 1570   4                                      }
  1627. 1571   3      
  1628. 1572   3                                      OSD_Slider(13, 31, 17, stMUD.CLOCK - 78, 100, 2, 14);
  1629. 1573   3      
  1630. 1574   3      #else
  1631.               //                              if (NOTIFY_RIGHT_KEY == Key)
  1632.                                               if (NOTIFY_LEFT_KEY == Key)
  1633.                                               {
  1634.                                                       if (228 <= stMUD.CLOCK)
  1635.                                                               break;
  1636. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 27  
  1637.               
  1638.                                                       if (KEY_TURBO_ENABLE > ucKey_Issued)
  1639.                                                               stMUD.CLOCK = (227 >= stMUD.CLOCK) ? stMUD.CLOCK + 1 : 228;
  1640.                                                       else
  1641.                                                               stMUD.CLOCK = (226 >= stMUD.CLOCK) ? stMUD.CLOCK + 2 : 228;
  1642.                                   
  1643.                                                       Set_Clock();
  1644.                                                       Set_H_Position();
  1645.                                               }
  1646.                                               else
  1647.                                               {
  1648.                                                       if (28 >= stMUD.CLOCK)
  1649.                                                               break;
  1650.               
  1651.                                                       if (KEY_TURBO_ENABLE > ucKey_Issued)
  1652.                                                               stMUD.CLOCK = (29 <= stMUD.CLOCK) ? stMUD.CLOCK - 1 : 28;
  1653.                                                       else
  1654.                                                               stMUD.CLOCK = (30 <= stMUD.CLOCK) ? stMUD.CLOCK - 2 : 28;
  1655.               
  1656.                                                       Set_H_Position();
  1657.                                                       Set_Clock();
  1658.                                               }
  1659.               
  1660.                                               OSD_Slider(13, 31, 17, stMUD.CLOCK - 28, 200, 2, 14);
  1661.               #endif
  1662. 1605   3                                      Save_MUD(ucMode_Curr);
  1663. 1606   3                                      break;
  1664. 1607   3      
  1665. 1608   3                              case PAGE2_ITEM_SHARP :
  1666. 1609   3      //                              if (NOTIFY_RIGHT_KEY == Key)
  1667. 1610   3                                      if (NOTIFY_LEFT_KEY == Key)
  1668. 1611   3                                      {
  1669. 1612   4                                              if (5 <= ucOSD_Item_Index1)
  1670. 1613   4                                                      break;
  1671. 1614   4      
  1672. 1615   4                                              ucOSD_Item_Index1   = ucOSD_Item_Index1 + 1;
  1673. 1616   4                                      }
  1674. 1617   3                                      else
  1675. 1618   3                                      {
  1676. 1619   4                                              if (1 >= ucOSD_Item_Index1)
  1677. 1620   4                                                      break;
  1678. 1621   4      
  1679. 1622   4                                              ucOSD_Item_Index1   = ucOSD_Item_Index1 - 1;
  1680. 1623   4                                      }
  1681. 1624   3      
  1682. 1625   3                                      OSD_Line( 9, 36, 14, 0x40, 2);  //Set color to black
  1683. 1626   3                                      OSD_Line( 9, 36 + (ucOSD_Item_Index1-1)*(2+1), 1, 0x20, 2);
  1684. 1627   3                                      
  1685. 1628   3                                      stGUD1.FILTER    = ucOSD_Item_Index1 - 1;
  1686. 1629   3                                      Sharpness();
  1687. 1630   3                      
  1688. 1631   3                                      if((usIPH_ACT_WID == 1280) && (DISP_SIZE == DISP_1280x1024) && (stGUD1.FILTER == 0x02))
  1689. 1632   3                                              RTDSetBit(SCALE_CTRL_15, 0xff, 0x01);   // Turn on H scale-up
  1690. 1633   3                                      else if((usIPH_ACT_WID == 1280) && (DISP_SIZE == DISP_1280x1024) && (stGUD1.FILTER != 0x02))
  1691. 1634   3                                              RTDSetBit(SCALE_CTRL_15, 0xfe, 0x00);   // Turn off H scale-up
  1692. 1635   3      
  1693. 1636   3                                      Save_GUD1();
  1694. 1637   3                                      break;
  1695. 1638   3                              
  1696. 1639   3                                              
  1697. 1640   3                      }
  1698. 1641   2              }
  1699. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 28  
  1700. 1642   1              else
  1701. 1643   1              {
  1702. 1644   2                      Osd_Change_Item(Key,PAGE2_ITEM_NUM);
  1703. 1645   2              }
  1704. 1646   1      }
  1705. 1647          
  1706. 1648          
  1707. 1649          void Page2_Show()
  1708. 1650          {
  1709. 1651   1              Show_Osd_Page(1,Page2_Atb,1);
  1710. 1652   1      
  1711. 1653   1              //Set Window 5 to select "Picture"
  1712. 1654   1              OSD_Window( 5, 10, 136, 87, 117, 1, 1, 14, 251, 0, 1, 25);
  1713. 1655   1      
  1714. 1656   1              if (MODE_NOSIGNAL == ucMode_Curr || MODE_NOSUPPORT == ucMode_Curr)
  1715. 1657   1              {
  1716. 1658   2                      ucOSD_Item_Index0   = 0;
  1717. 1659   2                      ucOSD_Item_Index1   = 0;
  1718. 1660   2              }
  1719. 1661   1      
  1720. 1662   1              if (SOURCE_VGA != (stGUD1.INPUT_SOURCE & 0x07) && PAGE2_ITEM_SHARP != ucOSD_Item_Index0)
  1721. 1663   1              {
  1722. 1664   2                      ucOSD_Item_Index1   = 0;
  1723. 1665   2              }
  1724. 1666   1      
  1725. 1667   1              if (0 == ucOSD_Item_Index1)
  1726. 1668   1              {
  1727. 1669   2                      OSD_Slider(5, 31, 17, ucH_Max_Margin - stMUD.H_POSITION, ucH_Max_Margin - ucH_Min_Margin, 4, 14);
  1728. 1670   2                      OSD_Slider(7, 31, 17, (unsigned int)(stMUD.V_POSITION - ucV_Min_Margin) * 50 / (128 - ucV_Min_Margin), 1
  1729.              -00, 4, 14);
  1730. 1671   2      #if(MORE_PHASE)
  1731.                               OSD_Slider(11, 31, 17, stMUD.PHASE, 127, 4, 14);
  1732.               #else
  1733. 1674   2                      OSD_Slider(11, 31, 17, (stMUD.PHASE & 0x7c) >> 2, 31, 4, 14);
  1734. 1675   2      #endif
  1735. 1676   2      
  1736. 1677   2      #if(ALIGN_LEFT == CLOCK_ALIGN)
  1737. 1678   2              OSD_Slider(13, 31, 17, stMUD.CLOCK - 78, 100, 4, 14);
  1738. 1679   2      #else
  1739.                               OSD_Slider(13, 31, 17, stMUD.CLOCK - 28, 200, 4, 14);
  1740.               #endif
  1741. 1682   2              }
  1742. 1683   1              else
  1743. 1684   1              {
  1744. 1685   2                      switch (ucOSD_Item_Index0)
  1745. 1686   2                      {
  1746. 1687   3                              case PAGE2_ITEM_POSH :
  1747. 1688   3                                      break;
  1748. 1689   3                                      
  1749. 1690   3                              case PAGE2_ITEM_POSV :
  1750. 1691   3                                      break;
  1751. 1692   3                                      
  1752. 1693   3                              case PAGE2_ITEM_PHASE :
  1753. 1694   3                                      break;
  1754. 1695   3                                      
  1755. 1696   3                              case PAGE2_ITEM_CLOCK :
  1756. 1697   3                                      break;
  1757. 1698   3      
  1758. 1699   3                              case PAGE2_ITEM_SHARP :
  1759. 1700   3                                      break;
  1760. 1701   3                      }
  1761. 1702   2              }
  1762. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 29  
  1763. 1703   1      }
  1764. 1704          
  1765. 1705          /*
  1766. 1706          bit Page3_Enter_Key(void)
  1767. 1707          {
  1768. 1708                  if (0 == ucOSD_Item_Index0)
  1769. 1709                  {
  1770. 1710                          if ((MODE_NOSIGNAL != ucMode_Curr) && (MODE_NOSUPPORT != ucMode_Curr) && (SOURCE_VGA == (stGUD1.INPUT_SO
  1771.              -URCE & 0x07)))
  1772. 1711                          {
  1773. 1712                                  // Select and highlight the first item
  1774. 1713                                  ucOSD_Item_Index0   = PAGE3_ITEM_AUTOCFG;
  1775. 1714                                  ucOSD_Item_Index1   = 0;
  1776. 1715                                  
  1777. 1716                                  OSD_Window( 6, 150, 282, 54, 84, 1, 1, 14, 251, 0, 1, 25);
  1778. 1717                          }
  1779. 1718                  }
  1780. 1719                  else
  1781. 1720                  {
  1782. 1721                          if (PAGE3_ITEM_EXIT == ucOSD_Item_Index0)
  1783. 1722                          {
  1784. 1723                                  // Disable highlight window
  1785. 1724                                  OSD_Window( 6, 150, 282, (54 + (ucOSD_Item_Index0-1)*(29+4)), (84 + (ucOSD_Item_Index0-1)*(29+4))
  1786. 1725                                          , 0, 0, 14, 251, 0, 1, 0);
  1787. 1726                                  // De-select the page item and disable the hightlight window
  1788. 1727                                  ucOSD_Item_Index0   = 0;
  1789. 1728                                  ucOSD_Item_Index1   = 0;
  1790. 1729                          }
  1791. 1730                          else if (ucOSD_Item_Index1)
  1792. 1731                          {
  1793. 1732                                  if (1 == ucOSD_Item_Index1)
  1794. 1733                                  {
  1795. 1734                                          switch (ucOSD_Item_Index0)
  1796. 1735                                          {
  1797. 1736                                                  case PAGE3_ITEM_AUTOCFG :
  1798. 1737                                                          if (MODE_0640x0350x70HZ <= ucMode_Curr && MODE_0720x0400x70HZ >= ucMode_Curr)
  1799. 1738                                                          {
  1800. 1739                                                                  unsigned char ucResult;
  1801. 1740          
  1802. 1741                                                                  stMUD.CLOCK = 128;
  1803. 1742          
  1804. 1743                                                                  Set_H_Position();
  1805. 1744                                                                  Set_Clock();
  1806. 1745                                                                  Save_MUD(ucMode_Curr);
  1807. 1746          
  1808. 1747                                                                  ucResult    = Auto_Phase();
  1809. 1748          
  1810. 1749                                                                  if (ERROR_SUCCEED == ucResult)
  1811. 1750                                                                  {
  1812. 1751                                                                          ucResult    = Auto_Position();
  1813. 1752                                                                  }
  1814. 1753                                                                  
  1815. 1754                                                                  if (ERROR_INPUT == ucResult)
  1816. 1755                                                                  {
  1817. 1756                                                                          ucMode_Curr = MODE_OSDFORCE;
  1818. 1757                                                                          return 0;
  1819. 1758                                                                  }
  1820. 1759                                                          }
  1821. 1760                                                          else
  1822. 1761                                                          {
  1823. 1762                                                                  if (ERROR_INPUT == Auto_Config())
  1824. 1763                                      {
  1825. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 30  
  1826. 1764                                                                          ucMode_Curr = MODE_OSDFORCE;
  1827. 1765                                                                          return 0;
  1828. 1766                                                                  }
  1829. 1767                                                          }
  1830. 1768          
  1831. 1769                                                          OSD_Line( 5, 36 + (ucOSD_Item_Index1-1)*(6+1), 4, 0x40, 2);
  1832. 1770                                                          break;
  1833. 1771          
  1834. 1772                                                  case PAGE3_ITEM_AUTOBAL :
  1835. 1773                                                          if (ERROR_INPUT == Auto_Balance())
  1836. 1774                                                          {
  1837. 1775                                                                  ucMode_Curr = MODE_OSDFORCE;
  1838. 1776                                                                  return 0;
  1839. 1777                                                          }
  1840. 1778          
  1841. 1779                                                          OSD_Line( 7, 36 + (ucOSD_Item_Index1-1)*(6+1), 4, 0x40, 2);
  1842. 1780                                                          break;
  1843. 1781                                                          
  1844. 1782                                          }
  1845. 1783                                  }
  1846. 1784                                  
  1847. 1785                                  switch (ucOSD_Item_Index0)
  1848. 1786                                  {
  1849. 1787                                                  case PAGE3_ITEM_AUTOCFG :
  1850. 1788                                                          OSD_Line( 5, 36, 14, 0x40, 2);  //Set color to black
  1851. 1789                                                          break;
  1852. 1790                                                  case PAGE3_ITEM_AUTOBAL :
  1853. 1791                                                          OSD_Line( 7, 36, 14, 0x40, 2);  //Set color to black
  1854. 1792                                                          break;
  1855. 1793                                  }
  1856. 1794                                  ucOSD_Item_Index1   = 0;    // Leave the item
  1857. 1795                                  //Show_Mode();
  1858. 1796                          }
  1859. 1797                          else
  1860. 1798                          {
  1861. 1799                                  if (MODE_NOSIGNAL == ucMode_Curr || MODE_NOSUPPORT == ucMode_Curr)  
  1862. 1800                                          return 1;//break;
  1863. 1801          
  1864. 1802                                  ucOSD_Item_Index1   = 2;    // Enter the item, default NO
  1865. 1803          
  1866. 1804                                  switch (ucOSD_Item_Index0)
  1867. 1805                                  {
  1868. 1806                                                  case PAGE3_ITEM_AUTOCFG :
  1869. 1807                                                          OSD_Line( 5, 36 + (ucOSD_Item_Index1-1)*(6+1), 4, 0x20, 2);
  1870. 1808                                                          break;
  1871. 1809                                                  case PAGE3_ITEM_AUTOBAL :
  1872. 1810                                                          OSD_Line( 7, 36 + (ucOSD_Item_Index1-1)*(6+1), 4, 0x20, 2);
  1873. 1811                                                          break;
  1874. 1812                                  }
  1875. 1813                          }
  1876. 1814                  }
  1877. 1815          }
  1878. 1816          */
  1879. 1817          
  1880. 1818          /*
  1881. 1819          void Page3_Left_Right_Key(unsigned char Key)
  1882. 1820          {
  1883. 1821                  if (ucOSD_Item_Index1)
  1884. 1822                  {
  1885. 1823                          ucOSD_Item_Index1   = (NOTIFY_LEFT_KEY == Key) ? 1 : 2;
  1886. 1824          
  1887. 1825                          switch (ucOSD_Item_Index0)
  1888. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 31  
  1889. 1826                          {
  1890. 1827                                          case PAGE3_ITEM_AUTOCFG :
  1891. 1828                                                  OSD_Line( 5, 36, 14, 0x40, 2);  //Set color to black
  1892. 1829                                                  OSD_Line( 5, 36 + (ucOSD_Item_Index1-1)*(6+1), 4, 0x20, 2);
  1893. 1830                                                  break;
  1894. 1831                                          case PAGE3_ITEM_AUTOBAL :
  1895. 1832                                                  OSD_Line( 7, 36, 14, 0x40, 2);  //Set color to black
  1896. 1833                                                  OSD_Line( 7, 36 + (ucOSD_Item_Index1-1)*(6+1), 4, 0x20, 2);
  1897. 1834                                                  break;
  1898. 1835                          }
  1899. 1836                  }
  1900. 1837                  else
  1901. 1838                  {
  1902. 1839                          Osd_Change_Item(Key,PAGE3_ITEM_NUM);
  1903. 1840                  }
  1904. 1841          }
  1905. 1842          
  1906. 1843          void Page3_Show(void)
  1907. 1844          {
  1908. 1845                  Show_Osd_Page(2,Page3_Atb,2);
  1909. 1846          
  1910. 1847                  //Set Window 5 to select "Functuin"
  1911. 1848                  OSD_Window( 5, 10, 136, 120, 150, 1, 1, 14, 251, 0, 1, 25);
  1912. 1849          
  1913. 1850                  if (MODE_NOSIGNAL == ucMode_Curr || MODE_NOSUPPORT == ucMode_Curr)
  1914. 1851                  {
  1915. 1852                          ucOSD_Item_Index0   = 0;
  1916. 1853                          ucOSD_Item_Index1   = 0;
  1917. 1854                  }
  1918. 1855          }
  1919. 1856          */
  1920. 1857          
  1921. 1858          void Page4_Enter_Key(void)
  1922. 1859          {
  1923. 1860   1              if (0 == ucOSD_Item_Index0)
  1924. 1861   1              {
  1925. 1862   2                      // Select and highlight the first item
  1926. 1863   2                      ucOSD_Item_Index0   = PAGE4_ITEM_LANGUAGE;
  1927. 1864   2                      ucOSD_Item_Index1   = 0;
  1928. 1865   2      
  1929. 1866   2                      OSD_Window( 6, 150, 282, 54, 84, 1, 1, 14, 251, 0, 1, 25);
  1930. 1867   2              }
  1931. 1868   1              else
  1932. 1869   1              {
  1933. 1870   2                      switch (ucOSD_Item_Index0)
  1934. 1871   2                      {
  1935. 1872   3                              case PAGE4_ITEM_LANGUAGE :
  1936. 1873   3                                      ucOSD_Item_Index1 = (stGUD1.FUNCTION & 0x07) + 1;
  1937. 1874   3                                      OSD_Proc_B(NOTIFY_SHOW);                // Show the sub-page
  1938. 1875   3                                      break;
  1939. 1876   3                                      
  1940. 1877   3                              case PAGE4_ITEM_OSDH :
  1941. 1878   3                                      if (ucOSD_Item_Index1)
  1942. 1879   3                                      {
  1943. 1880   4                                              ucOSD_Item_Index1 = 0;          // Leave the item
  1944. 1881   4                                              Get_OSD_Margin();
  1945. 1882   4                                              OSD_Slider(7, 31, 17, stGUD1.OSD_POSH - Data[0], Data[1] - Data[0], 4, 14);
  1946. 1883   4                                      }
  1947. 1884   3                                      else
  1948. 1885   3                                      {
  1949. 1886   4                                              ucOSD_Item_Index1 = 1;    // Enter the item, show slider
  1950. 1887   4                                              Get_OSD_Margin();
  1951. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 32  
  1952. 1888   4                                              OSD_Slider(7, 31, 17, stGUD1.OSD_POSH - Data[0], Data[1] - Data[0], 2, 14);
  1953. 1889   4                                      }
  1954. 1890   3                                      break;
  1955. 1891   3                                      
  1956. 1892   3                              case PAGE4_ITEM_OSDV :
  1957. 1893   3                                      if (ucOSD_Item_Index1)
  1958. 1894   3                                      {
  1959. 1895   4                                              ucOSD_Item_Index1   = 0;    // Leave the item
  1960. 1896   4                                              Get_OSD_Margin();
  1961. 1897   4                                              OSD_Slider(9, 31, 17, stGUD1.OSD_POSV - Data[2], Data[3] - Data[2], 4, 14);
  1962. 1898   4                                      }
  1963. 1899   3                                      else
  1964. 1900   3                                      {
  1965. 1901   4                                              ucOSD_Item_Index1   = 1;    // Enter the item, slider
  1966. 1902   4                                              Get_OSD_Margin();
  1967. 1903   4                                              OSD_Slider(9, 31, 17, stGUD1.OSD_POSV - Data[2], Data[3] - Data[2], 2, 14);
  1968. 1904   4                                      }
  1969. 1905   3                                      break;
  1970. 1906   3                                      
  1971. 1907   3                              case PAGE4_ITEM_TIMEOUT :
  1972. 1908   3                                      if(ucOSD_Item_Index2)
  1973. 1909   3                                      {
  1974. 1910   4                                              ucOSD_Item_Index2   = 0;
  1975. 1911   4                                              ucOSD_Item_Index1   = 0;    // Leave the item
  1976. 1912   4      
  1977. 1913   4                                              //Redraw the ON/OFF words
  1978. 1914   4                                              OSD_Line( 11, 31, 3, 0x40, 2);
  1979. 1915   4                                              OSD_Line( 11, 31, 3, 0x00, 1);
  1980. 1916   4      
  1981. 1917   4                                              OSD_Line( 11, 36, 12, 0x8a, 0);
  1982. 1918   4                                              OSD_Line( 11, 36, 12, 0x00, 1);
  1983. 1919   4                                              switch( stGUD1.FUNCTION & 0x07 )
  1984. 1920   4                                              {
  1985. 1921   5                                                      case 5:
  1986. 1922   5                                                              OSD_Line( 11, 37, 1, 0x8c, 0);
  1987. 1923   5                                                              OSD_Line( 11, 37, 1, 0xb3, 1);
  1988. 1924   5                                                              OSD_Line( 11, 43, 1, 0x8c, 0);
  1989. 1925   5                                                              OSD_Line( 11, 43, 1, 0xc9, 1);
  1990. 1926   5                                                              break;
  1991. 1927   5      
  1992. 1928   5                                                      case 6:
  1993. 1929   5                                                              OSD_Line( 11, 37, 1, 0x8c, 0);
  1994. 1930   5                                                              OSD_Line( 11, 37, 1, 0xdb, 1);
  1995. 1931   5                                                              OSD_Line( 11, 43, 1, 0x8c, 0);
  1996. 1932   5                                                              OSD_Line( 11, 43, 1, 0xe5, 1);
  1997. 1933   5                                                              break;
  1998. 1934   5      
  1999. 1935   5                                                      case 7:
  2000. 1936   5                                                              OSD_Line( 11, 37, 1, 0x8c, 0);
  2001. 1937   5                                                              OSD_Line( 11, 37, 1, 0x9b, 1);
  2002. 1938   5                                                              OSD_Line( 11, 43, 1, 0x8c, 0);
  2003. 1939   5                                                              OSD_Line( 11, 43, 1, 0x9c, 1);
  2004. 1940   5                                                              break;
  2005. 1941   5      
  2006. 1942   5                                                      default:
  2007. 1943   5                                                              OSD_Line( 11, 37, 1, 0x2e, 1);
  2008. 1944   5                                                              OSD_Line( 11, 38, 1, 0x2d, 1);
  2009. 1945   5                                                              OSD_Line( 11, 43, 1, 0x2e, 1);
  2010. 1946   5                                                              OSD_Line( 11, 44, 2, 0x25, 1);
  2011. 1947   5                                                              break;
  2012. 1948   5      
  2013. 1949   5                                              }
  2014. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 33  
  2015. 1950   4                                              OSD_Line( 11, 36, 12, 0x40, 2);
  2016. 1951   4      
  2017. 1952   4                                              OSD_Line( 11, 35, 1, 0x00, 1);
  2018. 1953   4                                              OSD_Line( 11, 48, 1, 0x00, 1);
  2019. 1954   4                                                                                      
  2020. 1955   4                                              OSD_Window( 6, 150, 282, (54 + (ucOSD_Item_Index0-1)*(29+4)), (84 + (ucOSD_Item_Index0-1)*(29+4))
  2021. 1956   4                                                      , 1, 1, 14, 251, 0, 1, 25);
  2022. 1957   4      
  2023. 1958   4                                      }
  2024. 1959   3                                      else if (ucOSD_Item_Index1)
  2025. 1960   3                                      {
  2026. 1961   4                                              if(ucOSD_Item_Index1 == 2)
  2027. 1962   4                                              {
  2028. 1963   5                                                      OSD_Line( 11, 36 + (ucOSD_Item_Index1-1)*(6+1), 3, 0x40, 2);
  2029. 1964   5                                                      ucOSD_Item_Index1 = 0;
  2030. 1965   5                                              }
  2031. 1966   4                                              else
  2032. 1967   4                                              {
  2033. 1968   5                                                      ucOSD_Item_Index2    = 1;
  2034. 1969   5                                                      if(stGUD1.OSD_TIMEOUT < 5)
  2035. 1970   5                                                      {
  2036. 1971   6                                                              stGUD1.OSD_TIMEOUT = 20; //reset to 20 seconds
  2037. 1972   6                                                              usOSD_Timer         = 1020; //20*51     
  2038. 1973   6                                                              Save_GUD1();
  2039. 1974   6                                                      }
  2040. 1975   5                              
  2041. 1976   5                                                      OSD_Line( 11, 36, 12, 0xe0, 2);
  2042. 1977   5                                                      OSD_Line( 11, 36, 12, 0x8c, 0);
  2043. 1978   5                                                      OSD_Line( 11, 35, 1, 0x40, 2);
  2044. 1979   5                                                      OSD_Line( 11, 35, 1, 0x0d, 1);
  2045. 1980   5                                                      OSD_Line( 11, 48, 1, 0x40, 2);
  2046. 1981   5                                                      OSD_Line( 11, 48, 1, 0x0c, 1);
  2047. 1982   5                                                      OSD_Slider(11, 31, 17, stGUD1.OSD_TIMEOUT, 60, 2, 14);
  2048. 1983   5                                              }
  2049. 1984   4                                      }
  2050. 1985   3                                      else
  2051. 1986   3                                      {
  2052. 1987   4                                              ucOSD_Item_Index1   = stGUD1.OSD_TIMEOUT ? 1 : 2;
  2053. 1988   4                                              OSD_Line( 11, 36 + (ucOSD_Item_Index1-1)*(6+1), 3, 0x20, 2);
  2054. 1989   4                                      }
  2055. 1990   3                                      break;
  2056. 1991   3                                      
  2057. 1992   3                              case PAGE4_ITEM_TRANSLU :
  2058. 1993   3                                      if (ucOSD_Item_Index1)
  2059. 1994   3                                      {
  2060. 1995   4                                              ucOSD_Item_Index1   = 0;    // Leave the item
  2061. 1996   4                                              OSD_Slider(13, 31, 17, (stGUD1.INPUT_SOURCE & 0xe0) >> 5, 7, 4, 14);
  2062. 1997   4                                      }
  2063. 1998   3                                      else
  2064. 1999   3                                      {
  2065. 2000   4                                              ucOSD_Item_Index1   = 1;
  2066. 2001   4                                              OSD_Slider(13, 31, 17, (stGUD1.INPUT_SOURCE & 0xe0) >> 5, 7, 2, 14);
  2067. 2002   4                                      }
  2068. 2003   3                                      break;
  2069. 2004   3                                      
  2070. 2005   3                              case PAGE4_ITEM_EXIT :
  2071. 2006   3                                      // Disable highlight window 6
  2072. 2007   3                                      OSD_Window( 6, 150, 282, (54 + (ucOSD_Item_Index0-1)*(29+4)), (84 + (ucOSD_Item_Index0-1)*(29+4))
  2073. 2008   3                                              , 0, 0, 14, 251, 0, 1, 0);
  2074. 2009   3                                      // De-select the page item and disable the hightlight window
  2075. 2010   3                                      ucOSD_Item_Index0   = 0;
  2076. 2011   3                                      ucOSD_Item_Index1   = 0;
  2077. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 34  
  2078. 2012   3                                      
  2079. 2013   3                                      break;
  2080. 2014   3                                      
  2081. 2015   3                      }
  2082. 2016   2              }
  2083. 2017   1      }
  2084. 2018          
  2085. 2019          void Page4_Left_Right_Key(unsigned char Key)
  2086. 2020          {
  2087. 2021   1              if (ucOSD_Item_Index1)
  2088. 2022   1              {
  2089. 2023   2                      switch (ucOSD_Item_Index0)
  2090. 2024   2                      {
  2091. 2025   3                              case PAGE4_ITEM_OSDH :
  2092. 2026   3                                      Get_OSD_Margin();
  2093. 2027   3      //                              if (NOTIFY_RIGHT_KEY == Key)
  2094. 2028   3                                      if (NOTIFY_LEFT_KEY == Key)
  2095. 2029   3                                      {
  2096. 2030   4                                              if (Data[1] <= stGUD1.OSD_POSH)
  2097. 2031   4                                                      break;
  2098. 2032   4      
  2099. 2033   4                                              if (KEY_TURBO_ENABLE > ucKey_Issued)
  2100. 2034   4                                                      stGUD1.OSD_POSH   = Data[1] > stGUD1.OSD_POSH ? stGUD1.OSD_POSH + 1 : Data[1];
  2101. 2035   4                                              else
  2102. 2036   4                                                      stGUD1.OSD_POSH   = (Data[1] - 1) > stGUD1.OSD_POSH ? stGUD1.OSD_POSH + 2 : Data[1];
  2103. 2037   4                                      }
  2104. 2038   3                                      else
  2105. 2039   3                                      {
  2106. 2040   4                                              if (Data[0] >= stGUD1.OSD_POSH)
  2107. 2041   4                                                      break;
  2108. 2042   4      
  2109. 2043   4                                              if (KEY_TURBO_ENABLE > ucKey_Issued)
  2110. 2044   4                                                      stGUD1.OSD_POSH   = Data[0] < stGUD1.OSD_POSH ? stGUD1.OSD_POSH - 1 : Data[0];
  2111. 2045   4                                              else
  2112. 2046   4                                                      stGUD1.OSD_POSH   = (Data[0] + 1) < stGUD1.OSD_POSH ? stGUD1.OSD_POSH - 2 : Data[0];
  2113. 2047   4                                      }
  2114. 2048   3      
  2115. 2049   3                                      OSD_Slider(7, 31, 17, stGUD1.OSD_POSH - Data[0], Data[1] - Data[0], 2, 14);
  2116. 2050   3                                      OSD_Position(OSD_ENABLE);
  2117. 2051   3                                      Save_GUD1();
  2118. 2052   3                                      break;
  2119. 2053   3                                      
  2120. 2054   3                              case PAGE4_ITEM_OSDV :
  2121. 2055   3                                      Get_OSD_Margin();
  2122. 2056   3      //                              if (NOTIFY_RIGHT_KEY == Key)
  2123. 2057   3                                      if (NOTIFY_LEFT_KEY == Key)
  2124. 2058   3                                      {
  2125. 2059   4                                              
  2126. 2060   4                                              if (Data[3] <= stGUD1.OSD_POSV)
  2127. 2061   4                                                      break;
  2128. 2062   4      
  2129. 2063   4                                              if (KEY_TURBO_ENABLE > ucKey_Issued)
  2130. 2064   4                                                      stGUD1.OSD_POSV   = Data[3] > stGUD1.OSD_POSV ? stGUD1.OSD_POSV + 1 : Data[3];
  2131. 2065   4                                              else
  2132. 2066   4                                                      stGUD1.OSD_POSV   = (Data[3] - 1) > stGUD1.OSD_POSV ? stGUD1.OSD_POSV + 2 : Data[3];
  2133. 2067   4                                      
  2134. 2068   4                                      }
  2135. 2069   3                                      else
  2136. 2070   3                                      {
  2137. 2071   4                                      
  2138. 2072   4                                              if (Data[2] >= stGUD1.OSD_POSV)
  2139. 2073   4                                                      break;
  2140. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 35  
  2141. 2074   4      
  2142. 2075   4                                              if (KEY_TURBO_ENABLE > ucKey_Issued)
  2143. 2076   4                                                      stGUD1.OSD_POSV   = Data[2] < stGUD1.OSD_POSV ? stGUD1.OSD_POSV - 1 : Data[2];
  2144. 2077   4                                              else
  2145. 2078   4                                                      stGUD1.OSD_POSV   = (Data[2] + 1) < stGUD1.OSD_POSV ? stGUD1.OSD_POSV - 2 : Data[2];
  2146. 2079   4                                                      
  2147. 2080   4                                      }
  2148. 2081   3                                      
  2149. 2082   3                                      OSD_Slider(9, 31, 17, stGUD1.OSD_POSV - Data[2], Data[3] - Data[2], 2, 14);
  2150. 2083   3                                      OSD_Position(OSD_ENABLE);
  2151. 2084   3                                      Save_GUD1();
  2152. 2085   3                                      break;
  2153. 2086   3                                      
  2154. 2087   3                              case PAGE4_ITEM_TIMEOUT :
  2155. 2088   3      //                              if (NOTIFY_RIGHT_KEY == Key)
  2156. 2089   3                                      if (NOTIFY_LEFT_KEY == Key)
  2157. 2090   3                                      {
  2158. 2091   4                                              if(ucOSD_Item_Index2)
  2159. 2092   4                                              {
  2160. 2093   5                                                      stGUD1.OSD_TIMEOUT = (stGUD1.OSD_TIMEOUT == 60) ? 60 : stGUD1.OSD_TIMEOUT + 1;
  2161. 2094   5                                                      OSD_Slider(11, 31, 17, stGUD1.OSD_TIMEOUT, 60, 2, 14);
  2162. 2095   5                                              }
  2163. 2096   4                                              else if(ucOSD_Item_Index1)
  2164. 2097   4                                              {
  2165. 2098   5                                                      //if (2 == ucOSD_Item_Index1)     break;
  2166. 2099   5                                                      ucOSD_Item_Index1  = 2;
  2167. 2100   5                                                      stGUD1.OSD_TIMEOUT  = 0;
  2168. 2101   5                                                      OSD_Line( 11, 36, 14, 0x40, 2);
  2169. 2102   5                                                      OSD_Line( 11, 36 + (ucOSD_Item_Index1-1)*(6+1), 3, 0x20, 2);
  2170. 2103   5                                              }
  2171. 2104   4                                      }
  2172. 2105   3                                      else
  2173. 2106   3                                      {
  2174. 2107   4                                              if(ucOSD_Item_Index2)
  2175. 2108   4                                              {
  2176. 2109   5                                                      stGUD1.OSD_TIMEOUT = (stGUD1.OSD_TIMEOUT == 5) ? 5 : stGUD1.OSD_TIMEOUT - 1;
  2177. 2110   5                                                      OSD_Slider(11, 31, 17, stGUD1.OSD_TIMEOUT, 60, 2, 14);
  2178. 2111   5                                              }
  2179. 2112   4                                              else if(ucOSD_Item_Index1)
  2180. 2113   4                                              {
  2181. 2114   5                                                      //if (1 == ucOSD_Item_Index1)     break;
  2182. 2115   5                                                      ucOSD_Item_Index1   = 1;
  2183. 2116   5                                                      OSD_Line( 11, 36, 14, 0x40, 2);
  2184. 2117   5                                                      OSD_Line( 11, 36 + (ucOSD_Item_Index1-1)*(6+1), 3, 0x20, 2);
  2185. 2118   5                                              }
  2186. 2119   4                                      }
  2187. 2120   3      
  2188. 2121   3                                      usOSD_Timer         = (unsigned int)stGUD1.OSD_TIMEOUT * 51;     // 20 sec
  2189. 2122   3                                      //stGUD1.OSD_TIMEOUT  = (1 == ucOSD_Item_Index1) ? 2 : 0;
  2190. 2123   3                                      Save_GUD1();
  2191. 2124   3                                      break;
  2192. 2125   3                                      
  2193. 2126   3                              case PAGE4_ITEM_TRANSLU :
  2194. 2127   3                                      Data[0] = (stGUD1.INPUT_SOURCE & 0xe0) >> 5;
  2195. 2128   3      //                              if(NOTIFY_RIGHT_KEY  == Key)
  2196. 2129   3                                      if (NOTIFY_LEFT_KEY == Key)
  2197. 2130   3                                      {
  2198. 2131   4                                              if(ucOSD_Item_Index1)
  2199. 2132   4                                              {
  2200. 2133   5                                                      Data[0] = (Data[0] == 0x07) ? 0x07 : Data[0] + 1;
  2201. 2134   5                                                      stGUD1.INPUT_SOURCE = stGUD1.INPUT_SOURCE & 0x1f | (Data[0] << 5);
  2202. 2135   5                                              }
  2203. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 36  
  2204. 2136   4                                      }
  2205. 2137   3                                      else
  2206. 2138   3                                      {
  2207. 2139   4                                              if(ucOSD_Item_Index1)
  2208. 2140   4                                              {
  2209. 2141   5                                                      Data[0] = (Data[0] == 0x00) ? 0x00 : Data[0] - 1;
  2210. 2142   5                                                      stGUD1.INPUT_SOURCE = stGUD1.INPUT_SOURCE & 0x1f | (Data[0] << 5);
  2211. 2143   5                                              }
  2212. 2144   4                                      }
  2213. 2145   3      
  2214. 2146   3                                      RTDSetBit(OVL_CTRL_6D, 0xc7, Data[0] << 3);
  2215. 2147   3                                      OSD_Slider(13, 31, 17, Data[0] , 7, 2, 14);
  2216. 2148   3                                      Save_GUD1();
  2217. 2149   3                                      break;
  2218. 2150   3                                      
  2219. 2151   3                      }
  2220. 2152   2              }
  2221. 2153   1              else
  2222. 2154   1              {
  2223. 2155   2                      Osd_Change_Item(Key,PAGE4_ITEM_NUM);
  2224. 2156   2              }
  2225. 2157   1      }
  2226. 2158          
  2227. 2159          
  2228. 2160          void Page4_Show(void)
  2229. 2161          {
  2230. 2162   1              Show_Osd_Page(2,Page4_Atb,3);
  2231. 2163   1      
  2232. 2164   1      
  2233. 2165   1              //Set Window 5 to select "OSD Menu"
  2234. 2166   1      //      OSD_Window( 5, 10, 136, 153, 183, 1, 1, 14, 251, 0, 1, 25);
  2235. 2167   1              OSD_Window( 5, 10, 136, 120, 150, 1, 1, 14, 251, 0, 1, 25);
  2236. 2168   1      
  2237. 2169   1              if (0 == ucOSD_Item_Index1)
  2238. 2170   1              {
  2239. 2171   2                      Get_OSD_Margin();
  2240. 2172   2                      OSD_Slider(7, 31, 17, stGUD1.OSD_POSH - Data[0], Data[1] - Data[0], 4, 14);
  2241. 2173   2                      Get_OSD_Margin();
  2242. 2174   2                      OSD_Slider(9, 31, 17, stGUD1.OSD_POSV - Data[2], Data[3] - Data[2], 4, 14);
  2243. 2175   2      
  2244. 2176   2                      OSD_Slider(13, 31, 17, (stGUD1.INPUT_SOURCE & 0xe0) >> 5, 7, 4, 14);
  2245. 2177   2                      if( ucOSD_Item_Index0 == PAGE4_ITEM_LANGUAGE)
  2246. 2178   2                              OSD_Window( 6, 150, 282, 54, 84, 1, 1, 14, 251, 0, 1, 25);
  2247. 2179   2                      RTDSetBit(OVL_CTRL_6D, 0xfe, 0x01);
  2248. 2180   2              }
  2249. 2181   1              else
  2250. 2182   1              {
  2251. 2183   2                      switch (ucOSD_Item_Index0)
  2252. 2184   2                      {
  2253. 2185   3                              case PAGE4_ITEM_OSDH :
  2254. 2186   3                                      //Get_OSD_Margin();
  2255. 2187   3                                      //OSD_Slider(11, 2, 17, stGUD1.OSD_POSH - Data[0], Data[1] - Data[0], 0x02);
  2256. 2188   3                                      break;
  2257. 2189   3                                      
  2258. 2190   3                              case PAGE4_ITEM_OSDV :
  2259. 2191   3                                      //Get_OSD_Margin();
  2260. 2192   3                                      //OSD_Slider(11, 2, 17, stGUD1.OSD_POSV - Data[2], Data[3] - Data[2], 0x02);
  2261. 2193   3                                      break;
  2262. 2194   3                                      
  2263. 2195   3                              case PAGE4_ITEM_TIMEOUT :
  2264. 2196   3                                      //ucOSD_Item_Index1   = stGUD1.OSD_TIMEOUT ? 1 : 2;
  2265. 2197   3                                      //OSD_Line( 10, 15 + (ucOSD_Item_Index1-1)*(4+1), 4, 0x00, 2);
  2266. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 37  
  2267. 2198   3                                      break;
  2268. 2199   3                                      
  2269. 2200   3                              case PAGE4_ITEM_TRANSLU :
  2270. 2201   3                                      //ucOSD_Item_Index1   = (stGUD1.INPUT_SOURCE & 0x80) ? 1 : 2;     // 1-On, 2-Off
  2271. 2202   3                                      //OSD_Line( 10, 15 + (ucOSD_Item_Index1-1)*(4+1), 4, 0x00, 2);
  2272. 2203   3                                      break;
  2273. 2204   3                                      
  2274. 2205   3                      }
  2275. 2206   2              }
  2276. 2207   1      }
  2277. 2208          
  2278. 2209          void Page4B_Enter_Key(void)
  2279. 2210          {
  2280. 2211   1              if ((stGUD1.FUNCTION & 0x07) != (ucOSD_Item_Index1 - 1))
  2281. 2212   1              {
  2282. 2213   2                      stGUD1.FUNCTION = (stGUD1.FUNCTION & 0xf8) | ((ucOSD_Item_Index1 - 1) & 0x07);
  2283. 2214   2                      Save_GUD1();
  2284. 2215   2      
  2285. 2216   2                      switch (stGUD1.FUNCTION & 0x07)
  2286. 2217   2                      {
  2287. 2218   3                              case CHINESE_T :
  2288. 2219   3                              case CHINESE_S :
  2289. 2220   3                                      //RTDCodeW(OSD_Reset);
  2290. 2221   3                                      RTDSetBit(OVL_CTRL_6D, 0xfe, 0x00);
  2291. 2222   3                                      Load_VLC_Font(Font_East_C, 0x5a9, 0x45);
  2292. 2223   3                                      Page4_Show();
  2293. 2224   3                                      //RTDSetBit(OVL_CTRL_6D, 0xfe, 0x01);
  2294. 2225   3                                      //RTDCodeW(OSD_Enable);
  2295. 2226   3                                      break;
  2296. 2227   3                                      
  2297. 2228   3                              case JAPANESS :
  2298. 2229   3                                      //RTDCodeW(OSD_Reset);
  2299. 2230   3                                      RTDSetBit(OVL_CTRL_6D, 0xfe, 0x00);
  2300. 2231   3                                      Load_VLC_Font(Font_East_J, 0x573, 0x4B);
  2301. 2232   3                                      Page4_Show();
  2302. 2233   3                                      //RTDSetBit(OVL_CTRL_6D, 0xfe, 0x01);
  2303. 2234   3                                      //RTDCodeW(OSD_Enable);
  2304. 2235   3                                      break;
  2305. 2236   3                                      
  2306. 2237   3                              default :
  2307. 2238   3                                      break;
  2308. 2239   3                                      
  2309. 2240   3                      }
  2310. 2241   2              }
  2311. 2242   1      
  2312. 2243   1              ucOSD_Item_Index1   = 0;    // Quit Sub-Page
  2313. 2244   1      }
  2314. 2245          
  2315. 2246          void Page4B_Left_Right_Key(unsigned char Key)
  2316. 2247          {
  2317. 2248   1              // Select and highlight the next/previous item
  2318. 2249   1              OSD_Window( 6, 150 + ((ucOSD_Item_Index1-1)/4)*170, 282 + ((ucOSD_Item_Index1-1)/4)*170, 
  2319. 2250   1                      54 + ((ucOSD_Item_Index1-1)%4)*33, 84 + ((ucOSD_Item_Index1-1)%4)*33, 0, 0, 14, 251, 0, 1, 0);
  2320. 2251   1              if (NOTIFY_RIGHT_KEY == Key)
  2321. 2252   1                      ucOSD_Item_Index1   = (PAGE4B_ITEM_NUM == ucOSD_Item_Index1) ? 1 : (ucOSD_Item_Index1 + 1);
  2322. 2253   1              else
  2323. 2254   1                      ucOSD_Item_Index1   = (1 == ucOSD_Item_Index1) ? PAGE4B_ITEM_NUM : (ucOSD_Item_Index1 - 1);
  2324. 2255   1      
  2325. 2256   1              OSD_Window( 6, 150 + ((ucOSD_Item_Index1-1)/4)*170, 282 + ((ucOSD_Item_Index1-1)/4)*170, 
  2326. 2257   1                      54 + ((ucOSD_Item_Index1-1)%4)*33, 84 + ((ucOSD_Item_Index1-1)%4)*33, 1, 1, 14, 251, 0, 1, 25);
  2327. 2258   1      }
  2328. 2259          
  2329. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 38  
  2330. 2260          void Page4B_Show(void)
  2331. 2261          {
  2332. 2262   1              Show_Osd_Page(3,Page8_Atb,7);
  2333. 2263   1              RTDOSDW(Page8_Content);
  2334. 2264   1              // Set Window 6
  2335. 2265   1              OSD_Window( 6, 150 + ((ucOSD_Item_Index1-1)/4)*170, 282 + ((ucOSD_Item_Index1-1)/4)*170, 
  2336. 2266   1                      54 + ((ucOSD_Item_Index1-1)%4)*33, 84 + ((ucOSD_Item_Index1-1)%4)*33, 1, 1, 14, 251, 0, 1, 25);
  2337. 2267   1      }
  2338. 2268          
  2339. 2269          void Page5_Enter_Key(void)
  2340. 2270          {
  2341. 2271   1              if (0 == ucOSD_Item_Index0)
  2342. 2272   1              {
  2343. 2273   2                      // Select and highlight the first item
  2344. 2274   2                      ucOSD_Item_Index0   = PAGE5_ITEM_SOURCE;
  2345. 2275   2                      ucOSD_Item_Index1   = 0;
  2346. 2276   2                      OSD_Window( 6, 150, 282, 54, 84, 1, 1, 14, 251, 0, 1, 0);
  2347. 2277   2                      OSD_Window( 6, 150, 282, 54, 84, 1, 1, 14, 251, 0, 1, 25);
  2348. 2278   2              }
  2349. 2279   1              else
  2350. 2280   1              {
  2351. 2281   2                      switch (ucOSD_Item_Index0)
  2352. 2282   2                      {
  2353. 2283   3                              case PAGE5_ITEM_SOURCE :
  2354. 2284   3                                      Data[0]             = stGUD1.INPUT_SOURCE & 0x07;
  2355. 2285   3                                      ucOSD_Item_Index1   = (SOURCE_DVI == Data[0])   ? PAGE5B_ITEM_DVI 
  2356. 2286   3                                              : (SOURCE_AV == Data[0])    ? PAGE5B_ITEM_CVBS 
  2357. 2287   3                                              : (SOURCE_SV == Data[0])    ? PAGE5B_ITEM_SV 
  2358. 2288   3                                              : (SOURCE_YUV == Data[0])   ? PAGE5B_ITEM_YUV 
  2359. 2289   3                                              : (SOURCE_TV == Data[0])    ? PAGE5B_ITEM_TV : PAGE5B_ITEM_DSUB;
  2360. 2290   3      
  2361. 2291   3                                      OSD_Proc_B(NOTIFY_SHOW);   // Show the sub-page
  2362. 2292   3                                      break;
  2363. 2293   3                                      
  2364. 2294   3                              case PAGE5_ITEM_OPTION :
  2365. 2295   3                                      if (ucOSD_Item_Index1)
  2366. 2296   3                                      {
  2367. 2297   4                                              OSD_Line( 7, 36 + (ucOSD_Item_Index1-1)*(7+1), 7, 0x40, 2);
  2368. 2298   4                                                                                      
  2369. 2299   4                                              //ucOSD_Item_Index1   = (1 == ucOSD_Item_Index1) ? 0x00 : 0x80;
  2370. 2300   4                          Data[0]   = (1 == ucOSD_Item_Index1) ? 0x00 : 0x10;
  2371. 2301   4                                              //stGUD1.INPUT_SOURCE = (stGUD1.INPUT_SOURCE & 0x7f) | ucOSD_Item_Index1;
  2372. 2302   4                          stGUD1.FUNCTION = stGUD1.FUNCTION & 0xef | Data[0];
  2373. 2303   4                                              ucOSD_Item_Index1   = 0;
  2374. 2304   4                                              Save_GUD1();
  2375. 2305   4      
  2376. 2306   4                                              if (SOURCE_VGA == (stGUD1.INPUT_SOURCE & 0x07) && 400 == usIPV_ACT_LEN &&
  2377. 2307   4                                                      MODE_0640x0400x56HZ != ucMode_Curr && MODE_USER720x400 != ucMode_Curr)
  2378. 2308   4                                              {
  2379. 2309   5                                                      //if (stGUD1.INPUT_SOURCE & 0x80)
  2380. 2310   5      /*                                              if (stGUD1.FUNCTION & 0x10)
  2381. 2311   5                                                      {
  2382. 2312   5                                                              if (720 == usIPH_ACT_WID)
  2383. 2313   5                                                                      ucMode_Curr = MODE_OSDFORCE;    // Force to VGA search mode again
  2384. 2314   5                                                      }
  2385. 2315   5                                                      else
  2386. 2316   5                                                      {
  2387. 2317   5                                                              if (640 == usIPH_ACT_WID)
  2388. 2318   5                                                                      ucMode_Curr = MODE_OSDFORCE;    // Force to VGA search mode again
  2389. 2319   5                                                      }
  2390. 2320   5      */
  2391. 2321   5                                                      if (stGUD1.FUNCTION & 0x10)             //anson
  2392. C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 39  
  2393. 2322   5                                                      {
  2394. 2323   6                                                              stGUD1.FUNCTION = (stGUD1.FUNCTION & 0xef);
  2395. 2324   6                                                              ucMode_Curr = MODE_OSDFORCE;
  2396. 2325   6                                                      }
  2397. 2326   5                                                      else    
  2398. 2327   5                                                      {
  2399. 2328   6                                                              stGUD1.FUNCTION = (stGUD1.FUNCTION | 0x10);
  2400. 2329   6                                                              ucMode_Curr = MODE_OSDFORCE;
  2401. 2330   6                                                      }
  2402. 2331   5                                              }
  2403. 2332   4                                      }
  2404. 2333   3                                      else
  2405. 2334   3                                      {
  2406. 2335   4                                              ucOSD_Item_Index1   = (stGUD1.FUNCTION & 0x10) ? 2 : 1;     // 1-720, 2-640//(stGUD1.INPUT_SOURCE & 0
  2407.              -x80) ? 2 : 1;     // 1-720, 2-640
  2408. 2336   4                                              OSD_Line( 7, 36 + (ucOSD_Item_Index1-1)*(7+1), 7, 0x20, 2);
  2409. 2337   4                                      }
  2410. 2338   3                                      break;
  2411. 2339   3                                      
  2412. 2340   3                              case PAGE5_ITEM_RECALL :
  2413. 2341   3                                      if (ucOSD_Item_Index1)
  2414. 2342   3                                      {
  2415. 2343   4                                              if (1 == ucOSD_Item_Index1)
  2416. 2344   4                                              {
  2417. 2345   5                                              {
  2418. 2346   6                                                      unsigned char   ucTemp1, ucTemp2;
  2419. 2347   6      
  2420. 2348   6                                                      // Save the global settings we don't want to reset
  2421. 2349   6                                                      ucTemp1 = stGUD1.FUNCTION & 0x07;       // Language select
  2422. 2350   6                                                      ucTemp2 = stGUD1.INPUT_SOURCE & 0x07;   // Source select
  2423. 2351   6      
  2424. 2352   6                                                      if (JAPANESS < ucTemp1)
  2425. 2353   6                                                              ucTemp1 = ENGLISH;
  2426. 2354   6      
  2427. 2355   6                                                      // Reset OSD time-out timer
  2428. 2356   6                                                      usOSD_Timer = (unsigned int)2 << 9;     // 20 sec
  2429. 2357   6      
  2430. 2358   6                                                      // Reset global settings to default
  2431. 2359   6                                                      Init_GUD();
  2432. 2360   6                                                      // Reset OSD time-out timer
  2433. 2361   6                                                      usOSD_Timer = (unsigned int)stGUD1.OSD_TIMEOUT << 9;
  2434. 2362   6      
  2435. 2363   6                                                      // Restore the global settings we don't want to reset
  2436. 2364   6                                                      stGUD1.FUNCTION     = (stGUD1.FUNCTION & 0xf8) | ucTemp1;
  2437. 2365   6                                                      stGUD1.INPUT_SOURCE = (stGUD1.INPUT_SOURCE & 0xf8) | ucTemp2;
  2438. 2366   6                                                      Save_GUD1();
  2439. 2367   6      
  2440. 2368   6                                                      // Reset brightness and contrast to default
  2441. 2369   6                                                      Set_Bright_Contrast();
  2442. 2370   6      
  2443. 2371   6      #if (AUDIO_TYPE != AUDIO_NONE)
  2444. 2372   6                                                      SetVolume();
  2445. 2373   6      #endif
  2446. 2374   6                                                      // Reset OSD position
  2447. 2375   6                                                      OSD_Position(OSD_ENABLE);
  2448. 2376   6                                              }
  2449. 2377   5      
  2450. 2378   5                                                      // Reset all mode settings to default
  2451. 2379   5                                                      Init_MUD();
  2452. 2380   5      
  2453. 2381   5                                                      // Read default settings for current mode
  2454. 2382   5                                                      Load_MUD(ucMode_Curr);