#############################################################
#                                                           #
#   Configuration file for the "SVGATextMode" program       #
#                                                           #
#############################################################
#
# Created by: Koen Gadeyne (kmg@barco.be)
#
# DISCLAIMER: <include standard disclaimer here>
#  in short: USE AT YOUR OWN RISK!!!
#  This program does some pretty meaty things to your VGA card, and
#  I am ABSOLUTELY sure that there are more bugs in it than in the
#  entire Linux kernel source tree (>8 Mb). So If you have a heart
#  condition: ask for someone else to test it for you. During testing
#  of this piece of sh!t, I got LOTS of surprises (and so did my
#  monitor), and there are many surprises left.
#  I happen to like surprises!
#
#
#
# NOTES:
# 0. Just for safety: use "savetextmode" to save your current textmode
#    before trying anything of this stuff! If you get it wrong, you can
#    always restore your screen with "textmode" (prepare to type that 
#    "blindly": you might need to!). And to be even safer: do your first
#    tests from the standard 80x25 mode, and do your "savetextmode" in
#    that mode.
# 1. In addition to the clocks specified here, the same clocks divided
#    by 2 are ALSO available! (for as far as I know, that is a standard
#    VGA feature...) The drawback is that for a "standard" 80x25
#    mode, 25.175 must be specified as the clock. If you say just "25" MHz,
#    that is what you'll get: 50 MHz divided by 2 = EXACTLY 25 MHz. So be
#    as specific as possible in defining clocks!
# 2. ALL clocks must be specified on the SAME line as the "Clocks" statement
# 3. Note too that the MAXIMUM total screen size can be 32 Kbytes of data,
#    and since each char needs two bytes: MAX 16384 chars. (If you ask for
#    anything bigger, you will get an "out of memory" error from the kernel!)
#    160x100 is almost that big (imagine : 16000 chars on ONE screen ?!)
#    All of the 16384 chars you DON'T use for the ACTIVE part of the screen,
#    are used as a "scrollback buffer" by the kernel (SHIFT-PgUp/SHIFT_PgDn, 
#    remember?). So at 160x100, only 2 lines of scrollback remain...
# 4. You can use "vgaset" to tune timing parameters, just as in X-Windows.
# 5. WARNING!!!!!!!!!!!
#    Be absolutely sure that the CHIPSET is specified correctly! The code
#    does ABSOLUTELY NO PROBING AT ALL, and will joyfully program your ET4000
#    as an S3 chipset, and even pretend everything went OK. Don't ask me what
#    THAT can do... I might include VGA-card checking later.
#
# 6. for unsupported cards, or supported cards with unsupported clock selection 
#    algorithms, use the "Clocks external <path>" statement. The external program
#    MUST take as (only) argument the desired frequency in kHz. If it doesn't, 
#    embed it in a script that converts the syntax, or change the program...
#

#ChipSet	"S3"
#Clocks   25.175  28.322  40.0  0.00  50.00  77.00  36.00  44.90  130.00  120.00  80.00  31.50  110.00  65.00  75.00  94.50
### S3: for the 801/805, clocks above ~70 MHz work, but have a strange effect on some texts...

# for the (S3-based) diamond cards, or others using a special clock chip
#Clocks external "/home/kmg/SVGATextMode/diamond/SVGATextMode_freq"
### S3: for the Diamond Stealth 64 VRAM, anyting works, just as on the ET4000.

#ChipSet "ET4000"
#Option "hibit_high"     # just as in the Xconfig file for X-Windows!
#Clocks 25.1  28.3  32.5  36  40  44.9  31.5  37.6  50  56.6  65  72  80  90  63  75 
### ET4000 can handle ANY clock! This is probably the best engineered VGA chip I know of.

#Chipset "TVGA8900"
#Clocks 25.175 28.3 45 36 58 65 50 40     
### Trident 8900C seems to be unable to handle clocks > 45 MHz

#Chipset "TVGA8900"    # this is for a 8900CL card, it has 16 clocks.
#Clocks 25.175 28.3 45 36 57 64 50 40 75 108 110 107 72 61 79 74
### The 8900CL seems OK up to 55 MHz.

#Chipset "WDC90C3x"
#Clocks 25.175 28.3 65 36 40 50 32 45 31.5 35.5 74.5 72 30 77 86 80 60
### Seems to work well for all available clocks

#Chipset "ATI"
#Clocks 30.240 32.000 37.500 39.000 42.954 48.771 16.657 36.000 40.000 56.644 75.000 65.000 50.350 56.640 28.322 44.900
#Clocks 42.954 48.771 16.657 36.000 50.350 56.640 28.322 44.900 30.240 32.000 37.500 39.000 40.000 56.644 75.000 65.000
# normally ATI has programmable division by 1, 2, 3 or 4. This is not supported.
# however, division by 2 (VGA standard) should work. Let me know.
### COMPLETELY UNTESTED!!! BEWARE !!! Will only work on VGAWonder V4 and up
 
#Chipset "CLGD542x"
#no clocks needed: freely programmable!
### Cirrus: clocks above 56 MHz are no good. If you still want to read some text...

#############################################################################
#
# Standard 80x25 text mode: this should ALWAYS work (i.e. no timing problems
# because of a too large pixel clock)
# If this works, then at least PART of the program works fine... 
#
"80x25"  25.175      640 680 776 800      400 412 414 449 -hsync +vsync font 8x16

#
# The following should work too, but at 25.0 instead of 25.175 MHz.
# it can be used to check if the "divide by 2" feature
# works for your VGA chip. If you have a 50 MHz dot clock at hand...
#
"80x25b"  25    640 680 776 800      400 412 414 449 -hsync +vsync font 8x16

#
# The next two modes can be used to check if the selection of 8- and 9-pixel
# wide character sizes work. Both modes look exactly the same to the monitor
# as the standard 80x25 modes. But if you watch closely, you'll see the spacing
# between characters is slightly larger for the 9x16 font than for the 8x16 font.
#
# ======> VERY IMPORTANT NOTE : <=======
# NOTE that the timing parameters are the same for both (except for the
# clock)!!! Horizontal timings in VGA cards are specified in 8-bit wide
# CHARACTERS, not in PIXELS. Hence the restriction that hor. timings should be
# a multiple of 8 (if they're not, they will be rounded down).
# Although the character width is 9 in the second case, horizontal timings are
# still in 8-bit characters. So both modes will result in 80 chars per line
# (640/8), but the VGA chip will count 8 pixels per character in the first
# case, and 9 in the second case. That means that the total pixel-count at the
# end of the video-line is (800/8)*8 in the first example, and (800/8)*9 in
# the second case !!!
# To achieve the same horizontal frequency of 31.5 kHz, the second mode needs
# a higher clock ( (9/8)*25.175 MHz = 28.3 MHz, and that happens to be the
# second standard VGA clock, which is available on ALL VGA cards. Now you know
# why they added it in the first place).
#
"80x25x8" 25.175    640 680 776 800      400 412 414 449 -hsync +vsync font 8x16
"80x25x9" 28.3    640 680 776 800      400 412 414 449 -hsync +vsync font 9x16

#
# Another standard mode for most VGA cards. This SHOULD work for you.
# (It was grabbed from a Trident card)
#
"132x43"  40.00 1056 1072 1232 1280     473 485 487 521 -hsync -vsync font 8x11

#
# This is a standard mode on some cards (Trident and some ET4000's)
# (Again, from a Trident)
#
"132x60"  40.00 1056 1072 1232 1280     480 489 491 521 -hsync -vsync font 8x8

#
# It's time to try some more exotic (= non-standard) modes...
#
# This is my favourite for a 14" monitor. A bit more than the IMMENSELY
# BIG characters at 80x25, but still very readable. Most cards support 
# 132x43 as a standard mode as well, but that is rather "small print" 
# then. At 50 MHz, needs a 48 kHz monitor (VESA 800x600 @ 70 Hz standard).
# Low-end SVGA screens will need to lower the clock to 40 MHz (for 38 kHz
# @ 60 Hz) or even 36 MHz (for 35.5 kHz @ 50 Hz).
#
"100x37"  50   800  872  904 1040   600 632 638 670 +hsync +vsync font 8x16

#
# If you can't handle 48 kHz, try this: It's only 38 kHz/55 Hz, but almost all 
# VGA cards should work with this. And cheapo monitors too.
#
"100x37_low"  40   800  864  896 1056   600 605 607 628 +hsync +vsync font 8x16

#
# This has the same frequencies as a standard VGA text mode (31.5 kHz/60 Hz)
#
"100x37_VGA"  36   800  864  896 1016   518 520 522 530 -hsync -vsync font 9x14

#
# This is an enhancement to the standard 132x43 resolution. It uses a 16-pixel 
# font height instead of just 8. In combination with an appropriate font, this 
# is NOT bad at all.
#
"132x43_16"  65  1056 1096 1216 1336  688 688 694 714  -hsync -vsync font 8x16

#
# If you need BIG letters, try this one. You have to have a 32-pixel high font
# file somewhere (it is NOT included in the "keytbls" package in e.g. Slackware)
# Such a font is included with this package in the "setfont" directory.
# This needs a 49kHz/96Hz screen.
"50x15"  25.175  400 424 456 512  480 481 482 512  -hsync -vsync font 8x32

#
# If your monitor cannot handle that, use a 18 MHz clock. But that needs the
# "divide-by-two" feature (which should work on all VGA cards), dividing the
# (almost standard) 36 MHz clock down to 18 MHz, yielding 35kHz/68Hz, which
# should work on almost any screen, even the cheapest.
"50x15_low"  18  400 424 456 512  480 481 482 512  -hsync -vsync font 8x32

#
# Some VESA compliant very-high resolution modes. Don't try this on Trident 
# or Cirrus cards. S3's can handle it, although you might notice some garbage
# while scrolling. This should be of no concern. I can live with that.
# These modes have the same timings as a VESA 1024x768 mode at 70 Hz under
# X-windows. If you happen to own a single frequency monitor at 56 kHz, this
# is your ticket to paradise!
#
"v132x43" 75 1056 1096 1248 1336 774 783 784 800 +hsync +vsync font 8x18
"v132x48" 75 1056 1096 1248 1336 768 783 784 800 +hsync +vsync font 8x16
"v132x55" 75 1056 1096 1248 1336 770 783 784 800 +hsync +vsync font 8x14
"v132x60" 75 1056 1096 1248 1336 780 783 784 800 +hsync +vsync font 8x13
"v132x64" 75 1056 1096 1248 1336 768 783 784 800 +hsync +vsync font 8x12
"v132x70" 75 1056 1096 1248 1336 770 783 784 800 +hsync +vsync font 8x11

#
#
# For as far as I know, only ET4000 can handle clocks this big...
# Oh yeah: this program puts no limitation on the largest "safe" clock, as
# XFREE3.x does. This could be dangerous! Be warned!
# But the advantage is that, when using the modes below, you are working 
# in a HIGHER resolution than possible in X-Windows, because most ET4000's
# are limited to 86 MHz by XFREE3.x (WHY not 90 MHz???)
# But WHAT A RESULT!!! Once you've seen this, you're hooked!
# You will need at least a 17" screen for the 160 char wide modes!
#
"ET132x66"   90  1056 1088 1208 1336  800 820 830 850  -hsync +vsync font 8x12
"ET160x100"  90  1280 1312 1432 1560  800 820 830 850  -hsync +vsync font 8x8
"ET160x66"   90  1280 1312 1432 1560  800 820 830 850  -hsync +vsync font 8x12
"ET132x43"   90  1056 1096 1216 1336  688 688 694 714  -hsync -vsync font 8x16
"ET100x37"   72   800  848  880 1032  600 600 606 630  -hsync -vsync font 8x16

#
# Who says exagerating isn't fun ? 
# Can your monitor handle this? If you are afraid of damaging it: DON'T TRY THIS!
#
"80x25_160HZ"  56      640 680 776 800      400 412 414 449 -hsync +vsync font 8x16

#
# A little more moderate, but usefull: high-refresh 80x25.
#
"80x25_100Hz"  36      640 680 776 800      400 412 414 449 -hsync +vsync font 8x16

#
# TEST modes: for program development
#

#
# CUSTOM modes: put your own modes (new or adapted from above) here
#
