📄 osdctrl.lst
字号:
C51 COMPILER V7.06 OSDCTRL 06/19/2006 11:59:51 PAGE 1
C51 COMPILER V7.06, 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(T112) DEBUG OBJECTEXTEND PRINT(.\OSDCTRL.lst) OBJECT(.\Obj\OSDCTRL.obj)
stmt 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.06 OSDCTRL 06/19/2006 11:59:51 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 #if (defined T112) | (defined T116)
110 3 case idRGBMENU: // add by Sherman 06'01'18
111 3 AdjVideoRGB(sStep);
112 3 break;
113 3 case idVCOMAMENU: // add by Sherman 06'01'23
114 3 AdjVideoVCOMA(sStep);
115 3 break;
116 3 case idVCOMDMENU: // add by Sherman 06'01'23
C51 COMPILER V7.06 OSDCTRL 06/19/2006 11:59:51 PAGE 3
117 3 AdjVideoVCOMD(sStep);
118 3 break;
119 3 #endif
120 3 #ifdef LOAD_TIME
case idTIMEMENU:
AdjTimingB2(sStep);
break;
#endif
125 3 default :break;
126 3 }
127 2 }
128 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
165 1
166 1 }
167
168
169
170 void AdjVolume(sCHAR sStep)
171 {
172 1 if( (EepVideo.cVolume+sStep)<=sOSDParamsMax.cVolume
173 1 &&(EepVideo.cVolume+sStep)>=sOSDParamsMin.cVolume)
174 1 {
175 2 EepVideo.cVolume += sStep;
176 2 I2CWriteByte(TW101, 0xE9, EepVideo.cVolume);
177 2 OSDShowVideoData();
178 2 if(EepVideo.cVolume==sOSDParamsMin.cVolume)
C51 COMPILER V7.06 OSDCTRL 06/19/2006 11:59:51 PAGE 4
179 2 AUDIO_MUTE=1; //MUTE audio
180 2 else
181 2 AUDIO_MUTE=0; //open audio
182 2 }
183 1
184 1 #ifdef NVRAM
185 1 I2CWriteByte(EEPVIDEOBLOCK, idVIDEO_VOLUME_INDEX, EepVideo.cVolume);
186 1 #endif
187 1 return;
188 1
189 1 }
190
191
192 #if VIDEO_AVAILABLE
193 extern uCHAR idata m_cStandard;
194 void AdjTimingB2(sCHAR sStep)
195 {
196 1 sStep=sStep;
197 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
230 1 }
231
232 void AdjTimingB8(sCHAR sStep)
233 {
234 1 sStep=sStep;
235 1 #ifdef LOAD_TIME
if(I2CReadByte(TW101,0xb8)+sStep>=0&&I2CReadByte(TW101,0xb8)+sStep<=0xFF)
{
if(m_cStandard==S_NTSC)
{
C51 COMPILER V7.06 OSDCTRL 06/19/2006 11:59:51 PAGE 5
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)
{
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);
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
267 1 }
268 void AdjVideoBright(sCHAR sStep)
269 {
270 1 if( (EepVideo.cBright+sStep)<=V_BRIGHT_MAX && (EepVideo.cBright+sStep)>=V_BRIGHT_MIN)
271 1 {
272 2 EepVideo.cBright+=sStep;
273 2 I2CWriteByte(TW101,VBRIGHT,EepVideo.cBright); //Ruby 2004-10-09
274 2 OSDShowVideoData();
275 2 I2CWriteByte(EEPVIDEOBLOCK, idVIDEO_BRIGHT_INDEX, EepVideo.cBright);
276 2 twdDelay(NVRDELAY);
277 2
278 2 }
279 1 }
280
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -