📄 devvd.lst
字号:
C51 COMPILER V8.18 DEVVD 09/29/2009 23:58:04 PAGE 1
C51 COMPILER V8.18, COMPILATION OF MODULE DEVVD
OBJECT MODULE PLACED IN ..\..\1out\DevVD.obj
COMPILER INVOKED BY: d:\Keil\C51\BIN\C51.EXE ..\..\tv\DevVD.c BROWSE INCDIR(..\..\inc) DEBUG OBJECTEXTEND PRINT(..\..\1o
-ut\DevVD.lst) OBJECT(..\..\1out\DevVD.obj)
line level source
1
2 #define _DEVVD_C_
3
4 #include <math.h>
5 #include "types.h"
6 #include "ms_reg.h"
7 #include "board.h"
8 #include "global.h"
9 #include "DEBUG.h"
10 #include "ms_rwreg.h"
11 #include "misc.h"
12 #include "userpref.h"
13 #include "power.h"
14 #include "panel.h"
15 #include "mstar.h"
16 #include "tv.h"
17 #include "DevVD.h"
18 #include "DEVTuner.h"
19 #include "adjust.h"
20 #include "DevVD_User.h"
21 #include "menu.h"
22 #include "menuFunc.h"
23 #include "Maria2_FSC_Lib.h"
24 #include "Maria2_ACC_Lib.h"
25 #include "M2_VD_Std_Lib.h"
26 #include "M2_VD_AGC_Lib.h"
27
28 #if(ENABLE_VD_DSP)
29 #include "Maria2_dsp_lib.h"
30 #endif
31
32 void vdInitVariable(void)
33 {
34 1 g_ucmsVDCtl = MSVD_CTL_FLAG_DSP_STD
35 1 //|MSVD_CTL_FLAG_FSC_DETECT
36 1 //|MSVD_CTL_FLAG_ACC
37 1 |MSVD_CTL_FLAG_COLOR_BURST_HANDLER
38 1 |MSVD_CTL_FLAG_NOISE_HANDLER
39 1 |MSVD_CTL_FLAG_COMB_LINE_BUF
40 1 |MSVD_CTL_FLAG_VSYNC
41 1 |MSVD_CTL_FLAG_COMB_HANDLER
42 1 ;
43 1
44 1
45 1 g_ucmsVDCtl2 = 0
46 1 |MSVD_CTL2_FLAG_AGC_MONITOR
47 1 |MSVD_CTL2_FLAG_AGC_PROCESSOR
48 1 #if(ENABLE_VCR_HANDLER)
|MSVD_CTL2_FLAG_VCR
#endif
51 1 |MSVD_CTL2_FLAG_SECAM
52 1 |MSVD_CTL2_FLAG_HSYNC
53 1 |MSVD_CTL2_FLAG_PATCH5
54 1 |MSVD_CTL2_FLAG_PAL_SWITCH
C51 COMPILER V8.18 DEVVD 09/29/2009 23:58:04 PAGE 2
55 1 |MSVD_CTL2_FLAG_AFEC
56 1 ;
57 1
58 1
59 1 g_ucMSVDDebug = 0;
60 1 g_ucMSVDDebug2 = 0;
61 1
62 1 g_VdInfo.wVideoStatus = VD_RESET_ON;
63 1 g_VdInfo.ucVideoSystem = SIG_NONE;
64 1 g_VdInfo.ucVideoStableCounter = 0;
65 1 g_VdInfo.ucVideoPollingCounter = 0;
66 1 g_VdInfo.bVideoDoModeSetting = FALSE;
67 1 #ifdef VD_PATCH_002
68 1 g_msVD_Patch002_LastVideoSystem = 0xFF;
69 1 #endif
70 1
71 1 #ifdef VD_PATCH_003
72 1 msVD_Patch_003(0);
73 1 #endif
74 1
75 1 #ifdef msVD_Patch_005
msVD_Patch_005(100);
#endif
78 1 VD_Vsync_Set656VPosition( DSP_656_F_TGL_1_VAL, 0x09, DSP_656_V_CLR_1_VAL );
79 1
80 1 msDSP_Std_Init();
81 1 msVD_FSC_Init();
82 1
83 1 msVD_FSC_SetNoiseModeLevel( 12, 13);
84 1 msVD_FSC_SetColorKillNoise( 0xC0, 0xD0 );
85 1 msVD_FSC_SetColorKillLevel( 0x23, 0x18, 0x50, 0x60 );
86 1
87 1 msVDAcc_Ctl( 1 );
88 1 msVDAcc_Init();
89 1
90 1 g_uwVideoAGC=(WORD)(g_VideoSetting.videoAGC<<8);
91 1 g_ucLastVideoAGC=g_VideoSetting.videoAGC;
92 1 g_ucVideoAGCCount=0;
93 1 VD_AGC_Init();
94 1 VD_AGC_SetStartGain(g_uwVideoAGC);
95 1 VD_AGC_SetNoSyncGain(g_uwVideoAGC);
96 1 VD_AGC_SetMaxGain(0x2f00);
97 1
98 1 // for dsp 20060311 only, not mature yet
99 1 SetVthreshold(0x20);
100 1
101 1 msVDForceSystem( VD_FORCE_AUTO );
102 1
103 1 #if( ENABLE_SECAM )
104 1 g_dwVDSecamHandler_PreMagThl = 0;
105 1 g_wVDSecamHandler_PreNoiseMag = 0;
106 1 #endif
107 1
108 1 msVDNoiseHandlerInit();
109 1 g_ucOverScanH = VD_OVER_SCAN_H;
110 1 g_ucOverScanV = VD_OVER_SCAN_V;
111 1 g_ucAFECHnadler_LaseDplSel = 0xff;
112 1 }
113
114
115 #if TV_ENABLE
116 void ResetupMode(void)
C51 COMPILER V8.18 DEVVD 09/29/2009 23:58:04 PAGE 3
117 {
118 1
119 1 g_VdInfo.wVideoStatus = msVDGetSyncStatus();
120 1
121 1 if( g_VdInfo.wVideoStatus&VD_VSYNC_50HZ ) // 50Hz
122 1 {
123 2 g_VdInfo.ucVideoSystem = SIG_PAL;
124 2 g_ucSrcModeIndex = MD_720x576_50I;
125 2 }
126 1 else // 60Hz
127 1 {
128 2 g_VdInfo.ucVideoSystem = SIG_NTSC;
129 2 g_ucSrcModeIndex = MD_720x480_60I;
130 2 }
131 1
132 1 g_InOutCtl.bInterlace = 1;
133 1
134 1 // Check signal type
135 1 if( IsVideoPortInUse())
136 1 {
137 2 g_VdInfo.ucVideoSystem = msVDGetVideoSystem( g_VdInfo.wVideoStatus );
138 2 msVDSetupMode( g_VdInfo.wVideoStatus, g_VdInfo.ucVideoSystem );
139 2 }
140 1
141 1 SetOutputTimingAndWindow( OUTPUT_SIG ); // TV auto scan: has signal
142 1 }
143 #endif
144
145
146 void vdMonitorInput(void)
147 {
148 1 WORD wCurSyncStatus; // video status
149 1 BYTE ucStableCounter;
150 1 BYTE ucNoiseMag;
151 1 if (!PowerOnFlag)
152 1 return;
153 1
154 1 if( g_VdInfo.ucVideoPollingCounter )
155 1 return;
156 1 g_VdInfo.ucVideoPollingCounter = 20; // reset counter
157 1
158 1 if (g_bInputTimingChangeFlag)
159 1 {
160 2 g_VdInfo.wVideoStatus = VD_RESET_ON;
161 2 Clr_InputTimingChangeFlag();
162 2 }
163 1
164 1 wCurSyncStatus = msVDGetSyncStatus();
165 1 if( (wCurSyncStatus&VD_MODE_DETECT_MASK) != (g_VdInfo.wVideoStatus&VD_MODE_DETECT_MASK) )// Sync chan
-ge
166 1 {
167 2 //ucNoiseMag = msVDGetCurNoiseMag();
168 2 ucNoiseMag = msDSP_Std_GetNoiseMag();
169 2 if( IsAVInUse()||IsSVideoInUse() )
170 2 {
171 3 //if( (wCurSyncStatus&(VD_FSC_TYPE|VD_PAL_SWITCH|VD_VSYNC_50HZ)) != (g_VdInfo.wVideoStatus
-&(VD_FSC_TYPE|VD_PAL_SWITCH|VD_VSYNC_50HZ)) )
172 3 if( ( ((wCurSyncStatus&(VD_FSC_TYPE|VD_PAL_SWITCH)) != (g_VdInfo.wVideoStatus&(VD_FSC_TYPE
-|VD_PAL_SWITCH)))&&(ucNoiseMag<0x50) )
173 3 ||( (wCurSyncStatus&(VD_VSYNC_50HZ)) != (g_VdInfo.wVideoStatus&(VD_VSYNC_50HZ)) )
174 3 ||( (wCurSyncStatus&(VD_HSYNC_LOCKED)) != (g_VdInfo.wVideoStatus&(VD_HSYNC_LOCKED)) )
175 3 )
C51 COMPILER V8.18 DEVVD 09/29/2009 23:58:04 PAGE 4
176 3 {
177 4 msSetBlueScreen( _ENABLE, FR_BLACK);
178 4 g_VdInfo.wVideoStatus |= VD_RESET_ON;
179 4
180 4 if(!(wCurSyncStatus&VD_HSYNC_LOCKED))
181 4 msVDReset();
182 4 }
183 3 }
184 2
185 2 if( (wCurSyncStatus&VD_MODE_DETECT_MASK) == (g_wLastSyncStatus&VD_MODE_DETECT_MASK) )
186 2 {
187 3 if( g_VdInfo.ucVideoStableCounter < 0xff )
188 3 g_VdInfo.ucVideoStableCounter ++;
189 3
190 3 if( !(wCurSyncStatus&VD_HSYNC_LOCKED) )
191 3 ucStableCounter = VD_NO_INPUT_STABLE_COUNT;
192 3 else
193 3 ucStableCounter = VD_INPUT_STABLE_COUNT;
194 3
195 3 if( g_VdInfo.ucVideoStableCounter >= ucStableCounter )
196 3 {
197 4 //printf( "Video Status: %x\r\n", wCurSyncStatus );
198 4 g_VdInfo.wVideoStatus = wCurSyncStatus; // set flag
199 4 g_VdInfo.bVideoDoModeSetting = TRUE; // set mode flag
200 4
201 4 #ifdef VD_PATCH_002
202 4 msVD_Patch_002( msVDGetVideoSystem( wCurSyncStatus ) );
203 4 #endif
204 4 }
205 3 }
206 2 else // Current status != last status
207 2 {
208 3 g_VdInfo.ucVideoStableCounter = 0;
209 3 }
210 2 }
211 1 else // Current status == current global flag
212 1 {
213 2 g_VdInfo.ucVideoStableCounter = 0;
214 2 }
215 1
216 1 if(g_ucSyncMaxStableCounter)
217 1 {
218 2 if((--g_ucSyncMaxStableCounter)==0)
219 2 {
220 3 //printMsg("force turn on panel");
221 3 g_VdInfo.bVideoDoModeSetting = TRUE;
222 3 //g_VdInfo.wVideoStatus|=~VD_HSYNC_LOCKED;
223 3 g_VdInfo.ucVideoStableCounter = 0;
224 3 }
225 2 }
226 1
227 1 // Current status == system status
228 1 if( (wCurSyncStatus&VD_MODE_DETECT_MASK) == (g_VdInfo.wVideoStatus&VD_MODE_DETECT_MASK) )
229 1 {
230 2 // Polling input and doing something
231 2 if(wCurSyncStatus&VD_HSYNC_LOCKED)//&& IsSrcHasSignal())
232 2 {
233 3 msDetectInterlace(0); // Normal polling interlace
234 3 #if( ENABLE_MONITOR_SIGNAL )
235 3 msMonitorSignal(0); // Normal monitor input signal
236 3 #endif
237 3 }
C51 COMPILER V8.18 DEVVD 09/29/2009 23:58:04 PAGE 5
238 2 // Patch ...
239 2 // if( IsSrcUseInternalVD() ) // Status stable
240 2 {
241 3 #ifdef VD_PATCH_003
242 3 if( g_VdInfo.ucVideoSystem == SIG_NTSC )
243 3 msVD_Patch_003(1);
244 3 else
245 3 msVD_Patch_003(0);
246 3 #endif
247 3
248 3 #ifdef VD_PATCH_004
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -