📄 menu.c
字号:
}
else
Osd_DrawStr(13+xOffset, 5+(item-yOffset)*2,tLeftSpace);
}
void Draw_SUBWindow3(void)
{
mStar_WriteOSDByte(SUBW3C, 0x03);
mStar_WriteOSDByte(SUBW3A, 0x03);
mStar_WriteOSDByte(GCCTRL, 0x0B);
mStar_WriteOSDByte(HGRADCR, 0x00);
mStar_WriteOSDByte(HGRADCG, 0x00);
mStar_WriteOSDByte(HGRADCB, 0x00);
mStar_WriteOSDByte(HGRADSR, 0x00);
mStar_WriteOSDByte(HGRADSG, 0x00);
mStar_WriteOSDByte(HGRADSB, 0x00);
mStar_WriteOSDByte(VGRADCR, 0x01);
mStar_WriteOSDByte(VGRADCG, 0x01);
mStar_WriteOSDByte(VGRADCB, 0x01);
mStar_WriteOSDByte(SW3HST, 0x00);
mStar_WriteOSDByte(SW3HEND, 0x28);
mStar_WriteOSDByte(SW3VST, 0x02);
mStar_WriteOSDByte(SW3VEND, 0x0F);
}
void DrawMainWindow(BYTE item)
{
BYTE NoZERO=1;
BYTE TempItemValue;
mStar_WriteOSDByte(IOSDC3, 0x19);
mStar_WriteOSDByte(OSDHC, 0x44);
mStar_WriteOSDByte(GRADCLR, 0x00);
Draw_SUBWindow3();
Draw_SUBWindow2();
Draw_SUBWindow1();
DrawLeftWindow();
DrawButton_LEFT(item);
//////////////////////
if(item!=3)
{
for(i=0;i<6;i++)
DrawOsdMenuItem(i, &tblMenus[MainMenu+i].MenuItems[0]);
}
else if(item==3) //(MenuPageIndex==OsdSetMenu&&ReloadFontFlag))
{
TempItemValue=MenuItemIndex;
MenuItemIndex=10; //目的不是<0--5>
DrawOsdMenuItem(NoZERO, &tblMenus[MainMenu+0].MenuItems[0]);//for first item dont selcolor
for(i=1;i<6;i++)
DrawOsdMenuItem(i, &tblMenus[MainMenu+i].MenuItems[0]);
DrawOsdMenuItemText(10, &CurrentMenu.MenuItems[0]);
DrawOsdMenuItemValue(0, CurrentMenu.MenuItems[0].DisplayValue);
MenuItemIndex= TempItemValue;
}
}
void DrawNoCableWindow(void)
{
Osd_SetTextColor(CP_BlueColor, CP_BlueColor);
Osd_DrawStr(0,0, "\x05\x0A\x0A\x0A\x0A\x0A\x0A\x0A\x0A\x0A\x0A\x07");
Osd_DrawStr(0,3, "\x04\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x06");
for(i=1;i<3;i++)
{
Osd_SetTextColor(CP_BlueColor, CP_BlueColor);
Osd_DrawStr(0,i, "\x08");
Osd_DrawStr(11,i, "\x09");
Osd_SetTextColor(CP_GrayColor, CP_GrayColor);
Osd_DrawStr(1,i, "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20");
}
Osd_SetTextColor(CP_SoftLowGreenColor, CP_RedColor);
Osd_DrawStr(5,1, "\x02\x03");
}
#if Dual_Input_Icon_Enable
void DrawSourceTypeWindow(void)
{
Osd_SetTextColor(CP_BlueColor, CP_BlueColor);
Osd_DrawStr(0,0, "\x05\x0A\x0A\x0A\x0A\x0A\x07");
Osd_DrawStr(0,2, "\x04\x0B\x0B\x0B\x0B\x0B\x06");
{
Osd_SetTextColor(CP_BlueColor, CP_BlueColor);
Osd_DrawStr(0,1, "\x08");
Osd_DrawStr(6,1, "\x09");
if (SrcInputType==Input_Digital)
{
Osd_SetTextColor(CP_BlackColor, CP_GrayColor);
Osd_DrawStr(1, 1, "D V I");
}
else if (SrcInputType==Input_Analog1)
{
Osd_SetTextColor(CP_BlackColor, CP_GrayColor);
Osd_DrawStr(1, 1, " ");
Osd_SetTextColor(CP_RedColor, CP_GrayColor);
Osd_DrawStr(1, 1, "R");
Osd_SetTextColor(CP_GreenColor, CP_GrayColor);
Osd_DrawStr(3, 1, "G");
Osd_SetTextColor(CP_BlueColor, CP_GrayColor);
Osd_DrawStr(5, 1, "B");
}
else if (SrcInputType==Input_656Video)
{
Osd_SetTextColor(CP_BlackColor, CP_GrayColor);
Osd_DrawStr(1, 1, " ");
Osd_SetTextColor(CP_RedColor, CP_GrayColor);
Osd_DrawStr(1, 1, "6");
Osd_SetTextColor(CP_GreenColor, CP_GrayColor);
Osd_DrawStr(3, 1, "5");
Osd_SetTextColor(CP_BlueColor, CP_GrayColor);
Osd_DrawStr(5, 1, "6");
}
}
}
#endif
void DrawAutoConfigWindow(void)
{
Osd_SetTextColor(CP_SoftGrassGreenColor, CP_WhiteColor);
Osd_DrawStr(0,0, HalfSpace);
Osd_SetTextColor(CP_SoftGrassGreenColor,CP_SoftGrassGreenColor);
Osd_DrawStr(0,1, "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20");
Osd_SetTextColor(CP_WhiteColor,CP_SoftGrassGreenColor);
Osd_DrawStr(0,2, HalfSpace);
}
////////////////////////////////zwtan modify for hpc new osd -------end
Bool ResetOsdTime(void)
{
if (!FactoryModeFlag)
{
#if Dual_Input_Icon_Enable
if(MenuPageIndex==SourceTypeMenu)
OsdCounter=2;
else
#endif
OsdCounter=UserPrefOsdTime;
}
else if (FactoryModeFlag || MenuPageIndex == BurninMenu)
OsdCounter = 0;
// tony disable OSD timer out
Clr_OsdTimeoutFlag();
return TRUE;
}
void Menu_InitVariable(void)
{ MenuPageIndex=RootMenu;
MenuItemIndex=0;
OsdCounter=0;
if (!PowerOnFlag)
MenuPageIndex=PowerOffMenu;
moveX = 50;moveY = 50;//vick
}
void Menu_InitAction(void)
{ MenuItemIndex=0;
if (SyncLossState())
{
if (DoBurninModeFlag && BurninModeFlag)
{
MenuPageIndex=BurninMenu;
}
else if(DDCSwitchEnable)
{
MenuPageIndex=DDCTypeMenu;
}
#if Dual_Input_Icon_Enable
else if (DrawSourceTypeFlag)
{
MenuPageIndex=SourceTypeMenu;
}
#endif
#if NoCable_Detect_Enable
else if (CableNotConnectedFlag)
{
MenuPageIndex = CableNotConnectedMenu;
}
#endif
else
{
MenuPageIndex = StandbyMenu;
}
}
else if (UnsupportedModeFlag)
{ MenuPageIndex=UnsupportedModeMenu;
}
else if (FactoryModeFlag)
MenuPageIndex=AutoColorMenu;
#if Dual_Input_Icon_Enable
else if (DrawSourceTypeFlag)
{
MenuPageIndex=SourceTypeMenu;
}
#endif
else if ((UserPrefAutoTimes==0)&&(SrcInputType==Input_Analog1))//fendy add for Digital don t do auto
MenuPageIndex=AutoMenu;
else
MenuPageIndex=RootMenu;
if(DDCSwitchEnable==FALSE)
{
//#if 1//DUAL_INPUT
if (1)//DualInputIconEnableFlag)
{
if (!SyncLossState()&& SrcInputType<Input_Digital)
{
#if !MSTMCU
hw_SetDSUBDDC();
#endif
}
else
{
#if !MSTMCU
//mStar_WriteByte(DDCEN1,(mStar_ReadByte(DDCEN1)|BIT3|BIT4|BIT5);
hw_SetDVIDDC();
#endif
}
}
//#else
else
{
#if !MSTMCU
hw_SetDSUBDDC();
#endif
}
//#endif
}
DDCSwitchEnable=FALSE;
#if Dual_Input_Icon_Enable
if (MenuPageIndex==SourceTypeMenu)
ResetOsdTime();
else
#endif
OsdCounter=0;
ExecuteKeyEvent(MIA_RedrawMenu);
NVRam_WriteByte(nvrMonitorAddr(InputType), SrcInputType);
UserPrefInputType=SrcInputType;
if (UnsupportedModeFlag)
{ if (!FreeRunModeFlag)
{ if (UserPrefAutoTimes==0)
AutoConfig();
}
}
}
void Menu_OsdHandler(void)
{
BYTE menuAction;
if (ISPFlag)
{ MenuPageIndex=ISPMenu;
MenuItemIndex=0;
ExecuteKeyEvent(MIA_RedrawMenu);
}
#if 1 //tony
if(ToEnterFactoryFlag)
{
if(Key_CheckAutoKeyOnly())
{
ToEnterFactoryKeyCounter++;
Delay1ms(100);
if((ToEnterFactoryKeyCounter >=15 )&&(ToEnterFactoryKeyCounter%5==0))
printData("(25-40) %d" ,ToEnterFactoryKeyCounter);
}
else
{
if((ToEnterFactoryKeyCounter >=15)&&(ToEnterFactoryKeyCounter <=60))
{
Set_EnterFactoryMenuFlag();
}
else
ToEnterFactoryKeyCounter=0;
}
}
#endif
if(EnterFactoryMenuFlag)
{
printMsg("Enter factory mode here:");
Clr_EnterFactoryMenuFlag();
Set_FactoryModeFlag();
Enable_SerialPort();//zwtan 20050201
OsdCounter=0;
Clr_OsdTimeoutFlag(); //to avoid enter factory mode within 1s,
UserPrefLanguage = 0 ;//factorymenu disappear after enter
Osd_Hide();
ToEnterFactoryFlag = FALSE;
ToEnterFactoryKeyCounter = 0;
OsdWindowWidth = 0;
OsdWindowHeight = 0;
MenuPageIndex = FactoryMenu;
MenuItemIndex = 1;
ExecuteKeyEvent(MIA_RedrawMenu);
//NVRam_WriteByte(nvrMonitorAddr(MonitorFlag), MonitorFlags);
//tony added for soft power to exit factory mode
}
if (ForcePowerOffFlag)
{
Clr_ForcePowerOffFlag();
menuAction=MIA_Power;
}
Key_ScanKeypad();
if (KeypadButton>=BTN_EndBTN)
menuAction=MIA_Nothing;
else
{
if(StauIndex0==2)
{
if ((MenuPageIndex==PictureMenu && MenuItemIndex==1)//AdjustHPosition
|| (MenuPageIndex==OsdSetMenu && MenuItemIndex==3)//AdjustOSDVPos
|| (MenuPageIndex==MiscellaneousMenu && MenuItemIndex==1))//Mode select
menuAction=*(InvSliderSelectKeyEvent+KeypadButton);
else
menuAction=*(SliderSelectKeyEvent+KeypadButton); //fendy add this for enter intoslider adjust
}
else if(StauIndex0==3) // yes or no select key, menu key
{
menuAction=*(YesNOSelectKeyEvent+KeypadButton);
}
else
if (CurrentMenuItem.KeyEvents)
menuAction=*((CurrentMenuItem.KeyEvents)+KeypadButton);
}
if (menuAction)//vick when menuAction = MIA_Nothing
{
if (!InputTimingStableFlag) // prevent osd action while mode changing
{ if (menuAction!=MIA_Power)
menuAction=MIA_Nothing;
}
if (ExecuteKeyEvent(menuAction))
{ ResetOsdTime();
}
if (menuAction==MIA_IncValue||menuAction==MIA_DecValue)// || menuAction==MIA_Auto)
{ if (TurboKeyCounter<100)
TurboKeyCounter++;
}
else if (menuAction==MIA_Exit)
{ Delay1ms(150);
KeypadButton=BTN_Repeat;
}
}
else
TurboKeyCounter=0;
if (OsdTimeoutFlag)
{
Clr_OsdTimeoutFlag();
#if Dual_Input_Icon_Enable
if (DrawSourceTypeFlag)
{
Clr_DrawSourceTypeFlag();
Menu_InitAction();
}
else
#endif
{
MenuPageIndex=RootMenu;
MenuItemIndex=0;
ExecuteKeyEvent(MIA_RedrawMenu);
#if 1 //tony
ToEnterFactoryFlag = FALSE;
ToEnterFactoryKeyCounter=0;
#endif
}
}
#if 1//
if (DoBurninModeFlag && BurninModeFlag && ChangePatternFlag)//&&CableNotConnectedFlag) // for burnin mode
{ Clr_ChangePatternFlag();
PatternNo=(PatternNo+1)%5;//11;
mStar_AdjustBackgoundColor(PatternNo);
}
if (ms500Flag) // for moving osd position
{ Clr_ms500Flag();
if (CurrentMenu.Flags&mpbMoving && !PowerSavingFlag)// && FreeRunModeFlag) // for led flash
{ if (ReverseXFlag)
{ if (moveX==0) //vick add moveX & moveY
{ Clr_ReverseXFlag();
}
else
moveX-=1;
}
else
moveX++;
if (moveX>=100)
Set_ReverseXFlag();
if (ReverseYFlag)
{ if (moveY==0)
Clr_ReverseYFlag();
else
moveY-=2;
}
else
moveY+=2;
if (moveY>=100)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -