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

📄 lcd_osd.c

📁 Realtek 公司的RTD2523A芯片原厂source code,没有被修改过的。
💻 C
📖 第 1 页 / 共 5 页
字号:
				Bright_Contrast_Adjust(&stGUD0.CONTRAST,Key);

				OSD_Slider(5, 31, 17, stGUD0.CONTRAST, 100, 2, 14);

#if(ANALOG_CONTRAST)
				if((stGUD1.INPUT_SOURCE & 0x07) == SOURCE_VGA)
					SetADC_Gain();
				else
					Set_Bright_Contrast();
#else
				Set_Bright_Contrast();
#endif

				Save_GUD0();
				break;

			case PAGE1_ITEM_BRIGHT :
				Bright_Contrast_Adjust(&stGUD0.BRIGHT,Key);
		
				OSD_Slider(7, 31, 17, stGUD0.BRIGHT, 100, 2, 14);
				Set_Bright_Contrast();
				Save_GUD0();
				break;

			case PAGE1_ITEM_COLORTEMP:
				if(NOTIFY_RIGHT_KEY == Key)
					ucOSD_Item_Index1 = (ucOSD_Item_Index1 == 4) ? 4 : ucOSD_Item_Index1 + 1;
				else
					ucOSD_Item_Index1 = (ucOSD_Item_Index1 == 1) ? 1 : ucOSD_Item_Index1 - 1;

				stGUD1.INPUT_SOURCE = (stGUD1.INPUT_SOURCE & 0xe7 ) | ((ucOSD_Item_Index1 - 1) << 3);

				//Here we can only change the color in Byte 2 for necessary words
				OSD_Line( 11, 36, 20, 0x40, 2);	//Set color to black
				OSD_Line( 11, 36 + (ucOSD_Item_Index1-1)*(4+1), 4, 0x20, 2);

				Set_Bright_Contrast();
				Save_GUD1();
				break;
				
			case PAGE1_ITEM_GAMMA :
				if (NOTIFY_RIGHT_KEY == Key)
				{
					if (4 <= ucOSD_Item_Index1)
						break;

					ucOSD_Item_Index1   = ucOSD_Item_Index1 + 1;
				}
				else
				{
					if (1 >= ucOSD_Item_Index1)
						break;

					ucOSD_Item_Index1   = ucOSD_Item_Index1 - 1;
				}

				stGUD1.FUNCTION = (stGUD1.FUNCTION & 0x9f) | ((ucOSD_Item_Index1 - 1) << 5);
				//Here we can only change the color in Byte 2 for necessary words
				OSD_Line( 9, 36, 14, 0x40, 2);	//Set color to black
				OSD_Line( 9, 36 + (ucOSD_Item_Index1-1)*(2+1), 1, 0x20, 2);

				Set_Gamma();
				Save_GUD1();
				break;
            
		}
	}
	else
	{
		Osd_Change_Item(Key,PAGE1_ITEM_NUM);
		
	}
}

void Page1_Show(void)
{
    OSD_Position(OSD_ENABLE);
	Show_Osd_Page(0,Page1_Atb,0);

	//Set Window 5 to select "Colour"
	OSD_Window( 5, 10, 136, 54, 84, 1, 1, 14, 251, 0, 1, 25);

	if (MODE_NOSIGNAL == ucMode_Curr || MODE_NOSUPPORT == ucMode_Curr)
	{
		ucOSD_Item_Index0   = 0;
		ucOSD_Item_Index1   = 0;
	}

	OSD_Slider(5, 31, 17, stGUD0.CONTRAST, 100, 4, 14);
	OSD_Slider(7, 31, 17, stGUD0.BRIGHT, 100, 4, 14);
	
	switch (ucOSD_Item_Index0)
	{
		case PAGE1_ITEM_CONTRAST :
			break;
			
		case PAGE1_ITEM_BRIGHT :
			break;
			
		case PAGE1_ITEM_GAMMA :
			break;
			
		case PAGE1_ITEM_RGBADJ :
			OSD_Window( 6, 150, 282, (54 + (ucOSD_Item_Index0-1)*(29+4)), (84 + (ucOSD_Item_Index0-1)*(29+4))
				, 1, 1, 14, 251, 0, 1, 25);
			break;
	}
}

void Page1B_Enter_Key(void)
{
	ucOSD_Page_Index = 7;
	if (PAGE1B_ITEM_EXIT == ucOSD_Item_Index1)
	{
		// De-select the page item and disable the hightlight window
		OSD_Window( 6, 150, 282, (54 + (ucOSD_Item_Index0-1)*(29+4)), (84 + (ucOSD_Item_Index0-1)*(29+4))
			, 0, 0, 14, 251, 0, 1, 0);
		ucOSD_Item_Index1   = 0;
		ucOSD_Item_Index2   = 0;
	}
	else
	{
		if (ucOSD_Item_Index2)
		{
			ucOSD_Item_Index2   = 0;	// Leave the item
			switch (ucOSD_Item_Index1)
			{
				case PAGE1B_ITEM_RED :
					OSD_Slider(5, 31, 17, stGUD0.RTD_R_CONTRAST, 100, 4, 2);
					break;
				
				case PAGE1B_ITEM_GREEN :
					OSD_Slider(7, 31, 17, stGUD0.RTD_G_CONTRAST, 100, 4, 12);
					break;
				
				case PAGE1B_ITEM_BLUE :
					OSD_Slider(9, 31, 17, stGUD0.RTD_B_CONTRAST, 100, 4, 3);
					break;
			}
		}
		else if (MODE_NOSIGNAL != ucMode_Curr && MODE_NOSUPPORT != ucMode_Curr)
		{
			ucOSD_Item_Index2   = 1;	// Enter the item

			//Draw the selected slider
			switch (ucOSD_Item_Index1)
			{
				case PAGE1B_ITEM_RED :
					OSD_Slider(5, 31, 17, stGUD0.RTD_R_CONTRAST, 100, 2, 2);
					break;
				
				case PAGE1B_ITEM_GREEN :
					OSD_Slider(7, 31, 17, stGUD0.RTD_G_CONTRAST, 100, 12, 12);
					break;
				
				case PAGE1B_ITEM_BLUE :
					OSD_Slider(9, 31, 17, stGUD0.RTD_B_CONTRAST, 100, 3, 3);
					break;
			}
		}
	}
	ucOSD_Page_Index = 1;
}

void Page1B_Left_Right_Key(unsigned char Key)
{
	ucOSD_Page_Index = 7;
	if (ucOSD_Item_Index2)
	{
		switch (ucOSD_Item_Index1)
		{
			case PAGE1B_ITEM_RED :
				Bright_Contrast_Adjust(&stGUD0.RTD_R_CONTRAST,Key);
		
				OSD_Slider(5, 31, 17, stGUD0.RTD_R_CONTRAST, 100, 2, 2);
				break;
				
			case PAGE1B_ITEM_GREEN :
				Bright_Contrast_Adjust(&stGUD0.RTD_G_CONTRAST,Key);
			
				OSD_Slider(7, 31, 17, stGUD0.RTD_G_CONTRAST, 100, 12, 12);
				break;
				
			case PAGE1B_ITEM_BLUE :
				Bright_Contrast_Adjust(&stGUD0.RTD_B_CONTRAST,Key);
			
				OSD_Slider(9, 31, 17, stGUD0.RTD_B_CONTRAST, 100, 3, 3);
				break;
		}

		Set_Bright_Contrast();
		Save_GUD0();
		
	}
	else
	{
		// Select and highlight the next/previous item
		if (NOTIFY_RIGHT_KEY == Key)
			ucOSD_Item_Index1   = (PAGE1B_ITEM_NUM == ucOSD_Item_Index1) ? 1 : (ucOSD_Item_Index1 + 1);
		else
			ucOSD_Item_Index1   = (1 == ucOSD_Item_Index1) ? PAGE1B_ITEM_NUM : (ucOSD_Item_Index1 - 1);
            
		OSD_Window( 6, 150, 282, (54 + (ucOSD_Item_Index1-1)*(29+4)), (84 + (ucOSD_Item_Index1-1)*(29+4))
			, 1, 1, 14, 251, 0, 1, 25);
	}
	ucOSD_Page_Index = 1;
}

void Page1B_Show(void)
{
	Show_Osd_Page(0,Page7_Atb,6);

	// Set window 6 to Highlight the select item
	OSD_Window( 6, 150, 282, 54, 84, 1, 1, 14, 251, 0, 1, 25);
	
	if (MODE_NOSIGNAL == ucMode_Curr || MODE_NOSUPPORT == ucMode_Curr)      
		ucOSD_Item_Index2   = 0;

	if (0 == ucOSD_Item_Index2)
	{
		ucOSD_Page_Index = 7;
		OSD_Slider(5, 31, 17, stGUD0.RTD_R_CONTRAST, 100, 4, 2);
		OSD_Slider(7, 31, 17, stGUD0.RTD_G_CONTRAST, 100, 4, 12);
		OSD_Slider(9, 31, 17, stGUD0.RTD_B_CONTRAST, 100, 4, 3);
		ucOSD_Page_Index = 1;
	}
	else
	{
		//Set the active slider (Red, Greed, Blue)
		/*
		OSD_Slider(11, 2, 20,
			(PAGE1B_ITEM_RED == ucOSD_Item_Index1) ? stGUD0.RTD_R_CONTRAST 
			: (PAGE1B_ITEM_GREEN == ucOSD_Item_Index1) ? stGUD0.RTD_G_CONTRAST
			: stGUD0.RTD_B_CONTRAST, 100, 0x61);

		*/
	}
}

void Page2_Enter_Key()
{
	if (0 == ucOSD_Item_Index0)
	{
		if (MODE_NOSIGNAL != ucMode_Curr && MODE_NOSUPPORT != ucMode_Curr)
		{
			// Select and highlight the first item
			ucOSD_Item_Index0   = PAGE2_ITEM_POSH;
			ucOSD_Item_Index1   = 0;

			//Enable Window 6 and Draw it
			OSD_Window( 6, 150, 282, 54, 84, 1, 1, 14, 251, 0, 1, 25);
		}
	}
	else
	{
		if (ucOSD_Item_Index1)
		{
			switch (ucOSD_Item_Index0)
			{
				case PAGE2_ITEM_POSH :
					OSD_Slider(5, 31, 17, (unsigned int)ucAUTO_HPOS + 50 - stMUD.H_POSITION, 100, 4, 14);
					break;

				case PAGE2_ITEM_POSV :
					OSD_Slider(7, 31, 17, (unsigned int)(stMUD.V_POSITION - ucV_Min_Margin) * 50 / (ucAUTO_VPOS - ucV_Min_Margin), 100, 4, 14);
					break;
					
				case PAGE2_ITEM_PHASE :
#if(MORE_PHASE)
					OSD_Slider(9, 31, 17, stMUD.PHASE, 127, 4, 14);
#else
					OSD_Slider(9, 31, 17, (stMUD.PHASE & 0x7c) >> 2, 31, 4, 14);
#endif
					break;
					
				case PAGE2_ITEM_CLOCK :
					OSD_Slider(11, 31, 17, stMUD.CLOCK - (ucAUTO_SCLK - 50), 100, 4, 14);
					break;

				case PAGE2_ITEM_SHARP :
					OSD_Line( 13, 36 + (ucOSD_Item_Index1-1)*(2+1), 1, 0x40, 2);
					break;
												
			}

			ucOSD_Item_Index1   = 0;    // Leave the item
			
		}
		else
		{
			if (PAGE2_ITEM_EXIT == ucOSD_Item_Index0)
			{
				// Disable Window 6 and Draw it
				OSD_Window( 6, 150, 282, (54 + (ucOSD_Item_Index0-1)*(29+4)), (84 + (ucOSD_Item_Index0-1)*(29+4))
					, 0, 0, 14, 251, 0, 1, 0);
				// De-select the page item and disable the hightlight window
				ucOSD_Item_Index0   = 0;
				ucOSD_Item_Index1   = 0;
			}
			else if (MODE_NOSIGNAL != ucMode_Curr && MODE_NOSUPPORT != ucMode_Curr)
			{
				if (SOURCE_VGA == (stGUD1.INPUT_SOURCE & 0x07) || PAGE2_ITEM_SHARP == ucOSD_Item_Index0)
				{
					switch (ucOSD_Item_Index0)
					{
						case PAGE2_ITEM_POSH :
							ucOSD_Item_Index1   = 1;    // Enter the item
							OSD_Slider(5, 31, 17, (unsigned int)ucAUTO_HPOS + 50 - stMUD.H_POSITION, 100, 2, 14);
							break;
							
						case PAGE2_ITEM_POSV :
							ucOSD_Item_Index1   = 1;    // Enter the item
							OSD_Slider(7, 31, 17, (unsigned int)(stMUD.V_POSITION - ucV_Min_Margin) * 50 / (ucAUTO_VPOS - ucV_Min_Margin), 100, 2, 14);
							break;
							
						case PAGE2_ITEM_PHASE :
							ucOSD_Item_Index1   = 1;    // Enter the item
#if(MORE_PHASE)
							OSD_Slider(9, 31, 17, stMUD.PHASE, 127, 2, 14);
#else
							OSD_Slider(9, 31, 17, (stMUD.PHASE & 0x7c) >> 2, 31, 2, 14);
#endif
							break;
							
						case PAGE2_ITEM_CLOCK :
							ucOSD_Item_Index1   = 1;    // Enter the item
                            OSD_Slider(11, 31, 17, stMUD.CLOCK - (ucAUTO_SCLK - 50), 100, 2, 14);
							break;

						case PAGE2_ITEM_SHARP :
							ucOSD_Item_Index1   = stGUD1.FILTER + 1;
							OSD_Line( 13, 36 + (ucOSD_Item_Index1-1)*(2+1), 1, 0x20, 2);
							break;
												
					}
				}
			}
		}
	}
}

void Page2_Left_Right_Key(unsigned char Key)
{
	if (ucOSD_Item_Index1)
	{
		switch (ucOSD_Item_Index0)
		{
			case PAGE2_ITEM_POSH :
				if (NOTIFY_RIGHT_KEY == Key)
				{
                    Data[0] = (128 - 50) < ucAUTO_HPOS ? ucAUTO_HPOS - 50 : (128 - 50) - 50;

					if (Data[0] >= stMUD.H_POSITION)    break;

					if (!bKeyTurbo)
						stMUD.H_POSITION    = stMUD.H_POSITION > Data[0] ? stMUD.H_POSITION - 1 : Data[0];
					else
						stMUD.H_POSITION    = stMUD.H_POSITION > (Data[0] + 2) ? stMUD.H_POSITION - 3 : Data[0];
				}
				else
				{
                    Data[0] = (128 + 50) > ucAUTO_HPOS ? ucAUTO_HPOS + 50 : (128 + 50) + 50;

					if (Data[0] <= stMUD.H_POSITION)    break;

					if (!bKeyTurbo)
						stMUD.H_POSITION    = stMUD.H_POSITION < Data[0] ? stMUD.H_POSITION + 1 : Data[0];
					else
						stMUD.H_POSITION    = stMUD.H_POSITION < (Data[0] - 2) ? stMUD.H_POSITION + 3 : Data[0];
				}

				OSD_Slider(5, 31, 17, (unsigned int)ucAUTO_HPOS + 50 - stMUD.H_POSITION, 100, 2, 14);
				Set_H_Position();
				Set_Phase(stMUD.PHASE);
				Save_MUD(ucMode_Curr);
				break;
				
			case PAGE2_ITEM_POSV :
				if (NOTIFY_RIGHT_KEY == Key)
				{
                    Data[0] = 255 < ((unsigned int)ucAUTO_VPOS << 1) - ucV_Min_Margin 
                            ? 255 : ((unsigned int)ucAUTO_VPOS << 1) - ucV_Min_Margin;

                    if (Data[0] <= stMUD.V_POSITION)    break;

					stMUD.V_POSITION    += 1;
				}
				else
				{
					if (ucV_Min_Margin >= stMUD.V_POSITION)
						break;

					stMUD.V_POSITION    -= 1;
				}

				OSD_Slider(7, 31, 17, (unsigned int)(stMUD.V_POSITION - ucV_Min_Margin) * 50 / (ucAUTO_VPOS - ucV_Min_Margin), 100, 2, 14);
				Set_V_Position();
				Save_MUD(ucMode_Curr);
				break;
								
			case PAGE2_ITEM_PHASE :
#if(MORE_PHASE)
				if (NOTIFY_RIGHT_KEY == Key)
				{
					if (0x7f <= stMUD.PHASE)
						break;

					stMUD.PHASE += 1;
				}
				else
				{
					if (0x00 == stMUD.PHASE)
						break;

					stMUD.PHASE -= 1;
				}

				OSD_Slider(9, 31, 17, stMUD.PHASE, 127, 2, 14);
#else
				stMUD.PHASE     &= 0x7c;
				if (NOTIFY_RIGHT_KEY == Key)
				{
					if (0x7c <= stMUD.PHASE)
						break;

					stMUD.PHASE += 4;
				}
				else
				{
					if (0x00 == stMUD.PHASE)
						break;

					stMUD.PHASE -= 4;
				}
					
				OSD_Slider(9, 31, 17, (stMUD.PHASE & 0x7c) >> 2, 31, 2, 14);
#endif
				Set_Phase(stMUD.PHASE);
				Save_MUD(ucMode_Curr);
				break;
					
			case PAGE2_ITEM_CLOCK :
                if (NOTIFY_RIGHT_KEY == Key)
                {
                    Data[0] = (128 + 50) < ucAUTO_SCLK ? (128 + 50 + 50) : ucAUTO_SCLK + 50;

                    if (Data[0] <= stMUD.CLOCK)     break;

                    if (!bKeyTurbo)
                        stMUD.CLOCK = (Data[0] > stMUD.CLOCK) ? stMUD.CLOCK + 1 : Data[0];
                    else
                        stMUD.CLOCK = ((Data[0] - 3) > stMUD.CLOCK) ? stMUD.CLOCK + 4 : Data[0];                   
                }
                else
                {
                    Data[0] = (128 - 50) > ucAUTO_SCLK ? (128 - 50 - 50) : ucAUTO_SCLK - 50;

                    if (Data[0] >= stMUD.CLOCK)      break;

                    if (!bKeyTurbo)
                        stMUD.CLOCK = (Data[0] < stMUD.CLOCK) ? stMUD.CLOCK - 1 : Data[0];
                    else
                        stMUD.CLOCK = ((Data[0] + 3) < stMUD.CLOCK) ? stMUD.CLOCK - 4 : Data[0];
                }
                OSD_Slider(11, 31, 17, stMUD.CLOCK - (ucAUTO_SCLK - 50), 100, 2, 14);
                Set_Clock();
				Save_MUD(ucMode_Curr);
				break;

			case PAGE2_ITEM_SHARP :
				if (NOTIFY_RIGHT_KEY == Key)
				{
					if (5 <= ucOSD_Item_Index1)
						break;

					ucOSD_Item_Index1   = ucOSD_Item_Index1 + 1;
				}
				else
				{
					if (1 >= ucOSD_Item_Index1)
						break;

⌨️ 快捷键说明

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