Mode_Detect.i
上传用户:xmyjxjd
上传日期:2013-05-04
资源大小:1517k
文件大小:88k
- #line 1 "CodeMode_Detect.c" /0
-
-
-
-
- #line 1 "HeaderLcd_func.h" /0
-
- #line 1 "HEADERMain_def.h" /0
-
- #line 1 "HEADERCHAR_DEF.H" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 1 "HEADERMain_def.h" /0
-
-
- #line 1 "HEADERMODE_DEF.H" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 2 "HEADERMain_def.h" /0
-
-
- #line 1 "HEADERRTD_DEF.H" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 3 "HEADERMain_def.h" /0
-
-
- #line 1 "HEADERCODE_DEF.H" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 4 "HEADERMain_def.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 144 "HEADERMain_def.h" /1
-
-
-
-
-
-
-
-
-
-
-
- #line 155 "HEADERMain_def.h" /0
-
-
- #line 157 "HEADERMain_def.h" /1
-
-
- #line 159 "HEADERMain_def.h" /0
-
-
-
-
- #line 163 "HEADERMain_def.h" /1
-
-
- #line 165 "HEADERMain_def.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 270 "HEADERMain_def.h" /1
-
-
- #line 272 "HEADERMain_def.h" /0
-
- #line 273 "HEADERMain_def.h" /1
-
-
- #line 275 "HEADERMain_def.h" /0
-
- #line 276 "HEADERMain_def.h" /1
-
-
- #line 278 "HEADERMain_def.h" /0
-
- #line 279 "HEADERMain_def.h" /1
-
-
- #line 281 "HEADERMain_def.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 1 "HeaderLcd_func.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- typedef struct _GLOBAL_USER_DATA0
- {
- unsigned char CONTRAST;
- unsigned char BRIGHT;
- unsigned char RTD_R_CONTRAST;
- unsigned char RTD_G_CONTRAST;
- unsigned char RTD_B_CONTRAST;
- unsigned char RTD_R_BRIGHT;
- unsigned char RTD_G_BRIGHT;
- unsigned char RTD_B_BRIGHT;
- }
- GLOBAL_USER_DATA0, *LP_GLOBAL_USER_DATA0;
-
- typedef struct _GLOBAL_USER_DATA1
- {
- unsigned char FUNCTION;
-
-
-
-
-
-
-
-
-
-
-
-
-
- unsigned char INPUT_SOURCE;
-
-
-
-
-
-
-
-
-
-
- unsigned char FILTER;
- unsigned int OSD_POSH;
- unsigned char OSD_POSV;
- unsigned char OSD_TIMEOUT;
-
- unsigned char OSD_INPUT;
-
-
-
- }
- GLOBAL_USER_DATA1, *LP_GLOBAL_USER_DATA1;
-
-
- typedef struct _GLOBAL_USER_DATA2
- {
- unsigned char AD_R_GAIN;
- unsigned char AD_G_GAIN;
- unsigned char AD_B_GAIN;
- unsigned char AD_R_OFFSET;
- unsigned char AD_G_OFFSET;
- unsigned char AD_B_OFFSET;
- }
- GLOBAL_USER_DATA2, *LP_GLOBAL_USER_DATA2;
-
- typedef struct _GLOBAL_USER_DATA3
- {
- unsigned char VOLUME;
- unsigned char CURR_CHANNEL;
- unsigned char PREV_CHANNEL;
- unsigned char TV_SETTING;
-
-
-
-
-
-
-
-
-
-
-
- unsigned char SPREAD;
- }
- GLOBAL_USER_DATA3, *LP_GLOBAL_USER_DATA3;
-
- typedef struct _GLOBAL_USER_DATA4
- {
- unsigned char C1_R;
- unsigned char C1_G;
- unsigned char C1_B;
- unsigned char C2_R;
- unsigned char C2_G;
- unsigned char C2_B;
- unsigned char C3_R;
- unsigned char C3_G;
- unsigned char C3_B;
- }
- GLOBAL_USER_DATA4, *LP_GLOABL_USER_DATA4;
-
- typedef struct _RGB_MODE_USER_DATA
- {
- unsigned char H_POSITION;
- unsigned char V_POSITION;
- unsigned char CLOCK;
- unsigned char PHASE;
- }
- RGB_MODE_USER_DATA, *LP_RGB_MODE_USER_DATA;
-
- typedef struct _VIDEO_MODE_USER_DATA
- {
- unsigned char VBRIGHT;
- unsigned char VCONTRAST;
- unsigned char VSATURATION;
- unsigned char VHUE;
- }
- VIDEO_MODE_USER_DATA, *LP_VIDEO_MODE_USER_DATA;
-
-
-
- #line 134 "HeaderLcd_func.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 313 "HeaderLcd_func.h" /0
-
-
-
-
- extern GLOBAL_USER_DATA0 data stGUD0;
- extern GLOBAL_USER_DATA1 data stGUD1;
- extern GLOBAL_USER_DATA2 data stGUD2;
- extern GLOBAL_USER_DATA3 data stGUD3;
- extern GLOBAL_USER_DATA4 data stGUD4;
- extern RGB_MODE_USER_DATA data stMUD;
-
- extern unsigned int idata usIPH_ACT_STA;
- extern unsigned int idata usIPV_ACT_STA;
- extern unsigned int idata usIPH_ACT_WID;
- extern unsigned int idata usIPV_ACT_LEN;
-
- extern unsigned int idata usADC_Clock;
- extern unsigned int idata usDH_Total;
- extern unsigned int idata usDV_Total;
- extern unsigned char idata ucDV_Delay;
-
- extern unsigned char idata ucV_Max_Margin;
- extern unsigned char idata ucV_Min_Margin;
- extern unsigned char idata ucH_Max_Margin;
- extern unsigned char idata ucH_Min_Margin;
- extern unsigned char idata UartNum;
- extern unsigned char idata UartData[4];
-
-
-
- extern void SetMute(bit val);
- extern void SetVolume();
-
- extern void WriteGamma(unsigned char code *arrayR, unsigned char code *arrayG, unsigned char code *arrayB);
- extern void WriteDither(unsigned char code *array);
- extern void WriteSU_COEF(unsigned char code *arrayH, unsigned char code *arrayV);
-
- extern void Set_H_Position(void);
- extern void Set_V_Position(void);
- extern void Set_Clock(void);
- extern void Set_Phase(unsigned char phase);
- extern void Set_Bright_Contrast(void);
- extern void Set_Gamma(void);
- extern void Set_Dithering(void);
- extern void Sharpness(void);
- extern void Set_Mode_Params(void);
-
- extern void SetADC_VCO(unsigned char ucRate);
- extern void SetADC_Gain(void);
- extern void SetADC_Offset(void);
- extern void SetADC_GainOffset(void);
-
- #line 365 "HeaderLcd_func.h" /1
-
-
- #line 367 "HeaderLcd_func.h" /0
-
- extern void Wait_For_Event(unsigned char event);
-
-
-
- extern void Save_GUD0(void);
- extern void Load_GUD0(void);
- extern void Save_GUD1(void);
- extern void Load_GUD1(void);
- extern void Save_GUD2(void);
- extern void Load_GUD2(void);
- extern void Save_GUD3(void);
- extern void Load_GUD3(void);
- extern void Save_GUD4(void);
- extern void Load_GUD4(void);
- extern void Save_MUD(unsigned char mode_num);
- extern void Load_MUD(unsigned char mode_num);
- extern void Init_GUD(void);
- extern void Init_MUD(void);
- extern void Check_EEPROM(void);
- extern unsigned char code INIT_EEPROM2[];
- extern void RTD_Test(void);
- extern void Free_Background(void);
- extern void Reset_Mode(void);
-
-
-
- extern void Set_Spread(void);
- extern void Init_FACTORY(void);
- extern void Init_FRecall(void);
-
-
-
-
-
- #line 402 "HeaderLcd_func.h" /1
-
-
-
-
- #line 406 "HeaderLcd_func.h" /0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-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 3 "HEADERMain_def.h" /0
-
-
- #line 1 "HEADERCODE_DEF.H" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 4 "HEADERMain_def.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 144 "HEADERMain_def.h" /1
-
-
-
-
-
-
-
-
-
-
-
- #line 155 "HEADERMain_def.h" /0
-
-
- #line 157 "HEADERMain_def.h" /1
-
-
- #line 159 "HEADERMain_def.h" /0
-
-
-
-
- #line 163 "HEADERMain_def.h" /1
-
-
- #line 165 "HEADERMain_def.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 270 "HEADERMain_def.h" /1
-
-
- #line 272 "HEADERMain_def.h" /0
-
- #line 273 "HEADERMain_def.h" /1
-
-
- #line 275 "HEADERMain_def.h" /0
-
- #line 276 "HEADERMain_def.h" /1
-
-
- #line 278 "HEADERMain_def.h" /0
-
- #line 279 "HEADERMain_def.h" /1
-
-
- #line 281 "HEADERMain_def.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 1 "HEADERTimer.h" /0
-
-
-
-
-
-
-
-
- #line 9 "HEADERTimer.h" /1
-
-
-
-
- #line 13 "HEADERTimer.h" /0
-
-
-
-
-
-
-
- #line 20 "HEADERTimer.h" /1
-
-
-
-
-
- #line 25 "HEADERTimer.h" /0
-
-
-
-
-
-
-
-
-
-
- #line 35 "HEADERTimer.h" /1
-
-
-
-
-
-
- #line 41 "HEADERTimer.h" /0
-
-
- #line 43 "HEADERTimer.h" /1
-
-
-
-
-
-
-
-
- #line 68 "HEADERTimer.h" /0
-
- extern bit bNotify_Timer0_Int;
- extern bit bNotify_Timer1_Int;
- extern void Delay_Xms(unsigned char x);
-
- #line 1 "HeaderLcd_Main.h" /0
-
-
- #line 1 "HEADERPower_Ctrl.h" /0
-
-
-
-
-
-
-
-
-
-
-
- #line 12 "HEADERPower_Ctrl.h" /1
-
-
-
-
-
-
-
-
- #line 20 "HEADERPower_Ctrl.h" /0
-
- extern bit bPower_Status;
- extern bit bPanel_Status;
-
- extern void PowerDown_ADC(void);
- extern void PowerUp_ADC(void);
- extern void PowerDown_VDC(void);
- extern void PowerUp_VDC(void);
- extern void PowerDown_LVDS(void);
- extern void PowerUp_LVDS(void);
- extern void PowerDown_TMDS(void);
- extern void PowerUp_TMDS(void);
-
- extern void Set_Panel(unsigned char status);
- extern bit Power_Control(unsigned char Notify);
-
-
-
-
- #line 2 "HeaderLcd_Main.h" /0
-
-
- #line 1 "HEADERMode_Detect.h" /0
-
-
- void Mode_Detector(void);
- void Measure_Mode(void);
- void Detect_Input_Mode(void);
- void Check_Input_Mode(void);
- void Detect_Video_Mode(void);
- void Check_Video_Mode(void);
-
- void New_Mode_Auto(void);
- unsigned char idata ucfrist = 0;
-
- unsigned int idata usHsync = 0;
- unsigned int idata usVsync = 0;
- unsigned int idata usStdHS = 0;
- unsigned int idata usStdVS = 0;
- unsigned char idata ucRefresh = 0;
-
- bit bVpole_Prev = 0;
- bit bHpole_Prev = 0;
- bit bVpole_Curr = 0;
- bit bHpole_Curr = 0;
- bit bStable = 0;
- bit bOverSpec = 0;
-
-
- unsigned char idata ucSync_Type = 0x00;
-
- unsigned char idata ucAV_Mode = 0;
-
-
-
-
-
-
- unsigned char idata ucMode_Curr = 0;
- unsigned char idata ucMode_Found = 0;
- unsigned char idata ucMode_Times = 0;
- unsigned char idata ucInputSrc = 0;
-
-
- unsigned char idata ucModeCnt;
- unsigned char idata ucPE_Level = 0;
- unsigned char idata ucCE_Value = 0;
-
- unsigned char Seek_DVI_Mode(unsigned char mode);
-
- void Initial_Mode(void);
-
- void Display_VGA_Set(void);
- void Display_DVI_Set(void);
- void Display_Video_Set(void);
- void Set_Video_Mode(void);
-
- unsigned char Seek_DVI_Mode(unsigned char mode);
-
-
- #line 64 "HEADERMode_Detect.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 3 "HeaderLcd_Main.h" /0
- #line 3 "HeaderLcd_Main.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 32 "HeaderLcd_Main.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 86 "HeaderLcd_Main.h" /0
-
-
- extern bit bReload;
-
-
- #line 91 "HeaderLcd_Main.h" /1
-
-
-
- #line 94 "HeaderLcd_Main.h" /0
-
- extern unsigned int idata usOSD_Timer;
- extern unsigned int idata usTaskCnt;
- extern unsigned char idata ucID_Code;
-
-
-
-
- extern void ISP_Check_Sum(void);
- extern void Set_Task(unsigned char state);
-
-
-
- #line 5 "CodeMode_Detect.c" /0
-
-
- #line 1 "HeaderAccess.h" /0
-
-
-
- #line 4 "HeaderAccess.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 90 "HeaderAccess.h" /0
-
-
- extern unsigned char data Data[16];
-
-
- extern void BitDly(void);
- extern void SetPortBit(unsigned char port, unsigned char and, unsigned char or);
- extern void SetSFRPort(unsigned char port, unsigned char Data);
- extern unsigned char GetSFRPort(unsigned char port);
-
- extern unsigned char I2CGetByte(unsigned char ack);
- extern void I2CSendByte(unsigned char send);
- extern void I2CSendAddr(unsigned char addr, unsigned char index ,unsigned char rd);
- extern void I2CSendStop(void);
- extern void I2CRead(unsigned char addr, unsigned char index, unsigned char count);
- extern void I2CWrite(unsigned char *array);
-
- extern unsigned char RTDGetByte(void);
- extern void RTDSendByte(unsigned char send);
- extern void RTDSendAddr(unsigned char addr, unsigned char rd, unsigned char inc);
- extern void RTDRead(unsigned char index, unsigned char count, unsigned char inc);
- extern void RTDWrite(unsigned char data *array);
- extern void RTDCodeW(unsigned char code *array);
- extern void RTDOSDW(unsigned char code *array);
- extern void RTDOSDW(unsigned char code *array);
-
- extern void RTDSetBit(unsigned char addr,unsigned char and, unsigned char or);
- extern void RTDSetByte(unsigned char addr, unsigned char val);
-
-
- extern void Load_Font(unsigned char code *array, unsigned int start, unsigned int length);
- extern void Load_VLC_Font(unsigned char code *array, unsigned int start, unsigned int length);
-
-
- #line 124 "HeaderAccess.h" /1
-
-
- #line 126 "HeaderAccess.h" /0
-
-
- #line 128 "HeaderAccess.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 159 "HeaderAccess.h" /0
-
-
- #line 6 "CodeMode_Detect.c" /0
-
-
- #line 1 "Headerconfig.h" /0
-
-
-
-
-
-
-
-
-
-
- #line 11 "Headerconfig.h" /1
-
-
-
-
- #line 15 "Headerconfig.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 30 "Headerconfig.h" /1
-
-
- #line 32 "Headerconfig.h" /0
-
-
- #line 34 "Headerconfig.h" /1
-
-
-
-
-
-
-
-
-
-
- #line 44 "Headerconfig.h" /0
-
-
-
-
- #line 48 "Headerconfig.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 70 "Headerconfig.h" /0
-
-
- #line 72 "Headerconfig.h" /1
-
-
- #line 74 "Headerconfig.h" /0
-
- #line 75 "Headerconfig.h" /1
-
-
- #line 77 "Headerconfig.h" /0
-
- #line 78 "Headerconfig.h" /1
-
-
- #line 80 "Headerconfig.h" /0
-
-
- #line 82 "Headerconfig.h" /1
-
-
- #line 84 "Headerconfig.h" /0
-
-
- #line 86 "Headerconfig.h" /1
-
-
- #line 88 "Headerconfig.h" /0
-
-
-
- #line 1 "DisplayDISP_B6.H" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 92 "DisplayDISP_B6.H" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 562 "DisplayDISP_B6.H" /0
-
- extern unsigned char code RTD_PWUP_INI[];
- extern unsigned char code RTD_DDC_TABLE[];
- extern unsigned char code RTD_IO_INI[];
-
- extern unsigned char code FreeV[];
- extern unsigned char code OSD_PWUP_INI[];
-
- extern unsigned int code VGA_Mode[][6];
- extern unsigned int code Mode_Preset[][5];
-
- extern unsigned char code RTD_VIDEO_60[];
- extern unsigned char code RTD_VIDEO_50[];
-
-
- #line 90 "Headerconfig.h" /0
-
-
-
-
- #line 94 "Headerconfig.h" /1
-
-
- #line 96 "Headerconfig.h" /0
-
-
-
-
-
-
- #line 102 "Headerconfig.h" /1
-
-
- #line 104 "Headerconfig.h" /0
-
-
- #line 106 "Headerconfig.h" /1
-
-
- #line 108 "Headerconfig.h" /0
-
-
-
- #line 1 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/0
-
-
- #line 1 "HEADERCODE_DEF.H" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 4 "Headermain_def.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 144 "Headermain_def.h" /1
-
-
-
-
-
-
-
-
-
-
-
- #line 155 "Headermain_def.h" /0
-
-
- #line 157 "Headermain_def.h" /1
-
-
- #line 159 "Headermain_def.h" /0
-
-
-
-
- #line 163 "Headermain_def.h" /1
-
-
- #line 165 "Headermain_def.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 270 "Headermain_def.h" /1
-
-
- #line 272 "Headermain_def.h" /0
-
- #line 273 "Headermain_def.h" /1
-
-
- #line 275 "Headermain_def.h" /0
-
- #line 276 "Headermain_def.h" /1
-
-
- #line 278 "Headermain_def.h" /0
-
- #line 279 "Headermain_def.h" /1
-
-
- #line 281 "Headermain_def.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 1 "PCB2523d1_pcb.h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
-
-
- #line 3 "HEADERMain_def.h" /0
-
-
- #line 1 "HEADERCODE_DEF.H" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 4 "HEADERMain_def.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 144 "HEADERMain_def.h" /1
-
-
-
-
-
-
-
-
-
-
-
- #line 155 "HEADERMain_def.h" /0
-
-
- #line 157 "HEADERMain_def.h" /1
-
-
- #line 159 "HEADERMain_def.h" /0
-
-
-
-
- #line 163 "HEADERMain_def.h" /1
-
-
- #line 165 "HEADERMain_def.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 270 "HEADERMain_def.h" /1
-
-
- #line 272 "HEADERMain_def.h" /0
-
- #line 273 "HEADERMain_def.h" /1
-
-
- #line 275 "HEADERMain_def.h" /0
-
- #line 276 "HEADERMain_def.h" /1
-
-
- #line 278 "HEADERMain_def.h" /0
-
- #line 279 "HEADERMain_def.h" /1
-
-
- #line 281 "HEADERMain_def.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 1 "HeaderMTV512.h" /0
-
-
-
-
-
-
-
-
-
- extern unsigned char xdata byMTV512_DDCRAMA[128];
- extern unsigned char xdata byMTV512_DDCRAMB[128];
-
-
-
-
-
- extern unsigned char xdata M512_PadMode0;
- extern unsigned char xdata M512_PadMode1;
- extern unsigned char xdata M512_PadMode2;
- extern unsigned char xdata M512_PadMode3;
- extern unsigned char xdata M512_PadMode4;
- extern unsigned char xdata M512_PadMode5;
- extern unsigned char xdata M512_Option1;
- extern unsigned char xdata M512_PadMode6;
- extern unsigned char xdata M512_PadMode7;
-
- extern unsigned char xdata M512_Port40;
- extern unsigned char xdata M512_Port41;
- extern unsigned char xdata M512_Port42;
-
-
-
-
-
-
-
- extern unsigned char xdata M512_Port50;
- extern unsigned char xdata M512_Port51;
- extern unsigned char xdata M512_Port52;
- extern unsigned char xdata M512_Port53;
- extern unsigned char xdata M512_Port54;
- extern unsigned char xdata M512_Port55;
- extern unsigned char xdata M512_Port56;
-
- extern unsigned char xdata M512_Port60;
- extern unsigned char xdata M512_Port61;
- extern unsigned char xdata M512_Port62;
- extern unsigned char xdata M512_Port63;
- extern unsigned char xdata M512_Port64;
- extern unsigned char xdata M512_Port65;
- extern unsigned char xdata M512_Port66;
- extern unsigned char xdata M512_Port67;
-
- extern unsigned char xdata M512_Port76;
- extern unsigned char xdata M512_Port77;
-
- extern unsigned char xdata M512_DA0;
- extern unsigned char xdata M512_DA1;
- extern unsigned char xdata M512_DA2;
- extern unsigned char xdata M512_DA3;
- extern unsigned char xdata M512_DA4;
- extern unsigned char xdata M512_DA5;
- extern unsigned char xdata M512_DA6;
- extern unsigned char xdata M512_DA7;
- extern unsigned char xdata M512_DA8;
- extern unsigned char xdata M512_DA9;
- extern unsigned char xdata M512_DA10;
- extern unsigned char xdata M512_DA11;
- extern unsigned char xdata M512_DA12;
- extern unsigned char xdata M512_DA13;
-
-
- extern unsigned char xdata M512_HVSTUS;
- extern unsigned char xdata M512_HCNTH;
- extern unsigned char xdata M512_HCNTL;
- extern unsigned char xdata M512_VCNTH;
- extern unsigned char xdata M512_VCNTL;
- extern unsigned char xdata M512_INTFLG;
- extern unsigned char xdata M512_INTEN;
-
-
-
- extern unsigned char xdata M512_IIC_CTR;
- extern unsigned char xdata M512_IIC_STUS1;
- extern unsigned char xdata M512_IIC_STUS2;
- extern unsigned char xdata M512_IIC_INTFLG;
- extern unsigned char xdata M512_IIC_INTEN;
- extern unsigned char xdata M512_IIC_MBUF;
- extern unsigned char xdata M512_IIC_TXRCABUF;
- extern unsigned char xdata M512_IIC_SLVAADR;
- extern unsigned char xdata M512_IIC_TXRCBBUF;
- extern unsigned char xdata M512_IIC_SLVBADR;
-
- extern unsigned char xdata M512_ISPSLV;
- extern unsigned char xdata M512_ISPEN;
-
-
-
-
- extern unsigned char xdata M512_ADC;
- extern unsigned char xdata M512_WDT;
- extern unsigned char xdata EINT1PEN ;
-
-
- #line 105 "HeaderMTV512.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 130 "HeaderMTV512.h" /0
-
-
-
-
-
-
-
-
- #line 4 "PCB2523d1_pcb.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
- #line 16 "PCB2523d1_pcb.h" /1
-
-
-
- #line 19 "PCB2523d1_pcb.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 33 "PCB2523d1_pcb.h" /1
-
-
- #line 90 "PCB2523d1_pcb.h" /0
-
-
-
-
- sbit bRTD_SDIO_0 = 0x90;
-
-
- #line 158 "PCB2523d1_pcb.h" /1
-
-
-
-
- #line 162 "PCB2523d1_pcb.h" /0
-
- sbit bRTD_SCLK = 0x94;
- sbit bRTD_SCSB = 0x95;
- sbit bIIC_SCL = 0x96;
- sbit bIIC_SDA = 0x97;
-
- sbit bDDC_SCL = 0xb0;
- sbit bDDC_SDA = 0xb1;
-
- sbit bRTD_RST = 0xb2;
- sbit bRIGHT_KEY = 0xb4;
- sbit bLEFT_KEY = 0xb5;
-
-
-
-
-
-
-
-
- #line 182 "PCB2523d1_pcb.h" /1
-
-
-
- #line 185 "PCB2523d1_pcb.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 217 "PCB2523d1_pcb.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 282 "PCB2523d1_pcb.h" /0
-
-
- #line 110 "Headerconfig.h" /0
-
-
-
-
- #line 114 "Headerconfig.h" /1
-
-
- #line 116 "Headerconfig.h" /0
-
-
- #line 118 "Headerconfig.h" /1
-
-
- #line 120 "Headerconfig.h" /0
-
- #line 1 "HEADERVDC_CFG.H" /0
-
- #line 2 "HEADERVDC_CFG.H" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-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ETECT[];
- extern unsigned char code SV_DETECT[];
-
- extern unsigned char code YUV_DETECT[];
-
- extern unsigned char code AV_60_0[];
- extern unsigned char code AV_60_1[];
- extern unsigned char code AV_60_2[];
- extern unsigned char code AV_60_3[];
- extern unsigned char code AV_60_4[];
- extern unsigned char code AV_50_0[];
- extern unsigned char code AV_50_1[];
- extern unsigned char code AV_50_2[];
- extern unsigned char code AV_50_3[];
- extern unsigned char code AV_50_4[];
- extern unsigned char code AV_SECAM[];
-
- extern unsigned char code SV_60_0[];
- extern unsigned char code SV_60_1[];
- extern unsigned char code SV_60_2[];
- extern unsigned char code SV_60_3[];
- extern unsigned char code SV_60_4[];
- extern unsigned char code SV_50_0[];
- extern unsigned char code SV_50_1[];
- extern unsigned char code SV_50_2[];
- extern unsigned char code SV_50_3[];
- extern unsigned char code SV_50_4[];
- extern unsigned char code SV_SECAM[];
-
- extern unsigned char code VIDEO_ALL[];
- extern unsigned char code VIDEO_YUV[];
- extern unsigned char code VIDEO_60[];
- extern unsigned char code VIDEO_50[];
-
- extern unsigned char code TV_SOURCE_SEL[];
- extern unsigned char code TV_SCAN_GAIN[];
- extern unsigned char code TV_DISP_GAIN[];
-
-
- #line 120 "Headerconfig.h" /0
-
-
-
-
- #line 124 "Headerconfig.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 435 "Headerconfig.h" /0
-
- extern unsigned int code CAP_WIN[][5];
- extern unsigned int code ADC_SD_SET[][3];
-
- extern unsigned char code VGA_INI_SS[];
- extern unsigned char code VGA_INI_CS[];
- extern unsigned char code VGA_INI_SOG[];
- extern unsigned char code VIDEO_INI[];
- extern unsigned char code DVI_INI[];
- extern unsigned char code VGA_SET_SS[];
- extern unsigned char code VGA_SET_CS[];
- extern unsigned char code VGA_SET_SOG[];
- extern unsigned char code LVDS_POWERUP[];
- extern unsigned char code LVDS_POWERDOWN[];
- extern unsigned char code Palette_Open[];
- extern unsigned char code Palette_Close[];
- extern unsigned char code Palette_1[];
- extern unsigned char code Palette_2[];
- extern unsigned char code Palette_3[];
- extern unsigned char code Palette_4[];
- extern unsigned char code Palette_5[];
- extern unsigned char code Palette_6[];
- extern unsigned char code Palette_7[];
- extern unsigned char code DCLK_OFFSET[16];
-
-
- #line 7 "CodeMode_Detect.c" /0
-
-
- #line 1 "HeaderOSD.h" /0
-
- #line 1 ".HEADERMain_def.h" /0
-
- #line 1 "HEADERCHAR_DEF.H" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 144 ".HEADERMain_def.h" /1
-
-
-
-
-
-
-
-
-
-
-
- #line 155 ".HEADERMain_def.h" /0
-
-
- #line 157 ".HEADERMain_def.h" /1
-
-
- #line 159 ".HEADERMain_def.h" /0
-
-
-
-
- #line 163 ".HEADERMain_def.h" /1
-
-
- #line 165 ".HEADERMain_def.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 270 ".HEADERMain_def.h" /1
-
-
- #line 272 ".HEADERMain_def.h" /0
-
- #line 273 ".HEADERMain_def.h" /1
-
-
- #line 275 ".HEADERMain_def.h" /0
-
- #line 276 ".HEADERMain_def.h" /1
-
-
- #line 278 ".HEADERMain_def.h" /0
-
- #line 279 ".HEADERMain_def.h" /1
-
-
- #line 281 ".HEADERMain_def.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 1 "HeaderOSD.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 27 "HeaderOSD.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 5116 "HeaderOSD.h" /0
-
-
- extern unsigned char code Row_Info[][19];
- extern unsigned char code FactRow_Info[][20];
-
- extern unsigned char code OSD_Window_Setting[];
-
- extern unsigned char code Page_All_Atb[];
- extern unsigned char code Page_All_ENG[];
- extern unsigned char code Page_All_GER[];
- extern unsigned char code Page_All_FRE[];
- extern unsigned char code Page_All_ITA[];
- extern unsigned char code Page_All_SPA[];
- extern unsigned char code Page_All_CHI_T[];
- extern unsigned char code Page_All_CHI_S[];
- extern unsigned char code Page_All_JAP[];
-
- extern unsigned char code Page1_Atb[];
- extern unsigned char code Page1_ENG[];
- extern unsigned char code Page1_GER[];
- extern unsigned char code Page1_FRE[];
- extern unsigned char code Page1_ITA[];
- extern unsigned char code Page1_SPA[];
- extern unsigned char code Page1_CHI_T[];
- extern unsigned char code Page1_CHI_S[];
- extern unsigned char code Page1_JAP[];
-
- extern unsigned char code Page2_Atb[];
- extern unsigned char code Page2_ENG[];
- extern unsigned char code Page2_GER[];
- extern unsigned char code Page2_FRE[];
- extern unsigned char code Page2_ITA[];
- extern unsigned char code Page2_SPA[];
- extern unsigned char code Page2_CHI_T[];
- extern unsigned char code Page2_CHI_S[];
- extern unsigned char code Page2_JAP[];
-
- extern unsigned char code Page3_Atb[];
- extern unsigned char code Page3_ENG[];
- extern unsigned char code Page3_GER[];
- extern unsigned char code Page3_FRE[];
- extern unsigned char code Page3_ITA[];
- extern unsigned char code Page3_SPA[];
- extern unsigned char code Page3_CHI_T[];
- extern unsigned char code Page3_CHI_S[];
- extern unsigned char code Page3_JAP[];
-
- extern unsigned char code Page4_Atb[];
- extern unsigned char code Page4_ENG[];
- extern unsigned char code Page4_GER[];
- extern unsigned char code Page4_FRE[];
- extern unsigned char code Page4_ITA[];
- extern unsigned char code Page4_SPA[];
- extern unsigned char code Page4_CHI_T[];
- extern unsigned char code Page4_CHI_S[];
- extern unsigned char code Page4_JAP[];
-
- extern unsigned char code Page5_Atb[];
- extern unsigned char code Page5_ENG[];
- extern unsigned char code Page5_GER[];
- extern unsigned char code Page5_FRE[];
- extern unsigned char code Page5_ITA[];
- extern unsigned char code Page5_SPA[];
- extern unsigned char code Page5_CHI_T[];
- extern unsigned char code Page5_CHI_S[];
- extern unsigned char code Page5_JAP[];
-
- extern unsigned char code Page6_Atb[];
- extern unsigned char code Page6_ENG[];
- extern unsigned char code Page6_GER[];
- extern unsigned char code Page6_FRE[];
- extern unsigned char code Page6_ITA[];
- extern unsigned char code Page6_SPA[];
- extern unsigned char code Page6_CHI_T[];
- extern unsigned char code Page6_CHI_S[];
- extern unsigned char code Page6_JAP[];
-
- extern unsigned char code Page7_Atb[];
- extern unsigned char code Page7_ENG[];
- extern unsigned char code Page7_GER[];
- extern unsigned char code Page7_FRE[];
- extern unsigned char code Page7_ITA[];
- extern unsigned char code Page7_SPA[];
- extern unsigned char code Page7_CHI_T[];
- extern unsigned char code Page7_CHI_S[];
- extern unsigned char code Page7_JAP[];
-
- extern unsigned char code OSD_Version[];
-
- extern unsigned char code NoCable_ENG[];
- extern unsigned char code NoCable_GER[];
- extern unsigned char code NoCable_FRE[];
- extern unsigned char code NoCable_ITA[];
- extern unsigned char code NoCable_SPA[];
- extern unsigned char code NoCable_CHI_T[];
- extern unsigned char code NoCable_CHI_S[];
- extern unsigned char code NoCable_JAP[];
-
- extern unsigned char code NoSignal_ENG[];
- extern unsigned char code NoSignal_FRA[];
- extern unsigned char code NoSignal_DEU[];
- extern unsigned char code NoSignal_ESP[];
- extern unsigned char code NoSignal_ITA[];
- extern unsigned char code NoSignal_CHI_T[];
- extern unsigned char code NoSignal_CHI_S[];
- extern unsigned char code NoSignal_JAP[];
-
- extern unsigned char code NoSupport_ENG[];
- extern unsigned char code NoSupport_GER[];
- extern unsigned char code NoSupport_FRE[];
- extern unsigned char code NoSupport_ITA[];
- extern unsigned char code NoSupport_SPA[];
- extern unsigned char code NoSupport_CHI_T[];
- extern unsigned char code NoSupport_CHI_S[];
- extern unsigned char code NoSupport_JAP[];
-
- extern unsigned char code rgb_OSD_VOLUME[];
- extern unsigned char code OSD_VOLUME_ENG[];
- extern unsigned char code OSD_VOLUME_ESP[];
- extern unsigned char code OSD_VOLUME_JAP[];
- extern unsigned int code strTabVOLUME_Atb[];
-
- extern unsigned char code OSD_AUTO[];
- extern unsigned char code OSD_Auto_ENG[];
- extern unsigned char code OSD_Auto_DEU[];
- extern unsigned char code OSD_Auto_FRA[];
- extern unsigned char code OSD_Auto_ESP[];
- extern unsigned char code OSD_Auto_ITA[];
- extern unsigned char code OSD_Auto_CHI_T[];
- extern unsigned char code OSD_Auto_JAP[];
- extern unsigned int code strTabAuto_Atb[];
-
- extern unsigned char code OSD_RGB[];
- extern unsigned char code OSD_DVI[];
- extern unsigned char code OSD_AV[];
- extern unsigned char code OSD_SV[];
- extern unsigned char code OSD_YUV[];
- extern unsigned char code OSD_TV[];
-
- extern unsigned char code FactoryPageAtbFont[];
- extern unsigned char code OSD_Clean_All[];
- extern unsigned char code Version_Panel[];
- extern unsigned char code RecallOK[];
- extern unsigned char code AutoOK[];
-
- extern unsigned char code OSD_Reset[];
- extern unsigned char code OSD_Enable[];
-
-
- extern unsigned char code Page8_Atb[];
- extern unsigned char code Page8_Title_ENG[];
- extern unsigned char code Page8_Title_GER[];
- extern unsigned char code Page8_Title_FRE[];
- extern unsigned char code Page8_Title_ITA[];
- extern unsigned char code Page8_Title_SPA[];
- extern unsigned char code Page8_Title_CHI_T[];
- extern unsigned char code Page8_Title_CHI_S[];
- extern unsigned char code Page8_Title_JAP[];
- extern unsigned char code Page8_Content[];
-
- extern unsigned char code Page9_Atb[];
- extern unsigned char code Page9_Title_ENG[];
- extern unsigned char code Page9_Title_GER[];
- extern unsigned char code Page9_Title_FRE[];
- extern unsigned char code Page9_Title_ITA[];
- extern unsigned char code Page9_Title_SPA[];
- extern unsigned char code Page9_Title_CHI_T[];
- extern unsigned char code Page9_Title_CHI_S[];
- extern unsigned char code Page9_Title_JAP[];
- extern unsigned char code Page9_Content[];
-
- extern unsigned char code PageADC_Atb[];
- extern unsigned char code PageADC_ENG[];
- extern unsigned char code PageVDC_Atb[];
- extern unsigned char code PageVDC_ENG[];
-
-
-
-
- #line 5305 "HeaderOSD.h" /1
-
-
-
-
-
-
-
- #line 5312 "HeaderOSD.h" /0
-
-
- extern unsigned int code OSD_HINT_TABLE[][8];
- extern unsigned int code OSD_REMK_TABLE[][8];
- extern unsigned int code OSD_PAGE_TABLE[][8];
- extern unsigned int code OSD_PAGE_All_TABLE[][8];
-
-
-
- #line 8 "CodeMode_Detect.c" /0
-
-
- #line 1 "HeaderLcd_Auto.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 71 "HeaderLcd_Auto.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 107 "HeaderLcd_Auto.h" /0
-
- extern bit bAutoInProgress;
-
- extern unsigned int idata usVer_Start;
- extern unsigned int idata usVer_End;
- extern unsigned int idata usH_Start;
- extern unsigned int idata usH_End;
-
- extern unsigned char Auto_Phase(void);
-
- extern unsigned char Auto_Position(void);
- extern unsigned char Auto_Config(void);
- extern unsigned char Auto_Balance(void);
-
- extern unsigned char Measure_Color(unsigned char color, unsigned char margin);
-
-
- #line 9 "CodeMode_Detect.c" /0
-
-
- #line 1 "HeaderFrame_Sync.h" /0
-
- #line 2 "HeaderFrame_Sync.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 21 "HeaderFrame_Sync.h" /0
-
- extern bit bFrameSync;
- extern unsigned char idata ucSyncErrorCnt;
- extern unsigned char idata ucPE_Max;
- extern unsigned char idata ucStatus;
- extern unsigned char idata ucI_Code;
- extern unsigned char idata ucP_Corr;
-
- extern unsigned char Frame_Sync(void);
- extern bit Frame_Sync_Detector(void);
- extern void Adjust_I_Code(void);
-
-
- #line 10 "CodeMode_Detect.c" /0
-
-
- #line 1 "HeaderSrc_Ctrl.h" /0
-
- #line 2 "HeaderSrc_Ctrl.h" /1
-
-
-
-
-
-
-
-
-
-
-
- #line 13 "HeaderSrc_Ctrl.h" /0
-
-
-
- extern bit bSourceScanEnable;
-
-
-
-
- extern bit Source_Control(void);
- extern void Change_Source(unsigned char source);
-
-
- extern void Source_Auto_Scan();
-
-
-
- #line 11 "CodeMode_Detect.c" /0
-
-
- #line 1 "HeaderLCD_OSD.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 24 "HeaderLCD_OSD.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 90 "HeaderLCD_OSD.h" /0
-
- extern unsigned char idata ucOSD_Page_Index;
- extern unsigned char idata ucOSD_Item_Index0;
- extern unsigned char idata ucOSD_Item_Index1;
- extern unsigned char idata ucOSD_Item_Index2;
-
- extern unsigned char idata ucOSD_Pre_Page_Index;
-
- #line 98 "HeaderLCD_OSD.h" /1
-
-
-
-
- #line 102 "HeaderLCD_OSD.h" /0
-
-
- extern void OSD_Proc(unsigned char action);
-
-
- extern void OSD_Window(unsigned char win_no, unsigned int row_start, unsigned int row_end, unsigned int col_start, unsigned int col_end,
- unsigned char width, unsigned char height, unsigned char color, unsigned char color_sb, unsigned char gradient,
- unsigned char gra_level,unsigned char attr);
-
-
- extern void OSD_Line(unsigned char row, unsigned char col, unsigned char length, unsigned char value, unsigned char indicate);
-
- extern void Get_OSD_Margin(void);
-
- extern void OSD_Opening(void);
- extern void OSD_Ending(void);
-
- extern void Show_Note(void);
- extern void Show_Hint(void);
- extern void OSD_Clear(unsigned char row_start, unsigned char height, unsigned char col_start, unsigned char width);
-
- extern void OSD_Show_Check(void);
- extern void rgb_OSD_Slider(unsigned char row, unsigned char col, unsigned char length, unsigned char value, unsigned char range,
- unsigned char color, unsigned char color_slider);
-
-
-
- extern void OSD_Fact_Line(unsigned char row, unsigned char col, unsigned char length, unsigned char value, unsigned char indicate);
- extern void OSD_Fact_Clear(unsigned char row_start, unsigned char height, unsigned char col_start, unsigned char width);
- extern void OSD_Position(unsigned char para);
- extern void Value_Adjust(unsigned char *Var, unsigned char Key, unsigned char VMax, unsigned char VMin);
-
-
-
-
-
- #line 12 "CodeMode_Detect.c" /0
-
-
-
-
-
-
- void Mode_Detector(void)
- {
-
- switch (stGUD1.INPUT_SOURCE & 0x07)
- {
- case 0 :
- case 1 :
-
- bHpole_Prev = bHpole_Curr;
- bVpole_Prev = bVpole_Curr;
-
- if ((0 == ucMode_Curr) || (255 == ucMode_Curr))
- Detect_Input_Mode();
- else
- Check_Input_Mode();
- break;
-
- default :
- if ((0 == ucMode_Curr) || (255 == ucMode_Curr))
- Detect_Video_Mode();
- else
- Check_Video_Mode();
- break;
- }
-
- Measure_Mode();
- }
-
- void Measure_Mode(void)
- {
-
-
- switch (stGUD1.INPUT_SOURCE & 0x07)
- {
- RTDSetByte(0x4A,0x00);
- case 0 :
- RTDSetByte(0x4C, (0x00 == ucSync_Type) ? 0x02 : 0x32);
- break;
-
- case 1 :
-
- RTDSetByte(0x4C, 0x02);
- break;
-
- default :
- RTDSetByte(0x4C, 0x02);
- break;
- }
-
- }
-
-
-
-
-
- void Measure_Source(unsigned char SOURCE)
- {
- switch(SOURCE)
- {
- case 0:
- RTDSetByte(0x4A,0x01);
- break;
- case 1:
- RTDSetByte(0x4A,0x03);
- break;
- case 2:
- I2CWrite(V_ENABLE);
- I2CWrite(AV_DETECT);
- break;
- case 3:
- I2CWrite(V_ENABLE);
- I2CWrite(SV_DETECT);
- break;
- }
-
-
-
-
- if(((stGUD1.INPUT_SOURCE & 0x07) == 0) && (0x00 != ucSync_Type))
- RTDSetByte(0x4C,0x32);
- else
- RTDSetByte(0x4C,0x02);
-
- Delay_Xms(35);
-
-
-
- }
-
-
- unsigned char VGA_Mode_Search(unsigned int HS_Pulse)
- {
- unsigned char ucMode_Temp,m;
- Data[0] = HS_Pulse * 12 / usHsync;
-
- ucMode_Temp = 255;
-
-
- m = 44;
-
- do
- {
- if ((usHsync > VGA_Mode[m][0]) && (usHsync < VGA_Mode[m][1]))
- {
- if ((usVsync >= VGA_Mode[m][2]) && (usVsync <= VGA_Mode[m][3]))
- {
- if (44 == m)
- {
- if (0 == (bVpole_Curr | bHpole_Curr)) m = 43;
- }
- else if (32 == m)
- {
- if (0 == (bVpole_Curr | bHpole_Curr)) m = 31;
- }
- else if (14 == m && bVpole_Curr != bHpole_Curr)
- {
-
-
-
-
- if (bHpole_Curr)
- m = Data[0] ? 3 : 3 | 0x40;
- else
- m = (stGUD1.FUNCTION & 0x10) ? 4 : 4 | 0x40;
-
- }
- else if (13 == m && bVpole_Curr != bHpole_Curr)
- {
-
-
-
-
- if (bHpole_Curr)
- m = Data[0] ? 1 : 1 | 0x40;
- else
- m = (stGUD1.FUNCTION & 0x10) ? 2 : 2 | 0x40;
-
- }
- else if (12 == m)
- {
- if (1 == bHpole_Curr && 0 == bVpole_Curr)
- m = 10;
- else if (stGUD1.FUNCTION & 0x10)
- m = 11;
- }
- else if (9 == m)
- {
- if (1 == bHpole_Curr && 0 == bVpole_Curr)
- m = Data[0] ? 6 : 7;
- else if ((stGUD1.FUNCTION & 0x10)==0)
-
- m = 8;
- }
- else if (27 == m)
- {
- if(HS_Pulse > 45)
- m = 26;
- }
- else if (26 == m)
- {
- if(HS_Pulse <= 45)
- m = 27;
- }
- else if(30 == m)
- {
- if(ucRefresh <= 71)
- m = 29;
- }
-
- ucMode_Temp = m;
- }
- }
- }
- while ((0 != --m) && (255 == ucMode_Temp));
-
-
- if (255 == ucMode_Temp)
- {
- usIPV_ACT_LEN = 0;
-
- m = 58;
-
- do
- {
- if ((usVsync >= VGA_Mode[m][2]) && (usVsync <= VGA_Mode[m][3]))
- {
- usIPV_ACT_LEN = CAP_WIN[m][4];
-
- if ((usHsync >= VGA_Mode[m][0]) && (usHsync <= VGA_Mode[m][1]))
- {
- ucMode_Temp = m;
- }
- }
- }
- while ((51 <= --m) && (255 == ucMode_Temp));
- }
-
- return ucMode_Temp;
-
- }
-
- unsigned char Partial_Display(void)
- {
- unsigned char ucMode_Temp;
-
- if ((0x040c - 0x000c) < usIPV_ACT_LEN)
- {
-
-
- ((unsigned int *)Data)[0] = (unsigned long)2458 * Mode_Preset[61][0] * (0x040c - 0x000c)
- / ((unsigned long)100 * usIPV_ACT_LEN * usHsync);
-
- if (138 < ((unsigned int *)Data)[0])
- {
-
-
-
- ((unsigned int *)Data)[1] = (unsigned long)2458 * Mode_Preset[61][0] * 0x0410
- / ((unsigned long)100 * (usVsync - 1) * usHsync);
-
- if (138 < ((unsigned int *)Data)[1])
- {
-
- usIPV_ACT_LEN = (0x040c - 0x000c);
- }
- else
- {
- ucMode_Temp = 61 | 0x80;
- }
- }
- else
- ucMode_Temp = 61;
- }
-
- if ((0x040c - 0x000c) >= usIPV_ACT_LEN)
- {
- ((unsigned int *)Data)[0] = (unsigned long)2458 * Mode_Preset[60][0] * (0x040c - 0x000c)
- / ((unsigned long)100 * usIPV_ACT_LEN * usHsync);
-
- if (138 < ((unsigned int *)Data)[0])
- {
- if (0x0410 >= (usVsync - 1))
- {
- ((unsigned int *)Data)[1] = (unsigned long)2458 * Mode_Preset[60][0] * 0x0410
- / ((unsigned long)100 * (usVsync - 1) * usHsync);
- }
- else
- {
- ((unsigned int *)Data)[1] = (unsigned long)2458 * Mode_Preset[60][0]
- / ((unsigned long)100 * usHsync);
- }
-
- if (138 < ((unsigned int *)Data)[1])
- ucMode_Temp = 255;
- else
- ucMode_Temp = 60 | 0x80;
- }
- else
- ucMode_Temp = 60;
- }
-
- return ucMode_Temp;
-
- }
-
- void Sync_Type_Switch(void)
- {
- if (0 == ucMode_Curr)
- {
- if (0x10 == ucSync_Type)
- {
- RTDCodeW(VGA_SET_SS);
-
- bVpole_Curr = 1;
- bHpole_Curr = 1;
- ucSync_Type = 0x00;
-
- }
- else if (0x00 == ucSync_Type)
- {
- RTDCodeW(VGA_SET_SOG);
-
- bVpole_Curr = 1;
- bHpole_Curr = 1;
- ucSync_Type = 0x20;
-
-
-
- }
- else
- {
- RTDCodeW(VGA_SET_CS);
-
- bVpole_Curr = 1;
- bHpole_Curr = 1;
- ucSync_Type = 0x10;
-
-
-
- }
- }
- }
-
- void Sync_Type_Confirm(void)
- {
-
-
- #line 335 "CodeMode_Detect.c" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 425 "CodeMode_Detect.c" /0
-
- }
-
-
-
- void Detect_Input_Mode(void)
- {
- unsigned char ucMode_Temp;
- unsigned int usHS_Pulse;
-
- RTDRead(0x4C, 0x09, 0);
-
- if (Data[0] & 0x02)
- {
-
- RTDSetByte(0x4C, ((stGUD1.INPUT_SOURCE & 0x07) == 0) ? 0x20 : 0x00);
-
-
- ucMode_Temp = 0;
- }
- else
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- usStdHS = usHsync;
- usStdVS = usVsync;
-
- bVpole_Curr = (bit)(Data[0] & 0x08);
- bHpole_Curr = (bit)(Data[0] & 0x04);
-
- Data[7] = Data[5];
- Data[6] = Data[6] & 0x0f;
- Data[5] = Data[3];
- Data[4] = Data[4] & 0x87;
- Data[3] = Data[1];
- Data[2] = Data[2] & 0x8f;
-
- usHsync = ((unsigned int *)Data)[1];
- usVsync = ((unsigned int *)Data)[2];
-
- if((stGUD1.INPUT_SOURCE & 0x07) == 0)
- usHS_Pulse = ((unsigned int *)Data)[3];
-
-
-
-
-
- ((unsigned long *)Data)[0] = (unsigned long)usHsync * usVsync;
- ucRefresh = (unsigned long)49152000 / ((unsigned long *)Data)[0];
- ucRefresh = (ucRefresh & 0x01) ? ((ucRefresh + 1) >> 1) : (ucRefresh >> 1);
-
-
- if (usStdHS <= usHsync && (usStdHS + 2) >= usHsync) usHsync = usStdHS;
- if (usStdVS <= usVsync && (usStdVS + 2) >= usVsync) usVsync = usStdVS;
-
-
- if ((bVpole_Curr != bVpole_Prev) || (bHpole_Curr != bHpole_Prev))
- {
- RTDRead(0x05, 0x01, 1);
-
- if((stGUD1.INPUT_SOURCE & 0x07) == 0)
- {
- Data[0] &= 0xd7;
-
- if (!bHpole_Curr) Data[0] |= 0x20;
-
- if (!bVpole_Curr && 0x00 == ucSync_Type) Data[0] |= 0x08;
-
- ucMode_Temp = 255;
- }
- else if((stGUD1.INPUT_SOURCE & 0x07) == 1)
- {
- Data[0] &= 0xf3;
-
- if (!bVpole_Curr) Data[0] |= 0x08;
- if (!bHpole_Curr) Data[0] |= 0x04;
- }
- RTDSetByte(0x05, Data[0]);
-
-
- }
- else
- {
- if (0x07ff <= usHsync || 0x07ff <= usVsync || 0 == usHsync || 0 == usVsync)
- {
- ucMode_Temp = 0;
- }
- else
- {
- ucMode_Temp = ((stGUD1.INPUT_SOURCE & 0x07) == 0) ? VGA_Mode_Search(usHS_Pulse) : 255;
-
-
- if (48 > ucRefresh || 76 < ucRefresh)
- {
- ucMode_Temp = 255;
- }
- else if (255 == ucMode_Temp && (0 != usIPV_ACT_LEN) && ((stGUD1.INPUT_SOURCE & 0x07) == 0))
- {
- ucMode_Temp = Partial_Display();
- }
- else if((stGUD1.INPUT_SOURCE & 0x07) == 1)
- ucMode_Temp = Seek_DVI_Mode(ucMode_Temp);
-
-
- }
- }
- }
-
- if((stGUD1.INPUT_SOURCE & 0x07) == 0)
- {
- if (0x20 == ucSync_Type && 0 != (usHS_Pulse * 7 / usHsync))
- {
-
-
- ucMode_Temp = 0;
- }
- }
-
-
- if (255 == ucMode_Temp || 0 == ucMode_Temp)
- {
-
- if((stGUD1.INPUT_SOURCE & 0x07) == 0)
- {
- if (0x20 == ucSync_Type)
- ucMode_Temp = 0;
- }
-
- if (255 != ucMode_Found && 0 != ucMode_Found) ucMode_Times = 0;
-
- ucMode_Found = ucMode_Temp;
-
- if (5 > ucMode_Times)
- {
-
- ucMode_Times ++;
-
- if((stGUD1.INPUT_SOURCE & 0x07) == 1)
- {
-
- RTDSetByte(0xFF,0x03);
- }
- }
- else
- {
- if((stGUD1.INPUT_SOURCE & 0x07) == 1)
- {
-
- RTDSetByte(0xFF,0x00);
- }
-
- bStable = (ucMode_Curr == ucMode_Found) ? 1 : 0;
- ucMode_Curr = ucMode_Found;
- ucMode_Times = 5 - 2;
-
- if((stGUD1.INPUT_SOURCE & 0x07) == 0)
- Sync_Type_Switch();
-
- }
- }
- else
- {
- if (ucMode_Found != ucMode_Temp)
- {
- ucMode_Times = 1;
- ucMode_Found = ucMode_Temp;
-
- if((stGUD1.INPUT_SOURCE & 0x07) == 0)
- Sync_Type_Confirm();
- }
- else
- {
- Data[0] = ((stGUD1.INPUT_SOURCE & 0x07) == 0) ? 3 : 3;
-
- if (Data[0] > ucMode_Times)
- {
- ucMode_Times ++;
- }
- else
- {
-
- M512_Port51 = 1;
-
- RTDSetByte(0x02, 0x40);
- RTDOSDW(OSD_Reset);
-
- ucMode_Curr = ucMode_Found;
- ucMode_Times = 0;
- bStable = 0;
-
- if((stGUD1.INPUT_SOURCE & 0x07)== 0)
- Display_VGA_Set();
- else
- Display_DVI_Set();
-
-
-
- #line 635 "CodeMode_Detect.c" /1
-
-
-
-
-
-
-
-
-
-
-
- #line 646 "CodeMode_Detect.c" /0
- }
- }
- }
- }
-
-
- void Check_Input_Mode(void)
- {
- RTDRead(0x4C, 0x05, 0);
-
- if (Data[0] & 0x02)
- {
- RTDSetByte(0x4C, ((stGUD1.INPUT_SOURCE & 0x07) == 0) ? 0x20 : 0x00);
-
- ucMode_Found = 255;
- }
- else
- {
- bVpole_Curr = (bit)(Data[0] & 0x08);
- bHpole_Curr = (bit)(Data[0] & 0x04);
-
- Data[5] = Data[3];
- Data[4] = Data[4] & 0x87;
- Data[3] = Data[1];
- Data[2] = Data[2] & 0x8f;
- usHsync = ((unsigned int *)Data)[1];
- usVsync = ((unsigned int *)Data)[2];
-
-
- if ((bVpole_Curr != bVpole_Prev) || (bHpole_Curr != bHpole_Prev))
- {
- RTDRead(0x05, 0x01, 1);
-
-
-
- if((stGUD1.INPUT_SOURCE & 0x07) == 0)
- {
- Data[0] &= 0xd7;
-
- if (!bHpole_Curr) Data[0] |= 0x20;
-
- if (!bVpole_Curr && 0x00 == ucSync_Type) Data[0] |= 0x08;
- }
- else if((stGUD1.INPUT_SOURCE & 0x07) == 1)
- {
- Data[0] &= 0xf3;
-
- if (!bVpole_Curr) Data[0] |= 0x08;
- if (!bHpole_Curr) Data[0] |= 0x04;
- }
-
- RTDSetByte(0x05, Data[0]);
-
- ucMode_Found = 255;
- }
- else
- {
- if (0x07ff <= usHsync || 0x07ff <= usVsync || 0 == usHsync || 0 == usVsync)
- {
- ucMode_Found = 255;
- }
- else
- {
- if ((usHsync < (usStdHS - 1)) || (usHsync > (usStdHS + 3)) ||
- (usVsync < (usStdVS - 1)) || (usVsync > (usStdVS + 3)))
- {
- ucMode_Found = 255;
- }
- else
- {
- ucMode_Found = ucMode_Curr;
- }
- }
- }
- }
-
- if (255 == ucMode_Found)
- Reset_Mode();
- else
- {
- bStable = 1;
-
- #line 734 "CodeMode_Detect.c" /1
-
-
-
-
-
-
- #line 740 "CodeMode_Detect.c" /0
- }
-
- }
-
-
-
-
- unsigned char Seek_DVI_Mode(unsigned char mode)
- {
-
- unsigned char Wait_Time_Cnt;
-
- RTDSetByte(0x4C, 0x03);
-
- Wait_Time_Cnt = 60;
- do
- {
- Delay_Xms(1);
- RTDRead(0x4C, 0x07, 0);
- }
- while ((Data[0] & 0x02) && (--Wait_Time_Cnt));
-
- Data[7] = Data[5];
- Data[6] = Data[6] & 0x0f;
- Data[5] = Data[3];
- Data[4] = Data[4] & 0x87;
- Data[3] = Data[1];
- Data[2] = Data[2] & 0x8f;
-
-
- if ((0 == ((unsigned int *)Data)[1]) || (0x07ff <= ((unsigned int *)Data)[1]) ||
- (0 == ((unsigned int *)Data)[2]) || (0x07ff <= ((unsigned int *)Data)[2]) ||
- (0 == Wait_Time_Cnt))
- {
- RTDSetByte(0x4C, 0x00);
-
- return 255;
- }
-
-
- usADC_Clock = ((unsigned int *)Data)[1] * 2;
-
-
- usIPV_ACT_LEN = ((unsigned int *)Data)[2];
- usIPH_ACT_WID = ((unsigned int *)Data)[3] * 2;
-
-
- if (350 > usIPV_ACT_LEN) return 255;
-
-
- usIPH_ACT_WID = (2 < (usIPH_ACT_WID & 0x0007)) ? ((usIPH_ACT_WID + 8) & 0xfff8) : (usIPH_ACT_WID & 0xfff8);
-
-
- if (1280 < usIPH_ACT_WID) usIPH_ACT_WID = 1280;
-
-
- ((unsigned int *)Data)[0] = (unsigned long)(usVsync - 1) * (0x040c - 0x000c) / 0x0410;
-
- if (((unsigned int *)Data)[0] < usIPV_ACT_LEN) usIPV_ACT_LEN = ((unsigned int *)Data)[0];
-
- mode = 60;
-
- if (60 == mode)
- {
-
- Wait_Time_Cnt = 51;
- do
- {
- if (Mode_Preset[Wait_Time_Cnt][2] < CAP_WIN[Wait_Time_Cnt][4])
- {
-
-
- if (Mode_Preset[Wait_Time_Cnt][2] > usIPV_ACT_LEN || (CAP_WIN[Wait_Time_Cnt][4] + 24) < usIPV_ACT_LEN) continue;
- }
- else
- {
- if (Mode_Preset[Wait_Time_Cnt][2] < usIPV_ACT_LEN) continue;
- }
-
- ((unsigned int *)Data)[0] = (unsigned long)2458 * Mode_Preset[Wait_Time_Cnt][0] * Mode_Preset[Wait_Time_Cnt][2]
- / ((unsigned long)100 * usIPV_ACT_LEN * usHsync);
-
-
- if (138 > ((unsigned int *)Data)[0]) return Wait_Time_Cnt;
- }
- while (59 >= ++Wait_Time_Cnt);
-
- mode = Partial_Display();
-
-
- }
-
-
- return mode;
-
- #line 835 "CodeMode_Detect.c" /1
-
-
-
- #line 838 "CodeMode_Detect.c" /0
- }
-
-
-
-
- void Detect_Video_Mode(void)
- {
-
- #line 846 "CodeMode_Detect.c" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 1046 "CodeMode_Detect.c" /0
- Display_Video_Set();
-
- }
-
-
-
- void Check_Video_Mode(void)
- {
-
- #line 1055 "CodeMode_Detect.c" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 1100 "CodeMode_Detect.c" /0
- }
-
-
- void Calculate_IVS2DVS_Delay(unsigned char integer, unsigned char fraction, unsigned int DVStart)
- {
- if ((usIPV_ACT_STA + integer) < (DVStart >> 6))
- {
-
- usIPV_ACT_STA = ( DVStart >> 6) - integer;
-
- RTDSetByte(0x0A, (unsigned char)usIPV_ACT_STA);
- RTDSetByte(0x0A + 1, (unsigned char)(usIPV_ACT_STA >> 8));
- }
-
- ((unsigned int*)Data)[0] = ((usIPV_ACT_STA + integer) << 6) + ((unsigned int)fraction << 6)/10 - DVStart;
-
-
- ucDV_Delay = (unsigned char)(((unsigned int*)Data)[0] >> 6);
-
- Data[6] = ((unsigned int*)Data)[0] - (ucDV_Delay << 6);
-
- Data[6] = (unsigned long)usADC_Clock * Data[6] / 1024;
-
- RTDSetByte(0x1E, Data[6]);
-
-
- }
-
- void Set_Dclk(unsigned int DispLen)
- {
- if (Mode_Preset[ucMode_Curr][3])
- {
-
- Data[0] = 6;
- Data[1] = 0;
- Data[2] = 0xD0;
- Data[3] = 0x11;
- Data[4] = (unsigned char)(Mode_Preset[ucMode_Curr][3] >> 8);
- Data[5] = (unsigned char)Mode_Preset[ucMode_Curr][3];
- Data[6] = 0;
- RTDWrite(Data);
- }
- else
- {
-
-
-
-
-
-
-
-
-
- ((unsigned int *)Data)[0] = (unsigned long)8 * usDH_Total * 16 * DispLen
- / ((unsigned long)usIPV_ACT_LEN * usHsync);
-
-
-
-
-
-
-
-
- Data[15] = ((unsigned int *)Data)[0] >> 2;
- Data[5] = (unsigned int)Data[15] * 40 / 176 - 5;
- Data[6] = 0x00;
- if(Data[5] > 60)
- {
- Data[5] -= 60;
- Data[6] |= 0x80;
- }
-
- if(Data[5] > 40)
- {
- Data[5] -= 40;
- Data[6] |= 0x40;
- }
-
- if(Data[5] > 20)
- {
- Data[5] -= 20;
- Data[6] |= 0x20;
- }
-
- if(Data[5] > 10)
- {
- Data[5] -= 10;
- Data[6] |= 0x10;
- }
-
- if(Data[5] > 5)
- {
- Data[5] -= 5;
- Data[6] |= 0x08;
- }
-
-
- Data[0] = 7;
- Data[1] = 0;
- Data[2] = 0xD0;
- Data[3] = Data[6];
- Data[4] = Data[15] - 2;
- Data[5] = 0x10 | (16 - 2);
-
- Data[6] = 0x04;
- Data[7] = 0;
- RTDWrite(Data);
-
-
-
-
-
-
- ((unsigned long*)Data)[0] = (unsigned long)24576000 / usIPV_ACT_LEN * DispLen / usHsync * usDH_Total ;
-
-
- ((unsigned long*)Data)[1] = (unsigned long)12288000 * (Data[15] + 1) / 16;
-
- ((unsigned long*)Data)[2] = ((unsigned long*)Data)[1] - ((unsigned long*)Data)[0];
- ((unsigned long*)Data)[3] = ((unsigned long*)Data)[1] >> 15;
-
- ((unsigned long*)Data)[3] = ((((unsigned long*)Data)[2] << 1)/ ((unsigned long*)Data)[3]) & 0x00000fff;
-
-
- RTDSetByte(0x9a,(unsigned char)((unsigned long*)Data)[3]);
-
-
- RTDSetBit(0x9b,0xf0,(unsigned char)(((unsigned long*)Data)[3] >> 8) | 0x20);
-
- RTDSetBit(0x5A,0xff,0x08);
- RTDSetBit(0xD2,0xff,0x20);
- RTDSetBit(0xD3,0x7f,0x00);
- }
- }
-
- void Initial_Mode(void)
- {
- unsigned char ucOption;
- unsigned int usDispLen;
-
-
-
- ucOption = ucMode_Curr & 0xc0;
- ucMode_Curr = ucMode_Curr & 0x3f;
-
-
- RTDSetBit(0x70, 0xf9, 0x02);
- if (1 == (stGUD1.INPUT_SOURCE & 0x07))
- {
- RTDSetBit(0x70, 0xf9, 0x00);
-
- usIPH_ACT_STA = CAP_WIN[ucMode_Curr][1];
- }
- else
- {
-
- if (ucOption & 0x40)
- {
-
-
- usADC_Clock = CAP_WIN[9][0];
- usIPH_ACT_STA = CAP_WIN[9][1];
- usIPH_ACT_WID = CAP_WIN[9][2];
- }
- else
- {
- usADC_Clock = CAP_WIN[ucMode_Curr][0];
- usIPH_ACT_STA = CAP_WIN[ucMode_Curr][1];
- usIPH_ACT_WID = CAP_WIN[ucMode_Curr][2];
-
-
- usDispLen = (unsigned long)24576 * usADC_Clock / ((unsigned long)usHsync * 500);
- usDispLen = (usDispLen >> 1) + (usDispLen & 0x01);
-
-
- if (140 < usDispLen && 55 <= ucMode_Curr && 59 >= ucMode_Curr)
- {
- usADC_Clock = ADC_SD_SET[ucMode_Curr - 55][0];
- usIPH_ACT_STA = ADC_SD_SET[ucMode_Curr - 55][1];
- usIPH_ACT_WID = ADC_SD_SET[ucMode_Curr - 55][2];
- }
-
- }
-
-
- usDispLen = (unsigned long)24576 * usADC_Clock / ((unsigned long)usHsync * 500);
- usDispLen = (usDispLen >> 1) + (usDispLen & 0x01);
-
-
-
- RTDSetBit(0xEA,0xe0,(45 > usDispLen) ? 0x10 | ((0x01 << 2) & 0x0c) |( 0x01 & 0x03):
- 0x00 | ((0x01 << 2) & 0x0c) |( 0x01 & 0x03));
-
-
-
-
- RTDSetBit(0x04, 0xf3, (60 > usDispLen) ? 0x08 : 0x00);
-
- RTDSetByte(0x3C, 0x00);
-
- RTDSetByte(0xEB,0x06);
-
-
-
-
-
-
-
-
-
- RTDSetBit(0xEC,0xff,0x40);
-
- #line 1312 "CodeMode_Detect.c" /1
-
-
- #line 1314 "CodeMode_Detect.c" /0
-
-
-
-
- RTDSetByte(0xE8, 0x0d | ((0x01 << 4) & 0x30));
-
-
-
- RTDSetBit(0xEB,0xc7, (((0x01 << 2) & 0x10) << 1) | (((0x01 << 4) & 0x40) << 2)
- |((0x01 & 0x04) << 1));
-
-
-
- RTDSetBit(0xFF,0xff,0x04);
-
-
- if(ucMode_Curr < 29)
- RTDSetByte(0xE9, 0x08);
- else
- RTDSetByte(0xE9, 0x10);
-
-
-
- if (60 > ucMode_Curr)
- {
-
-
- usIPV_ACT_LEN = CAP_WIN[ucMode_Curr][4];
- }
-
- }
-
-
-
- RTDSetByte(0x8C, 3);
-
- usIPV_ACT_STA = CAP_WIN[ucMode_Curr][3] - 3 - 1;
-
-
- RTDSetByte(0x8D, 6);
-
-
- if(ucMode_Curr < 23)
- Data[0] = 2;
- else if(ucMode_Curr < 44)
- Data[0] = 5;
- else
- Data[0] = 3;
-
-
- usIPH_ACT_STA = usIPH_ACT_STA + Data[0] - 6;
-
-
-
- usDispLen = Mode_Preset[ucMode_Curr][2];
-
- if (60 == ucMode_Curr)
- {
- if (ucOption & 0x80)
- {
- if (0x0410 > (usVsync - 1))
- usDispLen = (unsigned long)usIPV_ACT_LEN * 0x0410 / (usVsync - 1);
- else
- usDispLen = usIPV_ACT_LEN;
- }
- }
- else if (61 == ucMode_Curr)
- {
- if (ucOption & 0x80)
- {
- usDispLen = (unsigned long)usIPV_ACT_LEN * 0x0410 / (usVsync - 1);
- }
- }
-
- if (Mode_Preset[ucMode_Curr][2] < usDispLen) usDispLen = Mode_Preset[ucMode_Curr][2];
-
-
- if (usDispLen >= usIPV_ACT_LEN && Mode_Preset[ucMode_Curr][1] < usIPH_ACT_WID)
- {
- usIPH_ACT_WID = Mode_Preset[ucMode_Curr][1];
- }
-
- if (usDispLen > usIPV_ACT_LEN) ucOption |= 0x01;
- if (usDispLen < usIPV_ACT_LEN) ucOption |= 0x02;
- if (Mode_Preset[ucMode_Curr][1] > usIPH_ACT_WID) ucOption |= 0x04;
- if (Mode_Preset[ucMode_Curr][1] < usIPH_ACT_WID) ucOption |= 0x08;
-
-
- Data[0] = 11;
- Data[1] = 0;
- Data[2] = 0x06;
- Data[3] = (unsigned char)usIPH_ACT_STA;
- Data[4] = (unsigned char)(usIPH_ACT_STA >> 8);
- Data[5] = (unsigned char)usIPH_ACT_WID;
- Data[6] = (unsigned char)(usIPH_ACT_WID >> 8);
- Data[7] = (unsigned char)usIPV_ACT_STA;
- Data[8] = (unsigned char)(usIPV_ACT_STA >> 8);
- Data[9] = (unsigned char)usIPV_ACT_LEN;
- Data[10] = (unsigned char)(usIPV_ACT_LEN >> 8);
- Data[11] = 0;
- RTDWrite(Data);
-
-
- Data[0] = 7;
- Data[1] = 0;
- Data[2] = 0x40;
-
- if (ucOption & 0x08)
- {
-
- Data[3] = (unsigned char)Mode_Preset[ucMode_Curr][1];
- Data[4] = (unsigned char)(Mode_Preset[ucMode_Curr][1] >> 8);
- }
- else
- {
-
- Data[3] = Data[5];
- Data[4] = Data[6];
- }
-
- if (ucOption & 0x02)
- {
-
- Data[5] = (unsigned char)usDispLen;
- Data[6] = (unsigned char)(usDispLen >> 8);
- }
- else
- {
-
- Data[5] = Data[9];
- Data[6] = Data[10];
- }
- Data[7] = 0;
- RTDWrite(Data);
-
-
- if (ucOption & 0x0a)
- RTDSetBit(0x70, 0xff, 0x01);
- else
- RTDSetBit(0x70, 0xfe, 0x00);
-
- if (ucOption & 0x01)
- RTDSetBit(0x15, 0xff, 0x02);
- else
- RTDSetBit(0x15, 0xfd, 0x00);
-
- if (ucOption & 0x04)
- RTDSetBit(0x15, 0xff, 0x01);
- else
- RTDSetBit(0x15, 0xfe, 0x00);
-
-
- Data[0] = 7;
- Data[1] = 0;
- Data[2] = 0x71;
-
- if (ucOption & 0x08)
- {
-
- ((unsigned long *)Data)[3] = (unsigned long)256 * 4096 * usIPH_ACT_WID / Mode_Preset[ucMode_Curr][1];
-
-
- ((unsigned int *)Data)[2] = (((unsigned long *)Data)[3] >> 8) + 2;
-
-
- Data[3] = Data[5];
-
- RTDSetBit(0x04, 0xff, 0x40);
- }
- else
- {
- Data[3] = 0x00;
- Data[4] = 0x10;
-
- RTDSetBit(0x04, 0xbf, 0x00);
- }
-
- if (ucOption & 0x02)
- {
-
- ((unsigned long *)Data)[3] = (unsigned long)256 * 4096 * usIPV_ACT_LEN / usDispLen;
-
-
- ((unsigned int *)Data)[3] = (((unsigned long *)Data)[3] >> 8);
-
- if (0 == Data[15]) ((unsigned int *)Data)[3] = ((unsigned int *)Data)[3] - 1;
-
-
- Data[5] = Data[7];
-
- RTDSetBit(0x04, 0xff, 0x80);
- }
- else
- {
- Data[5] = 0x00;
- Data[6] = 0x10;
-
- RTDSetBit(0x04, 0x7f, 0x00);
- }
- Data[7] = 0;
- RTDWrite(Data);
-
-
- Data[0] = 8;
- Data[1] = 0;
- Data[2] = 0x16;
-
- if (ucOption & 0x04)
- {
-
- ((unsigned long *)Data)[3] = (unsigned long)2 * 262144 * usIPH_ACT_WID / Mode_Preset[ucMode_Curr][1];
- ((unsigned long *)Data)[3] = ((((unsigned long *)Data)[3] >> 1) + (((unsigned long *)Data)[3] & 0x01)) << 6;
-
- Data[3] = Data[14];
- Data[4] = Data[13];
- Data[7] = Data[15];
- }
- else
- {
- Data[3] = 0xff;
- Data[4] = 0xff;
- Data[7] = 0;
- }
-
- if (ucOption & 0x01)
- {
-
- ((unsigned long *)Data)[3] = (unsigned long)2 * 262144 * usIPV_ACT_LEN / usDispLen;
- ((unsigned long *)Data)[3] = ((((unsigned long *)Data)[3] >> 1) + (((unsigned long *)Data)[3] & 0x01)) << 6;
-
- Data[5] = Data[14];
-
- Data[6] = Data[13];
-
- Data[7] = Data[7] | (Data[15] >> 4);
- }
- else
- {
- Data[5] = 0xff;
- Data[6] = 0xff;
- }
- Data[8] = 0;
- RTDWrite(Data);
-
-
-
-
- RTDSetByte(0x20, 0x28 | 0x00 | 0x04);
-
- Data[0] = 5;
- Data[1] = 0;
-
-
- #line 1567 "CodeMode_Detect.c" /1
-
-
-
-
-
-
-
-
-
- #line 1576 "CodeMode_Detect.c" /0
-
- Data[2] = 0x29;
-
-
- ((unsigned int *)Data)[2] = (unsigned int)0x0020 + Mode_Preset[ucMode_Curr][1];
-
- Data[3] = Data[5];
-
-
-
- Data[5] = 5;
- Data[6] = 0;
- Data[7] = 0x34;
-
-
- ((unsigned int *)Data)[5] = (unsigned int)0x000c + usDispLen;
-
- Data[8] = Data[11];
- Data[9] = Data[10];
- Data[10] = 0;
- RTDWrite(Data);
-
-
- usDH_Total = Mode_Preset[ucMode_Curr][0];
-
-
-
- if (0 == bPanel_Status)
- RTDSetByte(0x20, 0x29 | 0x00 | 0x04);
- else
- RTDSetByte(0x20, 0x2b | 0x00 | 0x04);
-
- Set_Dclk(usDispLen);
-
-
-
-
- Data[0] = 5;
- Data[1] = 0;
- Data[2] = 0x22;
- Data[3] = (unsigned char)(usDH_Total - 2);
- Data[4] = (unsigned char)((usDH_Total - 2) >> 8);
- Data[5] = 0;
- RTDWrite(Data);
-
-
-
-
- if((ucOption & 0x01) || (ucOption & 0x02))
- {
-
-
- #line 1628 "CodeMode_Detect.c" /1
-
-
- #line 1630 "CodeMode_Detect.c" /0
-
-
- #line 1632 "CodeMode_Detect.c" /1
-
-
- #line 1634 "CodeMode_Detect.c" /0
-
-
-
- usDV_Total = (unsigned long)usVsync * 1024 / (unsigned long)usIPV_ACT_LEN + 64;
-
-
-
- }
- else
- usDV_Total = usVsync + 64;
-
-
- Data[0] = 5;
- Data[1] = 0;
- Data[2] = 0x2D;
- Data[3] = (unsigned char)usDV_Total;
- Data[4] = (unsigned char)((usDV_Total >> 8) & 0x07);
- Data[5] = 0;
- RTDWrite(Data);
-
-
-
-
-
-
-
-
- ((unsigned int *)Data)[0] = (unsigned long)64 * 0x000c * usIPV_ACT_LEN / usDispLen;
-
- if (ucOption & 0x01)
- {
- Calculate_IVS2DVS_Delay(2,5,((unsigned int*)Data)[0]);
-
- }
- else
- {
-
- #line 1671 "CodeMode_Detect.c" /1
-
-
- #line 1673 "CodeMode_Detect.c" /0
- if (ucOption & 0x02)
- {
-
- Calculate_IVS2DVS_Delay(2,6,((unsigned int*)Data)[0]);
- }
- else
- {
-
- Calculate_IVS2DVS_Delay(1,9,((unsigned int*)Data)[0]);
- }
-
-
- }
-
-
- #line 1688 "CodeMode_Detect.c" /1
-
-
-
- #line 1691 "CodeMode_Detect.c" /0
- RTDSetBit(0x68, 0xfc, 0x00);
-
-
-
- RTDSetByte(0x38, ucDV_Delay);
-
- RTDSetByte(0x01, 0x00);
- RTDSetByte(0x1F, 0x00);
-
-
-
-
-
-
-
-
- RTDSetBit(0x04, 0xff, 0x01);
-
- }
-
- void Display_VGA_Set(void)
- {
- unsigned char Wait_Time_Cnt;
-
-
-
- Initial_Mode();
- Sharpness();
-
- if((usIPH_ACT_WID == 1280) && (2 == 2) && (stGUD1.FILTER == 0x02))
- RTDSetBit(0x15, 0xff, 0x01);
-
-
- PowerDown_ADC();
-
-
-
- SetADC_GainOffset();
-
- Set_Gamma();
- Set_Dithering();
- Set_Bright_Contrast();
-
-
- Load_MUD(ucMode_Curr);
-
-
- ucPE_Level = 0;
-
-
-
- if (28 > stMUD.CLOCK || 228 < stMUD.CLOCK) stMUD.CLOCK = 128;
-
-
-
- Set_Clock();
-
- Delay_Xms(6);
-
- if(ucCE_Value == 0)
- {
- RTDRead(0xCA,1,1);
- RTDSetByte(0xCA, 0x0d);
- Delay_Xms(4);
- RTDRead(0xCE,1,1);
- ucP_Corr = (unsigned char)((unsigned int)(Data[0] * 200) >> (29 - 21));
- ucCE_Value = Data[0];
-
- }
-
- if(ucI_Code == 0)
- Adjust_I_Code();
-
-
- Set_Clock();
-
-
-
-
-
-
-
-
- ucH_Max_Margin = 128 + 50;
- ucH_Min_Margin = 128 - 50;
-
-
- I2CRead(0xAE,(ucMode_Curr - 1),0x01);
- if(Data[0] > 228)
- Data[0] = 0;
-
- usIPH_ACT_STA = (Data[0] & 0x80) ? usIPH_ACT_STA - 50 - (Data[0] - 0x80) : usIPH_ACT_STA + Data[0] - 50;
-
- Data[0] = 5;
- Data[1] = 0;
- Data[2] = 0x06;
- Data[3] = (unsigned char)usIPH_ACT_STA;
- Data[4] = (unsigned char)(usIPH_ACT_STA >> 8);
- Data[5] = 0;
- RTDWrite(Data);
-
-
- if (ucH_Max_Margin < stMUD.H_POSITION)
- stMUD.H_POSITION = ucH_Max_Margin;
- else if (ucH_Min_Margin > stMUD.H_POSITION)
- stMUD.H_POSITION = ucH_Min_Margin;
-
-
- Set_H_Position();
-
-
- stMUD.PHASE &= 0x7c;
-
-
- Set_Phase(stMUD.PHASE);
-
-
- RTDSetByte(0x7F, 0x01);
- Delay_Xms(40);
-
-
- RTDSetByte(0x7F, 0x00);
- Delay_Xms(40);
-
-
- Data[0] = 14;
- Data[1] = 0;
- Data[2] = 0x75;
- Data[3] = 0x00;
- Data[4] = 0xff;
- Data[5] = 0x07;
- Data[6] = 0x00;
- Data[7] = 0x00;
- Data[8] = 0x00;
- Data[9] = 0x00;
- Data[10] = 0x00;
- Data[11] = 0x00;
- Data[12] = 0x00;
- Data[13] = 0x01;
- Data[14] = 0;
- RTDWrite(Data);
-
- Wait_Time_Cnt = 60;
- do
- {
- Delay_Xms(1);
- RTDRead(0x7F, 0x01, 1);
- }
- while ((Data[0] & 0x01) && (--Wait_Time_Cnt));
-
- RTDSetByte(0x7F, 0x00);
-
- if (Wait_Time_Cnt)
- {
- RTDRead(0x80, 0x04, 0);
- Data[0] = Data[3] & 0x0f;
- Data[1] = Data[2];
-
- usVer_End = (usVsync < ((unsigned int *)Data)[0]) ? ((unsigned int *)Data)[0] : usVsync;
- }
- else
- {
- usVer_End = usVsync;
- }
-
-
- if (51 <= ucMode_Curr)
- {
- ((unsigned int *)Data)[0] = usVer_End - VGA_Mode[ucMode_Curr][2];
-
- if (254 < ((unsigned int *)Data)[0] + ucDV_Delay) ((unsigned int *)Data)[0] = 254 - ucDV_Delay;
-
- usIPV_ACT_STA += ((unsigned int *)Data)[0];
- ucDV_Delay += ((unsigned int *)Data)[0];
- }
-
-
- ucV_Min_Margin = (128 < usIPV_ACT_STA) ? 0 : 128 - usIPV_ACT_STA + 1;
-
- if ((128 - 50) > ucV_Min_Margin) ucV_Min_Margin = 128 - 50;
-
- ((unsigned int *)Data)[0] = (usVer_End + 128 - 2) - (usIPV_ACT_STA + usIPV_ACT_LEN);
-
- ucV_Max_Margin = (((unsigned int *)Data)[0] > 0x00ff) ? 0xff : ((unsigned int *)Data)[0];
-
-
-
-
-
-
-
- if ((unsigned int)128 > ((unsigned int)ucV_Min_Margin + ucDV_Delay)) ucV_Min_Margin = 128 - ucDV_Delay;
- if ((unsigned int)382 < ((unsigned int)ucV_Max_Margin + ucDV_Delay)) ucV_Max_Margin = 382 - ucDV_Delay;
-
- if ((128 + 50) < ucV_Max_Margin) ucV_Max_Margin = 128 + 50;
-
-
- if (ucV_Min_Margin > stMUD.V_POSITION)
- stMUD.V_POSITION = ucV_Min_Margin;
- else if ((unsigned int)256 - ucV_Min_Margin < stMUD.V_POSITION)
- stMUD.V_POSITION = (unsigned int)256 - ucV_Min_Margin;
-
-
- Set_V_Position();
-
-
- ((unsigned long *)Data)[0] = (unsigned long)usHsync * usVer_End;
- ucRefresh = (unsigned long)49152000 / ((unsigned long *)Data)[0];
- ucRefresh = (ucRefresh & 0x01) ? ((ucRefresh + 1) >> 1) : (ucRefresh >> 1);
-
- if(ucRefresh > 78)
- bOverSpec = 1;
-
- if((unsigned int)24576/usHsync > 90)
- bOverSpec = 1;
-
- Data[0] = Frame_Sync();
-
- if (1 == Data[0])
- {
- Delay_Xms(10);
- Data[0] = Frame_Sync();
- }
-
- bFrameSync = Data[0] ? 0 : 1;
- ucSyncErrorCnt = 0;
-
- RTDSetBit(0x6D,0x3f,0x00);
- RTDSetByte(0x6C,0x00);
- RTDSetBit(0x6D,0x3f,0x40);
- RTDSetByte(0x6C,0x00);
- RTDSetBit(0x6D,0x3f,0x80);
- RTDSetByte(0x6C,0x00);
-
-
- RTDSetBit(0x20, 0x7f, 0x20 | 0x00);
-
-
- if(bFrameSync)
- RTDSetBit(0x8E,0xdf,0x20);
-
-
-
- ucfrist = (ucMode_Curr - 1 ) / 8 ;
- I2CRead(0xAE, ucfrist , 1);
- ucfrist = ucMode_Curr - (ucfrist*8) ;
- ucfrist = Data[0] >> (ucfrist-1) ;
- ucfrist = ucfrist & 0x01;
- stGUD1.OSD_INPUT = stGUD1.OSD_INPUT | 0x20;
-
-
- }
-
- void Display_DVI_Set(void)
- {
-
- unsigned char Wait_Time_Cnt;
-
- Initial_Mode();
-
-
- ucV_Min_Margin = (128 < usIPV_ACT_STA) ? 0 : 128 - usIPV_ACT_STA + 1;
-
-
- ((unsigned int *)Data)[4] = (usVsync + 128 - 2) - (usIPV_ACT_STA + usIPV_ACT_LEN);
-
- ucV_Max_Margin = (0x00ff < ((unsigned int *)Data)[4]) ? 0xff : ((unsigned int *)Data)[4];
-
-
-
-
-
-
-
- if ((unsigned int)128 > ((unsigned int)ucV_Min_Margin + ucDV_Delay)) ucV_Min_Margin = 128 - ucDV_Delay;
- if ((unsigned int)382 < ((unsigned int)ucV_Max_Margin + ucDV_Delay)) ucV_Max_Margin = 382 - ucDV_Delay;
-
-
- Load_MUD(ucMode_Curr);
-
- Set_Gamma();
- Set_Dithering();
- Set_Bright_Contrast();
- Sharpness();
-
-
-
-
-
-
-
-
-
- Data[0] = 14;
- Data[1] = 0;
- Data[2] = 0x75;
- Data[3] = 0x02;
- Data[4] = usADC_Clock - 2;
- Data[5] = (usADC_Clock - 2) >> 8;
- Data[6] = 0x02;
- Data[7] = usVsync - 2;
- Data[8] = (usVsync - 2) >> 8;
- Data[9] = 0;
- Data[10] = 0;
- Data[11] = 0;
- Data[12] = 0;
- Data[13] = 0x81;
- Data[14] = 0;
-
-
- RTDWrite(Data);
-
- Wait_Time_Cnt = 60;
- do
- {
- Delay_Xms(1);
- RTDRead(0x7F, 0x01, 1);
- }
- while ((Data[0] & 0x01) && (--Wait_Time_Cnt));
-
- if (0 == Wait_Time_Cnt)
- {
- RTDSetByte(0x7F, 0x00);
- Reset_Mode();
- }
- else
- {
-
- RTDRead(0x80, 0x08, 0);
-
-
- usIPH_ACT_STA = (unsigned int)Data[4] + ((unsigned int)Data[5] << 8) - 2;
-
-
- ((unsigned int *)Data)[0] = (unsigned int)Data[0] + ((unsigned int)Data[1] << 8) - 1;
-
- if (((unsigned int *)Data)[0] > (usIPV_ACT_STA + ucV_Max_Margin - 0x80))
- {
- ((unsigned int *)Data)[1] = (usVsync + 128 - 2) - (usIPV_ACT_STA + usIPV_ACT_LEN);
-
- ucDV_Delay = (unsigned char)((unsigned int)ucDV_Delay + ucV_Max_Margin - 0x80);
- usIPV_ACT_STA = usIPV_ACT_STA + ucV_Max_Margin - 0x80;
-
- if (ucV_Max_Margin < ((unsigned int *)Data)[1])
- {
-
- if ((((unsigned int *)Data)[1] - ucV_Max_Margin) >= (((unsigned int *)Data)[0] - usIPV_ACT_STA))
- ((unsigned int *)Data)[1] = ((unsigned int *)Data)[0] - usIPV_ACT_STA + 3;
- else
- ((unsigned int *)Data)[1] = usIPV_ACT_STA + ((unsigned int *)Data)[1] - ucV_Max_Margin + 3;
-
- if (126 < ((unsigned int *)Data)[1]) ((unsigned int *)Data)[1] = 126;
-
- RTDSetByte(0x8C, 0x80 | ((unsigned int *)Data)[1]);
- }
- }
- else if (((unsigned int *)Data)[0] < (usIPV_ACT_STA + ucV_Min_Margin - 0x80))
- {
- ucDV_Delay = (unsigned char)((unsigned int)ucDV_Delay + ucV_Min_Margin - 0x80);
- usIPV_ACT_STA = usIPV_ACT_STA + ucV_Min_Margin - 0x80;
-
- ((unsigned int *)Data)[1] = usIPV_ACT_STA - ((unsigned int *)Data)[0];
-
-
- if (3 <= ((unsigned int *)Data)[1])
- RTDSetByte(0x8C, 0x00);
- else
- RTDSetByte(0x8C, 0x80 | (3 - ((unsigned int *)Data)[1]));
- }
- else
- {
- ucDV_Delay = ((unsigned int *)Data)[0] + ucDV_Delay - usIPV_ACT_STA ;
- usIPV_ACT_STA = ((unsigned int *)Data)[0];
- }
-
- RTDRead(0xFF,0x01,1);
-
- if(Data[0] & 0x03)
- usIPH_ACT_STA -= 14;
-
- Data[0] = 5;
- Data[1] = 0;
- Data[2] = 0x06;
- Data[3] = (unsigned char)(usIPH_ACT_STA & 0x00ff);
- Data[4] = (unsigned char)((usIPH_ACT_STA >> 8) & 0x00ff);
- Data[5] = 5;
- Data[6] = 0;
- Data[7] = 0x0A;
- Data[8] = (unsigned char)(usIPV_ACT_STA & 0x00ff);
- Data[9] = (unsigned char)((usIPV_ACT_STA >> 8) & 0x00ff);
- Data[10] = 4;
- Data[11] = 1;
- Data[12] = 0x38;
- Data[13] = ucDV_Delay;
- Data[14] = 0;
- RTDWrite(Data);
-
- Wait_For_Event(0x08);
-
- Data[0] = Frame_Sync();
-
- if (1 == Data[0]) Data[0] = Frame_Sync();
-
- bFrameSync = Data[0] ? 0 : 1;
- ucSyncErrorCnt = 0;
-
-
- RTDSetBit(0x20, 0x7f, 0x20 | 0x00);
- }
-
- #line 2101 "CodeMode_Detect.c" /1
-
-
- #line 2103 "CodeMode_Detect.c" /0
- }
-
- void Set_Video_Mode(void)
- {
-
- #line 2108 "CodeMode_Detect.c" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 2181 "CodeMode_Detect.c" /0
- }
-
- void Display_Video_Set(void)
- {
-
- #line 2186 "CodeMode_Detect.c" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 2278 "CodeMode_Detect.c" /0
- Set_Video_Mode();
-
- }
-
- void Input_Mode_Detector(void)
- {
- RTDRead(0x4C, 0x01, 1);
-
- if (0 == (Data[0] & 0x02)) ucModeCnt = 0;
-
- if (ucModeCnt)
- {
- ucModeCnt -= 1;
- }
- else
- {
- ucModeCnt = 2;
-
-
- Source_Auto_Scan();
-
- #line 2299 "CodeMode_Detect.c" /1
-
-
- #line 2301 "CodeMode_Detect.c" /0
-
- if (!bStable)
- {
- bReload = 1;
-
- Set_Task(2);
- }
- }
- }
-
-
-
-
- void New_Mode_Auto(void)
- {
-
- if (bStable &&
- bFrameSync &&
- ((stGUD1.OSD_INPUT & 0x20) == 0x20) &&
- (0 != ucMode_Curr) &&
- (255 != ucMode_Curr) &&
- ucfrist
- )
- {
- OSD_Position(0x01);
- OSD_Position(0x01);
- RTDSetBit(0x6D, 0xfe, 0x00);
- RTDOSDW(OSD_Reset);
- RTDSetBit(0x6D, 0xfe, 0x01);
- RTDOSDW(OSD_AUTO);
- RTDOSDW(strTabAuto_Atb[stGUD1.FUNCTION & 0x07]);
- Auto_Config();
- RTDSetBit(0x6D, 0xfe, 0x00);
- RTDOSDW(OSD_Reset);
-
- stGUD1.OSD_INPUT &= 0xdf;
- Save_GUD1();
- ucfrist = (ucMode_Curr - 1 ) / 8 ;
- I2CRead(0xAE, ucfrist , 1);
- Data[1] = 0x01;
- Data[1] = Data[1] << (ucMode_Curr - 1 - (ucfrist*8)) ;
- Data[3] = Data[0] & ~Data[1];
-
- Data[0] = 4;
- Data[1] = 0xAE;
- Data[2] = ucfrist;
- I2CWrite(Data);
- Delay_Xms(0x10);
- ucfrist = 0;
- }
-
- }
-