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

📄 osdctrl.lst

📁 t112 参考文件
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V7.50   OSDCTRL                                                               01/12/2006 13:31:13 PAGE 1   


C51 COMPILER V7.50, COMPILATION OF MODULE OSDCTRL
OBJECT MODULE PLACED IN .\Obj\OSDCTRL.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE Source\OSD\OSDCTRL.C BROWSE INCDIR(.\Include\;.\Source\;.\Include\Panel\;.\
                    -Include\GammaTable\) DEFINE(T106) DEBUG OBJECTEXTEND PRINT(.\OSDCTRL.lst) OBJECT(.\Obj\OSDCTRL.obj)

line level    source

   1          //---------------------------------------------------------------------------
   2          // Terawins Inc. Company Confidential Strictly Private
   3          //
   4          // $Archive: OSDCtrl.c $
   5          // $Revision: 2.0 $
   6          // $Author: jwang $
   7          // $Date: 2003/08/13 $
   8          //
   9          // --------------------------------------------------------------------------
  10          // >>>>>>>>>>>>>>>>>>>>>>>>> COPYRIGHT NOTICE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  11          // --------------------------------------------------------------------------
  12          // Copyright 2002 (c) Terawins Inc.
  13          // This is an unpublished work.
  14          // --------------------------------------------------------------------------
  15          #include <reg51.h>
  16          #include "common.h"
  17          #include "System.h"
  18          #include "Struct.h"
  19          #include "TW10xReg.h"
  20          #include "OSDCtrl.h"
  21          #include "TwoWire.h"
  22          #include "OSDDraw.h"
  23          #include "Keypad.h"
  24          #include "Video.h"
  25          #include "Tuner.h"
  26          //#include "OSDDRAW.h"
  27          #ifdef NVRAM
  28          #include "NVRam.h"
  29          extern uWORD idata m_wEepRom;
  30          #endif
  31          extern bit m_bAir_Cable;
  32          extern bit m_bTV_Skip;
  33          extern uCHAR ir_data;
  34          extern void BKPower(void);
  35          #ifdef TIMER1
  36          extern void Timer1Reset(void);
  37          extern void Timer1Start(void);
  38          extern void Timer1Stop(void);
  39          #endif
  40          
  41          extern uCHAR m_cSoundSystem;
  42          extern bit m_bBKPowerOn;
  43          extern LoadFilter(uCHAR);
  44          extern BOOL SrcOptimizing(uCHAR cTuneType);
  45          extern OSDPARAMS code sOSDParamsDef, sOSDParamsMin, sOSDParamsMax;
  46          extern uCHAR idata m_cOSDEvent;
  47          extern uCHAR idata m_cOSDFunc;
  48          extern uCHAR idata m_cItem;
  49          extern uCHAR idata m_cSource;
  50          extern uCHAR code OSDPositionTable[];
  51          extern uCHAR idata m_cBuff[4];
  52          extern uWORD idata m_wBuff[3];
  53          
  54          bit idata skipon=0;
C51 COMPILER V7.50   OSDCTRL                                                               01/12/2006 13:31:13 PAGE 2   

  55          
  56          #if VIDEO_AVAILABLE
  57          extern EEPVIDEO idata EepVideo;
  58          #endif
  59          
  60          
  61          void OSDItemAdj(uCHAR cAdj)
  62          {
  63   1              sCHAR sStep;
  64   1              if(cAdj==INCREASE)
  65   1                      sStep=1;
  66   1              else if(cAdj==DECREASE)
  67   1                      sStep=-1;
  68   1      #ifdef LOAD_TIME        
                      if(cAdj==INCREASE1)
                      {
                              AdjTimingB8(1);
                              return;
                      }
                      else if(cAdj==DECREASE1)
                      {
                              AdjTimingB8(-1);
                              return;
                  }
              #endif  
  80   1                      OSDItemAdjVideo(sStep);
  81   1      }
  82          
  83          extern uCHAR idata m_cOSDMenu;
  84          
  85          void OSDItemAdjVideo(sCHAR sStep)
  86          {
  87   1        if(m_cOSDMenu==idVIDEOMENU)
  88   1        {
  89   2      
  90   2              switch(m_cOSDFunc){
  91   3              case idBRIGHTMENU:
  92   3                      AdjVideoBright(sStep);
  93   3                      break;
  94   3              case idCONTRASTMENU:
  95   3                      AdjVideoContrast(sStep);
  96   3                      break;
  97   3      
  98   3              case idSHARPMENU:
  99   3                      AdjVideoSharp(sStep);
 100   3                      break;
 101   3      
 102   3              case idSATMENU:
 103   3                      AdjVideoSat(sStep);
 104   3                      break;
 105   3      
 106   3              case idHUEMENU:
 107   3                      AdjVideoHue(sStep);
 108   3                      break;
 109   3      #ifdef LOAD_TIME                
                      case idTIMEMENU:
                              AdjTimingB2(sStep);
                              break;
              #endif
 114   3                      default :break;
 115   3                      }
 116   2          }
C51 COMPILER V7.50   OSDCTRL                                                               01/12/2006 13:31:13 PAGE 3   

 117   1      #ifdef TV
                  else
                  {
              
                      switch(m_cOSDFunc){
                      case idCHANNEL_TV:
                              AdjTVChannel(sStep, 1);
                              break;
              #ifdef PAL
                      case iSOUNDSYSTEM_TV:
                              AdjTVSoundSystem();
                              break;
              #endif
              #ifdef NTSC
                      case idSKIP_TV:
                              AdjTVSkip();
                              break;
                      case idSOURCE_TV:
                              AdjTVSource();
                           //OSDShowTVSource(sStep);
                              break;
              #endif
                      case idFINETUNE_TV:
                              AdjTVFineTune(sStep);
                              break;
                      case idAUTOMEMORY_TV:
                              AutoMemory();
                              break;
                      case idRECALL_TV:
                          OSDShowRESET(0);
                              ResetTVChannel();
                              OSDShowRESET(1);
                              break;
                      default: break;
                       }
                }
              #endif
 154   1        
 155   1      }
 156          
 157          
 158          
 159          void AdjVolume(sCHAR sStep)
 160          {
 161   1              if( (EepVideo.cVolume+sStep)<=sOSDParamsMax.cVolume
 162   1                &&(EepVideo.cVolume+sStep)>=sOSDParamsMin.cVolume)
 163   1              {
 164   2                      EepVideo.cVolume += sStep;
 165   2                 I2CWriteByte(TW101, 0xE9, EepVideo.cVolume);
 166   2                      OSDShowVideoData();
 167   2                      if(EepVideo.cVolume==sOSDParamsMin.cVolume)
 168   2                              AUDIO_MUTE=1;  //MUTE audio
 169   2                      else
 170   2                              AUDIO_MUTE=0;  //open audio     
 171   2              }
 172   1              
 173   1              #ifdef NVRAM
 174   1              I2CWriteByte(EEPVIDEOBLOCK, idVIDEO_VOLUME_INDEX, EepVideo.cVolume);
 175   1              #endif
 176   1              return;
 177   1      
 178   1      }
C51 COMPILER V7.50   OSDCTRL                                                               01/12/2006 13:31:13 PAGE 4   

 179          
 180          
 181          #if VIDEO_AVAILABLE
 182          extern uCHAR idata m_cStandard;
 183          void AdjTimingB2(sCHAR sStep)
 184          {
 185   1      sStep=sStep;
 186   1      #ifdef LOAD_TIME
                          if(I2CReadByte(TW101,0xb2)+sStep>=0&&I2CReadByte(TW101,0xb2)+sStep<=0xFF)
                              {
              
                       
                                      if(m_cStandard==S_NTSC)   
                                      {
                                              EepVideo.cB2=I2CReadByte(TW101,0xb2)+sStep;
                                              EepVideo.cB8=I2CReadByte(TW101,0xb8);
                                              I2CWriteByte(TW101,0xb2,EepVideo.cB2);          
                                      I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B8, EepVideo.cB8);
                                              twdDelay(NVRDELAY);     
                                              I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B2, EepVideo.cB2);
                                      twdDelay(NVRDELAY);
                                              EepVideo.cFlag=Panel_ID;
                                      I2CWriteByte(EEPVIDEOBLOCK, idTIMING_FLAG_INDEX, EepVideo.cFlag);
                                      }
                          else if(m_cStandard==S_PAL)  
                                      {
                                              EepVideo.cB2_PAL=I2CReadByte(TW101,0xb2)+sStep;
                                              EepVideo.cB8_PAL=I2CReadByte(TW101,0xb8);
                                              I2CWriteByte(TW101,0xb2,EepVideo.cB2_PAL);              
                                      I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B8_PAL, EepVideo.cB8_PAL);
                                              twdDelay(NVRDELAY);     
                                              I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B2_PAL, EepVideo.cB2_PAL);
                                      twdDelay(NVRDELAY);
                                              EepVideo.cFlag_PAL=Panel_ID;
                                      I2CWriteByte(EEPVIDEOBLOCK, idTIMING_FLAG_INDEX1, EepVideo.cFlag_PAL);
                                      }
                              twdDelay(NVRDELAY);     
                                      OSDShowVideoData();
                              }
              #endif
 219   1      }
 220          
 221          void AdjTimingB8(sCHAR sStep)
 222          {
 223   1      sStep=sStep;
 224   1      #ifdef LOAD_TIME
                          if(I2CReadByte(TW101,0xb8)+sStep>=0&&I2CReadByte(TW101,0xb8)+sStep<=0xFF)
                              {
              
                                      if(m_cStandard==S_NTSC)   
                                      {
                                              EepVideo.cB2=I2CReadByte(TW101,0xb2);
                                              EepVideo.cB8=I2CReadByte(TW101,0xb8)+sStep;
                                              I2CWriteByte(TW101,0xb8,EepVideo.cB8);          
                                      I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B8,EepVideo.cB8);
                                              twdDelay(NVRDELAY);     
                                              I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B2,EepVideo.cB2);
                                      twdDelay(NVRDELAY);
                                              EepVideo.cFlag=Panel_ID;
                                      I2CWriteByte(EEPVIDEOBLOCK, idTIMING_FLAG_INDEX, EepVideo.cFlag);
                                      }
                          else if(m_cStandard==S_NPAL)
C51 COMPILER V7.50   OSDCTRL                                                               01/12/2006 13:31:13 PAGE 5   

                                      {
                                              EepVideo.cB2_PAL=I2CReadByte(TW101,0xb2);
                                              EepVideo.cB8_PAL=I2CReadByte(TW101,0xb8)+sStep;
                                              I2CWriteByte(TW101,0xb8,EepVideo.cB8_PAL);              
                                      I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B8_PAL, EepVideo.cB8_PAL);
                                              twdDelay(NVRDELAY);     

⌨️ 快捷键说明

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