osdmenu.lst
来自「显示屏驱动源代码」· LST 代码 · 共 1,286 行 · 第 1/5 页
LST
1,286 行
C51 COMPILER V7.06 OSDMENU 02/21/2008 14:00:28 PAGE 1
C51 COMPILER V7.06, 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 INCDIR(.\Include\) DEBUG OBJECTEX
-TEND PRINT(.\Source\osdmenu.lst) OBJECT(.\Output\osdmenu.obj)
stmt 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
#include "Tuner.h"
#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
bit ChannelEdit_Flag = 0;
bit ChannelEdit_on = 0;
#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.06 OSDMENU 02/21/2008 14:00:28 PAGE 2
55 extern IDATA WORD IVF;
56 extern IDATA DWORD IHF;
57
58 struct MenuType CODE *MenuFormat;
59 struct RegisterInfo CODE *BarRange;
60 struct DefineMenu CODE *MenuTitle;
61 struct DefineMenu CODE *MenuChild;
62 struct DefineMenu CODE *MenuStack[4];
63 static IDATA BYTE MenuSP=0, MenuIndexStack[4];
64
65 #include "OSDString.h"
66 #include "menu.h"
67 #include "OSDOper.c"
68
69 #ifdef SUPPORT_LINE_OSDDEMO
#include "OsdInitTable_Line.c"
#endif
72 //---------------------------------------------------------------------
73 // Push MenuTile, title_item in stack
74 // MenuTile[title_item][]...
75 //
76 BYTE pushMenu(void)
77 {
78 1 #ifdef DEBUG_OSD
dPrintf("\r\n(pushMenu)-MenuSP:%d", (WORD)MenuSP);
#endif
81 1 if( MenuSP < sizeof( MenuIndexStack ) ) {
82 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
94 2 MenuStack[MenuSP] = MenuTitle;
95 2 MenuIndexStack[MenuSP++] = title_item;
96 2 return 1;
97 2 }
98 1 return 0;
99 1 }
100
101 BYTE popMenu(void)
102 {
103 1 #ifdef DEBUG_OSD
dPrintf("\r\n(popMenu)-MenuSP:%d", (WORD)MenuSP);
#endif
106 1 if( MenuSP ) {
107 2 MenuTitle = MenuStack[--MenuSP];
108 2 title_item = MenuIndexStack[MenuSP];
109 2 #ifdef DEBUG_OSD
{
BYTE **Desc;
BYTE i;
Desc = MenuTitle[title_item].Desc;
for(i=0; i<OSDLang; i++)
Desc += ( strlen(*Desc) + 1 );
C51 COMPILER V7.06 OSDMENU 02/21/2008 14:00:28 PAGE 3
dPrintf("...MenuStack[%d]:Desc(%s)",(WORD)MenuSP, Desc);
}
#endif
122 2 return 1;
123 2 }
124 1 return 0;
125 1 }
126
127 BYTE GetLowerMenuItem( CODE_P struct DefineMenu *DMp, BYTE itemno )
128 {
129 1 if( itemno==NIL )
130 1 return NIL;
131 1 itemno++;
132 1 if( (DMp[itemno].IconColor==NIL) && (DMp[itemno].DescColor==NIL) ) // end
133 1 return NIL;
134 1 return itemno;
135 1
136 1 }
137
138 BYTE GetUpperMenuItem( BYTE itemno )
139 {
140 1 //if( itemno==0 ||
141 1 if( itemno==NIL )
142 1 return NIL;
143 1 itemno--;
144 1 return itemno;
145 1 }
146
147 BYTE GetTargetChild( BYTE tid)
148 {
149 1 BYTE i;
150 1
151 1
152 1 if( MenuChild ) i = 0;
153 1 else i = NIL;
154 1
155 1
156 1 #ifdef DEBUG_OSD
dPrintf("\r\nTarget id:0x%x", (WORD)tid);
#endif
159 1
160 1 while( i != NIL ) {
161 2
162 2 #ifdef DEBUG_OSD
dPrintf("__ForActionId[%d]:0x%x", (WORD)i, (WORD)MenuChild[i].Id);
#endif
165 2
166 2 if ( ( MenuChild[i].Id & 0x0f ) == tid )
167 2 return i;//break;
168 2 i = GetLowerMenuItem(MenuChild, i );
169 2 }
170 1
171 1 return i;
172 1 }
173 /*
174 BYTE GetTargetChild1( BYTE tid)
175 {
176 BYTE i;
177
178
C51 COMPILER V7.06 OSDMENU 02/21/2008 14:00:28 PAGE 4
179 if( MenuChild ) i = 0;
180 else i = NIL;
181
182
183 #ifdef DEBUG_OSD
184 dPrintf("\r\nTarget id:0x%x", (WORD)tid);
185 #endif
186
187 while( i != NIL ) {
188
189 #ifdef DEBUG_OSD
190 dPrintf("__ForActionId[%d]:0x%x", (WORD)i, (WORD)MenuChild[i]. PreFnId);
191 #endif
192
193 if ( ( MenuChild[i]. PreFnId & 0x0f ) == tid )
194 return i;//break;
195 i = GetLowerMenuItem( MenuChild, i );
196 }
197 return i;
198 }
199 */
200 //===============================================================================
201 //
202 // Display Information of the menu
203 //
204 //===============================================================================
205 CODE BYTE OSDInfoStr[][26]={
206 { "Input : " },
207 { "System : " },
208 { "H Freq : kHz " },
209 { "V Freq : Hz " },
210 { "F/W Rev: new " },
211 { "" }
212 };
213 #define OSD_INFO_SUB_X 9
214
215 void DisplayInfo_OSD(void)
216 {
217 1 BYTE i, title=1, len, inputs;
218 1 BYTE mstr[5];
219 1
220 1 pushMenu();
221 1 MenuTitle = MenuChild;
222 1 title_item = cursor_item;
223 1
224 1 OSDMenuLevel++;
225 1
226 1 MenuChild = 0;
227 1 cursor_item = NIL;
228 1
229 1 DrawMenulist(1); // Display Title
230 1
231 1 DrawAttrCnt(OSDMENU_SUBADDR+MENU_WIDTH, OSD_INFO_COLOR, 5*MENU_WIDTH ); // Line 1 ~ Line 5
232 1 for(i=0; OSDInfoStr[i][0]; i++)
233 1 WriteStringToAddr(OSDMENU_SUBADDR+MENU_WIDTH*(i+title), OSDInfoStr[i], MENU_WIDTH );
234 1
235 1 // Display Input
236 1 inputs = GetInputSelection();
237 1 for (i=1; ;i++)
238 1 if( struct_InputSelection[i].Id==inputs ) break;
239 1 len=strlen(struct_InputSelection[i].Name);
240 1 WriteStringToAddr(OSDMENU_SUBADDR+MENU_WIDTH*(0+title)+OSD_INFO_SUB_X, struct_InputSelection[i].Name, len
C51 COMPILER V7.06 OSDMENU 02/21/2008 14:00:28 PAGE 5
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?