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