⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 init301.c

📁 内核linux2.4.20,可跟rtlinux3.2打补丁 组成实时linux系统,编译内核
💻 C
📖 第 1 页 / 共 5 页
字号:
		case 5:			LVDSData = SiS_LVDS1280x1024Data_2;			break;			/*  case  5:  LVDSData=SiS_LVDS1280x960Data_2;  break; */		}	}	else {		SiS_GetCRT2Ptr (ROMAddr, ModeNo, ModeIdIndex,				RefreshRateTableIndex, &CRT2Index, &ResIndex);		switch (CRT2Index) {		case 0:			LVDSData = SiS_LVDS800x600Data_1;			break;		case 1:			LVDSData = SiS_LVDS1024x768Data_1;			break;		case 2:			LVDSData = SiS_LVDS1280x1024Data_1;			break;		case 3:			LVDSData = SiS_LVDS800x600Data_2;			break;		case 4:			LVDSData = SiS_LVDS1024x768Data_2;			break;		case 5:			LVDSData = SiS_LVDS1280x1024Data_2;			break;		case 6:			LVDSData = SiS_LVDS640x480Data_1;			break;		case 7:			LVDSData = SiS_CHTVUNTSCData;			break;		case 8:			LVDSData = SiS_CHTVONTSCData;			break;		case 9:			LVDSData = SiS_CHTVUPALData;			break;		case 10:			LVDSData = SiS_CHTVOPALData;			break;		}	}	SiS_VGAHT = (LVDSData + ResIndex)->VGAHT;	SiS_VGAVT = (LVDSData + ResIndex)->VGAVT;	SiS_HT = (LVDSData + ResIndex)->LCDHT;	SiS_VT = (LVDSData + ResIndex)->LCDVT;/*301b*/	if ((SiS_IF_DEF_LVDS == 0)	    && ((SiS_VBType & VB_SIS301B) || (SiS_VBType & VB_SIS302B))) {	/*for test */		if (!(SiS_LCDInfo & LCDNonExpanding)) {			if (SiS_LCDResInfo == Panel1024x768) {				tempax = 1024;				tempbx = 768;			} else {				tempax = 1280;				tempbx = 1024;			}			SiS_HDE = tempax;			SiS_VDE = tempbx;		}	} else {		if (SiS_IF_DEF_TRUMPION == 0) {			if (SiS_VBInfo & SetCRT2ToLCD) {				if (!(SiS_LCDInfo & LCDNonExpanding)) {					if (SiS_LCDResInfo == Panel800x600) {						tempax = 800;						tempbx = 600;					} else if (SiS_LCDResInfo ==						   Panel1024x768) {						tempax = 1024;						tempbx = 768;					} else {						tempax = 1280;						tempbx = 1024;					}					SiS_HDE = tempax;					SiS_VDE = tempbx;				}			}		}	}	return;}voidSiS_GetCRT2Data301 (ULONG ROMAddr, USHORT ModeNo, USHORT ModeIdIndex,		    USHORT RefreshRateTableIndex){	USHORT tempax, tempbx, modeflag;	USHORT resinfo;	USHORT CRT2Index, ResIndex;	SiS_LCDDataStruct *LCDPtr = NULL;	SiS_TVDataStruct *TVPtr = NULL;	if (ModeNo <= 0x13) {		modeflag = SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;	/* si+St_ResInfo */		resinfo = SiS_SModeIDTable[ModeIdIndex].St_ResInfo;	} else {		modeflag = SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;	/* si+Ext_ResInfo */		resinfo = SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;	}	SiS_NewFlickerMode = 0;	SiS_RVBHRS = 50;	SiS_RY1COE = 0;	SiS_RY2COE = 0;	SiS_RY3COE = 0;	SiS_RY4COE = 0;	SiS_GetCRT2ResInfo (ROMAddr, ModeNo, ModeIdIndex);	if (SiS_VBInfo & SetCRT2ToRAMDAC) {		SiS_GetRAMDAC2DATA (ROMAddr, ModeNo, ModeIdIndex,				    RefreshRateTableIndex);		return;	}	if (SiS_VBInfo & SetCRT2ToTV) {		SiS_GetCRT2Ptr (ROMAddr, ModeNo, ModeIdIndex,				RefreshRateTableIndex, &CRT2Index, &ResIndex);		switch (CRT2Index) {		case 2:			TVPtr = SiS_ExtHiTVData;			break;		case 3:			TVPtr = SiS_ExtPALData;			break;		case 4:			TVPtr = SiS_ExtNTSCData;			break;		case 7:			TVPtr = SiS_St1HiTVData;			break;		case 8:			TVPtr = SiS_StPALData;			break;		case 9:			TVPtr = SiS_StNTSCData;			break;		case 12:			TVPtr = SiS_St2HiTVData;			break;		}		SiS_RVBHCMAX = (TVPtr + ResIndex)->RVBHCMAX;		SiS_RVBHCFACT = (TVPtr + ResIndex)->RVBHCFACT;		SiS_VGAHT = (TVPtr + ResIndex)->VGAHT;		SiS_VGAVT = (TVPtr + ResIndex)->VGAVT;		SiS_HDE = (TVPtr + ResIndex)->TVHDE;		SiS_VDE = (TVPtr + ResIndex)->TVVDE;		SiS_RVBHRS = (TVPtr + ResIndex)->RVBHRS;		SiS_NewFlickerMode = (TVPtr + ResIndex)->FlickerMode;		if (SiS_VBInfo & SetCRT2ToHiVisionTV) {			if (resinfo == 0x08)				SiS_NewFlickerMode = 0x40;			if (resinfo == 0x09)				SiS_NewFlickerMode = 0x40;			if (resinfo == 0x10)				SiS_NewFlickerMode = 0x40;		}		if (SiS_VBInfo & SetCRT2ToHiVisionTV) {			if (SiS_VGAVDE == 350)				SiS_SetFlag = SiS_SetFlag | TVSimuMode;			tempax = ExtHiTVHT;			tempbx = ExtHiTVVT;			if (SiS_VBInfo & SetInSlaveMode) {				if (SiS_SetFlag & TVSimuMode) {					tempax = StHiTVHT;					tempbx = StHiTVVT;					if (!(modeflag & Charx8Dot)) {						tempax = StHiTextTVHT;						tempbx = StHiTextTVVT;					}				}			}		}		if (!(SiS_VBInfo & SetCRT2ToHiVisionTV)) {			SiS_RY1COE = (TVPtr + ResIndex)->RY1COE;			SiS_RY2COE = (TVPtr + ResIndex)->RY2COE;			if (modeflag & HalfDCLK) {				SiS_RY1COE = 0x00;				SiS_RY2COE = 0xf4;			}			SiS_RY3COE = (TVPtr + ResIndex)->RY3COE;			SiS_RY4COE = (TVPtr + ResIndex)->RY4COE;			if (modeflag & HalfDCLK) {				SiS_RY3COE = 0x10;				SiS_RY4COE = 0x38;			}			if (!(SiS_VBInfo & SetPALTV)) {				tempax = NTSCHT;				tempbx = NTSCVT;			} else {				tempax = PALHT;				tempbx = PALVT;			}		}		SiS_HT = tempax;		SiS_VT = tempbx;		return;	}	if (SiS_VBInfo & SetCRT2ToLCD) {		SiS_GetCRT2Ptr (ROMAddr, ModeNo, ModeIdIndex,				RefreshRateTableIndex, &CRT2Index, &ResIndex);		switch (CRT2Index) {		case 0:			LCDPtr = SiS_ExtLCD1024x768Data;			break;		case 1:			LCDPtr = SiS_ExtLCD1280x1024Data;			break;		case 5:			LCDPtr = SiS_StLCD1024x768Data;			break;		case 6:			LCDPtr = SiS_StLCD1280x1024Data;			break;		case 10:			LCDPtr = SiS_St2LCD1024x768Data;			break;		case 11:			LCDPtr = SiS_St2LCD1280x1024Data;			break;		case 13:			LCDPtr = SiS_NoScaleData;			break;		case 14:			LCDPtr = SiS_LCD1280x960Data;			break;		}		SiS_RVBHCMAX = (LCDPtr + ResIndex)->RVBHCMAX;		SiS_RVBHCFACT = (LCDPtr + ResIndex)->RVBHCFACT;		SiS_VGAHT = (LCDPtr + ResIndex)->VGAHT;		SiS_VGAVT = (LCDPtr + ResIndex)->VGAVT;		SiS_HT = (LCDPtr + ResIndex)->LCDHT;		SiS_VT = (LCDPtr + ResIndex)->LCDVT;		tempax = 1024;		if (SiS_SetFlag & LCDVESATiming) {			if (SiS_VGAVDE == 350)				tempbx = 560;			else if (SiS_VGAVDE == 400)				tempbx = 640;			else				tempbx = 768;		} else {			if (SiS_VGAVDE == 357)				tempbx = 527;			else if (SiS_VGAVDE == 420)				tempbx = 620;			else if (SiS_VGAVDE == 525)				tempbx = 775;			else if (SiS_VGAVDE == 600)				tempbx = 775;			else if (SiS_VGAVDE == 350)				tempbx = 560;			else if (SiS_VGAVDE == 400)				tempbx = 640;			else				tempbx = 768;		}		if (SiS_LCDResInfo == Panel1280x1024) {			tempax = 1280;			if (SiS_VGAVDE == 360)				tempbx = 768;			else if (SiS_VGAVDE == 375)				tempbx = 800;			else if (SiS_VGAVDE == 405)				tempbx = 864;			else				tempbx = 1024;		}		if (SiS_LCDResInfo == Panel1280x960) {			tempax = 1280;			if (SiS_VGAVDE == 350)				tempbx = 700;			else if (SiS_VGAVDE == 400)				tempbx = 800;			else if (SiS_VGAVDE == 1024)				tempbx = 960;			else				tempbx = 960;		}		if (SiS_LCDInfo & LCDNonExpanding) {			tempax = SiS_VGAHDE;			tempbx = SiS_VGAVDE;		}		SiS_HDE = tempax;		SiS_VDE = tempbx;		return;	}}USHORTSiS_GetResInfo (ULONG ROMAddr, USHORT ModeNo, USHORT ModeIdIndex){	USHORT resindex;	if (ModeNo <= 0x13) {		resindex = SiS_SModeIDTable[ModeIdIndex].St_ResInfo;	/* si+St_ResInfo */	} else {		resindex = SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;	/* si+Ext_ResInfo */	}	return (resindex);}voidSiS_GetCRT2ResInfo (ULONG ROMAddr, USHORT ModeNo, USHORT ModeIdIndex){	USHORT xres, yres, modeflag, resindex;	resindex = SiS_GetResInfo (ROMAddr, ModeNo, ModeIdIndex);	if (ModeNo <= 0x13) {		xres = SiS_StResInfo[resindex].HTotal;		yres = SiS_StResInfo[resindex].VTotal;	} else {		xres = SiS_ModeResInfo[resindex].HTotal;	/* xres->ax */		yres = SiS_ModeResInfo[resindex].VTotal;	/* yres->bx */		modeflag = SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;	/* si+St_ModeFlag */		if (modeflag & HalfDCLK) {			xres = xres * 2;		}		if (modeflag & DoubleScanMode) {			yres = yres * 2;		}	}	if (SiS_IF_DEF_LVDS == 0) {		if (SiS_LCDResInfo == Panel1280x1024) {			if (yres == 400)				yres = 405;			if (yres == 350)				yres = 360;			if (SiS_SetFlag & LCDVESATiming) {				if (yres == 360)					yres = 375;			}		}		if (SiS_LCDResInfo == Panel1024x768) {			if (!(SiS_SetFlag & LCDVESATiming)) {				if (!(SiS_LCDInfo & LCDNonExpanding)) {					if (yres == 350)						yres = 357;					if (yres == 400)						yres = 420;/*          if(!OldBios)             */					if (yres == 480)						yres = 525;				}			}		}	} else {		if (xres == 720)			xres = 640;	}	SiS_VGAHDE = xres;	SiS_HDE = xres;	SiS_VGAVDE = yres;	SiS_VDE = yres;}voidSiS_GetCRT2Ptr (ULONG ROMAddr, USHORT ModeNo, USHORT ModeIdIndex,		USHORT RefreshRateTableIndex, USHORT * CRT2Index,		USHORT * ResIndex){	USHORT tempbx, tempal;	USHORT Flag;	if (SiS_IF_DEF_LVDS == 0) {		if (SiS_VBInfo & SetCRT2ToLCD) {	/* LCD */			tempbx = SiS_LCDResInfo;			tempbx = tempbx - Panel1024x768;			if (!(SiS_SetFlag & LCDVESATiming)) {				tempbx += 5;/*      GetRevisionID();  */				tempbx += 5;			}		} else {			if (SiS_VBInfo & SetCRT2ToHiVisionTV) {	/* TV */				if (SiS_VGAVDE > 480)					SiS_SetFlag =					    SiS_SetFlag & (!TVSimuMode);				tempbx = 2;				if (SiS_VBInfo & SetInSlaveMode) {					if (!(SiS_SetFlag & TVSimuMode))						tempbx = 10;				}			} else {				if (SiS_VBInfo & SetPALTV) {					tempbx = 3;				} else {					tempbx = 4;				}				if (SiS_SetFlag & TVSimuMode) {					tempbx = tempbx + 5;				}			}		}		if (ModeNo <= 0x13) {			tempal = SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;		} else {			tempal =			    SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;		}		tempal = tempal & 0x3F;		/*301b */		if (((SiS_VBType & VB_SIS301B) || (SiS_VBType & VB_SIS302B))		    && (SiS_VBInfo & SetCRT2ToTV)) {			/*look */			if (tempal == 0x06)				tempal = 0x07;		}		/*end 301b */		if ((0x31 <= ModeNo) && (ModeNo <= 0x35))			tempal = 6;		if (SiS_LCDInfo & LCDNonExpanding)			tempbx = 0x0D;		if (SiS_LCDResInfo == Panel1280x960)			tempbx = 0x0E;		*CRT2Index = tempbx;		*ResIndex = tempal;	} else {		/* LVDS */		Flag = 1;		tempbx = 0;		if (SiS_IF_DEF_CH7005 == 1) {			if (!(SiS_VBInfo & SetCRT2ToLCD)) {				Flag = 0;				tempbx = 7;				if (SiS_VBInfo & SetPALTV)					tempbx = tempbx + 2;				if (SiS_VBInfo & SetCHTVOverScan)					tempbx = tempbx + 1;			}		}		if (Flag == 1) {			tempbx = SiS_LCDResInfo - Panel800x600;			if (SiS_LCDInfo & LCDNonExpanding) {				tempbx = tempbx + 3;			}		}		if (ModeNo <= 0x13) {			tempal = SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;		} else {			tempal =			    SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;		}		tempal = tempal & 0x1F;		*CRT2Index = tempbx;		*ResIndex = tempal;	}}voidSiS_GetCRT2PtrA (ULONG ROMAddr, USHORT ModeNo, USHORT ModeIdIndex,		 USHORT RefreshRateTableIndex, USHORT * CRT2Index,		 USHORT * ResIndex){	USHORT tempbx, tempal;	tempbx = SiS_LCDResInfo - Panel1024x768;	if (SiS_LCDInfo & LCDNonExpanding) {		tempbx = tempbx + 3;	}	if (ModeNo <= 0x13) {		tempal = SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;	} else {		tempal = SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;	}	tempal = tempal & 0x1F;	*CRT2Index = tempbx;	*ResIndex = tempal;}/*end 301b*/USHORTSiS_GetRatePtrCRT2 (ULONG ROMAddr, USHORT ModeNo, USHORT ModeIdIndex){	SHORT LCDRefreshIndex[] = { 0x00, 0x00, 0x03, 0x01 };	SHORT LCDARefreshIndex[] = { 0x00, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01 };	USHORT RefreshRateTableIndex, i;	USHORT modeflag, index, temp;	if (ModeNo <= 0x13) {		modeflag = SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;	} else {		modeflag = SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;	}	if (SiS_IF_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -