diff --git a/src/init.c b/src/init.c index e048f62..df61137 100644 --- a/src/init.c +++ b/src/init.c @@ -476,27 +476,6 @@ XGI_New_GetOffset(VB_DEVICE_INFO *XGI_Pr,USHORT ModeNo,USHORT ModeIdIndex, return(temp); } -/*********************************************/ -/* GRC */ -/*********************************************/ - -static void -XGI_New_SetGRCRegs(VB_DEVICE_INFO *XGI_Pr, USHORT StandTableIndex) -{ - UCHAR GRdata; - USHORT i; - - for(i = 0; i <= 0x08; i++) { - GRdata = XGI_Pr->StandTable[StandTableIndex].GRC[i]; - XGI_SetReg(XGI_Pr->P3ce,i,GRdata); - } - - if(XGI_Pr->ModeType > ModeVGA) { - /* 256 color disable */ - XGI_SetRegAND(XGI_Pr->P3ce,0x05,0xBF); - } -} - /*********************************************/ /* CLEAR EXTENDED REGISTERS */ /*********************************************/ @@ -871,7 +850,7 @@ XGI_New_SetCRT1Group(VB_DEVICE_INFO *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo, XGI_SetMiscRegs(StandTableIndex, XGI_Pr); XGI_SetCRTCRegs(StandTableIndex, XGI_Pr); XGI_SetATTRegs(ModeNo, StandTableIndex, ModeIdIndex, XGI_Pr); - XGI_New_SetGRCRegs(XGI_Pr, StandTableIndex); + XGI_SetGRCRegs(StandTableIndex, XGI_Pr); XGI_New_ClearExt1Regs(XGI_Pr, HwInfo, ModeNo); XGI_ResetCRT1VCLK(XGI_Pr, HwInfo); diff --git a/src/vb_setmode.c b/src/vb_setmode.c index f1279c3..e964194 100644 --- a/src/vb_setmode.c +++ b/src/vb_setmode.c @@ -135,7 +135,6 @@ void XGI_SetCRT1Group(PXGI_HW_DEVICE_INFO HwDeviceExtension, USHORT ModeNo, USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); static void XGI_WaitDisplay(PVB_DEVICE_INFO pVBInfo); void XGI_SenseCRT1(PVB_DEVICE_INFO pVBInfo); -void XGI_SetGRCRegs(USHORT StandTableIndex, PVB_DEVICE_INFO pVBInfo); void XGI_ClearExt1Regs(PVB_DEVICE_INFO pVBInfo); void XGI_SetSync(USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); @@ -783,20 +782,20 @@ XGI_SetATTRegs(unsigned ModeNo, unsigned StandTableIndex, unsigned ModeIdIndex, /* Description : */ /* --------------------------------------------------------------------- */ void -XGI_SetGRCRegs(USHORT StandTableIndex, PVB_DEVICE_INFO pVBInfo) +XGI_SetGRCRegs(unsigned StandTableIndex, const VB_DEVICE_INFO *pVBInfo) { - UCHAR GRdata; - USHORT i; + unsigned i; - for (i = 0; i <= 0x08; i++) { - GRdata = pVBInfo->StandTable[StandTableIndex].GRC[i]; /* Get GR from file */ - XGI_SetReg((XGIIOADDRESS) pVBInfo->P3ce, i, GRdata); /* Set GR(3ce) */ + for (i = 0; i <= 8; i++) { + /* Get GR from file and set GR (3ce) + */ + const unsigned GRdata = pVBInfo->StandTable[StandTableIndex].GRC[i]; + XGI_SetReg((XGIIOADDRESS) pVBInfo->P3ce, i, GRdata); } if (pVBInfo->ModeType > ModeVGA) { - GRdata = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3ce, 0x05); - GRdata &= 0xBF; /* 256 color disable */ - XGI_SetReg((XGIIOADDRESS) pVBInfo->P3ce, 0x05, GRdata); + /* 256 color disable */ + XGI_SetRegAND((XGIIOADDRESS) pVBInfo->P3ce, 0x05, 0xBF); } } diff --git a/src/vb_setmode.h b/src/vb_setmode.h index a62fcf4..1df0932 100644 --- a/src/vb_setmode.h +++ b/src/vb_setmode.h @@ -67,4 +67,7 @@ extern void XGI_SetCRTCRegs(unsigned StandTableIndex, extern void XGI_SetATTRegs(unsigned ModeNo, unsigned StandTableIndex, unsigned ModeIdIndex, const VB_DEVICE_INFO *pVBInfo); + +extern void XGI_SetGRCRegs(unsigned StandTableIndex, + const VB_DEVICE_INFO *pVBInfo); #endif