2001-10-26 17:20:33 +00:00
|
|
|
#!/bin/sh
|
2002-09-12 09:42:00 +00:00
|
|
|
#
|
|
|
|
# Gabucino - no warranty, this script can BOOM your TV and/or monitor, or else.
|
2003-06-01 23:00:37 +00:00
|
|
|
# v3.0
|
2003-02-23 18:56:45 +00:00
|
|
|
# This script has been tested and configured on a Matrox G400DH, a PAL TV,
|
|
|
|
# a 14" analog and a 15" digital monitor.
|
2002-09-12 09:42:00 +00:00
|
|
|
#
|
|
|
|
# INSTALLATION:
|
|
|
|
# 1. READ MPLAYER'S TVOUT DOCUMENTATION!
|
2003-06-01 23:00:37 +00:00
|
|
|
# 2. Choose proper mode at 'defaultmode', 'TVdefaultmode',
|
|
|
|
# and 'SetTVstandard' functions to fit your needs.
|
|
|
|
# You normally shouldn't touch anything else.
|
2002-09-12 09:42:00 +00:00
|
|
|
# 3. Remove 'exit 1' safety check.
|
|
|
|
#
|
|
|
|
|
|
|
|
function defaultmode {
|
|
|
|
# You can choose the mode to use in monitor-only mode
|
|
|
|
# 640x480 60Hz 32bpp (14" monitors)
|
2003-04-06 10:06:31 +00:00
|
|
|
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
|
2002-09-12 09:42:00 +00:00
|
|
|
# 768x576 60Hz 32bpp (14" monitors)
|
2003-04-06 10:06:31 +00:00
|
|
|
# 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
|
2002-09-12 09:42:00 +00:00
|
|
|
# 800x600 76Hz 32bpp (15" monitors)
|
2003-04-06 10:06:31 +00:00
|
|
|
# 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
|
2002-09-12 09:42:00 +00:00
|
|
|
# 1024x768 70Hz 32bpp (15" monitors)
|
2003-04-06 10:06:31 +00:00
|
|
|
# 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
|
2002-09-12 09:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function TVdefaultmode {
|
|
|
|
|
|
|
|
##
|
|
|
|
## PAL modes
|
|
|
|
##
|
|
|
|
|
|
|
|
# 640x512 80Hz 32bpp
|
2003-06-01 23:00:37 +00:00
|
|
|
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
|
2002-09-12 09:42:00 +00:00
|
|
|
# 640x528 83Hz 32bpp
|
2003-06-01 23:00:37 +00:00
|
|
|
# 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
|
2002-09-12 09:42:00 +00:00
|
|
|
# 720x576 78Hz 32bpp
|
2003-06-01 23:00:37 +00:00
|
|
|
# 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
|
2002-09-12 09:42:00 +00:00
|
|
|
|
|
|
|
##
|
|
|
|
## NTSC modes
|
|
|
|
##
|
|
|
|
|
|
|
|
# 640x240 non-interlaced 32bpp
|
2003-06-01 23:00:37 +00:00
|
|
|
# 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
|
2002-09-12 09:42:00 +00:00
|
|
|
# 640x480 interlaced 32bpp
|
2003-06-01 23:00:37 +00:00
|
|
|
# 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
|
2002-09-12 09:42:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function SetTVstandard {
|
2003-04-06 09:07:49 +00:00
|
|
|
matroxset 1 # PAL
|
2002-09-12 09:42:00 +00:00
|
|
|
# matroxset 2 # NTSC
|
|
|
|
}
|
2003-02-23 16:23:37 +00:00
|
|
|
|
|
|
|
function SetMonitorMode {
|
2003-02-23 18:56:45 +00:00
|
|
|
matroxset 128
|
2003-02-23 16:23:37 +00:00
|
|
|
}
|
|
|
|
|
2003-02-23 18:56:45 +00:00
|
|
|
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
|
2003-06-01 23:00:37 +00:00
|
|
|
echo "tty2 will be automatically transferred to fb1 using the con2fb utility."
|
2003-02-23 18:56:45 +00:00
|
|
|
echo
|
|
|
|
echo
|
2003-06-01 23:00:37 +00:00
|
|
|
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."
|
2003-02-23 18:56:45 +00:00
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo "If you read this, PRESS ANY KEY TO CONTINUE"
|
|
|
|
read
|
2003-02-23 16:23:37 +00:00
|
|
|
}
|
2003-02-23 18:56:45 +00:00
|
|
|
|
|
|
|
function warn2 {
|
2003-06-01 23:00:37 +00:00
|
|
|
id1 > /dev/tty1 &
|
|
|
|
id2 > /dev/tty2 &
|
|
|
|
}
|
|
|
|
|
|
|
|
function id1 {
|
|
|
|
sleep 1
|
2003-02-23 18:56:45 +00:00
|
|
|
clear
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo
|
2003-06-01 23:00:37 +00:00
|
|
|
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"
|
|
|
|
}
|
2003-02-23 18:56:45 +00:00
|
|
|
|
2002-09-12 09:42:00 +00:00
|
|
|
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
|
2003-02-23 19:00:11 +00:00
|
|
|
exit 1
|
2001-10-26 17:20:33 +00:00
|
|
|
|
|
|
|
while [ 1 ]; do
|
|
|
|
|
|
|
|
clear
|
|
|
|
|
2002-09-28 16:10:09 +00:00
|
|
|
echo " [ 0 ] Clear & blank screen"
|
2002-09-12 09:42:00 +00:00
|
|
|
echo " [ 1 ] Monitor only"
|
2003-02-23 16:23:37 +00:00
|
|
|
echo
|
2003-06-01 23:00:37 +00:00
|
|
|
echo " [ 2 ] Cloning - CRTC1 -> Monitor"
|
|
|
|
echo " CRTC2 -> TV"
|
|
|
|
echo
|
|
|
|
echo " [ 3 ] Cloning - CRTC1 -> Monitor1"
|
|
|
|
echo " CRTC2 -> Monitor2"
|
2003-02-23 16:23:37 +00:00
|
|
|
echo
|
2003-06-01 23:00:37 +00:00
|
|
|
echo " [ 4 ] DualHead - CRTC1 -> Monitor1"
|
|
|
|
echo " CRTC2 -> Monitor2"
|
2003-02-23 18:56:45 +00:00
|
|
|
echo
|
2003-06-01 23:00:37 +00:00
|
|
|
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"
|
2001-10-26 17:20:33 +00:00
|
|
|
|
|
|
|
echo
|
|
|
|
|
2003-06-01 23:00:37 +00:00
|
|
|
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"
|
2003-02-23 18:56:45 +00:00
|
|
|
echo
|
2003-06-01 23:00:37 +00:00
|
|
|
echo " (Warning, fb0 and fb1 tend to change RANDOMLY with these mode changers..)"
|
2001-10-26 17:20:33 +00:00
|
|
|
|
|
|
|
read ABC
|
|
|
|
|
|
|
|
case "$ABC" in
|
2002-09-28 16:10:09 +00:00
|
|
|
0)
|
|
|
|
clear
|
|
|
|
setterm -cursor off
|
|
|
|
setterm -blank 0
|
|
|
|
read
|
2003-02-23 18:56:45 +00:00
|
|
|
setterm -cursor on
|
2002-09-28 16:10:09 +00:00
|
|
|
;;
|
|
|
|
|
2001-10-26 17:20:33 +00:00
|
|
|
1)
|
2003-02-23 18:56:45 +00:00
|
|
|
mappingreset
|
2001-10-26 17:20:33 +00:00
|
|
|
echo
|
|
|
|
;;
|
|
|
|
|
|
|
|
2)
|
2003-02-23 18:56:45 +00:00
|
|
|
mappingreset
|
2001-10-26 17:20:33 +00:00
|
|
|
matroxset -f /dev/fb0 -m 3
|
2002-09-12 09:42:00 +00:00
|
|
|
SetTVstandard
|
2003-06-01 23:00:37 +00:00
|
|
|
TVdefaultmode /dev/fb0
|
2001-10-26 17:20:33 +00:00
|
|
|
;;
|
|
|
|
|
2003-02-23 16:23:37 +00:00
|
|
|
3)
|
2003-02-23 18:56:45 +00:00
|
|
|
mappingreset
|
2003-02-23 16:23:37 +00:00
|
|
|
matroxset -f /dev/fb0 -m 3
|
|
|
|
;;
|
|
|
|
|
|
|
|
4)
|
2003-02-23 18:56:45 +00:00
|
|
|
warn
|
|
|
|
mappingreset
|
|
|
|
matroxset -f /dev/fb0 -m 1
|
|
|
|
matroxset -f /dev/fb1 -m 2
|
|
|
|
warn2
|
|
|
|
;;
|
|
|
|
|
|
|
|
5)
|
|
|
|
warn
|
|
|
|
mappingreset
|
2003-02-23 16:23:37 +00:00
|
|
|
matroxset -f /dev/fb0 -m 2
|
|
|
|
matroxset -f /dev/fb1 -m 1
|
2003-02-23 18:56:45 +00:00
|
|
|
warn2
|
2003-02-23 16:23:37 +00:00
|
|
|
;;
|
|
|
|
|
2003-06-01 23:00:37 +00:00
|
|
|
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
|
|
|
|
;;
|
|
|
|
|
2001-10-26 17:20:33 +00:00
|
|
|
a)
|
2002-09-12 09:42:00 +00:00
|
|
|
# 640x512 80Hz 32bpp
|
2003-06-01 23:00:37 +00:00
|
|
|
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
|
2001-10-26 17:20:33 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
s)
|
2002-09-12 09:42:00 +00:00
|
|
|
# 640x528 83Hz 32bpp
|
2003-06-01 23:00:37 +00:00
|
|
|
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
|
2001-10-26 17:20:33 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
d)
|
2002-09-12 09:42:00 +00:00
|
|
|
# 720x576 78Hz 32bpp
|
2003-06-01 23:00:37 +00:00
|
|
|
# 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
|
2001-10-26 17:20:33 +00:00
|
|
|
;;
|
|
|
|
|
2002-09-12 09:42:00 +00:00
|
|
|
f)
|
|
|
|
# 640x240 non-interlaced 32bpp
|
2003-06-01 23:00:37 +00:00
|
|
|
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
|
2002-09-12 09:42:00 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
g)
|
|
|
|
# 640x480 interlaced 32bpp
|
2003-06-01 23:00:37 +00:00
|
|
|
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
|
2002-09-12 09:42:00 +00:00
|
|
|
;;
|
2001-10-26 17:20:33 +00:00
|
|
|
esac
|
|
|
|
|
|
|
|
done
|