osdmenu.lst
来自「显示屏驱动源代码」· LST 代码 · 共 1,286 行 · 第 1/5 页
LST
1,286 行
987 2 if( DisplayInputHold ) DisplayInput();
988 2 else if( IsAudioMuteOn() ) DisplayMuteInfo();
989 2 return;
990 2 }
991 1
992 1 #ifdef DEBUG_OSD
dPrintf("\r\n++(OSDHighMenu_sub) OSDMenuLevel:%d", (WORD)OSDMenuLevel );
#endif
995 1
996 1 MenuFormat = ( CODE_P struct MenuType *) MenuTitle[title_item].TypeData;
997 1
998 1 OSDMenuLevel--; // Up Menu tree
999 1
1000 1 if(OSDMenuLevel == 1){ // Top Menu Level
1001 2 cur_osdwin = OSDMENU_TOPWIN;//Window #4
1002 2 DisplayOSDMenu();
1003 2 }
1004 1 else
1005 1 {
1006 2 DrawMenulist(0); // Redraw List and contents.
1007 2 DisplayCursor();
1008 2 }
1009 1
1010 1 // 3D Effect Cursor Top
1011 1 if(OSDMenuLevel == 1) {
1012 2 WriteDecoder(TW88_WINNUM, OSDCURSORWINDOW-1);
1013 2 WriteDecoder(TW88_WINATTR, OSD_Window_Attr(WINDOW_3D_TOP,BG_COLOR_BLACK|EXTENDED_COLOR,0,WINDOW_3D_ENABL
-E,WINDOW_ENABLE));
1014 2 }
1015 1
1016 1 return;
1017 1 }
1018
1019
1020 BYTE DoAction(BYTE id)
1021 {
1022 1 BYTE ret = 1;
1023 1
1024 1 #ifdef DEBUG_OSD
dPrintf("\r\n++(DoAction) id:0x%x", (WORD)id );
#endif
1027 1 switch( id ) {
1028 2
1029 2 case CHANGE_TO_COMPOSITE:
1030 2 case CHANGE_TO_SVIDEO:
1031 2 case CHANGE_TO_COMPONENT:
1032 2
1033 2 #ifdef SUPPORT_TV
case CHANGE_TO_TV:
#endif
1036 2
1037 2 #ifdef SUPPORT_PC
1038 2 case CHANGE_TO_PC:
1039 2 case CHANGE_TO_DIGITALVGA:
1040 2 #endif
1041 2
C51 COMPILER V7.06 OSDMENU 02/21/2008 14:00:28 PAGE 18
1042 2 #ifdef SUPPORT_DTV
case CHANGE_TO_DTV:
#endif
1045 2
1046 2 ChangeInput( id & 0x0f );
1047 2 break;
1048 2
1049 2 #ifdef SUPPORT_PC
1050 2 case AUTOADJUST:
1051 2 AutoAdjust();
1052 2 break;
1053 2 /*case AUTOADJUST2: ret = DetectAndSetForVGAInput(2);
1054 2 LCDPowerON(0); //HHY 1.63
1055 2 SetOSDLastKeyInTime();
1056 2 ClearCursor();
1057 2 cursor_item = 0;
1058 2 DisplayCursor();
1059 2 break;*/
1060 2 case RESET_PCVALUE: ClearOSDInfo();
1061 2 ResetPanelAttributeValue();
1062 2 ResetPCValue();
1063 2 ResetOSDValue();
1064 2 ResetAudioValue();
1065 2 break;
1066 2
1067 2 case PCCOLORADJUST:
1068 2 break;
1069 2 #endif
1070 2
1071 2
1072 2 case RESET_VIDEOVALUE: ClearOSDInfo();
1073 2 ResetVideoValue();
1074 2 ResetOSDValue();
1075 2 ResetAudioValue();
1076 2 break;
1077 2
1078 2 #ifdef SUPPORT_TV
case SCAN_CHANNEL: ClearOSDInfo();
DisplayScanTV();
delay(50); //protect for repeat key
ScanTVChannel();
ClearScanTV();
break;
#ifdef PAL_TV
case EDIT_CHANNEL: ChannelEdit_Window();
ChannelEdit_Flag = 1;
break;
#endif // PAL_TV
#endif // SUPPORT_TV
1092 2
1093 2 //----
1094 2 case DISP_INFO: DisplayInfo_OSD();
1095 2 displayOnValueWindow = 1;
1096 2 break;
1097 2
1098 2 case TOHIGHMENU: OSDHighMenu_sub();
1099 2 break;
1100 2
1101 2 case EXITMENU: CloseOSDMenu();
1102 2 if( DisplayInputHold ) DisplayInput();
1103 2 else if( IsAudioMuteOn() ) DisplayMuteInfo();
C51 COMPILER V7.06 OSDMENU 02/21/2008 14:00:28 PAGE 19
1104 2 break;
1105 2 }
1106 1 return ret;
1107 1 }
1108
1109
1110 BYTE GetNextCursorMenuItem( CODE_P struct DefineMenu *DMp, BYTE itemno, BYTE flag)
1111 {
1112 1 BYTE new_cursor;
1113 1
1114 1 switch( flag ) {
1115 2 case UP: new_cursor = GetUpperMenuItem( /*DMp,*/ itemno ); break;
1116 2 case DN: new_cursor = GetLowerMenuItem( DMp, itemno ); break;
1117 2 }
1118 1 return new_cursor;
1119 1 }
1120
1121 //============== Public functions =================================================
1122 //CODE BYTE TryAgainMsg[]={ "Try again."};
1123
1124 BYTE SaveValue1(void)
1125 {
1126 1 // BYTE /*ret=0,*/ addroff;
1127 1
1128 1 switch( MenuChild[cursor_item].Type ) {
1129 2
1130 2 case NUMBER:
1131 2 switch ( MenuChild[cursor_item].Id ) {
1132 3
1133 3 case SLEEP_TIMER: SetSleepTimer( OSDItemValue );
1134 3 return 1; //break;
1135 3 }
1136 2 //ret = 1;
1137 2 break;
1138 2
1139 2 default: break;
1140 2 }
1141 1
1142 1 return 0;
1143 1 }
1144
1145 void ClearValueWin(void)
1146 {
1147 1 SaveValue1();
1148 1 //ShowOSDWindow(OSDBARWINDOW, FALSE);
1149 1 val_osdwin = 0xff;
1150 1 OnChangingValue = 0;
1151 1 }
1152
1153 void OSDCursorMove(BYTE flag )
1154 {
1155 1 BYTE new_cursor, old_cursor;
1156 1 WORD dat;
1157 1
1158 1 #ifdef DEBUG_OSD
dPrintf("\r\n++(OSDCursorMove)cursor_item:%d __", (WORD)cursor_item);
#endif
1161 1
1162 1 if (displayOnValueWindow) return;
1163 1 #ifdef PAL_TV
if( ChannelEdit_Flag ) return;
#endif
C51 COMPILER V7.06 OSDMENU 02/21/2008 14:00:28 PAGE 20
1166 1
1167 1 if( MenuChild[ cursor_item ].Id == PC_COLOR_TEMP && GetPCColorTempModeEE() != 3 ) return; // User
1168 1 if( MenuChild[ cursor_item ].Id == VIDEO_MODE && GetVideoModeEE() != 3 ) return; // User
1169 1
1170 1 new_cursor = GetNextCursorMenuItem( MenuChild, cursor_item, flag ); // Get item to move
1171 1
1172 1 if( new_cursor ==NIL ) {
1173 2 BYTE i;
1174 2 if( flag == UP )
1175 2 for(i=0; i<8; ){
1176 3 new_cursor=i;
1177 3 if( (i=GetLowerMenuItem(MenuChild, i) ) == NIL) break;
1178 3
1179 3 }
1180 2 //new_cursor = MenuFormat->height - 1;
1181 2 else
1182 2 new_cursor = 0;
1183 2 }
1184 1
1185 1 if( OnChangingValue ) {
1186 2 ClearValueWin();
1187 2 }
1188 1 if( OSDMenuLevel != 1) ClearCursor();
1189 1
1190 1 old_cursor = cursor_item;
1191 1 cursor_item = new_cursor;
1192 1 if(OSDMenuLevel == 1)
1193 1 {
1194 2 WaitEndofDisplayArea();
1195 2 dat = GetOSDWindowY(OSDCURSORWINDOW);
1196 2 dat += (cursor_item-old_cursor)*(0x0a);
1197 2 SetOSDWindowY_TW88(OSDCURSORWINDOW,dat);
1198 2 WriteDecoder(TW88_WINNUM, OSDCURSORWINDOW-1);
1199 2 WriteDecoder(TW88_WINSADDRLO, cursor_item*2);
1200 2
1201 2 DisplayOSDMenu();
1202 2
1203 2 }
1204 1 else {
1205 2
1206 2 if( MenuChild[ old_cursor ].Id == OSDLANG)
1207 2 DrawMenulist(0); // Recover Attr. and menu Data list
1208 2 DisplayCursor();
1209 2 }
1210 1 }
1211
1212 void OSDValueUpDn(BYTE flag)
1213 {
1214 1 CODE_P BYTE *ptr;
1215 1 WORD val;
1216 1 WORD addr;
1217 1 // BYTE len1;
1218 1
1219 1 addr = OSDMENU_SUBADDR;
1220 1 addr = addr + MAX_DESC + (cursor_item+1)*MenuFormat->width;
1221 1
1222 1 switch ( MenuChild[cursor_item].Type ) {
1223 2
1224 2 case BAR:
1225 2 val = SetItemValue(MenuChild[cursor_item].Id, flag );
1226 2 DisplayViewBar( addr, val);
1227 2 break;
C51 COMPILER V7.06 OSDMENU 02/21/2008 14:00:28 PAGE 21
1228 2
1229 2 case NUMBER:
1230 2 ptr = MenuChild[cursor_item].TypeData;
1231 2
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?