Mercurial > mplayer.hg
comparison TVout/fbset/modes.y @ 1:3b5f5d1c5041
Initial revision
author | arpi_esp |
---|---|
date | Sat, 24 Feb 2001 20:28:24 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:c1bb2c071d63 | 1:3b5f5d1c5041 |
---|---|
1 /* | |
2 * Linux Frame Buffer Device Configuration | |
3 * | |
4 * © Copyright 1995-1998 by Geert Uytterhoeven | |
5 * (Geert.Uytterhoeven@cs.kuleuven.ac.be) | |
6 * | |
7 * -------------------------------------------------------------------------- | |
8 * | |
9 * This file is subject to the terms and conditions of the GNU General Public | |
10 * License. See the file COPYING in the main directory of the Linux | |
11 * distribution for more details. | |
12 */ | |
13 | |
14 | |
15 %{ | |
16 | |
17 #define YYSTYPE long | |
18 | |
19 #include <stdio.h> | |
20 #include <stdlib.h> | |
21 #include <string.h> | |
22 | |
23 #include "fb.h" | |
24 #include "fbset.h" | |
25 | |
26 extern int yylex(void); | |
27 extern void yyerror(const char *s); | |
28 extern int line; | |
29 | |
30 | |
31 static struct VideoMode VideoMode; | |
32 | |
33 static void ClearVideoMode(void) | |
34 { | |
35 memset(&VideoMode, 0, sizeof(VideoMode)); | |
36 VideoMode.accel_flags = FB_ACCELF_TEXT; | |
37 } | |
38 | |
39 %} | |
40 | |
41 %start file | |
42 | |
43 %token MODE GEOMETRY TIMINGS HSYNC VSYNC CSYNC GSYNC EXTSYNC BCAST LACED DOUBLE | |
44 RGBA NONSTD ACCEL GRAYSCALE | |
45 ENDMODE POLARITY BOOLEAN STRING NUMBER | |
46 | |
47 %% | |
48 | |
49 file : vmodes | |
50 ; | |
51 | |
52 | |
53 vmodes : /* empty */ | |
54 | vmodes vmode | |
55 ; | |
56 | |
57 vmode : MODE STRING geometry timings options ENDMODE | |
58 { | |
59 VideoMode.name = (const char *)$2; | |
60 AddVideoMode(&VideoMode); | |
61 ClearVideoMode(); | |
62 } | |
63 ; | |
64 | |
65 geometry : GEOMETRY NUMBER NUMBER NUMBER NUMBER NUMBER | |
66 { | |
67 ClearVideoMode(); | |
68 VideoMode.xres = $2; | |
69 VideoMode.yres = $3; | |
70 VideoMode.vxres = $4; | |
71 VideoMode.vyres = $5; | |
72 VideoMode.depth = $6; | |
73 } | |
74 ; | |
75 | |
76 timings : TIMINGS NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER | |
77 { | |
78 VideoMode.pixclock = $2; | |
79 VideoMode.left = $3; | |
80 VideoMode.right = $4; | |
81 VideoMode.upper = $5; | |
82 VideoMode.lower = $6; | |
83 VideoMode.hslen = $7; | |
84 VideoMode.vslen = $8; | |
85 } | |
86 ; | |
87 | |
88 options : /* empty */ | |
89 | options hsync | |
90 | options vsync | |
91 | options csync | |
92 | options gsync | |
93 | options extsync | |
94 | options bcast | |
95 | options laced | |
96 | options double | |
97 | options rgba | |
98 | options nonstd | |
99 | options accel | |
100 | options grayscale | |
101 ; | |
102 | |
103 hsync : HSYNC POLARITY | |
104 { | |
105 VideoMode.hsync = $2; | |
106 } | |
107 ; | |
108 | |
109 vsync : VSYNC POLARITY | |
110 { | |
111 VideoMode.vsync = $2; | |
112 } | |
113 ; | |
114 | |
115 csync : CSYNC POLARITY | |
116 { | |
117 VideoMode.csync = $2; | |
118 } | |
119 ; | |
120 | |
121 gsync : GSYNC POLARITY | |
122 { | |
123 VideoMode.gsync = $2; | |
124 } | |
125 ; | |
126 | |
127 extsync : EXTSYNC BOOLEAN | |
128 { | |
129 VideoMode.extsync = $2; | |
130 } | |
131 ; | |
132 | |
133 bcast : BCAST BOOLEAN | |
134 { | |
135 VideoMode.bcast = $2; | |
136 } | |
137 ; | |
138 | |
139 laced : LACED BOOLEAN | |
140 { | |
141 VideoMode.laced = $2; | |
142 } | |
143 ; | |
144 | |
145 double : DOUBLE BOOLEAN | |
146 { | |
147 VideoMode.dblscan = $2; | |
148 } | |
149 ; | |
150 | |
151 rgba : RGBA STRING | |
152 { | |
153 makeRGBA(&VideoMode, (const char*)$2); | |
154 } | |
155 ; | |
156 | |
157 nonstd : NONSTD NUMBER | |
158 { | |
159 VideoMode.nonstd = $2; | |
160 } | |
161 ; | |
162 | |
163 accel : ACCEL BOOLEAN | |
164 { | |
165 VideoMode.accel_flags = $2; | |
166 } | |
167 ; | |
168 | |
169 grayscale : GRAYSCALE BOOLEAN | |
170 { | |
171 VideoMode.grayscale = $2; | |
172 } | |
173 ; | |
174 | |
175 %% |