📄 osdtune.lst
字号:
170 {
171 1 unsigned int vStart,vHeight;
172 1
173 1
174 1 #if (DEBUGMSG>=2)
printf("\n ### HV Calib,\n");
#endif
177 1
178 1 RegByteOut(0xB0, 0x02); // Enable vertical calibration
C51 COMPILER V6.23a OSDTUNE 09/10/2004 16:09:05 PAGE 4
179 1 RegByteOut(0x00, 0x00); // Clear the calibration status reg
180 1 if (!waitCalibReady(0x02))
181 1 {
182 2 CalibSuccess = 0;
183 2 goto hvcal_fail;
184 2 }
185 1
186 1
187 1 miscDelay(30);
188 1 RegDataIn(0xD8, buff+7, 3);
189 1
190 1 RegByteOut(0xB0, 0x04);
191 1 RegByteOut(0x00, 0x00); // Clear the calibration status reg
192 1 if (!waitCalibReady(0x04))
193 1 if (!waitCalibReady(0x02))
194 1 {
195 2 CalibSuccess = 0;
196 2 goto hvcal_fail;
197 2 }
198 1
199 1 RegDataIn(0xD3, buff, 5);
200 1 RegDataIn(0xFA, buff+5, 2);
201 1 hStart = ((unsigned int)(buff[2]&0x07)<<8) + buff[0]-2;
202 1 hWidth = ((unsigned int)(buff[6]&0x70)<<4) + buff[5] - hStart + 1;
203 1
204 1 vStart = ((unsigned int)(buff[4]&0x07)<<8) + buff[3];
205 1 vHeight= ((unsigned int)(buff[9]&0x07)<<8) + buff[7] - vStart + 1;
206 1
207 1 #if (DEBUGMSG>=3)
printf("hStart = %d, hWidth = %d, vStart = %d, vHeight = %d\n",hStart,hWidth,vStart,vHeight);
#endif
210 1
211 1
212 1
213 1 // Horizontal calibration
214 1 //hcalib:
215 1 if (!(options & OPTIONHORT))
216 1 goto vcalib;
217 1
218 1 #if (DEBUGMSG>=2)
printf("H Calib, ");
#endif
221 1
222 1
223 1 if (hStart < HCALSTART) {
224 2 #if DEBUGMSG
printf(" Error: hStart < HCALSTART ");
#endif
227 2 goto hvcal_fail;
228 2 }
229 1
230 1 if (hWidth < CurrentWidth - HLIMIT) {
231 2 #if DEBUGMSG
printf(" Error:hWidth out of HLIMIT");
#endif
234 2 goto hvcal_fail;
235 2 }
236 1
237 1
238 1 if (hStart <= MIN_hstart && hStart>=MAX_hstart ) {
239 2 #if DEBUGMSG
printf(" Error:hStart out of range ");
C51 COMPILER V6.23a OSDTUNE 09/10/2004 16:09:05 PAGE 5
#endif
242 2
243 2 hvcal_fail:
244 2 CalibSuccess = 0;
245 2 RegByteOut(0x34, (unsigned char)eepModeData.hstart);
246 2 RegByteOut(0x35, (unsigned char)(eepModeData.hstart>>8));
247 2 RegByteOut(0x36, eepModeData.vstart);
248 2 RegByteOut(0x37, 0);
249 2 RegByteOut(0xB0, 0x00);
250 2 return;
251 2 }
252 1
253 1 eepModeData.hstart = hStart;
254 1 eepModeData.def_hstart = hStart;
255 1 RegByteOut(0x34, (unsigned char)eepModeData.hstart);
256 1 RegByteOut(0x35, (unsigned char)(eepModeData.hstart>>8));
257 1
258 1 #if (DEBUGMSG>=2)
printf("HS=%d HW=%d", eepModeData.hstart, hWidth);
#endif
261 1
262 1
263 1 // Vertical calibration
264 1 vcalib:
265 1 if (!(options & OPTIONVERT))
266 1 goto hvcal_fail;
267 1
268 1 #if (DEBUGMSG>=2)
printf(" V Calib, ");
#endif
271 1
272 1
273 1 if (vStart < VCALSTART) {
274 2 #if DEBUGMSG
printf(" Error: vStart < VCALSTART ");
#endif
277 2 goto hvcal_fail;
278 2 }
279 1
280 1
281 1 if ( vHeight < CurrentHeight - VLIMIT) {
282 2 #if DEBUGMSG
printf(" Error:vHeight out of VLIMIT");
#endif
285 2 goto hvcal_fail;
286 2 }
287 1
288 1
289 1 if (vStart <= MIN_vstart && vStart>=MAX_vstart ) {
290 2 #if DEBUGMSG
printf(" Error:vStart out of range ");
#endif
293 2
294 2 goto hvcal_fail;
295 2 }
296 1
297 1 if (RegByteIn(0x24) & 0x02) vStart -= 1; //USE_MINIFY
298 1
299 1 if ((CurrentMode&0x7f) == 5) //640x350 84
300 1 vStart -= 24;
301 1
302 1
C51 COMPILER V6.23a OSDTUNE 09/10/2004 16:09:05 PAGE 6
303 1 eepModeData.vstart = vStart;
304 1 eepModeData.def_vstart = vStart;
305 1 RegByteOut(0x36, eepModeData.vstart);
306 1 RegByteOut(0x37, 0);
307 1
308 1 #if (DEBUGMSG>=2)
printf(" VS=%d\n\n", (unsigned int)eepModeData.vstart);
#endif
311 1
312 1 /* Disable vertical calibration */
313 1 RegByteOut(0xB0, 0x00);
314 1 }
315 #undef hStart
316 #undef hWidth
317
318
319 /************************************************
320 * Pitch Calibration *
321 *************************************************/
322 #define hStart ival1
323 #define hWidth ival2
324
325 #define adjust_limit buff[14] // 12 to 14 by seven 030630
326
327
328 #define CHANGE 1
329 #define NOCHANGE 0
330
331 bit pitchCalibration(void)
332 {
333 1
334 1 unsigned int pitch,tpitch0;
335 1 bit up = 0,dn = 0;
336 1
337 1 #if (DEBUGMSG>=2)
printf("\n ### Pitch Calib\n");
#endif
340 1
341 1 if ( !CalibSuccess )
342 1 return NOCHANGE;
343 1
344 1 //adjust_limit = (unsigned char)(CurrentWidth >> 4);
345 1 adjust_limit = 120; // 2003/7/22 06:14
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -