home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / asmutil / 80x0393.zip / MODEX.DOC < prev    next >
Text File  |  1993-03-30  |  4KB  |  78 lines

  1. By: Matt Pritchard
  2. Re: Vga mode x
  3. ----------------------------------------------------------------------
  4.  
  5. Hello Everyone,
  6.  
  7.     Lately I've seen a lot of interest in Mode X programming here from 
  8. people like Matt Heck,  Sean Palmer,  Shawn Mills,  Jerry Coffin, Matt 
  9. Rains, Mike Koss, etc.
  10.  
  11. Well,  I've decided to pull  my head out of the sand,  and donate some 
  12. code to the echo.  All of these are Optimized  code,  fully supporting 
  13. the virtual screen sizes and multiple pages.                                    
  14.                                                                     
  15. It was designed for MASM 5.10A, but TASM will probably work as well.
  16.  
  17. Take a look at what I have to offer:
  18.  
  19. * Complete Code: Full source with *LOTS* of Comments 
  20. * COMPLETE MODE SET CODE - All *8* variations of MODE X are included 
  21. * MULTIPLE PAGES/PAGE FLIPPING - All the code's included 
  22. * VIRTUAL SCREENS/ SMOOTH SCROLLING - All of it's here 
  23. * DAC READ/WRITE CODE - all the code needed to play with the DACs 
  24. * HIGH SPEED GRAPHICS PRIMITIVES: 
  25.   =   CLEAR PAGE 
  26.   =   SET PIXEL 
  27.   =   READ PIXEL 
  28.   =   FILL BLOCK (4 times faster than mode 13h) 
  29.   =   DRAW LINE (Fast! + Optimized Horizontal & vertical)
  30.  
  31. Despite the comments included,  I'm sure people will  have  questions. 
  32. Please send the  to me  over the echo  (I Don't have net mail *sigh*), 
  33. as I really want feedback on this.
  34.  
  35. The following is a FAQ (Frequently Asked Question) summary of informa-
  36. tion and assembly routines for Mode "X" Graphics.
  37.  
  38. An overview of Mode "X" for the VGA Adaptor:
  39.  
  40. 1) Mode "X" is a 256 color graphics mode that is  available  on  *ANY* 
  41. VGA card with the  minimum  of  256K  video  RAM.  It  is  capable  of 
  42. providing higher resoultions  than the only "Official" 256 color mode, 
  43. mode 13h. (In quickbasic that is mode 13)
  44.  
  45. 2) Mode  "X"  comes in 8 different flavors: 320 or 360 pixels horizon-
  46. tally, and 200, 240, 400, and 480 pixels vertically.
  47.  
  48. 3) Since mode X is not supported by the VGA BIOS, there is no built in 
  49. support for it.  A program  must provide  its own  routines  for *ALL* 
  50. operations in Mode "X", including setting up the video mode.
  51.  
  52. 4) Unlike Mode 13h, which has one display page, Mode "X" allows from 1 
  53. to 4 video pages, depending upon the  resoultion selected.  The reason 
  54. that Mode 13h has but one  page is that  it  activates a VGA  hardware 
  55. feature known as CHAIN4, which prevents access to all but 64K of VGA's 
  56. video RAM.  CHAIN4 is what provides mode 13h's linear addres space.
  57.  
  58. 5) Unlike Mode 13h,  where each 256 color (1-byte)  pixel has a unique 
  59. address in the E000: segement,  in Mode X there are Four (4) Pixels at 
  60. each address in E000: segment.  The VGA's control registers allow  you 
  61. to control which of the 4 pixels is currently available at an address.
  62.  
  63. 6) It is possible to use the VGA's control registers to  operate  on 2 
  64. or more of the Pixels at the same address at  the  same time.  The CPU 
  65. can write one color value,  and set up to 4 pixels with that value  at 
  66. the same time.
  67.  
  68. 7) Video RAM that is not being used for the current screen display can 
  69. be used to store images and patterns.  These  images and  patterns can 
  70. be copied to other parts of the Video RAM 4 bytes (32 bits) at a time, 
  71. which is much faster than the 8 bits (1 byte) at time that is possible 
  72. over the ISA BUS.(16 Bit BUS operations can produce erroneous results)
  73.  
  74. If anything is unclear,  inadequate,  or you just plain  want to  know 
  75. more or have other specific questions, please send me a message.
  76.  
  77. -Matt Pritchard
  78.