📄 osdmenu.lst
字号:
C51 COMPILER V7.50 OSDMENU 04/01/2008 15:02:25 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE OSDMENU
OBJECT MODULE PLACED IN .\Output\osdmenu.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE osdmenu.c COMPACT OPTIMIZE(9,SIZE) BROWSE MODDP2 INCDIR(.\Include\) DEFINE(
-INTERNAL_MCU) DEBUG OBJECTEXTEND PRINT(.\Source\osdmenu.lst) OBJECT(.\Output\osdmenu.obj)
line level source
1 // osdmenu.c
2
3 #include "Config.h"
4 #include "typedefs.h"
5 #include "main.h"
6 #include "i2c.h"
7 #include "Tw88.h"
8 #include "measure.h"
9 #include "dispinfo.h"
10 #include "osdbasic.h"
11 #include "osdmenu.h"
12 #include "adc.h"
13 #include "etc_eep.h"
14 #include "pc_eep.h"
15 #include "audio.h"
16 #include "printf.h"
17 #include "udfont.h"
18 #include "panel.h"
19 #include "rgbmix.h" // for TW8801
20 #ifdef SUPPORT_TV
21 #include "Tuner.h"
22 #endif
23
24 static WORD OSDItemValue;
25 //static BYTE OSDDuration;
26
27 static BYTE title_item, cursor_item, /*cursor_y,*/ cur_osdwin, /*cur_osdaddr,*/ val_osdwin=0xff,
28 val_index=0;
29
30 static BYTE OSDMenuX, OSDMenuY;/*ljy100303..., OSDZoom*/
31 static BYTE OSDLang=0;
32
33 static BYTE OSDMenuLevel;
34 bit OnChangingValue = 0;
35 static BYTE OSDNumberString[5];
36
37 bit displayOnValueWindow = 0;
38 #ifdef PAL_TV
39 bit ChannelEdit_Flag = 0;
40 bit ChannelEdit_on = 0;
41 #endif
42
43 //extern IDATA struct BarInfo BarInfo;
44 extern CODE struct struct_IdName struct_VInputStd[];
45 extern CODE struct struct_IdName struct_InputSelection[];
46 //extern IDATA BYTE InputSelectionInx;
47 //extern bit PowerMode ;
48 extern bit I2CAutoIncFlagOn ;
49 extern BYTE VInputStdDetectMode;
50 extern CODE BYTE Init_Osd_MainMenu[];
51 #ifdef ADD_ANALOGPANEL
extern CODE BYTE Init_Osd_MainMenu_A[];
#endif
54 extern bit DisplayInputHold;
C51 COMPILER V7.50 OSDMENU 04/01/2008 15:02:25 PAGE 2
55 extern IDATA WORD IVF;
56 extern IDATA DWORD IHF;
57 #ifdef PAL_TV
58 extern PDATA BYTE TVChannel;
59 extern IDATA WORD TVFreq;
60 #endif
61
62
63 struct MenuType CODE *MenuFormat;
64 struct RegisterInfo CODE *BarRange;
65 struct DefineMenu CODE *MenuTitle;
66 struct DefineMenu CODE *MenuChild;
67 struct DefineMenu CODE *MenuStack[4];
68 static IDATA BYTE MenuSP=0, MenuIndexStack[4];
69
70 #include "OSDString.h"
71 #include "menu.h"
72 #include "OSDOper.c"
73
74 //---------------------------------------------------------------------
75 // Push MenuTile, title_item in stack
76 // MenuTile[title_item][]...
77 //
78 BYTE pushMenu(void)
79 {
80 1 #ifdef DEBUG_OSD
dPrintf("\r\n(pushMenu)-MenuSP:%d", (WORD)MenuSP);
#endif
83 1 if( MenuSP < sizeof( MenuIndexStack ) ) {
84 2 #ifdef DEBUG_OSD
{
BYTE **Desc;
BYTE i;
Desc = MenuTitle[title_item].Desc;
for(i=0; i<OSDLang; i++)
Desc += ( strlen(*Desc) + 1 );
dPrintf("...MenuStack[%d]:Desc(%s)",(WORD)MenuSP, Desc);
}
#endif
96 2 MenuStack[MenuSP] = MenuTitle;
97 2 MenuIndexStack[MenuSP++] = title_item;
98 2 return 1;
99 2 }
100 1 return 0;
101 1 }
102
103 BYTE popMenu(void)
104 {
105 1 #ifdef DEBUG_OSD
dPrintf("\r\n(popMenu)-MenuSP:%d", (WORD)MenuSP);
#endif
108 1 if( MenuSP ) {
109 2 MenuTitle = MenuStack[--MenuSP];
110 2 title_item = MenuIndexStack[MenuSP];
111 2 #ifdef DEBUG_OSD
{
BYTE **Desc;
BYTE i;
Desc = MenuTitle[title_item].Desc;
C51 COMPILER V7.50 OSDMENU 04/01/2008 15:02:25 PAGE 3
for(i=0; i<OSDLang; i++)
Desc += ( strlen(*Desc) + 1 );
dPrintf("...MenuStack[%d]:Desc(%s)",(WORD)MenuSP, Desc);
}
#endif
124 2 return 1;
125 2 }
126 1 return 0;
127 1 }
128
129 BYTE GetLowerMenuItem( CODE_P struct DefineMenu *DMp, BYTE itemno )
130 {
131 1 if( itemno==NIL )
132 1 return NIL;
133 1 itemno++;
134 1 if( (DMp[itemno].IconColor==NIL) && (DMp[itemno].DescColor==NIL) ) // end
135 1 return NIL;
136 1 return itemno;
137 1
138 1 }
139
140 BYTE GetUpperMenuItem( BYTE itemno )
141 {
142 1 //if( itemno==0 ||
143 1 if( itemno==NIL )
144 1 return NIL;
145 1 itemno--;
146 1 return itemno;
147 1 }
148
149 BYTE GetTargetChild( BYTE tid)
150 {
151 1 BYTE i;
152 1
153 1
154 1 if( MenuChild ) i = 0;
155 1 else i = NIL;
156 1
157 1
158 1 #ifdef DEBUG_OSD
dPrintf("\r\nTarget id:0x%x", (WORD)tid);
#endif
161 1
162 1 while( i != NIL ) {
163 2
164 2 #ifdef DEBUG_OSD
dPrintf("__ForActionId[%d]:0x%x", (WORD)i, (WORD)MenuChild[i].Id);
#endif
167 2
168 2 if ( ( MenuChild[i].Id & 0x0f ) == tid )
169 2 return i;//break;
170 2 i = GetLowerMenuItem(MenuChild, i );
171 2 }
172 1
173 1 return i;
174 1 }
175 /*
176 BYTE GetTargetChild1( BYTE tid)
177 {
178 BYTE i;
C51 COMPILER V7.50 OSDMENU 04/01/2008 15:02:25 PAGE 4
179
180
181 if( MenuChild ) i = 0;
182 else i = NIL;
183
184
185 #ifdef DEBUG_OSD
186 dPrintf("\r\nTarget id:0x%x", (WORD)tid);
187 #endif
188
189 while( i != NIL ) {
190
191 #ifdef DEBUG_OSD
192 dPrintf("__ForActionId[%d]:0x%x", (WORD)i, (WORD)MenuChild[i]. PreFnId);
193 #endif
194
195 if ( ( MenuChild[i]. PreFnId & 0x0f ) == tid )
196 return i;//break;
197 i = GetLowerMenuItem( MenuChild, i );
198 }
199 return i;
200 }
201 */
202 //===============================================================================
203 //
204 // Display Information of the menu
205 //
206 //===============================================================================
207 CODE BYTE OSDInfoStr[][26]={
208 { "Input : " },
209 { "System : " },
210 { "H Freq : kHz " },
211 { "V Freq : Hz " },
212 { "F/W Rev: new " },
213 { "" }
214 };
215 #define OSD_INFO_SUB_X 9
216
217 void DisplayInfo_OSD(void)
218 {
219 1 BYTE i, title=1, len, inputs;
220 1 BYTE mstr[5];
221 1
222 1 pushMenu();
223 1 MenuTitle = MenuChild;
224 1 title_item = cursor_item;
225 1
226 1 OSDMenuLevel++;
227 1
228 1 MenuChild = 0;
229 1 cursor_item = NIL;
230 1
231 1 DrawMenulist(1); // Display Title
232 1
233 1 DrawAttrCnt(OSDMENU_SUBADDR+MENU_WIDTH, OSD_INFO_COLOR, 5*MENU_WIDTH ); // Line 1 ~ Line 5
234 1 for(i=0; OSDInfoStr[i][0]; i++)
235 1 WriteStringToAddr(OSDMENU_SUBADDR+MENU_WIDTH*(i+title), OSDInfoStr[i], MENU_WIDTH );
236 1
237 1 // Display Input
238 1 inputs = GetInputSelection();
239 1 for (i=1; ;i++)
240 1 if( struct_InputSelection[i].Id==inputs ) break;
C51 COMPILER V7.50 OSDMENU 04/01/2008 15:02:25 PAGE 5
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -