summaryrefslogtreecommitdiffstats
path: root/TVout/matroxtv
blob: 680877c49ba5dc500df1d60744b1aedd82086bdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
#!/bin/sh
#
# Gabucino - no warranty, this script can BOOM your TV and/or monitor, or else.
# v3.0
# This script has been tested and configured on a Matrox G400DH, a PAL TV,
# a 14" analog and a 15" digital monitor.
#
# INSTALLATION:
#	1. READ MPLAYER'S TVOUT DOCUMENTATION!
#	2. Choose proper mode at 'defaultmode', 'TVdefaultmode',
#	   and 'SetTVstandard' functions to fit your needs.
#	   You normally shouldn't touch anything else.
#	3. Remove 'exit 1' safety check.
#

function defaultmode {
	# You can choose the mode to use in monitor-only mode
	# 640x480 60Hz 32bpp	(14" monitors)
	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
	# 768x576 60Hz 32bpp	(14" monitors)
	# 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
	# 800x600 76Hz 32bpp	(15" monitors)
	# 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
	# 1024x768 70Hz 32bpp	(15" monitors)
	# 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
}

function TVdefaultmode {

	##
	## PAL modes
	##

	# 640x512 80Hz 32bpp
	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
	# 640x528 83Hz 32bpp
	# 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
	# 720x576 78Hz 32bpp
	# 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

	##
	## NTSC modes
	##

	# 640x240 non-interlaced 32bpp
	# 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
	# 640x480 interlaced 32bpp
	# 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
}

function SetTVstandard {
	matroxset 1		# PAL
	# matroxset 2		# NTSC
}

function SetMonitorMode {
        matroxset 128
}

function mappingreset {
	matroxset -f /dev/fb0 -m 0
	matroxset -f /dev/fb1 -m 0
	matroxset -f /dev/fb0 -m 1
	con2fb /dev/fb0 /dev/tty1
	con2fb /dev/fb0 /dev/tty2
	SetMonitorMode
	defaultmode
}

function warn {
	clear
	echo "tty2 will be automatically transferred to fb1 using the con2fb utility."
	echo
	echo
	echo "A big \"1\" letter will be displayed on tty1 after the change."
	echo "A big \"2\" letter will be displayed on tty2 after the change."
	echo
	echo
	echo "If you read this, PRESS ANY KEY TO CONTINUE"
	read
}

function warn2 {
	id1 > /dev/tty1 &
	id2 > /dev/tty2 &
}	

function id1 {
	sleep 1
	clear
	echo
	echo
	echo
	echo
	echo
	echo
	echo
	echo
	echo
	echo
	echo
	echo "                                   ****"
	echo "                                  *****"
	echo "                                 ******"
	echo "                                *******"
	echo "                                    ***"
	echo "                                    ***"
	echo "                                    ***"
	echo "                                    ***"
	echo "                                    ***"
	echo "                                   *****"
	echo
	echo
	echo "	                        FAST console"
	echo
	echo
	echo "                         Press ALT-F1 to change here"
}

function id2 {
	sleep 1
	clear
	echo
	echo
	echo
	echo
	echo
	echo
	echo
	echo
	echo
	echo
	echo
	echo "                                   *****"
	echo "                                  **   **"
	echo "                                  *    **"
	echo "                                      **"
	echo "                                     **"
	echo "                                    **"
	echo "                                   **"
	echo "                                  **"
	echo "                                  **   **"
	echo "                                  *******"
	echo
	echo
	echo "	                        SLOW console"
	echo
	echo
	echo "                         Press ALT-F2 to change here"
}

echo
echo "Please read MPlayer's TV-out documentation, and install 'matroxset' and 'fbset'."
echo "Then edit this script to suit your monitor+TV set."
echo
exit 1

while [ 1 ]; do

clear

echo " [ 0 ]    Clear & blank screen"
echo " [ 1 ]    Monitor only"
echo
echo " [ 2 ]    Cloning  - CRTC1 -> Monitor"
echo "                     CRTC2 -> TV"
echo
echo " [ 3 ]    Cloning  - CRTC1 -> Monitor1"
echo "                     CRTC2 -> Monitor2"
echo
echo " [ 4 ]    DualHead - CRTC1 -> Monitor1"
echo "                     CRTC2 -> Monitor2"
echo
echo " [ 5 ]    DualHead - CRTC1 -> Monitor2 (SWAP!)"
echo "                     CRTC2 -> Monitor1"
echo
echo " [ 6 ]    DualHead - CRTC1 -> Monitor1"
echo "                     CRTC2 -> TV"
echo
echo " [ 7 ]    DualHead - CRTC1 -> TV (SWAP!)"
echo "                     CRTC2 -> Monitor1"

echo

echo "-- TV MODES on /dev/fb0			 -- TV MODES on /dev/fb1"
echo
echo " [ a ]	640x512		PAL                 [ A ]    640x512		PAL"
echo " [ s ]	640x528		PAL                 [ S ]    640x528		PAL"
echo " [ d ]	720x576		PAL                 [ D ]    720x576		PAL"
echo " [ f ]	640x240		NTSC                [ F ]    640x240		NTSC"
echo " [ g ]	640x480		NTSC, interlaced    [ G ]    640x480		NTSCl"
echo
echo " (Warning, fb0 and fb1 tend to change RANDOMLY with these mode changers..)"

read ABC

case "$ABC" in
	0)
	clear
	setterm -cursor off
	setterm -blank 0
	read
	setterm -cursor on
	;;

	1)
	mappingreset
	echo
	;;

	2)
	mappingreset
	matroxset -f /dev/fb0 -m 3
	SetTVstandard
	TVdefaultmode /dev/fb0
	;;

	3)
	mappingreset
	matroxset -f /dev/fb0 -m 3
	;;

	4)
	warn
	mappingreset
	matroxset -f /dev/fb0 -m 1
	matroxset -f /dev/fb1 -m 2
	warn2
	;;

	5)
	warn
	mappingreset
	matroxset -f /dev/fb0 -m 2
	matroxset -f /dev/fb1 -m 1
	warn2
	;;

	6)
	warn
	mappingreset
	con2fb /dev/fb1 /dev/tty2
	matroxset -f /dev/fb0 -m 1
	matroxset -f /dev/fb1 -m 2
	SetTVstandard
	TVdefaultmode /dev/fb1
	warn2
	;;

	7)
	warn
	mappingreset
	con2fb /dev/fb1 /dev/tty2
	matroxset -f /dev/fb0 -m 2
	matroxset -f /dev/fb1 -m 1
	SetTVstandard
	TVdefaultmode /dev/fb0
	warn2
	;;

	a)
	# 640x512 80Hz 32bpp
	fbset -depth 32 -left 60 -right 0 -upper 70 -lower 39 -hslen 76 -vslen 4 -xres 640 -yres 512 -bcast true -laced false
	;;

	A)
	# 640x512 80Hz 32bpp
	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
	;;

	s)
	# 640x528 83Hz 32bpp
	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
	;;

	S)
	# 640x528 83Hz 32bpp
	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
	;;

	d)
	# 720x576 78Hz 32bpp
#	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
	fbset -depth 32 -right -36 -lower -6 -hslen 46 -vslen 4 -xres 720 -yres 576 -vxres 720 -vyres 576 -laced false -bcast true
	;;

	D)
	# 720x576 78Hz 32bpp
#	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
	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
	;;

	f)
	# 640x240 non-interlaced 32bpp
	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
	;;

	F)
	# 640x240 non-interlaced 32bpp
	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
	;;

	g)
	# 640x480 interlaced 32bpp
	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
	;;

	G)
	# 640x480 interlaced 32bpp
	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
	;;
esac

done