home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / console / svgatext.3 / svgatext / SVGATextMode-1.3 / doc / vgaset.note < prev   
Encoding:
Text File  |  1995-03-12  |  4.1 KB  |  85 lines

  1. NOTE on vgaset!
  2. ---------------
  3.  
  4. The "vgaset" utility on most Linux systems has this really weird tendency to
  5. "change" vertical timing parameters before showing them to you. As an
  6. example, look at this line of output from vgaset:
  7.  
  8. kmg> vgaset
  9. 1056 1072 1232 1280     960 978 982 1042
  10.  
  11. It was executed on a TVGA8900CL card, in textmode, at 132x60 character mode
  12. (NOT changed with this program: this is the standard BIOS text mode). If you
  13. calculate frequencies from those numbers, you get a Horizontal frequency of
  14. 40.00/1280 = 31.250 kHz (OK!), and a vertical frequency of just 31250/1042 =
  15. 30 Hz. Now that is LOW. In fact, I KNOW it is 60 Hz, like most textmodes
  16. (some are 70 Hz, but NONE are 30 Hz.  Nobody would settle for that). I have
  17. my own program to read VGA registers, and THEY show all vertical timigs to
  18. be HALF of the ones shown by vgaset. So it REALLY is:
  19.  
  20. 1056 1072 1232 1280     480 489 491 521
  21.  
  22. I have NO idea why vgaset does this. I checked the code, and there actually
  23. is a routine in there that doubles all vertical timings (before printing
  24. them) repeatedly, until the total vertical size is AT LEAST half as much as
  25. the total horizontal size. In our case, 521*2 is less than 1280, so it
  26. doubles the vertical timings ONCE, since then 960*2 IS greater than 1280...
  27.  
  28.  
  29.  
  30. Some say that that 'trick' was used to 'intelligently' display the REAL
  31. parameters in interlaced mode: if you would use an unchanged vgaset on an
  32. interlaced mode, it would give you HALF the vertical sizes that were REALLY
  33. used. It is impossible (?) to detect interlacing without chipset-specific
  34. code, so vgaset was changed to 'detect' it using the ratio between H and V
  35. size: the latter case (1056x480) is quite uncommon in graphics mode, since
  36. most modes use the 4/3 'golden ratio', because all common monitor screens
  37. have the same 4/3 H/V ratio.
  38.  
  39. Take for instance the popular 800x600 mode: 800/600 = 4/3. If vgaset would
  40. be run from such a mode, it WOULD detect it as 800x600. But if that mode
  41. were to be INTERLACED, it would show up as 800x300! And since this is
  42. probably a mode that is 'never' used (it would look squeezed horizontally),
  43. they assume it was an interlaced mode, and multiply all vertical sizes by 2.
  44.  
  45. This is al very sensible in graphics mode, but in text mode, things are not
  46. that easy. The H/V ratio of a text mode is not only determined by the actual
  47. H/V _pixel_ ratio, but also by the font size: a 1056x344 mode with an 8x8
  48. font looks EXACTLY the same as a 1056x688 mode with a 8x16 font (except for
  49. the detail of the characters). And BOTH are non-interlaced 132x43 text
  50. displays.
  51.  
  52.  
  53.  
  54. The timings that vgaset actually uses to program the VGA chip are the REAL
  55. ones (before that doubling process). So if you run vgaset on a 132x60
  56. character text display, and use THOSE timings, you might run into a real
  57. surprise, because if you type the timing-line from vgaset into the
  58. TextConfig file for this program, it will give you a 132x120 character
  59. display at 30 Hz !!!
  60.  
  61. I know of NO way to find out if vgaset is lying to you, except by pulling
  62. the register contents from the chips with another program (like the included
  63. 'grabmode'), or using your common sense, and do some calculations before
  64. blindly copying vgaset timings!
  65.  
  66.  
  67. | UPDATE: The original version of vgaset (which doesn't show that strange
  68. | behaviour) is included in the SVGATextMode distribution, with kind
  69. | permission from the author. Use this one if you are unsure
  70. | about your own "vgaset", or if you don't have it at all.
  71.  
  72.  
  73. Final note: it's probably better not to use vgaset AT ALL just for grabbing
  74. text modes for inclusion in the TextConfig file. Use the included tool
  75. 'grabmode': it outputs a line that can be pasted into the TextConfig line
  76. directly.
  77.  
  78. Of course you still need vgaset to move the screen around etc., but then the
  79. mode parameters it displays are not that important anymore. The vertical
  80. timings from vgaset COULD show up divided by two, so you cannot copy them
  81. immediately int the TextConfig. Either use your common sense together with
  82. what this text told you about vgaset, or use grabmode again after exiting
  83. from vgaset (with the changed screen position still intact, as changed by
  84. vgaset).
  85.