📄 osd.lst
字号:
C51 COMPILER V7.09 OSD 09/06/2006 13:39:48 PAGE 1
C51 COMPILER V7.09, COMPILATION OF MODULE OSD
OBJECT MODULE PLACED IN ..\OUTPUT\OSD.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE ..\code\OSD.C LARGE ROM(COMPACT) BROWSE DEBUG OBJECTEXTEND PRINT(.\OSD.lst)
- OBJECT(..\OUTPUT\OSD.obj)
line level source
1 #include "global.h"
2 #include "font.h"
3 #include "menu.h"
4
5 BYTE MenuFlagState;
6 code BYTE HexTab[16] = {_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _A, _B, _C, _D, _E, _F};
7 code BYTE SStr1[]= {_A,_V,_1,0x77};
8 code BYTE SStr2[]= {_A,_V,_2,0x77};
9 code BYTE NTSCStr[]= {_N,_T,_S,_C};
10 code BYTE PALStr[]= {_P,_A,_L,__};
11
12 //#ifdef MTV230
13 void ClearMenu()
14 {
15 1 EnableOSDRAMClr();
16 1 DoWait(2);
17 1 DisableOSDRAMClr();
18 1 //EnableOSD();
19 1
20 1 }
21
22 void ClearRow(BYTE row,BYTE startcol,BYTE num)
23 {
24 1 BYTE i;
25 1
26 1 byMTV_OSDRA=row |Address;
27 1 byMTV_OSDCA=startcol;
28 1 for (i=0;i< num;i++)
29 1 byMTV_OSDDT0= __;
30 1 }
31
32 void SetBGColor(BYTE StartX,BYTE StartY,BYTE num,BYTE color)
33 {
34 1 BYTE i;
35 1
36 1 byMTV_OSDRA=StartY|Attribute;
37 1 byMTV_OSDCA=StartX;
38 1 for(i=0;i< (num*2);i++)
39 1 byMTV_OSDDT0= color;//0x12;
40 1 }
41
42 void ShowSubMenu(BYTE menuvlaue)
43 {
44 1 BYTE i;
45 1
46 1 gotoxy(19,MainPageYStart+1);
47 1 PrintByteString(MOD_Item,4,0x32); //0x62 :BG Yellow, color :green
48 1 gotoxy(19,MainPageYStart+2);
49 1 PrintByteString(MENU_Item,4,0x32);
50 1 gotoxy(19,MainPageYStart+3);
51 1 PrintByteString(UP_Item,4,0x32);
52 1 gotoxy(19,MainPageYStart+4);
53 1 PrintByteString(DOWN_Item,4,0x32);
54 1
C51 COMPILER V7.09 OSD 09/06/2006 13:39:48 PAGE 2
55 1 switch (menuvlaue)
56 1 {//0x62 :BG Yellow, color :green
57 2 case 0:
58 2 byMTV_OSDRA=(MainPageYStart+1) |Attribute; break;
59 2 case 1:
60 2 byMTV_OSDRA=(MainPageYStart+2) |Attribute; break;
61 2 case 2:
62 2 byMTV_OSDRA=(MainPageYStart+3) |Attribute; break;
63 2 case 3:
64 2 byMTV_OSDRA=(MainPageYStart+4) |Attribute; break;
65 2 }
66 1 byMTV_OSDCA=22;
67 1 for(i=0;i< 4;i++)
68 1 byMTV_OSDDT0= 0x12;
69 1
70 1 }
71 void OpenWindow(BYTE win_no, BYTE start_x, BYTE start_y, BYTE end_x, BYTE end_y, BYTE color)
72 {
73 1 BYTE i;
74 1 i = (win_no-1)*3; //window 1,2,3,4
75 1 byMTV_WinReg[i] = (start_y<<4)|end_y; //row start and end address
76 1 byMTV_WinReg[i+1] = (start_x<<3)|WEN; //column start address
77 1 byMTV_WinReg[i+2] = (end_x<<3)|color; // column end address and window color
78 1 }
79 void CloseWindow(BYTE win_no)
80 {
81 1 BYTE i;
82 1 i = (win_no-1)*3;
83 1 byMTV_WinReg[i+1] &= (~WEN);
84 1 }
85
86 void ClearAllWindow(void)
87 {
88 1 EnableOSDWinClr();
89 1 DoWait(5);
90 1 DisableOSDWinClr();
91 1 }
92
93 void gotoxy(BYTE x,BYTE y)
94 {
95 1 CursorX=x;
96 1 CursorY=y;
97 1 }
98 void SetDouble()
99 {
100 1 BYTE i;
101 1
102 1 for (i=0;i < 14;i++)
103 1 {
104 2 byMTV_OSDCA=30; //Colunm 30
105 2 byMTV_OSDRA= i ;
106 2 byMTV_OSDDT0= 0x01;
107 2 }
108 1
109 1 }
110
111 void DoubleWidthPrintString(BYTE *databuf,BYTE number,BYTE color)
112 {
113 1 BYTE i;
114 1
115 1 byMTV_OSDRA=CursorY|Address;
116 1
C51 COMPILER V7.09 OSD 09/06/2006 13:39:48 PAGE 3
117 1 for(i=0;i<number;i++)
118 1 {
119 2 byMTV_OSDCA=CursorX+i;
120 2
121 2 // if(databuf[i]>255)
122 2 // byM332OSDDT1= (BYTE)(databuf[i]);
123 2 // else
124 2 byMTV_OSDDT0= (BYTE)(databuf[i]);
125 2 Short_Delay(5);
126 2 }
127 1
128 1 // For double width
129 1 byMTV_OSDRA=CursorY|Address;
130 1 byMTV_OSDCA=30;
131 1 byMTV_OSDDT0 = 0x01;
132 1 Short_Delay(15);
133 1
134 1
135 1 byMTV_OSDRA=CursorY|Attribute;
136 1
137 1 for(i=0;i<number;i++)
138 1 {
139 2 byMTV_OSDCA=CursorX+i;
140 2
141 2 // if(databuf[i]>255)
142 2 // byM332OSDDT1= 0x00|color;
143 2 // else
144 2 byMTV_OSDDT0= 0x00|color;
145 2 }
146 1
147 1 }
148 void PrintString(BYTE *databuf,BYTE number,BYTE color)
149 {
150 1 BYTE i;
151 1
152 1 byMTV_OSDRA=CursorY|Address;
153 1
154 1 for(i=0;i<number;i++)
155 1 {
156 2 byMTV_OSDCA=CursorX+i;
157 2
158 2 // if(databuf[i]>255)
159 2 // byM332OSDDT1= (BYTE)(databuf[i]);
160 2 // else
161 2 byMTV_OSDDT0= (BYTE)(databuf[i]);
162 2 Short_Delay(5);
163 2 }
164 1
165 1 byMTV_OSDRA=CursorY|Attribute;
166 1
167 1 for(i=0;i<number;i++)
168 1 {
169 2 byMTV_OSDCA=CursorX+i;
170 2
171 2 // if(databuf[i]>255)
172 2 // byM332OSDDT1= 0x00|color;
173 2 // else
174 2 byMTV_OSDDT0= 0x00|color;
175 2 }
176 1
177 1 }
178 void PrintByteString(BYTE*databuf,BYTE number,BYTE color)
C51 COMPILER V7.09 OSD 09/06/2006 13:39:48 PAGE 4
179 {
180 1 BYTE i;
181 1
182 1 byMTV_OSDRA=CursorY|Address;
183 1
184 1 for(i=0;i<number;i++)
185 1 {
186 2 byMTV_OSDCA=CursorX+i;
187 2 byMTV_OSDDT0= (BYTE)(databuf[i]);
188 2 }
189 1
190 1 byMTV_OSDRA=CursorY|Attribute;
191 1
192 1 for(i=0;i<number;i++)
193 1 {
194 2 byMTV_OSDCA=CursorX+i;
195 2 byMTV_OSDDT0= 0x00|color;
196 2 }
197 1
198 1 }
199
200 void PrintChar(WORD chardata,BYTE color)
201 {
202 1 byMTV_OSDRA=CursorY;
203 1 byMTV_OSDCA=CursorX;
204 1 // if(chardata>255)
205 1 // byM332OSDDT1=(BYTE)chardata;
206 1 // else
207 1 byMTV_OSDDT0=(BYTE)chardata;
208 1
209 1 byMTV_OSDRA=CursorY|0x40;
210 1 byMTV_OSDCA=CursorX;
211 1 // if(chardata>255)
212 1 // byM332OSDDT1=0x00|color;
213 1 // else
214 1 byMTV_OSDDT0=0x00|color;
215 1
216 1 CursorX++;
217 1 }
218
219
220
221
222 void PrintHex(BYTE value, BYTE color)
223 {
224 1 PrintChar(HexTab[value/16], color);
225 1 PrintChar(HexTab[value%16], color);
226 1 }
227
228 void PrintValue(WORD value, BYTE color)
229 {
230 1 WORD Level;
231 1 BYTE i,Count;
232 1
233 1 Level=value;
234 1 //count digial num
235 1 for(Count=1;Count<5;Count++)
236 1 {
237 2 Level=Level/10;
238 2 if( Level==0 )
239 2 {
240 3 break;
C51 COMPILER V7.09 OSD 09/06/2006 13:39:48 PAGE 5
241 3 }
242 2 }
243 1
244 1 Level=1;
245 1 for(i=1;i<Count;i++)
246 1 {
247 2 Level=Level*10;
248 2 }
249 1
250 1 //clear
251 1 for(i=0;i<4;i++)
252 1 {
253 2 PrintChar(__, MainPageColor);
254 2 }
255 1 CursorX=CursorX-4;
256 1
257 1 //print value
258 1 for(i=0;i<4;i++)
259 1 {
260 2 if(Level==0)
261 2 {
262 3 break;
263 3 }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -