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

📄 menufunc.c

📁 完整的软件学习--显示器驱动视频软件
💻 C
📖 第 1 页 / 共 4 页
字号:
  else
    MSAddr=(MSAddr+255)%0x100;

  return TRUE;
}
WORD GetAddrValue(void)
{ return MSAddr;
}
Bool AdjustRegValue(MenuItemActionType action)
{ if (action==MIA_IncValue)
    MSValue=(MSValue+1)%0x100;
  else
    MSValue=(MSValue+255)%0x100;

  return TRUE;
}
WORD GetAddrRegValue(void)
{ if (MSBankNo==0) // scaler
    MSValue=mStar_ReadByte(MSAddr);
  else if (MSBankNo==1) // adc
    { mStar_WriteByte(REGBK, REGBANKADC);
      MSValue=mStar_ReadByte(MSAddr);
      mStar_WriteByte(REGBK, REGBANKSCALER);
    }
  else if (MSBankNo==2) // TCON
    { mStar_WriteByte(REGBK, REGBANKTCON);
      MSValue=mStar_ReadByte(MSAddr);
      mStar_WriteByte(REGBK, REGBANKSCALER);
    }
  return MSValue;
}
WORD GetRegValue(void)
{ return MSValue;
}

Bool WriteRegValue(void)
{ if (MSBankNo==0) // scaler
    mStar_WriteByte(MSAddr, MSValue);
  else if (MSBankNo==1) // adc
    { mStar_WriteByte(REGBK, REGBANKADC);
      mStar_WriteByte(MSAddr, MSValue);
      mStar_WriteByte(REGBK, REGBANKSCALER);
    }
  else if (MSBankNo==2) // TCON
    { mStar_WriteByte(REGBK, REGBANKTCON);
      mStar_WriteByte(MSAddr, MSValue);
      mStar_WriteByte(REGBK, REGBANKSCALER);
    }
  return TRUE;
}
#endif

Bool EnterISPMode(void)
{ 
Power_TurnOnPanel();
  EnableISP();
  return TRUE;
}

#endif
//===========


Bool AdjustOsdTimeValue(MenuItemActionType action)
{ WORD tempValue;

  tempValue=DecIncValue(action, UserPrefOsdTime, 5, 60, 1);
  if (tempValue==UserPrefOsdTime)
    return FALSE;    
  UserPrefOsdTime=tempValue;
 NVRam_WriteByte(nvrMonitorAddr(OsdTime), UserPrefOsdTime);
//	printData("UserPrefOsdTime3 %d" , UserPrefOsdTime);	
  return TRUE;
}

void  YesNoTextPositionORColor(Bool WherePosition)
{

     Osd_SetTextColor(CP_BlackColor, CP_SoftLowGreenColor);	
 
	 if(WherePosition==0)  //up
	 {
	     Osd_DrawPropStr(28,4 ,YesText());
	      Osd_DrawPropStr(34,4,NOText());
	 }
         else{
	     Osd_DrawPropStr(28,6,YesText());
	     Osd_DrawPropStr(34,6,NOText());
         	}
		       
           
}


Bool  Select_YesNO_AutoAdjustUP(MenuItemActionType action) // 
{
if ((action==MIA_IncValue)||(action==MIA_DecValue))
  { StauIndex1=(StauIndex1==0) ? (1):(0);  //default is no==1	
    StauIndex0=3;  //for enter yes no select  ,enter YesNOSelectKeyEvent
}
   	
	 YesNoTextPositionORColor(0);//up
	 
   if(action!=  MIA_GotoYesNOItem)//MIA_GotoYesNOItem go back intem select station,don't RED
	{
	         Osd_SetTextColor(CP_RedColor, CP_SoftLowGreenColor);
		   Osd_DrawPropStr(28+StauIndex1*6,4 ,(StauIndex1==0)?(YesText()):(NOText()));
		   
	       
 	}
   
  return TRUE;

}

Bool  Select_YesNO_AutoAdjustDown(MenuItemActionType action) // 
{if ((action==MIA_IncValue)||(action==MIA_DecValue))
  { StauIndex1=(StauIndex1==0) ? (1):(0);  //default is no==1	
    StauIndex0=3;  //for enter yes no select  YesNOSelectKeyEvent
}
   
	  YesNoTextPositionORColor(1);//down
	  
  if(action!=  MIA_GotoYesNOItem)//MIA_GotoYesNOItem go back intem select station,don't RED
		{
		   Osd_SetTextColor(CP_RedColor, CP_SoftLowGreenColor);
		   Osd_DrawPropStr(28+StauIndex1*6,6 ,(StauIndex1==0)?(YesText()):(NOText()));

         	}
  return TRUE;

}



Bool  mStar_SetGamma(MenuItemActionType action) // programming gamma table
{BYTE* ValueAdd;
//BYTE i;

if (action==MIA_IncValue)
    //UserPrefGammaDef=(UserPrefGammaDef<GammValue3)?(UserPrefGammaDef+1):(GammValue3);
     UserPrefGammaDef++;
	  
else   if(action==MIA_DecValue)       
  //UserPrefGammaDef=(UserPrefGammaDef>GammValue0)?(UserPrefGammaDef-1):(GammValue0);
     UserPrefGammaDef+=(4-1);
     UserPrefGammaDef%=4;

	  switch(UserPrefGammaDef)
      	    {case GammValue0:  ValueAdd=Number0Text();
	                                      mStar_InitGamma(0);
      	                break;
		case GammValue1: ValueAdd=Number1Text();
		                                mStar_InitGamma(1);
         	          break;
		case GammValue2: ValueAdd=Number2Text();
		                                 mStar_InitGamma(2);
      	               break;                              
		case GammValue3: ValueAdd=Number3Text();
		                                 mStar_InitGamma(3);
      	           break;
		
	
      	}

	       Osd_SetTextColor(CP_BlackColor, CP_SoftLowGreenColor);
			
		Osd_DrawStr(25+0,8 ,Number0Text());
		Osd_DrawStr(25+3,8,Number1Text());
		Osd_DrawStr(25+6,8,Number2Text());
		Osd_DrawStr(25+9,8,Number3Text());
		
         if(action!=  MIA_GotoBackItem)//MIA_GotoBackItem go back intem select station,don't RED
		{Osd_SetTextColor(CP_RedColor, CP_SoftLowGreenColor);
		 Osd_DrawStr( 25+UserPrefGammaDef*3,8,ValueAdd);
         	}
           
//
//write Gamma tabel to  register  add here
//
	
NVRam_WriteByte(nvrMonitorAddr(Gamma), UserPrefGammaDef);   
return TRUE;

}


Bool  mStar_SetSharpness(MenuItemActionType action) // programming gamma table
{BYTE* ValueAdd;
//BYTE i;

if (action==MIA_IncValue)
        UserPrefSharpness++;
	
else   if(action==MIA_DecValue)       
  //UserPrefSharpness=(UserPrefSharpness>Sharpness_1)?(UserPrefSharpness-1):(Sharpness_1);
    UserPrefSharpness+=(Sharpness_6-1);
    UserPrefSharpness%=5;

	  switch(UserPrefSharpness)
      	   {
		case Sharpness_1: ValueAdd=Number1Text();
                      	  mStar_SetScalingFilter(0);
         					break;
		case Sharpness_2: ValueAdd=Number2Text();
							mStar_SetScalingFilter(1);
      	    					  break;
		case Sharpness_3: ValueAdd=Number3Text();
						  mStar_SetScalingFilter(2);
      	    					 break;
		
		case Sharpness_4: ValueAdd=Number4Text();
						mStar_SetScalingFilter(3);
      	     						 break;
	    case Sharpness_5:  ValueAdd=Number5Text();
			                mStar_SetScalingFilter(3);
      	                                             break;
      	}

	       Osd_SetTextColor(CP_BlackColor, CP_SoftLowGreenColor);
			
		Osd_DrawStr(25+0,12 ,Number1Text());
		Osd_DrawStr(25+3,12,Number2Text());
		Osd_DrawStr(25+6,12,Number3Text());
		Osd_DrawStr(25+9,12,Number4Text());
		Osd_DrawStr(25+12,12,Number5Text());
		
         if(action!=  MIA_GotoBackItem)//MIA_GotoBackItem go back intem select station,don't RED
		{Osd_SetTextColor(CP_RedColor, CP_SoftLowGreenColor);
		 Osd_DrawStr( 25+UserPrefSharpness*3,12,ValueAdd);
         	}

NVRam_WriteByte(nvrMonitorAddr(Sharpness), UserPrefSharpness);   
return TRUE;

}

//====================================================
Bool AdjustRedColor9300K(MenuItemActionType action)
{ WORD tempValue;

  tempValue=DecIncValue(action, UserPrefRedColor9300K, 0, MaxColorValue, 1);
  if (tempValue==UserPrefRedColor9300K)
    return FALSE;
  UserPrefRedColor9300K=tempValue;
#if UsesRGB
  mStar_AdjustContrast(UserPrefContrast);
#else
  mStar_AdjustRedColor(UserPrefRedColor9300K);
#endif
NVRam_WriteByte(nvrC9300KSaveAddr(RedColorTemp), UserPrefRedColor9300K);
  return TRUE;
}
Bool AdjustGreenColor9300K(MenuItemActionType action)
{ WORD tempValue;

  tempValue=DecIncValue(action, UserPrefGreenColor9300K, 0, MaxColorValue, 1);
  if (tempValue==UserPrefGreenColor9300K)
    return FALSE;
  UserPrefGreenColor9300K=tempValue;
#if UsesRGB
  mStar_AdjustContrast(UserPrefContrast);
#else
  mStar_AdjustGreenColor(UserPrefGreenColor9300K);
#endif
NVRam_WriteByte(nvrC9300KSaveAddr(GreenColorTemp), UserPrefGreenColor9300K);
  return TRUE;
}
Bool AdjustBlueColor9300K(MenuItemActionType action)
{ WORD tempValue;

  tempValue=DecIncValue(action, UserPrefBlueColor9300K, 0, MaxColorValue, 1);
  if (tempValue==UserPrefBlueColor9300K)
    return FALSE;
  UserPrefBlueColor9300K=tempValue;
#if UsesRGB
  mStar_AdjustContrast(UserPrefContrast);
#else
  mStar_AdjustBlueColor(UserPrefBlueColor9300K);
#endif
NVRam_WriteByte(nvrC9300KSaveAddr(BlueColorTemp), UserPrefBlueColor9300K);
  return TRUE;
}
WORD GetRColor9300KValue(void)
{ return UserPrefRedColor9300K;
}
WORD GetGColor9300KValue(void)
{ return UserPrefGreenColor9300K;
}
WORD GetBColor9300KValue(void)
{ return UserPrefBlueColor9300K;
}

//====================================================
//====================================================

Bool AdjustRedColor6500K(MenuItemActionType action)
{ WORD tempValue;

  tempValue=DecIncValue(action, UserPrefRedColor6500K, 0, MaxColorValue, 1);
  if (tempValue==UserPrefRedColor6500K)
    return FALSE;
  UserPrefRedColor6500K=tempValue;
#if UsesRGB
  mStar_AdjustContrast(UserPrefContrast);
#else
  mStar_AdjustRedColor(UserPrefRedColor6500K);
#endif
NVRam_WriteByte(nvrC6500KSaveAddr(RedColorTemp), UserPrefRedColor6500K);
  return TRUE;
}
Bool AdjustGreenColor6500K(MenuItemActionType action)
{ WORD tempValue;

  tempValue=DecIncValue(action, UserPrefGreenColor6500K, 0, MaxColorValue, 1);
  if (tempValue==UserPrefGreenColor6500K)
    return FALSE;
  UserPrefGreenColor6500K=tempValue;
#if UsesRGB
  mStar_AdjustContrast(UserPrefContrast);
#else
  mStar_AdjustGreenColor(UserPrefGreenColor6500K);
#endif
NVRam_WriteByte(nvrC6500KSaveAddr(GreenColorTemp), UserPrefGreenColor6500K);
  return TRUE;
}

Bool AdjustBlueColor6500K(MenuItemActionType action)
{ WORD tempValue;

  tempValue=DecIncValue(action, UserPrefBlueColor6500K, 0, MaxColorValue, 1);
  if (tempValue==UserPrefBlueColor6500K)
    return FALSE;
  UserPrefBlueColor6500K=tempValue;
#if UsesRGB
  mStar_AdjustContrast(UserPrefContrast);
#else
  mStar_AdjustBlueColor(UserPrefBlueColor6500K);
#endif
NVRam_WriteByte(nvrC6500KSaveAddr(BlueColorTemp), UserPrefBlueColor6500K);
  return TRUE;
}

WORD GetRColor6500KValue(void)
{ return UserPrefRedColor6500K;
}
WORD GetGColor6500KValue(void)
{ return UserPrefGreenColor6500K;
}
WORD GetBColor6500KValue(void)
{ return UserPrefBlueColor6500K;
}
//====================================================

//====================================================
Bool AdjustRedColor5800K(MenuItemActionType action)
{ WORD tempValue;

  tempValue=DecIncValue(action, UserPrefRedColor5800K, 0, MaxColorValue, 1);
  if (tempValue==UserPrefRedColor5800K)
    return FALSE;
  UserPrefRedColor5800K=tempValue;
#if UsesRGB
  mStar_AdjustContrast(UserPrefContrast);
#else
  mStar_AdjustRedColor(UserPrefRedColor5800K);
#endif
NVRam_WriteByte(nvrC5800KSaveAddr(RedColorTemp), UserPrefRedColor5800K);
  return TRUE;
}
Bool AdjustGreenColor5800K(MenuItemActionType action)
{ WORD tempValue;

  tempValue=DecIncValue(action, UserPrefGreenColor5800K, 0, MaxColorValue, 1);
  if (tempValue==UserPrefGreenColor5800K)
    return FALSE;
  UserPrefGreenColor5800K=tempValue;
#if UsesRGB
  mStar_AdjustContrast(UserPrefContrast);
#else
  mStar_AdjustGreenColor(UserPrefGreenColor5800K);
#endif
NVRam_WriteByte(nvrC5800KSaveAddr(GreenColorTemp), UserPrefGreenColor5800K);
  return TRUE;
}
Bool AdjustBlueColor5800K(MenuItemActionType action)
{ WORD tempValue;

  tempValue=DecIncValue(action, UserPrefBlueColor5800K, 0, MaxColorValue, 1);
  if (tempValue==UserPrefBlueColor5800K)
    return FALSE;
  UserPrefBlueColor5800K=tempValue;
#if UsesRGB
  mStar_AdjustContrast(UserPrefContrast);
#else
  mStar_AdjustBlueColor(UserPrefBlueColor5800K);
#endif
NVRam_WriteByte(nvrC5800KSaveAddr(BlueColorTemp), UserPrefBlueColor5800K);
  return TRUE;
}

WORD GetRColor5800KValue(void)
{ return UserPrefRedColor5800K;
}
WORD GetGColor5800KValue(void)
{ return UserPrefGreenColor5800K;
}
WORD GetBColor5800KValue(void)
{ return UserPrefBlueColor5800K;
}




Bool AdjustFactoryContrast(MenuItemActionType action)
{BYTE* pContrast; 
  WORD tempValue;
  if(FactoryModeFlag)
  {
    //  if(UserPrefColorTemp==CTEMP_6500K)
       // pContrast= &UserPrefContrast6500K;
     // else if(UserPrefColorTemp==CTEMP_9300K)
       // pContrast= &UserPrefContrast9300K;
       pContrast= &UserPrefContrast;
      tempValue=DecIncValue(action, *pContrast, MinContrastValue, MaxContrastValue, 1);
      if (tempValue==*pContrast)
        return FALSE;
      UserPrefContrast=tempValue;
      *pContrast=tempValue;
      mStar_AdjustContrast(*pContrast);
    }
 /* UserPrefContrast9300K=tempValue;
  UserPrefContrast6500K=tempValue;
if(UserPrefColorTemp == CTEMP_6500K)
NVRam_WriteByte(nvrC6500KSaveAddr(ContrastColorTemp), UserPrefContrast);
else if(UserPrefColorTemp == CTEMP_9300K)
NVRam_WriteByte(nvrC9300KSaveAddr(ContrastColorTemp), UserPrefContrast);  
*/
  NVRam_WriteByte(nvrMonitorAddr(Contrast), UserPrefBrightness);

return TRUE;
}

Bool AdjustFactoryBrightness(MenuItemActionType action)
{WORD tempValue;
  BYTE* pBrightness;
  if(FactoryModeFlag)
  {
      //if(UserPrefColorTemp==CTEMP_6500K)
      //  pBrightness= &(UserPrefBrightness6500K);
      //else if(UserPrefColorTemp==CTEMP_9300K)
     //   pBrightness= &(UserPrefBrightness9300K);
      pBrightness= &(UserPrefBrightness);
      tempValue=DecIncValue(action, *pBrightness, 0, 100, 1);
      if (tempValue==*pBrightness)
        return FALSE;
      UserPrefBrightness=tempValue;
      *pBrightness=tempValue;
	  
      mStar_AdjustBrightness(*pBrightness);
    }
/*  UserPrefBrightness9300K=tempValue;
  UserPrefBrightness6500K=tempValue;
  if(UserPrefColorTemp == CTEMP_6500K)
NVRam_WriteByte(nvrC6500KSaveAddr(BrightnessColorTemp), UserPrefBrightness);
else if(UserPrefColorTemp == CTEMP_9300K)
NVRam_WriteByte(nvrC9300KSaveAddr(BrightnessColorTemp), UserPrefBrightness);  
*/
  NVRam_WriteByte(nvrMonitorAddr(Brightness), UserPrefBrightness);

return TRUE;
}

WORD GetContrastValue(void)
{  return GetScale100Value(UserPrefContrast, MinContrastValue, MaxContrastValue);
}

WORD GetBrightnessValue(void)
{ return GetScale100Value(UserPrefBrightness, 0, 100);
  //return GetScale100Value(UserPrefBrightness, MinBrightnessValue, MaxBrightnessValue);
}

⌨️ 快捷键说明

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