📄 ddcci.c
字号:
{
switch(VCPFeature.vcp_opcode)
{
case DDC2B_CMD_VCP_NewControlVal: //To make MCCS 2.0 Compliant - 14June04
{
if (cmd == SET_VCP && VCPFeature.value)
{
VCPFeature.value = NoNewControlVal;
B_DDCCINewControlVal = 0;
}
else if (cmd == GET_VCP)
{
//Check for modeIndependent & mode dependent variables saved in NVRAM
if(B_DDCCINewControlVal)
VCPFeature.value = NewControlVal; //2 - a new control value has been saved
else
VCPFeature.value = NoNewControlVal;
VCPFeature.value = SWAP_BYTES(VCPFeature.value);
msg("NewControlVal: %d",VCPFeature.value);
}
break;
}
case DDC2B_CMD_VCP_MCCSVersion: //To make MCCS 2.0 Compliant - 14June04
{
if (cmd == GET_VCP)
{
VCPFeature.value = VCP_Version; //Version 2, revision 0 of VESA Monitor control command set document
msg("MCCSVersion: %d",VCPFeature.value);
}
break;
}
case DDC2B_CMD_VCP_ALLReset:
{
if (cmd == SET_VCP && VCPFeature.value)
FactoryReset();
break;
}
case DDC2B_CMD_VCP_BrightContrastReset: //To make MCCS 2.0 Compliant - 14June04
{
if (cmd == SET_VCP && VCPFeature.value)
{
ModeIndependentUserPreferences.Brightness = FactoryDefaultInROM.Brightness;
ModeIndependentUserPreferences.Contrast = FactoryDefaultInROM.Contrast;
AdjustBrightness();
AdjustColor();
}
break;
}
case DDC2B_CMD_VCP_GeometryReset:
{
if (cmd == SET_VCP && VCPFeature.value)
FactoryPositionReset();
break;
}
case DDC2B_CMD_VCP_ColorReset:
{
if (cmd == SET_VCP && VCPFeature.value)
FactoryColorReset();
break;
}
case DDC2B_CMD_VCP_RED:
case DDC2B_CMD_VCP_YELLOW:
case DDC2B_CMD_VCP_GREEN:
case DDC2B_CMD_VCP_CYAN:
case DDC2B_CMD_VCP_BLUE:
case DDC2B_CMD_VCP_MAGENDA:
case DDC2B_CMD_VCP_RedGain: //To make MCCS 2.0 Compliant - 14June04
case DDC2B_CMD_VCP_GreenGain: //To make MCCS 2.0 Compliant - 14June04
case DDC2B_CMD_VCP_BlueGain: //To make MCCS 2.0 Compliant - 14June04
// for black level (MicroSoft Vista)
#ifdef Action_AdjustBlackLevel_WB_Used
case Red_Video_Black_Level:
case Green_Video_Black_Level:
case Blue_Video_Black_Level:
#endif
offset = GetVCPAdjOffset(VCPFeature.vcp_opcode);
if(offset == 0xFFFF)
return 1;
if (cmd == SET_VCP)
{
#if (USE_ACM_3D && defined( ADJUSTER_COLORAXIS_DECLARED ))
UserPrefColorAxis = VCPFeature.vcp_opcode - DDC2B_CMD_VCP_RED;
#else
SetUserPrefColorToUser();
#endif
}
ProcessSetGetVCPAdjuster(cmd, offset);
break;
case DDC2B_CMD_VCP_Clock:
case DDC2B_CMD_VCP_Brightness:
case DDC2B_CMD_VCP_Contrast:
case DDC2B_CMD_VCP_HPosition:
case DDC2B_CMD_VCP_VPosition:
case DDC2B_CMD_VCP_ClockPhase:
case DDC2B_CMD_VCP_AudioVolume:
case DDC2B_CMD_VCP_TVSharpness:
case DDC2B_CMD_VCP_TVSaturation:
offset = GetVCPAdjOffset(VCPFeature.vcp_opcode);
if(offset == 0xFFFF)
return 1;
ProcessSetGetVCPAdjuster(cmd, offset);
break;
case DDC2B_ChangeportToVGA:
ChangeToVGAPort();
break;
case DDC2B_ChangeportToDVI:
ChangeToDVIPort();
break;
case DDC2B_CMD_VCP_SelectColorPreset:
if (cmd == SET_VCP)
{
switch (VCPFeature.value)
{
case DDCCI_sRGB :
UserPrefColor = CTEMP_SRGB;
break;
case DDCCI_4000K :
UserPrefColor = CTEMP_4200K;
break;
case DDCCI_5000K :
UserPrefColor = CTEMP_5000K;
break;
case DDCCI_6500K :
UserPrefColor = CTEMP_6500K;
break;
case DDCCI_7500K :
UserPrefColor = CTEMP_7500K;
break;
case DDCCI_9300K :
UserPrefColor = CTEMP_9300K;
break;
case DDCCI_USER1 :
UserPrefColor = CTEMP_USER;
break;
}
VCPFeature.value = UserPrefColor;
AdjustColor();
}
else
{
VCPFeature.value = UserPrefColor;
}
break;
case DDC2B_CMD_VCP_AutoSetUp:
{
if (cmd == SET_VCP && VCPFeature.value)
StartAutoAdjust();
break;
}
case DDC2B_CMD_VCP_ColorTemp:
{
//call your hook here
ret = dummy_hook();
break;
}
case DDC2B_CMD_VCP_InputSource: //To make MCCS 2.0 Compliant - 26July04
{
if (cmd == SET_VCP)
{
switch (VCPFeature.value)
{
case AnalogVideo_1 :
ChangeToPort(0);
msg("AnalogVideo_1: 0x%x",VCPFeature.value);
break;
case DigitalVideo_1 :
ChangeToPort(1);
msg("DigitalVideo_1: 0x%x",VCPFeature.value);
break;
case SVideo_1 :
ChangeToPort(2);
msg("SVideo_1: 0x%x",VCPFeature.value);
break;
case CompositeVideo_1 :
ChangeToPort(3);
msg("CompositeVideo_1: 0x%x",VCPFeature.value);
break;
case ComponentVideo_1 :
ChangeToPort(4);
msg("ComponentVideo_1: 0x%x",VCPFeature.value);
break;
}
}
else
{
if(InputPortArray[gmvb_CurrentPortMain].Port == IP_RGB )
{
VCPFeature.value = AnalogVideo_1;
}
else if(InputPortArray[gmvb_CurrentPortMain].Port == IP_DVI )
{
VCPFeature.value = DigitalVideo_1;
}
#if USE_VPORT && VPORT_CTRL // if no VPORT, don't include video ports.
else if(InputPortArray[gmvb_CurrentPortMain].Port == IP_VIDEO )
{
#if 1
switch (InputPortArray[gmvb_CurrentPortMain].VideoInput)
{
default:
case VDD_INTYP_COMPOSITE:
VCPFeature.value = CompositeVideo_1;
break;
case VDD_INTYP_SVIDEO:
VCPFeature.value = SVideo_1;
break;
case VDD_INTYP_TUNER:
VCPFeature.value = Tuner_1;
break;
case VDD_INTYP_COMPONENT:
VCPFeature.value = ComponentVideo_1;
break;
}
#else
if(InputPortArray[gmvb_CurrentPortMain].VideoInput == VDD_INTYP_COMPOSITE )
VCPFeature.value = CompositeVideo_1;
else if(InputPortArray[gmvb_CurrentPortMain].VideoInput == VDD_INTYP_SVIDEO )
VCPFeature.value = SVideo_1;
else if(InputPortArray[gmvb_CurrentPortMain].VideoInput == VDD_INTYP_TUNER )
VCPFeature.value = Tuner_1;
else if(InputPortArray[gmvb_CurrentPortMain].VideoInput == VDD_INTYP_COMPONENT )
VCPFeature.value = ComponentVideo_1;
#endif
}
#endif
}
break;
}
case DDC2B_CMD_VCP_Language:
{
if (cmd == SET_VCP && VCPFeature.value)
UserPrefOSDLanguage = VCPFeature.value - 1;
VCPFeature.value = UserPrefOSDLanguage + 1;
break;
}
case DDC2B_CMD_VCP_SyncType:
{
//call your hook here
ret = dummy_hook();
break;
}
case DDC2B_CMD_VCP_HFreq: //To make MCCS 2.0 Compliant - 14June04
{
VCPFeature.value = gmvw_InputHFreqMain;
msg("gmvw_InputHFreqMain %x",VCPFeature.value);
break;
}
case DDC2B_CMD_VCP_VFreq: //To make MCCS 2.0 Compliant - 14June04
{
VCPFeature.value = gmvw_InputVFreqMain;
msg("gmvw_InputVFreqMain %x",VCPFeature.value);
break;
}
case DDC2B_CMD_VCP_RGBodering:
{
//call your hook here
ret = dummy_hook();
break;
}
case DDC2B_CMD_VCP_MonitorType:
{
VCPFeature.value = DispTechnologyType; //TFT //To make MCCS 2.0 Compliant - 14June04
break;
}
case DDC2B_CMD_VCP_DisplayUsageTime: //To make MCCS 2.0 Compliant - 14June04
{
#ifdef UserPrefMonitorOnTime
VCPFeature.value = UserPrefBacklightOnTime; //Backlight on time
#endif
break;
}
case DDC2B_CMD_VCP_ApplnEnKey: //To make MCCS 2.0 Compliant - 14June04
{
VCPFeature.value = ApplnEnableKey; //A 2byte value
break;
}
case DDC2B_CMD_VCP_DispControllerType: //To make MCCS 2.0 Compliant - 14June04
{
//byte 1 = 2 for Genesis Controller, byte 2 = controller type (product_ID)
VCPFeature.value = (WORD)(((WORD)(DispControllerType << 8)) | gm_ReadRegByte(PRODUCT_ID));
//Byte 3 - provide a numeric indication of controller type (Rev ID) - ???
break;
}
case DDC2B_CMD_VCP_DispFirmwareLevel: //To make MCCS 2.0 Compliant - 14June04
{
VCPFeature.value = DispFirmwareLevel; //A 2byte value - f/w level installed in the display - V1.1
break;
}
case DDC2B_CMD_VCP_OSD: //To make MCCS 2.0 Compliant - 14June04
{
if (cmd == SET_VCP)
{
switch (VCPFeature.value)
{
case OSD_Enable :
// gm_SetRegBitsByte(OSD_ENABLES, OSD_REC1_EN | OSD_REC2_EN);
// gm_ForceUpdate();
msg("OSD_Enable: 0x%x",gm_ReadRegByte(OSD_ENABLES));
break;
case OSD_Disable :
// gm_ClearRegBitsByte(OSD_ENABLES, OSD_REC1_EN | OSD_REC2_EN);
// gm_ForceUpdate();
msg("OSD_Disable: 0x%x",gm_ReadRegByte(OSD_ENABLES));
break;
}
}
else
{
if(gm_ReadRegByte(OSD_ENABLES) & (OSD_REC1_EN | OSD_REC2_EN))
VCPFeature.value = OSD_Enable; //2 - enabled
else
VCPFeature.value = OSD_Disable; //1 - disabled
}
break;
}
case DDC2B_CMD_VCP_PowerMode: //To make MCCS 2.0 Compliant - 14June04
{
if (cmd == SET_VCP && VCPFeature.value)
{
//add - currently not supported !!!
}
else if (cmd == GET_VCP)
{
if (B_SyncState == gmd_HONVON)
VCPFeature.value = 0x01; //ON
else if (B_SyncState == gmd_HOFFVON)
VCPFeature.value = 0x02; //Standby
else if (B_SyncState == gmd_HONVOFF)
VCPFeature.value = 0x03; //Suspend
else if (B_SyncState == gmd_HOFFVOFF)
VCPFeature.value = 0x04; //Off
}
break;
}
case DDC2B_CMD_VCP_ControlLock:
{
//call your hook here
ret = dummy_hook();
break;
}
#if USE_ACC_ACM
case DDC2B_CMD_VCP_WindowPosTL_X : //DH_WINDOW_START
case DDC2B_CMD_VCP_WindowPosTL_Y : //DV_WINDOW_START
case DDC2B_CMD_VCP_WindowPosBR_X : //DH_WINDOW_WIDTH
case DDC2B_CMD_VCP_WindowPosBR_Y : //DV_WINDOW_LENGTH
windowControl(cmd, VCPFeature.vcp_opcode);
break;
#endif// USE_ACC_ACM
//VCP commands for theft deterrence
#if THEFT_DETERRENCE_SUPPORT
case DDC2B_CMD_VCP_ACMOde:
{
if (cmd == SET_VCP)
{
AC_VCPCommnd.ACMode = VCPFeature.value;
msg("Set AC Mode %d",AC_VCPCommnd.ACMode);
gm_WriteNVRAMBlock(TheftDeterrence_ID, 0x00, (BYTE *)&AC_VCPCommnd, 0, sizeof(AC_VCPCommnd));
}
else
{
retVal = gm_ReadNVRAMBlock(TheftDeterrence_ID, 0x00, (BYTE *)&AC_VCPCommnd, 0, sizeof(AC_VCPCommnd));
if(retVal == gmd_OK)
{
msg("AC mode found in nvram %d",AC_VCPCommnd.ACMode);
VCPFeature.value = AC_VCPCommnd.ACMode;
}
else
{
msg("AC mode not found in nvram",0);
}
}
break;
}
case DDC2B_CMD_VCP_ACTimeout:
{
if (cmd == SET_VCP)
{
retVal = gm_ReadNVRAMBlock(TheftDeterrence_ID, 0x00, (BYTE *)&AC_VCPCommnd, 0, sizeof(AC_VCPCommnd));
if(AC_VCPCommnd.ACMode == 0)
{
AC_VCPCommnd.ACTimeout = VCPFeature.value;
msg("Set AC Timeout %d",AC_VCPCommnd.ACTimeout);
gm_WriteNVRAMBlock(TheftDeterrence_ID, 0x00, (BYTE *)&AC_VCPCommnd, 0, sizeof(AC_VCPCommnd));
}
}
else
{
retVal = gm_ReadNVRAMBlock(TheftDeterrence_ID, 0x00, (BYTE *)&AC_VCPCommnd, 0, sizeof(AC_VCPCommnd));
if(retVal == gmd_OK)
{
msg("AC Timeout found in nvram",0);
VCPFeature.value = AC_VCPCommnd.ACTimeout;
}
else
msg("AC Timeout not found in nvram",0);
}
break;
}
case DDC2B_CMD_VCP_ACPINLow:
{
if (cmd == SET_VCP)
{
retVal = gm_ReadNVRAMBlock(TheftDeterrence_ID, 0x00, (BYTE *)&AC_VCPCommnd, 0, sizeof(AC_VCPCommnd));
if(AC_VCPCommnd.ACMode == 0)
{
AC_VCPCommnd.ACPINLow = VCPFeature.value;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -