Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Programmers Reference 0.02b - <b>int 10h, 10h (16) set palette registers pcjr, ega</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
INT 10h,  10h (16)       Set Palette Registers                      PCjr, EGA

    Sets the palette and overscan (border) registers on the PCjr and EGA.

       On entry:      AH         10h
                      AL         Subservice
                                 0 - Set palette register
                                     BL      Palette register
                                     BH      Value to set

                                 1 - Set overscan (border) color register
                                     BH      Value to set

                                 2 - Set palette registers and border register
                                     ES:DX   Pointer to color list

                                 3 - Toggle intensify/blinking bit
                                     BL      0 - Enable intensify
                                     BL      1 - Enable blinking

                    VGA Only:
                                 7 - BL = Color register to get in BH

                                 8 - Returns overscan value in BH

                                 9 - Return list of palette registers & over-
                                     scan value
                                     ES:DX   Pointer to list

                                10h- Set color register
                                     BX      Register to set
                                     CH,CL,DL Green/Blue/Red

                                12h-
                                13h-
                                15h-
                                17h-
                                1Ah- Get color page info
                                     BL      Mode
                                     BH      Page

       Registers destroyed:      AX, SP, BP, SI, DI

  --------------------------------------------------------------------------

    There are 16 palette registers on the EGA and PCjr displays and 1
    overscan (border) register. This service gives the user control over
    these registers. The four subservices are explained below.

  Subservice  0  (Set Palette Register)

    Each of the 16 palette registers can take on 1 of 64 values. the value
    in BH is formatted as follows:

          Bit 7 - Reserved
          Bit 6 - Reserved
          Bit 5 - Secondary Red
          Bit 4 - Secondary Green
          Bit 3 - Secondary Blue
          Bit 2 - Red
          Bit 1 - Green
          Bit 0 - Blue

    The secondary colors have an intensity of 1/3, while the normal colors
    have an intensity of 2/3. For example, BH = 02h will produce green, BH
    = 10h will produce a dim green, and BH = 12h will produce a bright
    green.

    The default values for the palette registers, which are the same as
    the Color Graphics Adapter (CGA), are defined below:

  --------------------------------------------------------------------------
                   Palette
                   Register        Color value         Color
                     00h               00h             Black
                     01h               01h             Blue
                     02h               02h             Green
                     03h               03h             Cyan
                     04h               04h             Red
                     05h               05h             Magenta
                     06h               14h             Brown
                     07h               07h             White
                     08h               38h             Dark Gray
                     09h               39h             Light Blue
                     0Ah               3Ah             Light Green
                     0Bh               3Bh             LIght Cyan
                     0Ch               3Ch             Light Red
                     0Dh               3Dh             Light Magenta
                     0Eh               3Eh             Yellow
                     0Fh               3Fh             Bright White
  --------------------------------------------------------------------------

  Subservice  1  (Set Overscan (Border) Register)

    This subservice sets the border color. The Enhanced Color Display
    supports overscan in 200-line modes only.

  Subservice  2  (Set All Palette Registers and Overscan Register)

    ES:DX points to a 17-byte color list, in which the first 16 bytes
    consist of new values for the 16 palette registers and the last byte
    is the new overscan register value.

    Normally bit 7 of the attribute byte is used to indicate foreground
    blinking. With this subservice, bit 7 can indicate foreground blinking
    (BL=1) or background intensity (BL=0).

  Subservice  3  (Toggle intensify/blinking bit)

VGA Only:

  Subservice  7  (Get value of Color register)

  Subservice  8  (Get Overscan value)

  Subservice  9  (Load Color Registers into ...)

  Subservice 10h (Set Color Register)

  Subservice 12h (Change color registers ..)

  Subservice 13h (Set page ....)

  Subservice 15h (Read Color Register)

  Subservice 17h (Load Color Registers into memory)

  Subservice 1Ah (Get Color Page information)

See Also: INT 10h, 0Bh

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