Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Peter Norton Programmer's Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

  Service 10H (decimal 16) was introduced with the PCjr and carried forward
  in the EGA and PS/2 ROM BIOS. It consists of a set of subservices (Figure
  9-16) that let you control palette colors, blinking, and (on the MCGA and
  VGA) the video DAC. Be aware that different subservices are supported with
  different hardware. Before you use these subservices in a program, be sure
  your program "knows" which subsystem it's running on. (Video service 1AH
  can provide this information to a program.)

  Subservice Number        Description
  --------------------------------------------------------------------------
  AL = 00H                 Update a specified palette register.
  AL = 01H                 Specify the border color.
  AL = 02H                 Update all 16 palette registers plus border.
  AL = 03H                 Select background intensity or blink attribute.
  AL = 07H                 Read a specified palette register.
  AL = 08H                 Read the border color register.
  AL = 09H                 Read all 16 palette registers plus border.
  AL = 10H                 Update a specified video DAC color register.
  AL = 12H                 Update a block of video DAC color registers.
  AL = 13H                 Set video DAC color paging.
  AL = 15H                 Read a specified video DAC color register.
  AL = 17H                 Read a block of video DAC color registers.
  AL = 1AH                 Get video DAC color paging status.
  AL = 1BH                 Gray-scale a block of video DAC color registers.
  --------------------------------------------------------------------------

  Figure 9-16.  Subservices available through video BIOS service 10H.

  Subservice 00H (decimal 0) updates one of the 16 palette registers on an
  EGA or VGA. You specify the palette register number in BL and a new
  palette register value in BH when you call this subservice. The VGA BIOS
  also supports subservice 07H (decimal 7), which performs the complementary
  operation: When you call subservice 07H with a palette register number in
  BL, the ROM BIOS returns that palette register's current contents in BH.
  (Subservice 07H isn't available in the EGA BIOS because the EGA has
  write-only palette registers.)

  Subservice 01H (decimal 1) sets the border color on an EGA or VGA. You
  pass the color value to the BIOS in register BH when you call this
  subservice. The VGA BIOS supports subservice 08H, which returns the
  current border color value in BH, but again this complementary subservice
  isn't available on the EGA.

  Here are two tips about setting the border color on an EGA or VGA. First,
  in most EGA video modes the border area is very small, and selecting any
  border color other than black results in a narrow, smeared border. On the
  VGA, the border is better. Second, if compatibility with the CGA is
  important, remember that you can also use video service 0BH (page 180) to
  set the border color.

  Subservice 02H (decimal 2) updates all 16 palette registers, plus the
  border color, with a single ROM BIOS call. Before you call subservice 02H,
  you must store all 16 palette register values plus the border color value
  in a 17-byte table. You then pass the address (segment and offset) of this
  table to the BIOS in registers ES and DX when you call this subservice.
  The VGA also provides a subservice that lets you read the palette
  registers back into a table: When you call subservice 09H (decimal 9) with
  ES:DX pointing to a 17-byte table, the ROM BIOS fills the table with the
  16 current palette register values and the border color.

  Subservice 03H (decimal 3) lets you selectively enable or disable the
  blinking attribute. The ROM BIOS uses blinking by default, but if you
  prefer to have a full range of 16 background colors instead of only 8, you
  can use subservice 03H to disable blinking. The value you pass in register
  BL determines whether blinking is enabled (BL = 01H) or disabled (BL =
  00H).

  Subservices 10H (decimal 16) and 15H (decimal 21) are supported only by
  the MCGA and VGA BIOS. These two subservices give you direct access to one
  of the 256 color registers in the video digital to analog convertor (DAC).
  To update a video DAC color register, call subservice 10H with the color
  register number in BX and 6-bit red, green, and blue color values in
  registers DH, CH, and CL. To read a specified color register, place the
  color register number in BX and use subservice 15H, which returns the RGB
  values in DH, CH, and CL.

  The related subservices 12H (decimal 18) and 17H (decimal 23) operate on a
  block of video DAC color registers instead of only one. To use subservice
  12H, create a table of 3-byte red-green-blue values. Then place the
  segment-offset address of the table in ES and DX, the first color register
  number to update in BX, and the number of registers to update in CX. When
  you call subservice 12H, the ROM BIOS stores each red-green-blue value in
  turn into the block of color registers you specified in BX and CX.

  The complementary subservice 17H requires you to pass the address of a
  table in ES:DX, along with a starting register number in BX and a register
  count in CX. The ROM BIOS fills the table with the red-green-blue values
  it reads from the block of color registers you specified.

  On the VGA, which has both palette registers and video DAC color
  registers, you can use subservices 13H (decimal 19) and 1AH (decimal 26)
  to switch rapidly between different palettes. By default, the ROM BIOS
  configures the VGA hardware so that color decoding is the same as on the
  EGA: Each of the 16 palette registers contains a 6-bit value that
  specifies one of the first 64 video DAC registers, and these 64 color
  registers specify the 64 colors available in the EGA palette.

  Subservice 13H lets you use the other three color pages, or groups of 64
  video DAC color registers. (See Figure 9-17.) If you call subservice 13H
  with BH = 01H and BL = 01H, for example, the BIOS configures the VGA
  hardware to display colors from the second group of 64 color registers
  (color page 1). To use the first group (color page 0) again, you could
  call the same subservice with BH = 00H and BL = 01H. If, for example, you
  used the default, EGA-compatible colors in color page 0, and their
  gray-scale equivalents in color page 1, you could switch rapidly between
  the two with a single call to subservice 13H.

  If you need to switch rapidly between more than four palettes, you can use
  subservice 13H with BH = 01H and BL = 00H to configure the VGA color
  decoding hardware to use 4-bit palette register values instead of 6-bit
  values. In this case, each palette register value can specify one of only
  16 different video DAC registers. This makes 16 color pages available,
  each comprising 16 color registers. You can select any of the 16 color
  pages using subservice 13H with BL = 01H.

  Parameters                           Description
  --------------------------------------------------------------------------
  BL = 00H           BH = 00H          Use four 64-register pages.
                     BH = 01H          Use sixteen 16-register pages.
  BL = 01H           BH = n            Color page number.
                                       (n = 00H-03H if using 64-register
                                       pages
                                       n = 00H-0FH if using 16-register
                                       pages)
  --------------------------------------------------------------------------

  Figure 9-17.  Video DAC color paging with service 10H, subservice 13H.

  The VGA ROM BIOS supplements subservice 13H with a complementary function,
  subservice 1AH. This subservice returns the color page status in BL (16-
  or 64-register color pages) and BH (current color page number).

  With subservice 1BH (decimal 27) on the MCGA and VGA, you can convert the
  color values in a block of consecutive video DAC color registers to
  corresponding shades of gray. Call this subservice with BX containing the
  number of the first video DAC register to convert, and with CX containing
  the number of registers to update.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson