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

📄 lcd_osd.~c

📁 液晶显示器程序代码
💻 ~C
📖 第 1 页 / 共 5 页
字号:
		else if (ucOSD_Item_Index1)
		{
			if (1 == ucOSD_Item_Index1)
			{
				switch (ucOSD_Item_Index0)
				{
					case PAGE3_ITEM_AUTOCFG :
						if (MODE_0640x0350x70HZ <= ucMode_Curr && MODE_0720x0400x70HZ >= ucMode_Curr)
						{
							unsigned char ucResult;

							stMUD.CLOCK = 128;

							Set_H_Position();
							Set_Clock();
							Save_MUD(ucMode_Curr);

							ucResult    = Auto_Phase();

							if (ERROR_SUCCEED == ucResult)
							{
								ucResult    = Auto_Position();
							}
							
							if (ERROR_INPUT == ucResult)
							{
								ucMode_Curr = MODE_OSDFORCE;
								return 0;
							}
						}
						else
						{
							if (ERROR_INPUT == Auto_Config())
                            {
								ucMode_Curr = MODE_OSDFORCE;
								return 0;
							}
						}

						OSD_Line( 5, 36 + (ucOSD_Item_Index1-1)*(6+1), 4, 0x40, 2);
						break;

					case PAGE3_ITEM_AUTOBAL :
						if (ERROR_INPUT == Auto_Balance())
						{
							ucMode_Curr = MODE_OSDFORCE;
							return 0;
						}

						OSD_Line( 7, 36 + (ucOSD_Item_Index1-1)*(6+1), 4, 0x40, 2);
						break;
						
				}
			}
			
			switch (ucOSD_Item_Index0)
			{
					case PAGE3_ITEM_AUTOCFG :
						OSD_Line( 5, 36, 14, 0x40, 2);	//Set color to black
						break;
					case PAGE3_ITEM_AUTOBAL :
						OSD_Line( 7, 36, 14, 0x40, 2);	//Set color to black
						break;
			}
			ucOSD_Item_Index1   = 0;    // Leave the item
			//Show_Mode();
		}
		else
		{
			if (MODE_NOSIGNAL == ucMode_Curr || MODE_NOSUPPORT == ucMode_Curr)  
				return 1;//break;

			ucOSD_Item_Index1   = 2;    // Enter the item, default NO

			switch (ucOSD_Item_Index0)
			{
					case PAGE3_ITEM_AUTOCFG :
						OSD_Line( 5, 36 + (ucOSD_Item_Index1-1)*(6+1), 4, 0x20, 2);
						break;
					case PAGE3_ITEM_AUTOBAL :
						OSD_Line( 7, 36 + (ucOSD_Item_Index1-1)*(6+1), 4, 0x20, 2);
						break;
			}
		}
	}
}

void Page3_Left_Right_Key(unsigned char Key)
{
	if (ucOSD_Item_Index1)
	{
		ucOSD_Item_Index1   = (NOTIFY_LEFT_KEY == Key) ? 1 : 2;

		switch (ucOSD_Item_Index0)
		{
				case PAGE3_ITEM_AUTOCFG :
					OSD_Line( 5, 36, 14, 0x40, 2);	//Set color to black
					OSD_Line( 5, 36 + (ucOSD_Item_Index1-1)*(6+1), 4, 0x20, 2);
					break;
				case PAGE3_ITEM_AUTOBAL :
					OSD_Line( 7, 36, 14, 0x40, 2);	//Set color to black
					OSD_Line( 7, 36 + (ucOSD_Item_Index1-1)*(6+1), 4, 0x20, 2);
					break;
		}
	}
	else
	{
		Osd_Change_Item(Key,PAGE3_ITEM_NUM);
	}
}

void Page3_Show(void)
{
	Show_Osd_Page(2,Page3_Atb,2);

	//Set Window 5 to select "Functuin"
	OSD_Window( 5, 10, 136, 120, 150, 1, 1, 14, 251, 0, 1, 25);

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

void Page4_Enter_Key(void)
{
	if (0 == ucOSD_Item_Index0)
	{
		// Select and highlight the first item
		ucOSD_Item_Index0   = PAGE4_ITEM_LANGUAGE;
		ucOSD_Item_Index1   = 0;

		OSD_Window( 6, 150, 282, 54, 84, 1, 1, 14, 251, 0, 1, 25);
	}
	else
	{
		switch (ucOSD_Item_Index0)
		{
			case PAGE4_ITEM_LANGUAGE :
				ucOSD_Item_Index1 = (stGUD1.FUNCTION & 0x07) + 1;
				OSD_Proc_B(NOTIFY_SHOW);		// Show the sub-page
				break;
				
			case PAGE4_ITEM_OSDH :
				if (ucOSD_Item_Index1)
				{
					ucOSD_Item_Index1 = 0;		// Leave the item
					Get_OSD_Margin();
					OSD_Slider(7, 31, 17, stGUD1.OSD_POSH - Data[0], Data[1] - Data[0], 4, 14);
				}
				else
				{
					ucOSD_Item_Index1 = 1;    // Enter the item, show slider
					Get_OSD_Margin();
					OSD_Slider(7, 31, 17, stGUD1.OSD_POSH - Data[0], Data[1] - Data[0], 2, 14);
				}
				break;
				
			case PAGE4_ITEM_OSDV :
				if (ucOSD_Item_Index1)
				{
					ucOSD_Item_Index1   = 0;    // Leave the item
					Get_OSD_Margin();
					OSD_Slider(9, 31, 17, stGUD1.OSD_POSV - Data[2], Data[3] - Data[2], 4, 14);
				}
				else
				{
					ucOSD_Item_Index1   = 1;    // Enter the item, slider
					Get_OSD_Margin();
					OSD_Slider(9, 31, 17, stGUD1.OSD_POSV - Data[2], Data[3] - Data[2], 2, 14);
				}
				break;
				
			case PAGE4_ITEM_TIMEOUT :
				if(ucOSD_Item_Index2)
				{
					ucOSD_Item_Index2   = 0;
					ucOSD_Item_Index1   = 0;    // Leave the item

					//Redraw the ON/OFF words
					OSD_Line( 11, 31, 3, 0x40, 2);
					OSD_Line( 11, 31, 3, 0x00, 1);

					OSD_Line( 11, 36, 12, 0x8a, 0);
					OSD_Line( 11, 36, 12, 0x00, 1);
					switch( stGUD1.FUNCTION & 0x07 )
					{
						case 5:
							OSD_Line( 11, 37, 1, 0x8c, 0);
							OSD_Line( 11, 37, 1, 0xb3, 1);
							OSD_Line( 11, 43, 1, 0x8c, 0);
							OSD_Line( 11, 43, 1, 0xc9, 1);
							break;

						case 6:
							OSD_Line( 11, 37, 1, 0x8c, 0);
							OSD_Line( 11, 37, 1, 0xdb, 1);
							OSD_Line( 11, 43, 1, 0x8c, 0);
							OSD_Line( 11, 43, 1, 0xe5, 1);
							break;

						case 7:
							OSD_Line( 11, 37, 1, 0x8c, 0);
							OSD_Line( 11, 37, 1, 0x9b, 1);
							OSD_Line( 11, 43, 1, 0x8c, 0);
							OSD_Line( 11, 43, 1, 0x9c, 1);
							break;

						default:
							OSD_Line( 11, 37, 1, 0x2e, 1);
							OSD_Line( 11, 38, 1, 0x2d, 1);
							OSD_Line( 11, 43, 1, 0x2e, 1);
							OSD_Line( 11, 44, 2, 0x25, 1);
							break;

					}
					OSD_Line( 11, 36, 12, 0x40, 2);

					OSD_Line( 11, 35, 1, 0x00, 1);
					OSD_Line( 11, 48, 1, 0x00, 1);
										
					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);

				}
				else if (ucOSD_Item_Index1)
				{
					if(ucOSD_Item_Index1 == 2)
					{
						OSD_Line( 11, 36 + (ucOSD_Item_Index1-1)*(6+1), 3, 0x40, 2);
						ucOSD_Item_Index1 = 0;
					}
					else
					{
						ucOSD_Item_Index2    = 1;
						if(stGUD1.OSD_TIMEOUT < 5)
						{
							stGUD1.OSD_TIMEOUT = 20; //reset to 20 seconds
							usOSD_Timer         = 1020; //20*51     
							Save_GUD1();
						}
                        
						OSD_Line( 11, 36, 12, 0xe0, 2);
						OSD_Line( 11, 36, 12, 0x8c, 0);
						OSD_Line( 11, 35, 1, 0x40, 2);
						OSD_Line( 11, 35, 1, 0x0d, 1);
						OSD_Line( 11, 48, 1, 0x40, 2);
						OSD_Line( 11, 48, 1, 0x0c, 1);
						OSD_Slider(11, 31, 17, stGUD1.OSD_TIMEOUT, 60, 2, 14);
					}
				}
				else
				{
					ucOSD_Item_Index1   = stGUD1.OSD_TIMEOUT ? 1 : 2;
					OSD_Line( 11, 36 + (ucOSD_Item_Index1-1)*(6+1), 3, 0x20, 2);
				}
				break;
				
			case PAGE4_ITEM_TRANSLU :
				if (ucOSD_Item_Index1)
				{
					ucOSD_Item_Index1   = 0;    // Leave the item
					OSD_Slider(13, 31, 17, (stGUD1.INPUT_SOURCE & 0xe0) >> 5, 7, 4, 14);
				}
				else
				{
					ucOSD_Item_Index1   = 1;
					OSD_Slider(13, 31, 17, (stGUD1.INPUT_SOURCE & 0xe0) >> 5, 7, 2, 14);
				}
				break;
				
			case PAGE4_ITEM_EXIT :
				// Disable highlight window 6
				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;
				
				break;
				
		}
	}
}

void Page4_Left_Right_Key(unsigned char Key)
{
	if (ucOSD_Item_Index1)
	{
		switch (ucOSD_Item_Index0)
		{
			case PAGE4_ITEM_OSDH :
				Get_OSD_Margin();
				if (NOTIFY_RIGHT_KEY == Key)
				{
					if (Data[1] <= stGUD1.OSD_POSH)
						break;

					if (KEY_TURBO_ENABLE > ucKey_Issued)
						stGUD1.OSD_POSH   = Data[1] > stGUD1.OSD_POSH ? stGUD1.OSD_POSH + 1 : Data[1];
					else
						stGUD1.OSD_POSH   = (Data[1] - 1) > stGUD1.OSD_POSH ? stGUD1.OSD_POSH + 2 : Data[1];
				}
				else
				{
					if (Data[0] >= stGUD1.OSD_POSH)
						break;

					if (KEY_TURBO_ENABLE > ucKey_Issued)
						stGUD1.OSD_POSH   = Data[0] < stGUD1.OSD_POSH ? stGUD1.OSD_POSH - 1 : Data[0];
					else
						stGUD1.OSD_POSH   = (Data[0] + 1) < stGUD1.OSD_POSH ? stGUD1.OSD_POSH - 2 : Data[0];
				}

				OSD_Slider(7, 31, 17, stGUD1.OSD_POSH - Data[0], Data[1] - Data[0], 2, 14);
				OSD_Position(OSD_ENABLE);
				Save_GUD1();
				break;
				
			case PAGE4_ITEM_OSDV :
				Get_OSD_Margin();
				if (NOTIFY_RIGHT_KEY == Key)
				{
					if (Data[3] <= stGUD1.OSD_POSV)
						break;

					if (KEY_TURBO_ENABLE > ucKey_Issued)
						stGUD1.OSD_POSV   = Data[3] > stGUD1.OSD_POSV ? stGUD1.OSD_POSV + 1 : Data[3];
					else
						stGUD1.OSD_POSV   = (Data[3] - 1) > stGUD1.OSD_POSV ? stGUD1.OSD_POSV + 2 : Data[3];
				}
				else
				{
					if (Data[2] >= stGUD1.OSD_POSV)
						break;

					if (KEY_TURBO_ENABLE > ucKey_Issued)
						stGUD1.OSD_POSV   = Data[2] < stGUD1.OSD_POSV ? stGUD1.OSD_POSV - 1 : Data[2];
					else
						stGUD1.OSD_POSV   = (Data[2] + 1) < stGUD1.OSD_POSV ? stGUD1.OSD_POSV - 2 : Data[2];
				}
				
				OSD_Slider(9, 31, 17, stGUD1.OSD_POSV - Data[2], Data[3] - Data[2], 2, 14);
				OSD_Position(OSD_ENABLE);
				Save_GUD1();
				break;
				
			case PAGE4_ITEM_TIMEOUT :
				if (NOTIFY_RIGHT_KEY == Key)
				{
					if(ucOSD_Item_Index2)
					{
						stGUD1.OSD_TIMEOUT = (stGUD1.OSD_TIMEOUT == 60) ? 60 : stGUD1.OSD_TIMEOUT + 1;
						OSD_Slider(11, 31, 17, stGUD1.OSD_TIMEOUT, 60, 2, 14);
					}
					else if(ucOSD_Item_Index1)
					{
						//if (2 == ucOSD_Item_Index1)     break;
						ucOSD_Item_Index1  = 2;
						stGUD1.OSD_TIMEOUT  = 0;
						OSD_Line( 11, 36, 14, 0x40, 2);
						OSD_Line( 11, 36 + (ucOSD_Item_Index1-1)*(6+1), 3, 0x20, 2);
					}
				}
				else
				{
					if(ucOSD_Item_Index2)
					{
						stGUD1.OSD_TIMEOUT = (stGUD1.OSD_TIMEOUT == 5) ? 5 : stGUD1.OSD_TIMEOUT - 1;
						OSD_Slider(11, 31, 17, stGUD1.OSD_TIMEOUT, 60, 2, 14);
					}
					else if(ucOSD_Item_Index1)
					{
						//if (1 == ucOSD_Item_Index1)     break;
						ucOSD_Item_Index1   = 1;
						OSD_Line( 11, 36, 14, 0x40, 2);
						OSD_Line( 11, 36 + (ucOSD_Item_Index1-1)*(6+1), 3, 0x20, 2);
					}
				}

				usOSD_Timer         = (unsigned int)stGUD1.OSD_TIMEOUT * 51;     // 20 sec
				//stGUD1.OSD_TIMEOUT  = (1 == ucOSD_Item_Index1) ? 2 : 0;
				Save_GUD1();
				break;
				
			case PAGE4_ITEM_TRANSLU :
				Data[0] = (stGUD1.INPUT_SOURCE & 0xe0) >> 5;
				if(NOTIFY_RIGHT_KEY  == Key)
				{
					if(ucOSD_Item_Index1)
					{
						Data[0] = (Data[0] == 0x07) ? 0x07 : Data[0] + 1;
						stGUD1.INPUT_SOURCE = stGUD1.INPUT_SOURCE & 0x1f | (Data[0] << 5);
					}
				}
				else
				{
					if(ucOSD_Item_Index1)
					{
						Data[0] = (Data[0] == 0x00) ? 0x00 : Data[0] - 1;
						stGUD1.INPUT_SOURCE = stGUD1.INPUT_SOURCE & 0x1f | (Data[0] << 5);
					}
				}

				RTDSetBit(OVL_CTRL_6D, 0xc7, Data[0] << 3);
				OSD_Slider(13, 31, 17, Data[0] , 7, 2, 14);
				Save_GUD1();
				break;
				
		}
	}
	else
	{
		Osd_Change_Item(Key,PAGE4_ITEM_NUM);
	}
}


void Page4_Show(void)
{
	Show_Osd_Page(3,Page4_Atb,3);

	//Set Window 5 to select "OSD Menu"
	OSD_Window( 5, 10, 136, 153, 183, 1, 1, 14, 251, 0, 1, 25);

	if (0 == ucOSD_Item_Index1)
	{
		Get_OSD_Margin();
		OSD_Slider(7, 31, 17, stGUD1.OSD_POSH - Data[0], Data[1] - Data[0], 4, 14);
		Get_OSD_Margin();
		OSD_Slider(9, 31, 17, stGUD1.OSD_POSV - Data[2], Data[3] - Data[2], 4, 14);

		OSD_Slider(13, 31, 17, (stGUD1.INPUT_SOURCE & 0xe0) >> 5, 7, 4, 14);
		if( ucOSD_Item_Index0 == PAGE4_ITEM_LANGUAGE)
			OSD_Window( 6, 150, 282, 54, 84, 1, 1, 14, 251, 0, 1, 25);
		RTDSetBit(OVL_CTRL_6D, 0xfe, 0x01);
	}
	else
	{
		switch (ucOSD_Item_Index0)
		{
			case PAGE4_ITEM_OSDH :
				//Get_OSD_Margin();
				//OSD_Slider(11, 2, 17, stGUD1.OSD_POSH - Data[0], Data[1] - Data[0], 0x02);
				break;
				
			case PAGE4_ITEM_OSDV :
				//Get_OSD_Margin();
				//OSD_Slider(11, 2, 17, stGUD1.OSD_POSV - Data[2], Data[3] - Data[2], 0x02);
				break;
				
			case PAGE4_ITEM_TIMEOUT :
				//ucOSD_Item_Index1   = stGUD1.OSD_TIMEOUT ? 1 : 2;
				//OSD_Line( 10, 15 + (ucOSD_Item_Index1-1)*(4+1), 4, 0x00, 2);
				break;
				
			case PAGE4_ITEM_TRANSLU :
				//ucOSD_Item_Index1   = (stGUD1.INPUT_SOURCE & 0x80) ? 1 : 2;     // 1-On, 2-Off
				//OSD_Line( 10, 15 + (ucOSD_Item_Index1-1)*(4+1), 4, 0x00, 2);
				break;
				
		}
	}
}

void Page4B_Enter_Key(void)
{
	if ((stGUD1.FUNCTION & 0x07) != (ucOSD_Item_Index1 - 1))
	{
		stGUD1.FUNCTION = (stGUD1.FUNCTION & 0xf8) | ((ucOSD_Item_Index1 - 1) & 0x07);
		Save_GUD1();

		switch (stGUD1.FUNCTION & 0x07)
		{
			case CHINESE_T :
			case CHINESE_S :
				//RTDCodeW(OSD_Reset);
				RTDSetBit(OVL_CTRL_6D, 0xfe, 0x00);
				Load_VLC_Font(Font_East_C, 0x5a9, 0x45);
				Page4_Show();
				//RTDSetBit(OVL_CTRL_6D, 0xfe, 0x01);
				//RTDCodeW(OSD_Enable);
				break;
				
			case JAPANESS :
				//RTDCodeW(OSD_Reset);
				RTDSetBit(OVL_CTRL_6D, 0xfe, 0x00);
				Load_VLC_Font(Font_East_J, 0x573, 0x4B);
				Page4_Show();
				//RTDSetBit(OVL_CTRL_6D, 0xfe, 0x01);
				//RTDCodeW(OSD_Enable);
				break;
				
			default :

⌨️ 快捷键说明

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