10l: comparison of char* ptrs with string literals
[mplayer.git] / TOOLS / TVout / matroxtv
blob680877c49ba5dc500df1d60744b1aedd82086bdf
1 #!/bin/sh
3 # Gabucino - no warranty, this script can BOOM your TV and/or monitor, or else.
4 # v3.0
5 # This script has been tested and configured on a Matrox G400DH, a PAL TV,
6 # a 14" analog and a 15" digital monitor.
8 # INSTALLATION:
9 # 1. READ MPLAYER'S TVOUT DOCUMENTATION!
10 # 2. Choose proper mode at 'defaultmode', 'TVdefaultmode',
11 # and 'SetTVstandard' functions to fit your needs.
12 # You normally shouldn't touch anything else.
13 # 3. Remove 'exit 1' safety check.
16 function defaultmode {
17 # You can choose the mode to use in monitor-only mode
18 # 640x480 60Hz 32bpp (14" monitors)
19 fbset -a -xres 640 -yres 480 -vxres 640 -vyres 480 -depth 32 -pixclock 39721 -left 48 -right 16 -upper 33 -lower 10 -hslen 96 -vslen 2 -hsync high -accel true -laced false
20 # 768x576 60Hz 32bpp (14" monitors)
21 # fbset -a -xres 768 -yres 576 -vxres 768 -vyres 5460 -depth 32 -pixclock 26101 -left 144 -right 16 -upper 28 -lower 6 -hslen 112 -vslen 4 -accel true -laced false
22 # 800x600 76Hz 32bpp (15" monitors)
23 # fbset -a -xres 800 -yres 600 -vxres 800 -vyres 1440 -depth 32 -pixclock 20000 -left 128 -right 16 -upper 24 -lower 2 -hslen 96 -vslen 6 -laced false
24 # 1024x768 70Hz 32bpp (15" monitors)
25 # fbset -a -xres 1024 -yres 768 -vxres 1024 -vyres 1440 -depth 32 -pixclock 12500 -left 144 -right 32 -upper 30 -lower 2 -hslen 192 -vslen 6 -laced false
28 function TVdefaultmode {
31 ## PAL modes
34 # 640x512 80Hz 32bpp
35 fbset -fb $1 -a -depth 32 -left 60 -right 0 -upper 70 -lower 39 -hslen 76 -vslen 4 -xres 640 -yres 512 -bcast true -laced false
36 # 640x528 83Hz 32bpp
37 # fbset -fb $1 -a -depth 32 -left 40 -right 0 -upper 63 -lower 29 -hslen 56 -vslen 4 -xres 640 -yres 528 -vxres 640 -vyres 528 -laced false -bcast true
38 # 720x576 78Hz 32bpp
39 # fbset -fb $1 -a -depth 32 -left 54 -right -36 -upper 55 -lower -6 -hslen 46 -vslen 4 -xres 720 -yres 576 -vxres 720 -vyres 576 -laced false -bcast true
42 ## NTSC modes
45 # 640x240 non-interlaced 32bpp
46 # fbset -fb $1 -a -depth 32 -xres 640 -yres 240 -vxres 640 -vyres 240 -pixclock 79443 -left 72 -right 40 -upper 15 -lower 5 -hslen 48 -vslen 3 -laced false
47 # 640x480 interlaced 32bpp
48 # fbset -fb $1 -a -depth 32 -xres 640 -yres 480 -vxres 640 -vyres 480 -pixclock 79443 -left 72 -right 40 -upper 30 -lower 10 -hslen 48 -vslen 5 -laced true
51 function SetTVstandard {
52 matroxset 1 # PAL
53 # matroxset 2 # NTSC
56 function SetMonitorMode {
57 matroxset 128
60 function mappingreset {
61 matroxset -f /dev/fb0 -m 0
62 matroxset -f /dev/fb1 -m 0
63 matroxset -f /dev/fb0 -m 1
64 con2fb /dev/fb0 /dev/tty1
65 con2fb /dev/fb0 /dev/tty2
66 SetMonitorMode
67 defaultmode
70 function warn {
71 clear
72 echo "tty2 will be automatically transferred to fb1 using the con2fb utility."
73 echo
74 echo
75 echo "A big \"1\" letter will be displayed on tty1 after the change."
76 echo "A big \"2\" letter will be displayed on tty2 after the change."
77 echo
78 echo
79 echo "If you read this, PRESS ANY KEY TO CONTINUE"
80 read
83 function warn2 {
84 id1 > /dev/tty1 &
85 id2 > /dev/tty2 &
88 function id1 {
89 sleep 1
90 clear
91 echo
92 echo
93 echo
94 echo
95 echo
96 echo
97 echo
98 echo
99 echo
100 echo
101 echo
102 echo " ****"
103 echo " *****"
104 echo " ******"
105 echo " *******"
106 echo " ***"
107 echo " ***"
108 echo " ***"
109 echo " ***"
110 echo " ***"
111 echo " *****"
112 echo
113 echo
114 echo " FAST console"
115 echo
116 echo
117 echo " Press ALT-F1 to change here"
120 function id2 {
121 sleep 1
122 clear
123 echo
124 echo
125 echo
126 echo
127 echo
128 echo
129 echo
130 echo
131 echo
132 echo
133 echo
134 echo " *****"
135 echo " ** **"
136 echo " * **"
137 echo " **"
138 echo " **"
139 echo " **"
140 echo " **"
141 echo " **"
142 echo " ** **"
143 echo " *******"
144 echo
145 echo
146 echo " SLOW console"
147 echo
148 echo
149 echo " Press ALT-F2 to change here"
152 echo
153 echo "Please read MPlayer's TV-out documentation, and install 'matroxset' and 'fbset'."
154 echo "Then edit this script to suit your monitor+TV set."
155 echo
156 exit 1
158 while [ 1 ]; do
160 clear
162 echo " [ 0 ] Clear & blank screen"
163 echo " [ 1 ] Monitor only"
164 echo
165 echo " [ 2 ] Cloning - CRTC1 -> Monitor"
166 echo " CRTC2 -> TV"
167 echo
168 echo " [ 3 ] Cloning - CRTC1 -> Monitor1"
169 echo " CRTC2 -> Monitor2"
170 echo
171 echo " [ 4 ] DualHead - CRTC1 -> Monitor1"
172 echo " CRTC2 -> Monitor2"
173 echo
174 echo " [ 5 ] DualHead - CRTC1 -> Monitor2 (SWAP!)"
175 echo " CRTC2 -> Monitor1"
176 echo
177 echo " [ 6 ] DualHead - CRTC1 -> Monitor1"
178 echo " CRTC2 -> TV"
179 echo
180 echo " [ 7 ] DualHead - CRTC1 -> TV (SWAP!)"
181 echo " CRTC2 -> Monitor1"
183 echo
185 echo "-- TV MODES on /dev/fb0 -- TV MODES on /dev/fb1"
186 echo
187 echo " [ a ] 640x512 PAL [ A ] 640x512 PAL"
188 echo " [ s ] 640x528 PAL [ S ] 640x528 PAL"
189 echo " [ d ] 720x576 PAL [ D ] 720x576 PAL"
190 echo " [ f ] 640x240 NTSC [ F ] 640x240 NTSC"
191 echo " [ g ] 640x480 NTSC, interlaced [ G ] 640x480 NTSCl"
192 echo
193 echo " (Warning, fb0 and fb1 tend to change RANDOMLY with these mode changers..)"
195 read ABC
197 case "$ABC" in
199 clear
200 setterm -cursor off
201 setterm -blank 0
202 read
203 setterm -cursor on
207 mappingreset
208 echo
212 mappingreset
213 matroxset -f /dev/fb0 -m 3
214 SetTVstandard
215 TVdefaultmode /dev/fb0
219 mappingreset
220 matroxset -f /dev/fb0 -m 3
224 warn
225 mappingreset
226 matroxset -f /dev/fb0 -m 1
227 matroxset -f /dev/fb1 -m 2
228 warn2
232 warn
233 mappingreset
234 matroxset -f /dev/fb0 -m 2
235 matroxset -f /dev/fb1 -m 1
236 warn2
240 warn
241 mappingreset
242 con2fb /dev/fb1 /dev/tty2
243 matroxset -f /dev/fb0 -m 1
244 matroxset -f /dev/fb1 -m 2
245 SetTVstandard
246 TVdefaultmode /dev/fb1
247 warn2
251 warn
252 mappingreset
253 con2fb /dev/fb1 /dev/tty2
254 matroxset -f /dev/fb0 -m 2
255 matroxset -f /dev/fb1 -m 1
256 SetTVstandard
257 TVdefaultmode /dev/fb0
258 warn2
262 # 640x512 80Hz 32bpp
263 fbset -depth 32 -left 60 -right 0 -upper 70 -lower 39 -hslen 76 -vslen 4 -xres 640 -yres 512 -bcast true -laced false
267 # 640x512 80Hz 32bpp
268 fbset -fb /dev/fb1 -depth 32 -left 60 -right 0 -upper 70 -lower 39 -hslen 76 -vslen 4 -xres 640 -yres 512 -bcast true -laced false
272 # 640x528 83Hz 32bpp
273 fbset -depth 32 -left 40 -right 0 -upper 63 -lower 29 -hslen 56 -vslen 4 -xres 640 -yres 528 -vxres 640 -vyres 528 -laced false -bcast true
277 # 640x528 83Hz 32bpp
278 fbset -fb /dev/fb1 -depth 32 -left 40 -right 0 -upper 63 -lower 29 -hslen 56 -vslen 4 -xres 640 -yres 528 -vxres 640 -vyres 528 -laced false -bcast true
282 # 720x576 78Hz 32bpp
283 # fbset -depth 32 -left 54 -right -36 -upper 55 -lower -6 -hslen 46 -vslen 4 -xres 720 -yres 576 -vxres 720 -vyres 576 -laced false -bcast true
284 fbset -depth 32 -right -36 -lower -6 -hslen 46 -vslen 4 -xres 720 -yres 576 -vxres 720 -vyres 576 -laced false -bcast true
288 # 720x576 78Hz 32bpp
289 # fbset -fb /dev/fb1 -depth 32 -left 54 -right -36 -upper 55 -lower -6 -hslen 46 -vslen 4 -xres 720 -yres 576 -vxres 720 -vyres 576 -laced false -bcast true
290 fbset -fb /dev/fb1 -depth 32 -right -36 -lower -6 -hslen 46 -vslen 4 -xres 720 -yres 576 -vxres 720 -vyres 576 -laced false -bcast true
294 # 640x240 non-interlaced 32bpp
295 fbset -depth 32 -xres 640 -yres 240 -vxres 640 -vyres 240 -pixclock 79443 -left 72 -right 40 -upper 15 -lower 5 -hslen 48 -vslen 3 -laced false
299 # 640x240 non-interlaced 32bpp
300 fbset -fb /dev/fb1 -depth 32 -xres 640 -yres 240 -vxres 640 -vyres 240 -pixclock 79443 -left 72 -right 40 -upper 15 -lower 5 -hslen 48 -vslen 3 -laced false
304 # 640x480 interlaced 32bpp
305 fbset -depth 32 -xres 640 -yres 480 -vxres 640 -vyres 480 -pixclock 79443 -left 72 -right 40 -upper 30 -lower 10 -hslen 48 -vslen 5 -laced true
309 # 640x480 interlaced 32bpp
310 fbset -fb /dev/fb1 -depth 32 -xres 640 -yres 480 -vxres 640 -vyres 480 -pixclock 79443 -left 72 -right 40 -upper 30 -lower 10 -hslen 48 -vslen 5 -laced true
312 esac
314 done