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

📄 lcd_osd.c

📁 Realtek 公司的RTD2523A芯片原厂source code,没有被修改过的。
💻 C
📖 第 1 页 / 共 5 页
字号:
					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, 0xfc, 0x03);
	}
	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, 0xfc, 0x03);
				//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, 0xfc, 0x03);
				//RTDCodeW(OSD_Enable);
				break;
				
			default :
				break;
				
		}
	}

	ucOSD_Item_Index1   = 0;    // Quit Sub-Page
}

void Page4B_Left_Right_Key(unsigned char Key)
{
	// Select and highlight the next/previous item
	OSD_Window( 6, 150 + ((ucOSD_Item_Index1-1)/4)*170, 282 + ((ucOSD_Item_Index1-1)/4)*170, 
		54 + ((ucOSD_Item_Index1-1)%4)*33, 84 + ((ucOSD_Item_Index1-1)%4)*33, 0, 0, 14, 251, 0, 1, 0);
	if (NOTIFY_RIGHT_KEY == Key)
		ucOSD_Item_Index1   = (PAGE4B_ITEM_NUM == ucOSD_Item_Index1) ? 1 : (ucOSD_Item_Index1 + 1);
	else
		ucOSD_Item_Index1   = (1 == ucOSD_Item_Index1) ? PAGE4B_ITEM_NUM : (ucOSD_Item_Index1 - 1);

	OSD_Window( 6, 150 + ((ucOSD_Item_Index1-1)/4)*170, 282 + ((ucOSD_Item_Index1-1)/4)*170, 
		54 + ((ucOSD_Item_Index1-1)%4)*33, 84 + ((ucOSD_Item_Index1-1)%4)*33, 1, 1, 14, 251, 0, 1, 25);
}

void Page4B_Show(void)
{
	Show_Osd_Page(3,Page8_Atb,7);
	RTDOSDW(Page8_Content);
	// Set Window 6
	OSD_Window( 6, 150 + ((ucOSD_Item_Index1-1)/4)*170, 282 + ((ucOSD_Item_Index1-1)/4)*170, 
		54 + ((ucOSD_Item_Index1-1)%4)*33, 84 + ((ucOSD_Item_Index1-1)%4)*33, 1, 1, 14, 251, 0, 1, 25);
}

void Page5_Enter_Key(void)
{
	if (0 == ucOSD_Item_Index0)
	{
		// Select and highlight the first item
		ucOSD_Item_Index0   = PAGE5_ITEM_SOURCE;
		ucOSD_Item_Index1   = 0;
		OSD_Window( 6, 150, 282, 54, 84, 1, 1, 14, 251, 0, 1, 0);
		OSD_Window( 6, 150, 282, 54, 84, 1, 1, 14, 251, 0, 1, 25);
	}
	else
	{
		switch (ucOSD_Item_Index0)
		{
			case PAGE5_ITEM_SOURCE :
				Data[0]             = stGUD1.INPUT_SOURCE & 0x07;
				ucOSD_Item_Index1   = (SOURCE_DVI == Data[0])   ? PAGE5B_ITEM_DVI 
					: (SOURCE_AV == Data[0])    ? PAGE5B_ITEM_CVBS 
					: (SOURCE_SV == Data[0])    ? PAGE5B_ITEM_SV 
					: (SOURCE_YUV == Data[0])   ? PAGE5B_ITEM_YUV 
					: (SOURCE_TV == Data[0])    ? PAGE5B_ITEM_TV : PAGE5B_ITEM_DSUB;

				OSD_Proc_B(NOTIFY_SHOW);   // Show the sub-page
				break;
				
			case PAGE5_ITEM_OPTION :
				if (ucOSD_Item_Index1)
				{
					OSD_Line( 7, 36 + (ucOSD_Item_Index1-1)*(7+1), 7, 0x40, 2);
										
					//ucOSD_Item_Index1   = (1 == ucOSD_Item_Index1) ? 0x00 : 0x80;
                    Data[0]   = (1 == ucOSD_Item_Index1) ? 0x10 : 0x00;
					//stGUD1.INPUT_SOURCE = (stGUD1.INPUT_SOURCE & 0x7f) | ucOSD_Item_Index1;
                    stGUD1.FUNCTION = stGUD1.FUNCTION & 0xef | Data[0];
					ucOSD_Item_Index1   = 0;
					Save_GUD1();

					if (SOURCE_VGA == (stGUD1.INPUT_SOURCE & 0x07) && 400 == usIPV_ACT_LEN &&
						MODE_0640x0400x56HZ != ucMode_Curr && MODE_USER720x400 != ucMode_Curr)
					{
						//if (stGUD1.INPUT_SOURCE & 0x80)
						if (stGUD1.FUNCTION & 0x10)
						{
							if (640 == usIPH_ACT_WID)
								ucMode_Curr = MODE_OSDFORCE;    // Force to VGA search mode again
						}
						else
						{
							if (720 == usIPH_ACT_WID)
								ucMode_Curr = MODE_OSDFORCE;    // Force to VGA search mode again
						}
					}
				}
				else
				{
					ucOSD_Item_Index1   = (stGUD1.FUNCTION & 0x10) ? 1 : 2;     // 1-720, 2-640//(stGUD1.INPUT_SOURCE & 0x80) ? 2 : 1;     // 1-720, 2-640
					OSD_Line( 7, 36 + (ucOSD_Item_Index1-1)*(7+1), 7, 0x20, 2);
				}
				break;
				
			case PAGE5_ITEM_RECALL :
				if (ucOSD_Item_Index1)
				{
					if (1 == ucOSD_Item_Index1)
					{
                        		{
						unsigned char   ucTemp1, ucTemp2;

						// Save the global settings we don't want to reset
						ucTemp1 = stGUD1.FUNCTION & 0x07;       // Language select
						ucTemp2 = stGUD1.INPUT_SOURCE & 0x07;   // Source select

						if (JAPANESS < ucTemp1)
							ucTemp1 = ENGLISH;

						// Reset OSD time-out timer
						usOSD_Timer = (unsigned int)2 << 9;     // 20 sec

						// Reset global settings to default
						Init_GUD();
						// Reset OSD time-out timer
						usOSD_Timer = (unsigned int)stGUD1.OSD_TIMEOUT << 9;

						// Restore the global settings we don't want to reset
						stGUD1.FUNCTION     = (stGUD1.FUNCTION & 0xf8) | ucTemp1;
						stGUD1.INPUT_SOURCE = (stGUD1.INPUT_SOURCE & 0xf8) | ucTemp2;
						Save_GUD1();

						// Reset brightness and contrast to default
						Set_Bright_Contrast();

#if (AUDIO_TYPE != AUDIO_NONE)
						SetVolume();
#endif
						// Reset OSD position
						OSD_Position(OSD_ENABLE);
					}

						// Reset all mode settings to default
						Init_MUD();

						// Read default settings for current mode
						Load_MUD(ucMode_Curr);

						// Leave current mode and search mode again
						ucMode_Curr = MODE_OSDFORCE;
					}

					OSD_Line( 9, 36 + (ucOSD_Item_Index1-1)*(6+1), 4, 0x40, 2);
					ucOSD_Item_Index1   = 0;    // Leave the item
				}
				else
				{
					ucOSD_Item_Index1   = 2;    // Enter the item, Default NO
					OSD_Line( 9, 36 + (ucOSD_Item_Index1-1)*(6+1), 4, 0x20, 2);
				}
				break;
				
			case PAGE5_ITEM_VOLUME :
				if (ucOSD_Item_Index1)
				{
					ucOSD_Item_Index1   = 0;    // Leave the item
					OSD_Slider(11, 31, 17, 0x1f - stGUD3.VOLUME, 0x1f, 4, 14);
				}
				else
				{
					ucOSD_Item_Index1   = 1;    // Enter the item, show slider

					stGUD3.VOLUME   &= 0x1f;
					OSD_Slider(11, 31, 17, 0x1f - stGUD3.VOLUME, 0x1f, 2, 14);
				}
				break;
				
			case PAGE5_ITEM_EXIT :
				// Disable highlight 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);
				// De-select the page item and disable the hightlight window
				ucOSD_Item_Index0   = 0;
				ucOSD_Item_Index1   = 0;

				break;
				
		}
	}
}

void Page5_Left_Right_Key(unsigned char Key)
{
	if (ucOSD_Item_Index1)
	{
		switch (ucOSD_Item_Index0)
		{
			case PAGE5_ITEM_OPTION :
				//ucOSD_Item_Index1   = (NOTIFY_LEFT_KEY == Key) ? 2 : 1;      // 1-720, 2-640
				ucOSD_Item_Index1   = (ucOSD_Item_Index1 == 1) ? 2 : 1;      // 1-720, 2-640
				OSD_Line( 7, 36 , 16, 0x40, 2);
				OSD_Line( 7, 36 + (ucOSD_Item_Index1-1)*(7+1), 7, 0x20, 2);
				//RTDOSDW((1 == ucOSD_Item_Index1) ? OSD_MODE_V720 : OSD_MODE_V640);
				break;
				
			case PAGE5_ITEM_RECALL :
				ucOSD_Item_Index1   = (NOTIFY_LEFT_KEY == Key) ? 1 : 2;
				OSD_Line( 9, 36 , 14, 0x40, 2);
				OSD_Line( 9, 36 + (ucOSD_Item_Index1-1)*(6+1), 4, 0x20, 2);
				//RTDOSDW(OSD_YESNO_TABLE[ucOSD_Item_Index1 - 1][stGUD1.FUNCTION & 0x07]);
				break;
				
			case PAGE5_ITEM_VOLUME :
				if (NOTIFY_RIGHT_KEY == Key)
				{
					if (0x00 == stGUD3.VOLUME)
						break;

					stGUD3.VOLUME   = stGUD3.VOLUME - 1;
				}
				else
				{
					if (0x1f <= stGUD3.VOLUME)
						break;

					stGUD3.VOLUME   = stGUD3.VOLUME + 1;
				}

				OSD_Slider(11, 31, 17, 0x1f - stGUD3.VOLUME, 0x1f, 2, 14);
				SetVolume();
				Save_GUD3();
				break;
				
			default :
				break;
				
		}
	}
	else
	{
		Osd_Change_Item(Key,PAGE5_ITEM_NUM);
	}
}

void Page5_Show(void)
{
	Show_Osd_Page(4,Page5_Atb,4);

	//Set Window 5 to select "Misc."
	OSD_Window( 5, 10, 136, 186, 216, 1, 1, 14, 251, 0, 1, 25);

#if (AUDIO_TYPE != AUDIO_NONE)

	OSD_Slider(11, 31, 17, 0x1f - stGUD3.VOLUME, 0x1f, 4, 14);

#endif
	if (0 == ucOSD_Item_Index1)
	{
		if( ucOSD_Item_Index0 == PAGE5_ITEM_SOURCE)
			OSD_Window( 6, 150, 282, 54, 84, 1, 1, 14, 251, 0, 1, 25);
	}
	else
	{
		switch (ucOSD_Item_Index0)
		{
			case PAGE5_ITEM_OPTION :
				//OSD_Line( 10, 15 + (ucOSD_Item_Index1-1)*(4+1), 4, 0x00, 2);
				//RTDOSDW((1 == ucOSD_Item_Index1) ? OSD_MODE_V720 : OSD_MODE_V640);
				break;
				
			case PAGE5_ITEM_RECALL :
				//OSD_Line( 10, 15 + (ucOSD_Item_Index1-1)*(4+1), 4, 0x00, 2);
				//RTDOSDW(OSD_YESNO_TABLE[ucOSD_Item_Index1 - 1][stGUD1.FUNCTION & 0x07]);
				break;
				
			case PAGE5_ITEM_VOLUME :
				//stGUD3.VOLUME   &= 0x1f;
				//OSD_Slider(11, 2, 20, 0x1f - stGUD3.VOLUME, 0x1f, 0x61);
				break;
				
			default :
				break;
				
		}
	}
}

void Page5B_Enter_Key()
{
	Data[0] = (PAGE5B_ITEM_DVI == ucOSD_Item_Index1) ?  SOURCE_DVI 
		: (PAGE5B_ITEM_CVBS == ucOSD_Item_Index1) ? SOURCE_AV
		: (PAGE5B_ITEM_SV == ucOSD_Item_Index1) ?   SOURCE_SV 
		: (PAGE5B_ITEM_YUV == ucOSD_Item_Index1) ?  SOURCE_YUV 
		: (PAGE5B_ITEM_TV == ucOSD_Item_Index1) ?   SOURCE_TV : SOURCE_VGA;

	if(Data[0] != ucInputSrc)
	{
		Change_Source(Data[0]);
		ucOSD_Page_Index = 0;
	}
	else
	{
		ucOSD_Item_Index1 = 0;            // Quit Sub-Page
	}

}

void Page5B_Left_Right_Key(unsigned char Key)
{
	// Select and highlight the next/previous item
	OSD_Window( 6, 150 + ((ucOSD_Item_Index1-1)/4)*170, 282 + ((ucOSD_Item_Index1-1)/4)*170, 
		54 + ((ucOSD_Item_Index1-1)%4)*33, 84 + ((ucOSD_Item_Index1-1)%4)*33, 0, 0, 14, 251, 0, 1, 0);
	if (NOTIFY_RIGHT_KEY == Key)
		ucOSD_Item_Index1   = (PAGE5B_ITEM_NUM == ucOSD_Item_Index1) ? 1 : (ucOSD_Item_Index1 + 1);
	else
		ucOSD_Item_Index1   = (1 == ucOSD_Item_Index1) ? PAGE5B_ITEM_NUM : (ucOSD_Item_Index1 - 1);

	OSD_Window( 6, 150 + ((ucOSD_Item_Index1-1)/4)*170, 282 + ((ucOSD_Item_Index1-1)/4)*170, 
		54 + ((ucOSD_Item_Index1-1)%4)*33, 84 + ((ucOSD_Item_Index1-1)%4)*33, 1, 1, 14, 251, 0, 1, 25);
}

void Page5B_Show()
{
	Show_Osd_Page(4,Page9_Atb,8);
	RTDOSDW(Page9_Content);

	OSD_Window( 6, 150 + ((ucOSD_Item_Index1-1)/4)*170, 282 + ((ucOSD_Item_Index1-1)/4)*170, 
		54 + ((ucOSD_Item_Index1-1)%4)*33, 84 + ((ucOSD_Item_Index1-1)%4)*33, 1, 1, 14, 251, 0, 1, 25);
	// Highlight the select item
	// Set Window 6
	//OSD_Window( 6, 152, 282, 56, 86, 2, 2, 14, 251, 0, 1, 25);


}

void Page6_Left_Right_Key(unsigned char Key)
{
	if(Key == NOTIFY_RIGHT_KEY)
		ucOSD_Page_Index    = GetNextPageIdx(ucOSD_Page_Index);
	else
		ucOSD_Page_Index    = GetPrevPageIdx(ucOSD_Page_Index);
}

void Page6_Show(void)
{
	//Init_Page(5);
	//RTDOSDW(OSD_PAGE_TABLE[5][stGUD1.FUNCTION & 0x07]);

	Show_Osd_Page(5,Page6_Atb,5);

	//Set Window 5 to select "Exit"
	OSD_Window( 5, 10, 136, 219, 249, 1, 1, 14, 251, 0, 1, 25);

}

void PageADC_Left_Right_Key(unsigned char Key)
{
	if (ucOSD_Item_Index1)
	{
		switch (ucOSD_Item_Index0)
		{
			case PAGEH_ITEM_REDGAIN :
				if (NOTIFY_RIGHT_KEY == Key)
				{
					if (0xff == stGUD2.AD_R_GAIN)
						return;

					stGUD2.AD_R_GAIN    += 1;
				}
				else
				{
					if (0x00 == stGUD2.AD_R_GAIN)
						return;

					stGUD2.AD_R_GAIN    -= 1;
				}

				OSD_Slider(5, 36, 17, stGUD2.AD_R_GAIN, 0xff, 2, 14);
				SetADC_Gain();
				break;
				
			case PAGEH_ITEM_GREENGAIN :
				if (NOTIFY_RIGHT_KEY == Key)
				{
					if (0xff == stGUD2.AD_G_GAIN)
						return;

					stGUD2.AD_G_GAIN    += 1;
				}
				else
				{
					if (0x00 == stGUD2.AD_G_GAIN)
						return;

					stGUD2.AD_G_GA

⌨️ 快捷键说明

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