home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / EGA_VGA / XGADEMO.ZIP / XGADEMO.DOC < prev    next >
Encoding:
Text File  |  1991-01-27  |  4.1 KB  |  83 lines

  1.  
  2.                XGA Modes toolkit - version 0.5
  3.  
  4. This package contains a set of simple routines providing direct-video
  5. access to IBM's new XGA adapter.  These routines have been tested on
  6. both single-monitor and dual-monitor (XGA & VGA) setups.  If you have
  7. multiple XGA adapter/monitors (and you can have up to eight of them!),
  8. you'll have to modify these routines yourself - I ran out of money after
  9. buying one XGA adapter <grin>.
  10.  
  11. The routines and detailed explanations of their operation are in
  12. XGAMODES.ASM, an assembly module written to interface with a driving
  13. "C" program using the medium model.  There is also a simple XGADEMO.C
  14. program provided as proof that these routines work (XGADEMO was also an
  15. invaluable tool for me in *getting* them to work, which is why the
  16. commented-out function calls in it exist).
  17.  
  18. Basically, the routines provide functions for throwing an XGA adapter
  19. into any of the modes listed below.  For the graphics modes, there are
  20. also routines for setting the XGA palette (which is *different* from the
  21. VGA palette), writing/reading individual pixels, and writing/reading
  22. entire (or portions of) individual scan lines.  The routines use the
  23. 64K aperture of the XGA as opposed to its 1MB or 4MB aperture, so they're
  24. not as fast as they could be - but they work, and they're relatively
  25. simple.
  26.  
  27. The XGA video modes supported by these routines are:
  28.  
  29.              normal VGA text mode
  30.              132-col VGA text mode
  31.              1024x768x256 graphics mode
  32.              1024x768x16 graphics mode
  33.              640x480x256 graphics mode
  34.              640x480x65536 graphics mode
  35.  
  36. This is definitely a "work-in-progress", but with one exception
  37. (detailed below, involving the 16-bit color mode) everything works.
  38. Future releases will fix that bug, and will most likely have
  39. faster code and more features, but will be compatible with the
  40. subroutine calls in this release.
  41.  
  42. ---------------------
  43.  
  44. The bug:  in the 16-bit ("true-color") mode, the colors are wrong.
  45. Specifically, the blue values are being ignored - each of those identical
  46. red/green rectangles on the demo screen is *supposed* to be a different
  47. shade of blue.  I don't know why this isn't working right, and am releasing
  48. this as "version 0.5" *with* the bug and a plea for someone to help me
  49. fix it.  To date, the responses to my queries seem to indicate that
  50. >>I<< am the XGA "expert", but I am confident that this will change
  51. over time.
  52.  
  53. ----------------------
  54.  
  55. The limitations (of both the XGA adapter and this code):
  56.  
  57. - Although the XGA adapter works just fine as a VGA adapter when it is in
  58. a VGA mode (which it can do on single-mode setups), it has a few uglies
  59. when it is in one of its extended modes.
  60.  
  61. For one, you can't get an XGA adapter back into a VGA mode just by
  62. calling a BIOS INT 10H routine, because the (current) PS/2 BIOS doesn't
  63. know about the XGA's special registers and so can't reset them - you have
  64. to invoke 'xga_mode(0)' first to get the adapter(s) back into a "normal"
  65. VGA mode.  On dual-adapter setups, 'xga_mode(0)' leaves the XGA image
  66. intact but switches the focus back to the VGA monitor.
  67.  
  68. For another, when it is in an extended mode, the XGA uses its own
  69. palette registers, which are *different* from those of the VGA.  They are
  70. accessed differently (use 'xga_setpalette()'), they are *not* initialized
  71. to the VGA palette (you have to set them explicitly), and they use the
  72. *top* six bits of a byte instead of the *bottom* six bits (IE, RGB value
  73. 10,20,30 in VGA mode is the same as color 40,80,120 in extended mode).
  74. 'xga_setpalette()' uses XGA-style values - 0 thru 255.
  75.  
  76. Also, the (current) Windows drivers that are distributed with the XGA
  77. prevent the XGA routines from working properly, probably because the
  78. XGA register locations are not virtualized.  The monitor ID is returned
  79. as an invalid '0000', the memory-detect routines do not work, and
  80. everything else is equally messed up.  For the moment, if 'xga_detect()'
  81. receives that impossible '0000' monitor ID, it just returns a "no XGA
  82. found" and inhibits the other routines from doing anything. 
  83.