📄 mode.lst
字号:
278 1
279 1 // Use DE counter to detect 720/640 modes
280 1 if ( RegByteIn(0x31)&0x20 ) // External DE
281 1 {
282 2 if (CurrentWidth == 640 || CurrentWidth == 720 || CurrentWidth == 800)
283 2 {
284 3 RegBitOut(0x30, 0x01, 0x01); // start capture
285 3 RegBitOut(0x47, 0x00, 0x80); //Select External DE width
286 3 RegBitOut(0x07, 0x08, 0x08); //Enable count External DE width
287 3 miscDelay(200);
288 3 ival = RegByteIn(0x11) & 0x07; //External DE High Byte
289 3 ival = (ival<<8) + RegByteIn(0x10); //High+Low byte of external DE
290 3 #if DEBUGMSG
printf(" DE=%d\n", ival);
#endif
293 3
294 3 if ((CurrentWidth == 640 || CurrentWidth == 720)&&(CurrentWidth != ival))
295 3 {
296 4 //modify for chroma 2326 timing 43
297 4 if (ival > 660)
298 4 CurrentWidth = ival = 720;
299 4 else
300 4 CurrentWidth = ival = 640; //720 x 400 x85 --> ival = 669
301 4 }
302 3
C51 COMPILER V6.23a MODE 09/10/2004 16:09:01 PAGE 6
303 3
304 3 //CurrentWidth = ival;
305 3 RegWordOut(0x38, ival-1); //Write back H width
306 3 RegByteOut(0x3C, (ival >> 2)-1);
307 3
308 3
309 3 #if PANEL_1280
ival1 = ((unsigned long)(--ival) << 16)/1279;
#else
312 3 ival1 = ((unsigned long)(--ival) << 16)/1023;
313 3 #endif
314 3 RegWordOut(0x4b, ival1);
315 3
316 3 RegBitOut(0x07, 0x00, 0x08);
317 3
318 3 }
319 2 }
320 1
321 1
322 1
323 1 RegBitOut(0x40, 0x80, 0x80);
324 1
325 1 if (mode != 26)
326 1 {
327 2 #if 1
328 2 RegBitOut(0x32, 0x90, 0x90);
329 2 #else
RegBitOut(0x32, 0x80, 0x90);
#endif
332 2 RegBitOut(0x29, 0x10, 0x10); //Enable Flash Noise Reduction
333 2 }
334 1
335 1
336 1
337 1 #if (USE_TCON + USE_RSDS)
#if 1 //(MVXPRL+MVXRL)
RegBitOut(0x24, 0x80, 0xC0);
#else
RegBitOut(0x24, 0x00, 0xC0);
#endif
#else
344 1 RegBitOut(0x24, 0xC0, 0xC0);
345 1 #endif
346 1
347 1
348 1 RegBitOut(0x4A, 0x80, 0x80);
349 1 RegBitOut(0x59, 0x03, 0x03);
350 1
351 1 RegByteOut(0x5B, 0x00); //Horizontal Zoom Accu Pre-Load Odd
352 1 RegByteOut(0x5C, 0x00); //Horizontal Zoom Accu Pre-Load even
353 1
354 1 if (CurrentWidth == 1152 || CurrentHeight == 960)
355 1 RegByteOut(0xa8, 0x04);
356 1 else
357 1 RegByteOut(0xa8, 0x08);
358 1
359 1 RegBitOut(0x30,0x00,0x40); //enable digital contrast
360 1 RegBitOut(0x40,0x00,0x40); //disable free run for modeadjust
361 1
362 1 #if USE_GAMMATABLE
setGammaTable(CurrentMode & 0x7f);
#endif
C51 COMPILER V6.23a MODE 09/10/2004 16:09:01 PAGE 7
365 1
366 1
367 1 #if SRC_SI151
if (eepData.MascotFlag & FLAG_PORTB)
RegBitOut(0x33, 0x58, 0x58);
#endif
371 1
372 1 RegBitOut(0x32, 0x80, 0x80);
373 1
374 1 #if MVXPRL
if (CurrentWidth > 1024)
RegByteOut(0x33,0x08);
else
RegByteOut(0x33,0x0e);
#else
380 1 RegBitOut(0x33, 0x00, 0x08);
381 1 #endif
382 1
383 1
384 1 // Start Capture
385 1 RegBitOut(0x30, 0x01, 0x01);
386 1
387 1
388 1 #if DO_COMPSYNC
389 1 pol = RegByteIn(0x07);
390 1 #if !NEW_ADC
if (pol & 0x01)
RegBitOut(0x17, 0x80, 0x80);
#endif
394 1
395 1 if (pol & 0x03 == 0x03)
396 1 {
397 2 RegBitOut(0x26, 0x02, 0x02);
398 2 RegBitOut(0x18, 0x00, 0xC0);
399 2 }
400 1 #endif
401 1
402 1 /*
403 1 if (CurrentWidth == 1280)
404 1 {
405 1 if (RegByteIn(0x68) == 0x00)
406 1 RegBitOut(0x32, 0x08, 0x08);
407 1 else
408 1 RegBitOut(0x32, 0x00, 0x08);
409 1 }
410 1 else
411 1 RegBitOut(0x32, 0x00, 0x08);
412 1 */
413 1
414 1 checkModeChange(); // by seven 030718
415 1 if (modechangeflag) // by seven 030718
416 1 return MODE_CHANGE;
417 1
418 1 RegByteOut(0xa5,0x00); //?? disable spectrum modulation
419 1
420 1 #if USE_TCON
if ( !modeAdjustMVz() )
return MODE_OUTOFSYNC;
#elif MODE_ADJ_BY_CALCULATE
425 1 if ( !fineCalculateDCLK() )
426 1 return MODE_OUTOFSYNC;
C51 COMPILER V6.23a MODE 09/10/2004 16:09:01 PAGE 8
427 1 if (modechangeflag) // by seven 030718
428 1 return MODE_CHANGE;
429 1 #else
if (eepData.MascotFlag & FLAG_PORTB)
{
pol = RegByteIn(0x31);
RegBitOut(0x31,0x00,0x60);
}
temp = modeAdjust();
if (eepData.MascotFlag & FLAG_PORTB)
RegByteOut(0x31,pol);
if (!temp)
return MODE_OUTOFSYNC;
#endif
444 1 #if NEW_SSC_HN
445 1 #if PANEL_1280
RegByteOut(0xa5,0x13); //?? enable spectrum modulation
#else
448 1 RegByteOut(0xa5,0x11); //?? enable spectrum modulation
449 1 #endif
450 1 #elif NEW_SSC_HO
#if PANEL_1280
RegByteOut(0xa5,0x47); //?? enable spectrum modulation
#else
RegByteOut(0xa5,0x45); //?? enable spectrum modulation
#endif
#else
RegByteOut(0xa5,0x47); //?? enable spectrum modulation
#endif
459 1
460 1
461 1 if (!(eepData.MascotFlag & FLAG_PORTB))
462 1 {
463 2
464 2 #if SRC_SI151
setColorRGB(EEP_DATA); // gain
#else
467 2 setBlackLevel();
468 2 #endif
469 2 }
470 1
471 1 checkVtotal();
472 1 disableOSD();
473 1
474 1 #if AUTO_CLAMP
//adcColorTune(SELECTALL);
adcClampTune();
#endif
478 1
479 1 if (modechangeflag) // by seven 030718
480 1 return MODE_CHANGE;
481 1
482 1 if ( HsyncCnt < HSYNC_KHZ(MIN_hsync) || HsyncCnt > HSYNC_KHZ(MAX_hsync)
483 1 || VsyncCnt > VSYNC_HZ(MIN_vsync) || VsyncCnt < VSYNC_HZ(MAX_vsync)
484 1 || CurrentWidth > PANEL_WIDTH || CurrentHeight > PANEL_HEIGHT)
485 1 {
486 2 OutWithBackground = 1;
487 2 osdOutofsync();
488 2 }
C51 COMPILER V6.23a MODE 09/10/2004 16:09:01 PAGE 9
489 1
490 1 if (eepData.MascotFlag & FLAG_POWERSTATUS)
491 1 {
492 2 dspMute(0);
493 2 miscTurnOnPower();
494 2 }
495 1 else
496 1 miscEnterSleepMode();
497 1
498 1 return CurrentMode;
499 1 }
500
501
502
503
504
505 #if (!MODE_ADJ_BY_CALCULATE)
#define MADJ_LIMIT 400
bit modeAdjust(void)
{
bit up,down,findflag;
int startValue,madj_cnt,temp;
#if CALCULATE_DCLK
char step = 3;
#else
char step = 15;
#endif
#if DEBUGMSG
printf(" ModeAdjust\n");
#endif
#if CHIMEI_M150X3
redo_madj:
step = 3;
#endif
up=0;down=0;findflag=0;
startValue=-128;
madj_cnt=0;
miscDelay(10);
RegByteOut(0x01,0x00);
madj_next:
temp = RegByteIn(0x01);
if ( temp & ((eepData.MascotFlag & FLAG_PORTB) ? 0xc9 : 0x35 ))
{
#if DEBUGMSG
printf(" Freq is changed, sync_status = %2X\n", (unsigned int)temp);
#endif
return 0;
}
RegByteOut(0x02, 0x00);
RegByteOut(0xB0, 0x80);
temp = 0;
while (RegByteIn(0xB0) & 0x80)
C51 COMPILER V6.23a MODE 09/10/2004 16:09:01 PAGE 10
{
temp++;
miscDelay(2);
if (temp > 100)
goto madj_fail;
}
temp = RegByteIn(0x02);
if (temp & 0x01) goto madj_down;
if (temp & 0x02) goto madj_up;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -