home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / PROGRAMM / FGL112B.ZIP / USER02.DOC < prev    next >
Text File  |  1992-10-05  |  22KB  |  467 lines

  1.  
  2.  
  3. Chapter 2
  4.  
  5. PC and PS/2 Video Modes
  6. 18  Fastgraph User's Guide
  7.  
  8.  
  9. Overview
  10.  
  11.      In the PC and PS/2 worlds, the method by which information appears on
  12. the computer's display screen is determined by the video mode currently in
  13. effect.  The video modes have different resolutions, different character or
  14. pixel attributes, different video memory structures, and other inherent
  15. hardware differences.  However, you do not need an in-depth knowledge of
  16. these video internals, because Fastgraph handles the necessary details.
  17.  
  18.      The PC and PS/2 video modes may be separated into two major classes:
  19. text modes and graphics modes.  In text modes, the display screen is divided
  20. into character cells.  There are 25 rows and either 40 or 80 columns of
  21. cells, and in each cell we can store any of the 256 characters in the IBM PC
  22. character set.  Each character has an associated attribute that determines
  23. such things as its foreground color, its background color, and whether or not
  24. the character blinks.  In graphics modes, the display screen is divided into
  25. picture elements, or pixels.  Depending on the video mode, the number of
  26. pixel rows ranges between 200 and 480, while the number of columns ranges
  27. between 320 and 720.  Each pixel has an associated value that determines the
  28. color of the pixel.  The number of character cells or pixels available is
  29. called the resolution of the screen.
  30.  
  31.      The display adapter (graphics card) and the video display (monitor)
  32. connected to it determine the video modes available on a given system.  The
  33. following table summarizes the characteristics of the PC and PS/2 video modes
  34. that Fastgraph supports.
  35.  
  36.      Mode                      No. of    Supported         Supported
  37.     Number  Type    Resolution Colors    Adapters          Displays
  38.  
  39.        0    Text    40 x 25    16/8      CGA,EGA,VGA,MCGA  RGB,ECD,VGA
  40.        1    Text    40 x 25    16/8      CGA,EGA,VGA,MCGA  RGB,ECD,VGA
  41.        2    Text    80 x 25    16/8      CGA,EGA,VGA,MCGA  RGB,ECD,VGA
  42.        3    Text    80 x 25    16/8      CGA,EGA,VGA,MCGA  RGB,ECD,VGA
  43.        4  Graphics  320 x 200  4         CGA,EGA,VGA,MCGA  RGB,ECD,VGA
  44.        5  Graphics  320 x 200  4         CGA,EGA,VGA,MCGA  RGB,ECD,VGA
  45.        6  Graphics  640 x 200  2/16      CGA,EGA,VGA,MCGA  RGB,ECD,VGA
  46.        7    Text    80 x 25    b/w       MDA,HGC,EGA,VGA   Mono,ECD,VGA
  47.        9  Graphics  320 x 200  16        Tandy 1000,PCjr   RGB
  48.       11  Graphics  720 x 348  b/w       HGC               Monochrome
  49.       12  Graphics  320 x 200  b/w       HGC               Monochrome
  50.       13  Graphics  320 x 200  16        EGA,VGA           RGB,ECD,VGA
  51.       14  Graphics  640 x 200  16        EGA,VGA           RGB,ECD,VGA
  52.       15  Graphics  640 x 350  b/w       EGA,VGA           Mono,VGA
  53.       16  Graphics  640 x 350  16/64     EGA,VGA           ECD,VGA
  54.       17  Graphics  640 x 480  2/256K    VGA,MCGA          VGA
  55.       18  Graphics  640 x 480  16/256K   VGA               VGA
  56.       19  Graphics  320 x 200  256/256K  VGA,MCGA          VGA
  57.       20  Graphics  320 x 200  256/256K  VGA               VGA
  58.       21  Graphics  320 x 400  256/256K  VGA               VGA
  59.       22  Graphics  320 x 240  256/256K  VGA               VGA
  60.       23  Graphics  320 x 480  256/256K  VGA               VGA
  61.  
  62.      Some notes about the format and abbreviations used in this table are in
  63. order.  A single value in the "number of colors" column refers to the number
  64.                                        Chapter 2:  PC and PS/2 Video Modes  19
  65.  
  66. of colors available in that video mode.  In text modes, a pair of numbers
  67. such as 16/8 means each displayed character can have one of 16 foreground
  68. colors and one of 8 background colors.  In graphics modes, a pair of numbers
  69. such as 16/64 means 16 colors can be displayed simultaneously from a
  70. collection, or palette, of 64.  The "b/w" listed in the monochrome modes
  71. stands for "black and white".  Characters or pixels in these video modes do
  72. not really have associated colors but instead have display attributes such as
  73. blinking or different intensities.
  74.  
  75.      The meanings of the abbreviations in the "supported adapters" and
  76. "supported displays" columns are:
  77.  
  78.      CGA       Color Graphics Adapter
  79.      ECD       Enhanced Color Display
  80.      EGA       Enhanced Graphics Adapter
  81.      HGC       Hercules Graphics Card
  82.      MCGA      Multi-Color Graphics Array
  83.      MDA       Monochrome Display Adapter
  84.      RGB       Red-Green-Blue Color Display
  85.      VGA       Video Graphics Array
  86.  
  87. The use of the term "VGA" in the "supported display" column refers to any
  88. analog display, such as a VGA, Super VGA (SVGA), or Multisync monitor.
  89.  
  90.      The IBM PS/2 family does not have an adapter and display combination per
  91. se.  Instead, the video hardware used in these systems is called the video
  92. subsystem.  The Model 25 and Model 30 have an MCGA-based video subsystem,
  93. while other models have a VGA-based video subsystem.
  94.  
  95.      This rest of this chapter will provide an overview of the most important
  96. features and restrictions of each video mode.  The first section will discuss
  97. the text modes, while the following section will discuss the graphics modes.
  98.  
  99.  
  100. Text Modes
  101.  
  102.      There are five text video modes in the IBM PC and PS/2 family.  Four of
  103. these modes (0, 1, 2, and 3) are designed for color displays, while the
  104. remaining mode (7) is designed for monochrome displays.  All text modes were
  105. introduced with the original IBM PC.
  106.  
  107.      In text modes, the screen is divided into character cells.  There are
  108. two bytes of video memory associated with each character cell -- one byte for
  109. the character's ASCII value, and another for the character's display
  110. attribute.  The amount of video memory required to store one screen of
  111. information (called a video page) is thus
  112.  
  113.                     number_of_columns x number_of_rows x 2
  114.  
  115. All text modes use 25 rows, so for the 40-column modes (0 and 1) the size of
  116. a video page is 2,000 bytes, and for the 80-column modes (2, 3, and 7) the
  117. size of a video page is 4,000 bytes.
  118. 20  Fastgraph User's Guide
  119.  
  120.       Mode                No. of   Supported         Supported
  121.      Number  Resolution   Colors   Adapters          Displays
  122.  
  123.        0     40 x 25      16/8     CGA,EGA,VGA,MCGA  RGB,ECD,VGA
  124.        1     40 x 25      16/8     CGA,EGA,VGA,MCGA  RGB,ECD,VGA
  125.        2     80 x 25      16/8     CGA,EGA,VGA,MCGA  RGB,ECD,VGA
  126.        3     80 x 25      16/8     CGA,EGA,VGA,MCGA  RGB,ECD,VGA
  127.        7     80 x 25      b/w      MDA,HGC,EGA,VGA   Monochrome,ECD,VGA
  128.  
  129.      The remainder of this section will describe the text video modes in more
  130. detail.
  131.  
  132. Mode 0
  133.  
  134.      Mode 0 is a 40-column by 25-row color text mode.  It is often called a
  135. colorless mode since it was designed to be used with composite or television
  136. monitors (as opposed to RGB monitors).  When used with these types of
  137. monitors, the available 16 "colors" appear as distinct shades of gray.  When
  138. used with an RGB monitor, mode 0 is identical in all respects to mode 1.  The
  139. use of composite or television monitors as PC video displays has virtually
  140. disappeared today.  As a result, mode 0 is used infrequently.
  141.  
  142. Mode 1
  143.  
  144.      Mode 1 is a 40-column by 25-row color text mode.  It is supported across
  145. all video adapter and color display combinations in the PC and PS/2 families.
  146. Characters displayed in mode 1 have an associated display attribute that
  147. defines the character's foreground color, its background color, and whether
  148. or not it blinks.  Sixteen foreground colors and eight background colors are
  149. available.
  150.  
  151. Mode 2
  152.  
  153.      Mode 2 is an 80-column by 25-row color text mode.  Like mode 0, it is
  154. often called a colorless mode since it was designed to be used with composite
  155. or television monitors (as opposed to RGB monitors).  When used with these
  156. types of monitors, the available 16 "colors" appear as distinct shades of
  157. gray.  When used with an RGB monitor, mode 2 is identical in all respects to
  158. mode 3.  The use of composite or television monitors as PC video displays has
  159. virtually disappeared today.  As a result, mode 2 is used infrequently.
  160.  
  161. Mode 3
  162.  
  163.      Mode 3 is an 80-column by 25-row color text mode.  It is the default
  164. video mode for systems that use any type of color display.  This mode is
  165. supported across all video adapter and color display combinations in the PC
  166. and PS/2 families.  Characters displayed in mode 3 have an associated display
  167. attribute that defines the character's foreground color, its background
  168. color, and whether or not it blinks.  Sixteen foreground colors and eight
  169. background colors are available.
  170.  
  171. Mode 7
  172.  
  173.      Mode 7 is the 80-column by 25-row monochrome text mode.  It is the
  174. default video mode for systems that use a monochrome display.  To use this
  175. mode, you must have a Monochrome Display Adapter (MDA), Hercules Graphics
  176. Card (HGC), or an Enhanced Graphics Adapter (EGA) connected to a monochrome
  177.                                        Chapter 2:  PC and PS/2 Video Modes  21
  178.  
  179. display.  Most VGA display adapters also provide an emulation mode that
  180. allows you to use mode 7 with analog displays.  Characters displayed in mode
  181. 7 have an associated display attribute that defines whether the character is
  182. invisible, normal, bold, underlined, reversed, blinking, or a combination of
  183. these.
  184.  
  185.  
  186. Graphics Modes
  187.  
  188.      There are 13 standard graphics video modes available in the IBM PC and
  189. PS/2 family.  Fastgraph provides support for 11 of the 13 modes (modes 8 and
  190. 10, which are specific to the PCjr and Tandy 1000 systems, are not
  191. supported).  In addition to these 13 modes, Fastgraph supports two video
  192. modes for the Hercules Graphics Card (modes 11 and 12) and four extended VGA
  193. modes (modes 20 through 23).  The following sections discuss the graphics
  194. modes in more detail.  The discussions include an overview of video memory
  195. organization in each mode, but you don't need a knowledge of this subject to
  196. use Fastgraph.
  197.  
  198.  
  199. CGA Graphics Modes
  200.  
  201.      Modes 4, 5, and 6 are designed to be used with the Color Graphics
  202. Adapter (CGA) and for this reason are called the native CGA modes.  They were
  203. the only graphics modes available with the original IBM PC.  Newer graphics
  204. adapters (EGA, VGA, and MCGA) can emulate the CGA, which means that the CGA
  205. graphics modes are available on any PC or PS/2 system equipped with a color
  206. display.
  207.  
  208.  
  209.          Mode                No. of   Supported         Supported
  210.         Number  Resolution   Colors   Adapters          Displays
  211.  
  212.           4     320 x 200    4        CGA,EGA,VGA,MCGA  RGB,ECD,VGA
  213.           5     320 x 200    4        CGA,EGA,VGA,MCGA  RGB,ECD,VGA
  214.           6     640 x 200    2/16     CGA,EGA,VGA,MCGA  RGB,ECD,VGA
  215.  
  216.  
  217. Mode 4
  218.  
  219.      Mode 4 is a CGA graphics mode with a resolution of 320 horizontal pixels
  220. by 200 vertical pixels.  Each pixel can assume one of four colors (the
  221. available colors are determined by which one of six palettes has been
  222. selected), so each pixel requires two bits of video memory.  This means that
  223. each byte of video memory represents four pixels.
  224.  
  225. Mode 5
  226.  
  227.      Mode 5 is the colorless analog of mode 4.  It was designed to be used
  228. with composite or television monitors (as opposed to RGB monitors).  When
  229. used with these types of monitors, the four colors appear as distinct shades
  230. of gray.  When used with an RGB monitor, mode 5 is essentially identical to
  231. mode 4.  The use of composite or television monitors as PC video displays has
  232. virtually disappeared today.  As a result, mode 5 is used infrequently.
  233. 22  Fastgraph User's Guide
  234.  
  235. Mode 6
  236.  
  237.      Mode 6 is a CGA graphics mode with a resolution of 640 horizontal pixels
  238. by 200 vertical pixels.  Each pixel can assume two states -- on or off.  The
  239. color in which the "on" pixels appear can be selected from a palette of 16
  240. available colors.  Each pixel thus requires one bit of video memory, which
  241. means that each byte of video memory represents eight pixels.
  242.  
  243.  
  244. Tandy 1000 and PCjr Graphics Modes
  245.  
  246.      Modes 8, 9, and 10 are only available on the PCjr and Tandy 1000 series
  247. computers (these systems also support modes 4, 5, and 6).  Modes 8 and 10 are
  248. not widely used, and for this reason Fastgraph does not support them.
  249.  
  250.  
  251.              Mode                No. of   Supported         Supported
  252.             Number  Resolution   Colors   Adapters          Displays
  253.  
  254.               8     160 x 200    16       Tandy 1000,PCjr   RGB
  255.               9     320 x 200    16       Tandy 1000,PCjr   RGB
  256.               10    640 x 200    4        Tandy 1000,PCjr   RGB
  257.  
  258.  
  259. Mode 9
  260.  
  261.      Mode 9 is a Tandy 1000 and PCjr graphics mode with a resolution of 320
  262. horizontal pixels by 200 vertical pixels.  Each pixel can assume one of 16
  263. colors, so each pixel requires four bits of video memory.  This means that
  264. each byte of video memory represents two pixels.  The Tandy 1000 and PCjr use
  265. standard random-access memory (RAM) as video memory.
  266.  
  267.  
  268. Hercules Graphics Modes
  269.  
  270.      Modes 11 and 12 are used with the Hercules Graphics Card (HGC) and a
  271. monochrome display.  As such, they are not true IBM video modes, but because
  272. of the popularity of the HGC, Fastgraph provides support for this adapter.
  273. IBM has not defined video modes with numbers 11 and 12.  Should they choose
  274. to do so in the future, Fastgraph's Hercules video mode numbers would likely
  275. change.
  276.  
  277.  
  278.           Mode                No. of   Supported         Supported
  279.          Number  Resolution   Colors   Adapters          Displays
  280.  
  281.            11    720 x 348    b/w      HGC               Monochrome
  282.            12    320 x 200    b/w      HGC               Monochrome
  283.                                        Chapter 2:  PC and PS/2 Video Modes  23
  284.  
  285. Mode 11
  286.  
  287.      Mode 11 is a true Hercules graphics mode with a resolution of 720
  288. horizontal pixels by 348 vertical pixels.  Each pixel can assume two
  289. states -- on or off.  Each pixel thus requires one bit of video memory, which
  290. means that each byte of video memory represents eight pixels.
  291.  
  292. Mode 12
  293.  
  294.      Mode 12 is a software-simulated Hercules graphics mode with an effective
  295. resolution of 320 horizontal pixels by 200 vertical pixels.  Its purpose is
  296. to provide a resolution that is available with all other graphics display
  297. adapters.
  298.  
  299.      This mode converts all coordinates from the 320 by 200 space (called
  300. virtual coordinates) into the 720 by 348 coordinate system (called physical
  301. coordinates).  It does this by using two physical pixels for each virtual
  302. pixel and scan doubling the odd-numbered virtual rows.  Finally, offsets are
  303. added to the resulting physical coordinates to center the image area on the
  304. display.  This creates an image area bounded horizontally by the physical
  305. coordinates 40 and 679 and vertically by the physical coordinates 24 and 323.
  306.  
  307.  
  308. EGA Graphics Modes
  309.  
  310.      Modes 13 through 16 were introduced with the Enhanced Graphics Adapter
  311. (EGA) and for this reason are called the native EGA modes.  The VGA also
  312. provides support for these modes, but the MCGA does not.  The original IBM
  313. EGA only contained 64K bytes of video memory, but memory could be added in
  314. 64K increments to fully populate the adapter with 256K bytes of video memory.
  315. As other manufacturers developed EGA cards, they generally included 256K
  316. bytes of video memory as a standard feature.
  317.  
  318.  
  319.         Mode                No. of   Supported         Supported
  320.        Number  Resolution   Colors   Adapters          Displays
  321.  
  322.          13    320 x 200    16       EGA,VGA           RGB,ECD,VGA
  323.          14    640 x 200    16       EGA,VGA           RGB,ECD,VGA
  324.          15    640 x 350    b/w      EGA,VGA           Monochrome,VGA
  325.          16    640 x 350    16/64    EGA,VGA           ECD,VGA
  326.  
  327.  
  328. Mode 13
  329.  
  330.      Mode 13 is an EGA graphics mode with a resolution of 320 horizontal
  331. pixels by 200 vertical pixels.  Each pixel can assume one of 16 colors, so
  332. each pixel requires four bits of video memory.  In this mode, video memory is
  333. organized as four bit planes.  Each video memory address actually references
  334. four bytes, one in each plane.  Put another way, each video memory byte
  335. references eight pixels, stored one bit per plane.
  336. 24  Fastgraph User's Guide
  337.  
  338. Mode 14
  339.  
  340.      Mode 14 is an EGA graphics mode with a resolution of 640 horizontal
  341. pixels by 200 vertical pixels.  Each pixel can assume one of 16 colors, so
  342. each pixel requires four bits of video memory.  In this mode, video memory is
  343. organized as four bit planes.  Each video memory address actually references
  344. four bytes, one in each plane.  Put another way, each video memory byte
  345. references eight pixels, stored one bit per plane.
  346.  
  347. Mode 15
  348.  
  349.      Mode 15 is an EGA monochrome graphics mode with a resolution of 640
  350. horizontal pixels by 350 vertical pixels.  Each pixel can assume one of 4
  351. display attributes, so each pixel requires two bits of video memory.  In this
  352. mode, video memory is organized as four bit planes, two of which are
  353. disabled.  Each video memory address actually references two bytes, one in
  354. each enabled plane.  Put another way, each video memory byte references eight
  355. pixels, stored one bit per plane.
  356.  
  357. Mode 16
  358.  
  359.      Mode 16 is an EGA graphics mode with a resolution of 640 horizontal
  360. pixels by 350 vertical pixels.(1)  Each pixel can assume one of 16 colors
  361. (the 16 colors can be selected from a palette of 64 colors), so each pixel
  362. requires four bits of video memory.  In this mode, video memory is organized
  363. as four bit planes.  Each video memory address actually references four
  364. bytes, one in each plane.  Put another way, each video memory byte references
  365. eight pixels, stored one bit per plane.
  366.  
  367.  
  368. VGA and MCGA Graphics Modes
  369.  
  370.      Modes 17, 18, and 19 were introduced with the MCGA and VGA video
  371. subsystems of the IBM PS/2 computers.  Since the introduction of the PS/2,
  372. other manufacturers have developed VGA cards that can be used with the PC
  373. family.  The VGA supports all three of these modes, but the MCGA does not
  374. support mode 18.  Modes 17 and 18 are called native VGA modes.
  375.  
  376.      Modes 20 through 23 are the extended VGA graphics modes.  Although these
  377. video modes are not standard VGA modes, they will work on any VGA system.
  378. Mode 20 is a special VGA version of mode 19, while mode 21 uses scan doubling
  379. to achieve a 400-line display.  Mode 22 is the so-called "mode X" and is
  380. appealing because it has a 1:1 aspect ratio.  Mode 23 is identical to mode
  381. 22, but it uses scan doubling to achieve a 480-line display.  Should IBM
  382. define video modes numbered 20 through 23 in the future, Fastgraph's numbers
  383. for these video modes would likely change.
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390. ____________________
  391.  
  392.      (1) In mode 16, the video page size actually is 640 x 400 pixels, though
  393. the screen resolution is 640 x 350.  The final 50 pixel rows are not displayed
  394. but are available for off-screen storage.
  395.                                        Chapter 2:  PC and PS/2 Video Modes  25
  396.  
  397.  
  398.            Mode                No. of    Supported        Supported
  399.           Number  Resolution   Colors    Adapters         Displays
  400.  
  401.             17    640 x 480    2/256K    VGA,MCGA         VGA
  402.             18    640 x 480    16/256K   VGA              VGA
  403.             19    320 x 200    256/256K  VGA,MCGA         VGA
  404.             20    320 x 200    256/256K  VGA              VGA
  405.             21    320 x 400    256/256K  VGA              VGA
  406.             22    320 x 240    256/256K  VGA              VGA
  407.             23    320 x 480    256/256K  VGA              VGA
  408.  
  409. Mode 17
  410.  
  411.      Mode 17 is a VGA and MCGA graphics mode with a resolution of 640
  412. horizontal pixels by 480 vertical pixels.  Each pixel can assume two
  413. states -- on or off.  The color in which the "on" and "off" pixels appear can
  414. be selected from a palette of 262,144 available colors.  Each pixel thus
  415. requires one bit of video memory, which means that each byte of video memory
  416. represents eight pixels.  On VGA systems, video memory is organized as four
  417. bit planes, and mode 17 is implemented by enabling one of these planes.
  418.  
  419. Mode 18
  420.  
  421.      Mode 18 is a native VGA graphics mode with a resolution of 640
  422. horizontal pixels by 480 vertical pixels.  Each pixel can assume one of 16
  423. colors (the 16 colors can be selected from a palette of 262,144 colors), so
  424. each pixel requires four bits of video memory.  In this mode, video memory is
  425. organized as four bit planes.  Each video memory address actually references
  426. four bytes, one in each plane.  Put another way, each video memory byte
  427. references eight pixels, stored one bit per plane.
  428.  
  429. Mode 19
  430.  
  431.      Mode 19 is a VGA and MCGA graphics mode with a resolution of 320
  432. horizontal pixels by 200 vertical pixels.  Each pixel can assume one of 256
  433. colors (the 256 colors can be selected from a palette of 262,144 colors), so
  434. each pixel requires eight bits of video memory.  This means that each byte of
  435. video memory represents one pixel.
  436.  
  437. Mode 20
  438.  
  439.      Mode 20 is a VGA graphics mode with a resolution of 320 horizontal
  440. pixels by 200 vertical pixels.  Each pixel can assume one of 256 colors (the
  441. 256 colors can be selected from a palette of 262,144 colors), so each pixel
  442. requires eight bits of video memory.  This means that each byte of video
  443. memory represents one pixel.  This mode offers the same resolution and number
  444. of colors as mode 19, but its video memory is organized as a series of four
  445. bit planes.  Every fourth pixel is stored in the same plane (that is, a pixel
  446. whose horizontal coordinate is x resides in plane x mod 4).
  447.  
  448. Mode 21
  449.  
  450.      Mode 21 is a VGA color graphics mode with a resolution of 320 horizontal
  451. pixels by 400 vertical pixels.  Except for the resolution, its video memory
  452. organization is identical to mode 20.
  453. 26  Fastgraph User's Guide
  454.  
  455. Mode 22
  456.  
  457.      Mode 22 is a VGA color graphics mode with a resolution of 320 horizontal
  458. pixels by 240 vertical pixels.  This is the so-called "mode X" described by
  459. Michael Abrash in Dr. Dobb's Journal.  Except for the resolution, its video
  460. memory organization is identical to mode 20.
  461.  
  462. Mode 23
  463.  
  464.      Mode 23 is a VGA color graphics mode with a resolution of 320 horizontal
  465. pixels by 480 vertical pixels.  Except for the resolution, its video memory
  466. organization is identical to mode 20.
  467.