📄 autoadj.lst
字号:
C51 COMPILER V7.06 AUTOADJ 12/11/2007 11:28:43 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE AUTOADJ
OBJECT MODULE PLACED IN .\BIN\AutoAdj.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE SRC\AutoAdj.C LARGE OPTIMIZE(9,SPEED) DEBUG OBJECTEXTEND PRINT(.\LST\AutoAd
-j.lst) OBJECT(.\BIN\AutoAdj.obj)
stmt level source
1 /*==========================================
2 ==========================================*/
3 #include "include.h"
4 /*==========================================
5 ==========================================*/
6 /*
7 void TunePositionOnly()
8 {
9 Abort = 0;
10 //WriteIIC563(0x001,FuncBuf[pRADC]);
11 //WriteIIC563(0x004,FuncBuf[pGADC]);
12 //WriteIIC563(0x007,FuncBuf[pBADC]);
13 AutoPosition();
14 if(Abort)
15 { //fail
16 LoadModeDependentSettings();
17 SetHP();
18 SetVP();
19 }
20 SetContrast();
21 }
22 */
23 /*==========================================
24 ==========================================*/
25 void AutoTune(void)
26 {
27 1 // Word addr;
28 1 // Byte PixelRate;
29 1 Abort = 0;
30 1 NonFullScreen = 0;
31 1 //WriteIIC563(0x001,FuncBuf[pRADC]);
32 1 //WriteIIC563(0x004,FuncBuf[pGADC]);
33 1 //WriteIIC563(0x007,FuncBuf[pBADC]);
34 1 // if(ModePoint < UserModeSt)
35 1 // Recall();
36 1 AutoPosition();
37 1 if(!Abort)
38 1 AutoClock();
39 1 // PixelRate = ((unsigned long)FuncBuf[pCLOCK] * H_SYNC)/10000;
40 1 // if(PixelRate >= PanelMaxPClk/1000)
41 1 // Abort = 1;
42 1 if(NonFullScreen && !Abort){ //non fullscreen recall
43 2 //addr = ep_Sync_Data + (ModePoint * 8);
44 2 //FuncBuf[pCLOCK] = Read24C16(addr+4) << 8;
45 2 //FuncBuf[pCLOCK] |= Read24C16(addr+5);
46 2 LoadPresetModeSettings(2);
47 2 SetADC_PLL();
48 2 }
49 1 #if 0
if(Abort){
if(NonFullScreen == 0){
//goto Error;
}
else{
C51 COMPILER V7.06 AUTOADJ 12/11/2007 11:28:43 PAGE 2
Abort = 0;
AutoClockByPhase(1);
}
}
else{
AutoClockByPhase(0);
}
#else
63 1 if(!Abort)
64 1 AutoClockByPhase(0);
65 1 #endif
66 1 if(!Abort)
67 1 AutoPhaseFineTune(32);
68 1 if(!Abort)
69 1 AutoPosition();
70 1
71 1 if(Abort) //fail
72 1 {
73 2 LoadModeDependentSettings();
74 2 SetADC_PLL();
75 2 SetADC_Phase();
76 2 //-------------------------------------------------------
77 2 if(SyncMode != 3){
78 3 SetHP();
79 3 SetVP();
80 3 }
81 2 if(Interlance){
82 3 WriteWordIIC563(0x032,Vresolution); // Capture V_Active
83 3 }else{
84 3 WriteWordIIC563(0x032,Vresolution); // Capture V_Active
85 3 }
86 2 WriteWordIIC563(0x036,Hresolution); // Capture H_Active
87 2 }else{ //ok
88 2 CheckModeChange(); // add by evan for mode change during auto will fail
89 2 }
90 1 LoadADC_Gain();
91 1 }
92 void AutoPosition(void)
93 {
94 1 Word OldVp,NewVp,Vact,Hact;
95 1 #if PRINT_MESSAGE
printf("AutoPosition\n");
#endif
98 1 WriteIIC563(0x02A,0); // AutoPosition Pixel mask -> H
99 1 WriteIIC563(0x02B,24); // AutoPosition Pixel mask -> H
100 1 WriteIIC563(0x02C,0x00); // AutoPosition Pixel mask -> H
101 1 WriteIIC563(0x02D,0x00); // AutoPosition Pixel mask -> H
102 1 WriteIIC563(0x107,0x40); // Red Noise Margin 05/05/05 joe modify
103 1 WriteIIC563(0x106,0x00);
104 1 if(SyncMode == 3)
105 1 WriteIIC563(0x106,0x11);
106 1 else
107 1 WriteIIC563(0x106,0x01);
108 1 #if DVImode == HVmode
if(SyncMode == 3)
WaitSetup(5);
#endif
112 1 OldVp = FuncBuf[pVPOSITION];
113 1 LocalTimer = 100;
114 1 while((ReadIIC563(0x106) & BIT_0) && LocalTimer != 0){
115 2 CheckModeChange();
116 2 if(Abort)
C51 COMPILER V7.06 AUTOADJ 12/11/2007 11:28:43 PAGE 3
117 2 return;
118 2 }
119 1 if(LocalTimer != 0){ // Auto-Position OK
120 2 Hact = ReadWordIIC563(0x110) & 0x0fff;
121 2 //Hact = ReadIIC563(0x111) & 0x3f;
122 2 //Hact <<= 8;
123 2 //Hact |= ReadIIC563(0x110);
124 2 //if(Hact < 300)
125 2 // if(Hact < Hresolution - 100){
126 2 // if(Hact < Hresolution - 100 && Hresolution>720){ //if <720 may in dos mode AGN spec needs tune positio
-n
127 2 if(Hact < Hresolution - 100 && Hresolution>720&&ReadWordIIC563(0x10c)!=576){ //joe modify 2005/4/29
128 3 Abort = 1;
129 3 return;
130 3 }
131 2 if(abs(Hact - Hresolution) > 100 && Hresolution>720 && Vresolution > 480) // add by evan date 051018
132 2 {
133 3 Abort = 1;
134 3 return;
135 3 }
136 2 FuncBuf[pVPOSITION] = ReadWordIIC563(0x108) & 0x07ff;
137 2 //FuncBuf[pVPOSITION] = ReadIIC563(0x109) & 0x07;
138 2 //FuncBuf[pVPOSITION] <<= 8;
139 2 //FuncBuf[pVPOSITION] |= ReadIIC563(0x108);
140 2 GetFuncRange(pVPOSITION);
141 2 if(FuncBuf[pVPOSITION] > FuncMax)//over VPosition Max
142 2 {
143 3 FuncBuf[pVPOSITION] = FuncMax;
144 3 #if PRINT_MESSAGE
printf("VPositon over Max");
#endif
147 3 }
148 2 FuncBuf[pHPOSITION] = ReadWordIIC563(0x10e) & 0x07ff;
149 2 //FuncBuf[pHPOSITION] = ReadIIC563(0x10F) & 0x07;
150 2 //FuncBuf[pHPOSITION] <<= 8;
151 2 //FuncBuf[pHPOSITION] |= ReadIIC563(0x10E);
152 2 GetFuncRange(pHPOSITION);
153 2 if(FuncBuf[pHPOSITION] > FuncMax)//over VPosition Max
154 2 {
155 3 FuncBuf[pHPOSITION] = FuncMax;
156 3 #if PRINT_MESSAGE
printf("HPositon over Max");
#endif
159 3 }
160 2 if(FuncBuf[pHPOSITION] < FuncMin) // add by evan date 051018
161 2 {
162 3 Abort = 1;
163 3 return;
164 3 }
165 2
166 2
167 2 Vact = ReadWordIIC563(0x10c) & 0x07ff;
168 2
169 2
170 2 //Vact = ReadIIC563(0x10d) & 0x07;
171 2 //Vact <<= 8;
172 2 //Vact |= ReadIIC563(0x10c);
173 2 NewVp = FuncBuf[pVPOSITION];
174 2 #if PRINT_MESSAGE
printf("VP_Start = %d\n",FuncBuf[pVPOSITION]);
printf("HP_Start = %d\n",FuncBuf[pHPOSITION]);
#endif
C51 COMPILER V7.06 AUTOADJ 12/11/2007 11:28:43 PAGE 4
178 2 SetHP();
179 2 if(OldVp > NewVp){
180 3 for(;OldVp>=NewVp;OldVp--){
181 4 //FuncBuf[pVPOSITION] = OldVp;
182 4 //SetVP();
183 4 // 050604,Eason,Start < for auto adjust don't stop issue>
184 4 if (OldVp<1){
185 5 Abort = 1; // abort
186 5 #if PRINT_MESSAGE
printf("AutoPosition fail\n");
#endif
189 5 break;
190 5 }else{
191 5 FuncBuf[pVPOSITION] = OldVp;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -