📄 1574main.lst
字号:
C51 COMPILER V7.02b 1574MAIN 05/24/2006 17:59:21 PAGE 1
C51 COMPILER V7.02b, COMPILATION OF MODULE 1574MAIN
OBJECT MODULE PLACED IN .\1574Main.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE ..\source\1574Main.c LARGE BROWSE DEBUG OBJECTEXTEND PRINT(.\1574Main.lst)
-OBJECT(.\1574Main.obj)
stmt level source
1 #include "..\inc\public2.h"
2 #include <string.h>
3 #define RX_PARSE 0x80 //pack data ready, wait process Parse routine
4
5 #define ENTER 0x1E //pressed key then pull low
6 #define UP 0x1B
7 #define DOWN 0x17
8 #define MENU 0x0F
9
10 #define WR_CVD1_BYTE 14
11 #define L44_WRID 0x28
12 #define SEL_OSDDISPCODE 0x02
13
14 extern code unsigned char CVD1_NTSCTab[WR_CVD1_BYTE*2];
15 extern code unsigned char CVD1_PALMTab[WR_CVD1_BYTE*2];
16 extern code unsigned char CVD1_PALTab[WR_CVD1_BYTE*2];
17 extern code unsigned char CVD1_SECAMTab[WR_CVD1_BYTE*2];
18 code unsigned char GAMMATAL[]=
19 {
20 // GAMMA TABLE
21 // 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
22 0x00,0x00,0x00,0x06,0x06,0x06,0x0F,0x0F,0x0F,0x18,0x18,0x18,0x20,0x20,0x20,0x26, // 0x0000
23 0x26,0x26,0x2D,0x2D,0x2D,0x35,0x35,0x35,0x3B,0x3B,0x3B,0x41,0x41,0x41,0x46,0x46, // 0x0010
24 0x46,0x4B,0x4B,0x4B,0x50,0x50,0x50,0x55,0x55,0x55,0x59,0x59,0x59,0x5C,0x5C,0x5C, // 0x0020
25 0x60,0x60,0x60,0x63,0x63,0x63,0x66,0x66,0x66,0x6A,0x6A,0x6A,0x6C,0x6C,0x6C,0x6E, // 0x0030
26 0x6E,0x6E,0x6F,0x6F,0x6F,0x71,0x71,0x71,0x72,0x72,0x72,0x75,0x75,0x75,0x77,0x77, // 0x0040
27 0x77,0x78,0x78,0x78,0x7A,0x7A,0x7A,0x7A,0x7A,0x7A,0x7B,0x7B,0x7B,0x7C,0x7C,0x7C, // 0x0050
28 0x7D,0x7D,0x7D,0x7E,0x7E,0x7E,0x7E,0x7E,0x7E,0x80,0x80,0x80,0x81,0x81,0x81,0x81, // 0x0060
29 0x81,0x81,0x81,0x81,0x81,0x82,0x82,0x82,0x81,0x81,0x81,0x82,0x82,0x82,0x81,0x81, // 0x0070
30 0x81,0x81,0x81,0x81,0x82,0x82,0x82,0x81,0x81,0x81,0x82,0x82,0x82,0x83,0x83,0x83, // 0x0080
31 0x81,0x81,0x81,0x82,0x82,0x82,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x82,0x82,0x81, // 0x0090
32 0x81,0x81,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x81,0x81,0x81,0x81,0x81, // 0x00A0
33 0x81,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x82,0x82,0x81,0x81,0x81,0x82,0x82,0x82, // 0x00B0
34 0x83,0x83,0x83,0x84,0x84,0x84,0x85,0x85,0x85,0x84,0x84,0x84,0x84,0x84,0x84,0x84, // 0x00C0
35 0x84,0x84,0x84,0x84,0x84,0x87,0x87,0x87,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86, // 0x00D0
36 0x86,0x87,0x87,0x87,0x88,0x88,0x88,0x86,0x86,0x86,0x88,0x88,0x88,0x89,0x89,0x89, // 0x00E0
37 0x89,0x89,0x89,0x8A,0x8A,0x8A,0x8A,0x8A,0x8A,0x8B,0x8B,0x8B,0x8B,0x8B,0x8B,0x8D, // 0x00F0
38 0x8D,0x8D,0x8C,0x8C,0x8C,0x8D,0x8D,0x8D,0x8E,0x8E,0x8E,0x8F,0x8F,0x8F,0x90,0x90, // 0x0100
39 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x91,0x91,0x91,0x91,0x91,0x91,0x94,0x94,0x94, // 0x0110
40 0x94,0x94,0x94,0x93,0x93,0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 0xD3,0xD3,0xD3,0xD3,0xD3,0xD3,0xD3,0xD4,0xD4,0xD4,0xD6,0xD6,0xD6,0xD6,0xD6,0xD6, // 0x0290
64 0xD7,0xD7,0xD7,0xD7,0xD7,0xD7,0xD8,0xD8,0xD8,0xD9,0xD9,0xD9,0xDA,0xDA,0xDA,0xDA, // 0x02A0
65 0xDA,0xDA,0xDC,0xDC,0xDC,0xDD,0xDD,0xDD,0xDE,0xDE,0xDE,0xDE,0xDE,0xDE,0xE0,0xE0, // 0x02B0
66 0xE0,0xE1,0xE1,0xE1,0xE1,0xE1,0xE1,0xE3,0xE3,0xE3,0xE5,0xE5,0xE5,0xE6,0xE6,0xE6, // 0x02C0
67 0xE7,0xE7,0xE7,0xE9,0xE9,0xE9,0xEB,0xEB,0xEB,0xEA,0xEA,0xEA,0xEC,0xEC,0xEC,0xEE, // 0x02D0
68 0xEE,0xEE,0xEF,0xEF,0xEF,0xF1,0xF1,0xF1,0xF2,0xF2,0xF2,0xF4,0xF4,0xF4,0xF6,0xF6, // 0x02E0
69 0xF6,0xF7,0xF7,0xF7,0xFA,0xFA,0xFA,0xFA,0xFA,0xFA,0xFC,0xFC,0xFC,0xFF,0xFF,0xFF, // 0x02F0
70
71 };
72
73 code unsigned char GAMMATAL2[]=
74 {
75 // GAMMA TABLE
76 // 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
77 0x00,0x00,0x00,0x03,0x03,0x03,0x09,0x09,0x09,0x0E,0x0E,0x0E,0x13,0x13,0x13,0x17, // 0x0000
78 0x17,0x17,0x1B,0x1B,0x1B,0x21,0x21,0x21,0x24,0x24,0x24,0x28,0x28,0x28,0x2B,0x2B, // 0x0010
79 0x2B,0x2E,0x2E,0x2E,0x31,0x31,0x31,0x34,0x34,0x34,0x37,0x37,0x37,0x3A,0x3A,0x3A, // 0x0020
80 0x3C,0x3C,0x3C,0x3E,0x3E,0x3E,0x40,0x40,0x40,0x41,0x41,0x41,0x45,0x45,0x45,0x45, // 0x0030
81 0x45,0x45,0x46,0x46,0x46,0x49,0x49,0x49,0x4A,0x4A,0x4A,0x4B,0x4B,0x4B,0x4B,0x4B, // 0x0040
82 0x4B,0x4F,0x4F,0x4F,0x4F,0x4F,0x4F,0x51,0x51,0x51,0x51,0x51,0x51,0x53,0x53,0x53, // 0x0050
83 0x54,0x54,0x54,0x56,0x56,0x56,0x57,0x57,0x57,0x58,0x58,0x58,0x5A,0x5A,0x5A,0x5A, // 0x0060
84 0x5A,0x5A,0x5B,0x5B,0x5B,0x5B,0x5B,0x5B,0x5C,0x5C,0x5C,0x5D,0x5D,0x5D,0x5D,0x5D, // 0x0070
85 0x5D,0x5F,0x5F,0x5F,0x5F,0x5F,0x5F,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x62,0x62, // 0x0080
86 0x61,0x61,0x61,0x62,0x62,0x62,0x63,0x63,0x63,0x63,0x63,0x63,0x64,0x64,0x64,0x65, // 0x0090
87 0x65,0x65,0x66,0x66,0x66,0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x67,0x69,0x69, // 0x00A0
88 0x69,0x6A,0x6A,0x6A,0x6B,0x6B,0x6B,0x6A,0x6A,0x6A,0x6C,0x6C,0x6C,0x6D,0x6D,0x6D, // 0x00B0
89 0x6E,0x6E,0x6E,0x6D,0x6D,0x6D,0x71,0x71,0x71,0x6F,0x6F,0x6F,0x70,0x70,0x70,0x71, // 0x00C0
90 0x71,0x71,0x70,0x70,0x70,0x72,0x72,0x72,0x71,0x71,0x71,0x74,0x74,0x74,0x74,0x74, // 0x00D0
91 0x74,0x74,0x74,0x74,0x75,0x75,0x75,0x74,0x74,0x74,0x77,0x77,0x77,0x77,0x77,0x77, // 0x00E0
92 0x78,0x78,0x78,0x78,0x78,0x78,0x79,0x79,0x79,0x79,0x79,0x79,0x79,0x79,0x79,0x79, // 0x00F0
93 0x79,0x79,0x7B,0x7B,0x7B,0x7D,0x7D,0x7D,0x7C,0x7C,0x7C,0x7B,0x7B,0x7B,0x7D,0x7D, // 0x0100
94 0x7D,0x7D,0x7D,0x7D,0x7F,0x7F,0x7F,0x7D,0x7D,0x7D,0x7E,0x7E,0x7E,0x7F,0x7F,0x7F, // 0x0110
95 0x7F,0x7F,0x7F,0x80,0x80,0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x7F, // 0x0120
96 0x7F,0x7F,0x7F,0x7F,0x7F,0x80,0x80,0x80,0x81,0x81,0x81,0x83,0x83,0x83,0x82,0x82, // 0x0130
97 0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x83,0x83,0x83,0x83,0x83,0x83,0x84,0x84,0x84, // 0x0140
98 0x83,0x83,0x83,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x85,0x85,0x85,0x85, // 0x0150
99 0x85,0x85,0x84,0x84,0x84,0x85,0x85,0x85,0x85,0x85,0x85,0x85,0x85,0x85,0x86,0x86, // 0x0160
100 0x86,0x85,0x85,0x85,0x85,0x85,0x85,0x87,0x87,0x87,0x86,0x86,0x86,0x86,0x86,0x86, // 0x0170
101 0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86, // 0x0180
102 0x86,0x86,0x87,0x87,0x87,0x88,0x88,0x88,0x87,0x87,0x87,0x87,0x87,0x87,0x89,0x89, // 0x0190
103 0x89,0x88,0x88,0x88,0x87,0x87,0x87,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88, // 0x01A0
104 0x88,0x88,0x88,0x89,0x89,0x89,0x89,0x89,0x89,0x8A,0x8A,0x8A,0x8A,0x8A,0x8A,0x89, // 0x01B0
105 0x89,0x89,0x89,0x89,0x89,0x8A,0x8A,0x8A,0x8B,0x8B,0x8B,0x8A,0x8A,0x8A,0x8C,0x8C, // 0x01C0
106 0x8C,0x8D,0x8D,0x8D,0x8C,0x8C,0x8C,0x8B,0x8B,0x8B,0x8D,0x8D,0x8D,0x8D,0x8D,0x8D, // 0x01D0
107 0x8E,0x8E,0x8E,0x8F,0x8F,0x8F,0x8E,0x8E,0x8E,0x8E,0x8E,0x8E,0x90,0x90,0x90,0x91, // 0x01E0
108 0x91,0x91,0x91,0x91,0x91,0x90,0x90,0x90,0x91,0x91,0x91,0x93,0x93,0x93,0x93,0x93, // 0x01F0
109 0x93,0x94,0x94,0x94,0x95,0x95,0x95,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96, // 0x0200
110 0x97,0x97,0x97,0x99,0x99,0x99,0x9A,0x9A,0x9A,0x99,0x99,0x99,0x9A,0x9A,0x9A,0x9A, // 0x0210
111 0x9A,0x9A,0x9C,0x9C,0x9C,0x9D,0x9D,0x9D,0xA0,0xA0,0xA0,0x9F,0x9F,0x9F,0xA0,0xA0, // 0x0220
112 0xA0,0xA1,0xA1,0xA1,0xA1,0xA1,0xA1,0xA3,0xA3,0xA3,0xA3,0xA3,0xA3,0xA6,0xA6,0xA6, // 0x0230
113 0xA5,0xA5,0xA5,0xA6,0xA6,0xA6,0xA7,0xA7,0xA7,0xA7,0xA7,0xA7,0xA8,0xA8,0xA8,0xAA, // 0x0240
114 0xAA,0xAA,0xAB,0xAB,0xAB,0xAD,0xAD,0xAD,0xAE,0xAE,0xAE,0xAE,0xAE,0xAE,0xAF,0xAF, // 0x0250
115 0xAF,0xB0,0xB0,0xB0,0xB1,0xB1,0xB1,0xB2,0xB2,0xB2,0xB4,0xB4,0xB4,0xB5,0xB5,0xB5, // 0x0260
116 0xB4,0xB4,0xB4,0xB6,0xB6,0xB6,0xB8,0xB8,0xB8,0xBA,0xBA,0xBA,0xBA,0xBA,0xBA,0xB9, // 0x0270
C51 COMPILER V7.02b 1574MAIN 05/24/2006 17:59:21 PAGE 3
117 0xB9,0xB9,0xBC,0xBC,0xBC,0xBC,0xBC,0xBC,0xBD,0xBD,0xBD,0xBE,0xBE,0xBE,0xC0,0xC0, // 0x0280
118 0xC0,0xBF,0xBF,0xBF,0xC2,0xC2,0xC2,0xC2,0xC2,0xC2,0xC3,0xC3,0xC3,0xC6,0xC6,0xC6, // 0x0290
119 0xC5,0xC5,0xC5,0xC5,0xC5,0xC5,0xC8,0xC8,0xC8,0xCA,0xCA,0xCA,0xCA,0xCA,0xCA,0xCB, // 0x02A0
120 0xCB,0xCB,0xCD,0xCD,0xCD,0xCE,0xCE,0xCE,0xCE,0xCE,0xCE,0xCF,0xCF,0xCF,0xD0,0xD0, // 0x02B0
121 0xD0,0xD3,0xD3,0xD3,0xD3,0xD3,0xD3,0xD6,0xD6,0xD6,0xD8,0xD8,0xD8,0xD9,0xD9,0xD9, // 0x02C0
122 0xD9,0xD9,0xD9,0xDA,0xDA,0xDA,0xDD,0xDD,0xDD,0xE1,0xE1,0xE1,0xE0,0xE0,0xE0,0xE3, // 0x02D0
123 0xE3,0xE3,0xE6,0xE6,0xE6,0xE7,0xE7,0xE7,0xEB,0xEB,0xEB,0xEB,0xEB,0xEB,0xF0,0xF0, // 0x02E0
124 0xF0,0xF2,0xF2,0xF2,0xF5,0xF5,0xF5,0xF8,0xF8,0xF8,0xFB,0xFB,0xFB,0xFF,0xFF,0xFF, // 0x02F0
125
126 };
127 extern BYTE CVD1_ReadWrite(BYTE, BYTE, BYTE);
128 extern xdata BYTE CBSH_Value[8];
129
130 extern void Adj_CBSH(void);
131 extern void All_Init(void);
132 extern void OSD_ShowTitle(char *, char);
133 extern void Write_OSDReg(BYTE [], BYTE, BYTE, BYTE);
134 extern void Adj_DisplayMode(char);
135
136 extern int T0_0Interval;
137 extern BYTE T0_0Service; //Timer 0 service Var.
138
139 //--- Function Prototype Define ----------------
140 BYTE WaitKey(void);
141
142 BYTE NTSC_PAL;
143 //===========================================================================
144 //===========================================================================
145 void main(void)
146 {
147 1 BYTE key, dig_cvd, show_type,i;
148 1 unsigned int j;
149 1 BYTE set_times;//cdv_3Astatus, cdv_3Cstatus,
150 1 BYTE ch_type[14], dig_str[14];
151 1 SHDN_L5V=0;
152 1 SHDN_VGL=1;
153 1 All_Init(); //Init. all of IC Reg. and Variable
154 1 // There are include 8051, 15xx and TV-Decoder
155 1
156 1 strcpy(ch_type, "VIDEO 3 NTSC ");
157 1 strcpy(dig_str, "DIGITAL ");
158 1
159 1 NTSC_PAL = 0; //default NTSC mode
160 1 dig_cvd = 0; //flag for switch CCIR or CVD1 CH#1, 2, 3
161 1 set_times = 0;
162 1 show_type = 0;
163 1 OSD_ShowTitle(ch_type, 13);
164 1 ////////for test
165 1 CVD1_ReadWrite(0x01, 0x90, 0x80);//for av port3
166 1
167 1 dig_cvd = 1;
168 1 // I2C_WriteByte(L44_WRID, 0x00, 0x50); //Switch to CCIR 601
169 1 I2C_WriteByte(L44_WRID, 0x00, 0x80); //Switch to CCIR 656
170 1 strcpy(ch_type, "CCIR601 NTSC ");
171 1 OSD_ShowTitle(ch_type, 13);
172 1 I2C_WriteByte(L44_WRID, 0x11, 0xF4); //access gamma table
173 1 for(j=0; j<768; j++)
174 1 {
175 2 i= GAMMATAL2[j];
176 2 I2C_WriteByte(L44_WRID, 0x1B, i); //R
177 2
178 2 }
C51 COMPILER V7.02b 1574MAIN 05/24/2006 17:59:21 PAGE 4
179 1 I2C_WriteByte(L44_WRID, 0x11, 0xFa); //enable gamma table
180 1 while(1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -