index = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x33) >> SiS_Pr->SiS_SelectCRT2Rate) & 0x0F; backupindex = index; 
index = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x33) >> SiS_Pr->SiS_SelectCRT2Rate) & 0x0F; backupindex = index; 
SiS_GetRatePtr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,               PSIS_HW_INFO HwInfo){  SHORT  LCDRefreshIndex[] = { 0x00, 0x00, 0x01, 0x01,                               0x01, 0x01, 0x01, 0x01,			       0x01, 0x01, 0x01, 0x01,			       0x01, 0x01, 0x01, 0x01,			       0x00, 0x00, 0x00, 0x00 };  USHORT RRTI,i,backup_i;  USHORT modeflag,index,temp,backupindex;  /* Do NOT check for UseCustomMode here, will skrew up FIFO */  if(ModeNo == 0xfe) return 0;  if(ModeNo <= 0x13) {     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;  } else {     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;  }  if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {     if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {     	if(modeflag & HalfDCLK) return 0;     }  }  if(ModeNo < 0x14) return 0xFFFF;  index = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x33) >> SiS_Pr->SiS_SelectCRT2Rate) & 0x0F;  backupindex = index;  if(index > 0) index--;  if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) {     if(SiS_Pr->SiS_VBType & VB_SISVB) {        if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {	   if(SiS_Pr->SiS_VBType & VB_NoLCD)		index = 0;	   else if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index = backupindex = 0;	}	if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {	   if(!(SiS_Pr->SiS_VBType & VB_NoLCD)) {              temp = LCDRefreshIndex[SiS_GetBIOSLCDResInfo(SiS_Pr)];              if(index > temp) index = temp;	   }	}     } else {        if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) index = 0;	if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {           if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) index = 0;        }     }  }  RRTI = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].REFindex;  ModeNo = SiS_Pr->SiS_RefIndex[RRTI].ModeID;  if(HwInfo->jChipType >= SIS_315H) {     if(!(SiS_Pr->SiS_VBInfo & DriverMode)) {        if( (SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_VESAID == 0x105) ||            (SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_VESAID == 0x107) ) {           if(backupindex <= 1) RRTI++;        }     }  }  i = 0;  do {     if(SiS_Pr->SiS_RefIndex[RRTI + i].ModeID != ModeNo) break;     temp = SiS_Pr->SiS_RefIndex[RRTI + i].Ext_InfoFlag;     temp &= ModeTypeMask;     if(temp < SiS_Pr->SiS_ModeType) break;     i++;     index--;  } while(index != 0xFFFF);  if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) {     if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {      	temp = SiS_Pr->SiS_RefIndex[RRTI + i - 1].Ext_InfoFlag;      	if(temp & InterlaceMode) i++;     }  }  i--;  if((SiS_Pr->SiS_SetFlag & ProgrammingCRT2) && (!(SiS_Pr->SiS_VBInfo & DisableCRT2Display))) {     backup_i = i;     if(!(SiS_AdjustCRT2Rate(SiS_Pr, ModeNo, ModeIdIndex, RRTI, &i, HwInfo))) {	i = backup_i;     }  }  return(RRTI + i);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/544393fe584d333480659a4bed30f5295355df11/init301.c/clean/drivers/video/sis/init301.c