README 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. Hi!
  2. This is version 1.1 of the VGA graphics library for linux. As the
  3. previous versions it has the following features:
  4. - Support for all standard VGA 16 and 256 color modes
  5. - Support for non-standard 256 color modes (including mode X)
  6. - Text mode restoration
  7. - Handling of console I/O
  8. - Flipping between graphics mode and text mode
  9. - Restores text mode after CTRL-C interrupt
  10. The present version adds the following:
  11. - Tseng ET4000 SVGA 256 color modes
  12. - Monochrome 640x480 mode
  13. - Bug fixes and some minor improvements
  14. VGAlib requires the 0.96b kernel (or newer) and must be compiled
  15. with GCC 2.2.2 (or newer). To compile and install VGAlib just
  16. type make. This will also build the following programs:
  17. vgatest: a simple demonstration of the library and the various
  18. video modes
  19. dumpreg: dumps the current VGA registers to stdout, mainly used
  20. for debugging and creating new video modes
  21. runx : if you have problems with text mode restoration after
  22. running X386, then try to use runx instead of startx
  23. Remember that all programs using VGAlib must be run with setuid
  24. root, otherwise you will get a "can't get I/O permissions" error.
  25. VGAlib does it's best to restore the text mode, but it may fail
  26. with some SVGA cards if you use a text mode with more than 80
  27. columns. If you are having problems please try to use an 80
  28. column text mode.
  29. Below is a short description of the functions in the library.
  30. Look at vgatest.c for examples on how to use these functions:
  31. - vga_setmode() is used to select the graphics mode or to
  32. restore the text mode.
  33. - vga_hasmode() tests if a given video mode is supported
  34. by the graphics card (use this function before using
  35. any of the ET4000 SVGA modes)
  36. - vga_clear() clears the graphics screen. This is also done
  37. by vga_setmode().
  38. - vga_getxdim(), vga_getydim() and vga_getcolors() return
  39. the resolution and number of colors for the current mode.
  40. - vga_getpalette() and vga_getpalvec() returns the contents
  41. of one or more palette registers, respectively.
  42. - vga_setpalette() and vga_setpalvec() allows you to modify
  43. one or more palette registers, respectively.
  44. - vga_setcolor() determines the color for future calls of
  45. the drawing functions.
  46. - vga_drawpixel() and vga_drawline() draws a pixel or a line
  47. in the current color, respectively.
  48. - vga_drawscanline() draws one single horisontal line of
  49. pixels and has been optimized for the fastest possible
  50. output.
  51. - vga_screenoff() and vga_screenon() turns the screen refresh
  52. off and on. On some VGA's the graphics operations will be
  53. faster, if the screen is turned off during graphics output.
  54. - vga_flip() switches between graphics and text mode without
  55. destroying the screen contents. This makes it possible for
  56. your application to use both text and graphics output.
  57. - vga_gecth() waits for a character to be typed an returns
  58. the ASCII value. If you press ESC (the exact key can be
  59. changed with vga_setflipchar()), the text mode will be
  60. temporarily restored until you press another key. This allows
  61. you to switch to another virtual console and later return to
  62. your graphics application.
  63. - vga_setflipchar() changes the character that vga_getch()
  64. uses for flipping between graphics and text mode.
  65. - vga_dumpregs() dumps the current VGA register contents to
  66. stdout
  67. My main motivation for implementing the graphics/text flipping was
  68. to make debugging easier. If your program reaches a breakpoint while
  69. in graphics mode, you can switch to text mode with the gdb command
  70. print vga_flip()
  71. and later restore the graphics screen contents with the same command.
  72. It is usefull to define the following alias in gdb:
  73. define flip <RETURN> print vga_flip() <RETURN> end <RETURN>
  74. There has been a lot of interest in the previous versions of VGAlib,
  75. and I would like to thank everybody who has suggested improvements.
  76. Tommy Frandsen (frandsen@diku.dk)