vbdpss.hlp (Table of Contents; Topic list)
Article Q46817
                                                 Contents  Index  Back
─────────────────────────────────────────────────────────────────────────────
                           Knowledge Base Contents  Knowledge Base Index
 
 Getting High-Intensity Background Color in SCREEN 0 - Q46817
 
 To print text with a high-intensity background, you must meet the
 following requirements:
 
 1. Be in SCREEN 0 (text mode)
 2. Operate on a machine with an EGA, VGA, or MCGA graphics adapter
 
 To get a high-intensity background, use ROM BIOS Interrupt 10h,
 with function 10h and subfunction 3h, to set the third bit in
 the Attribute Controller's Mode Control Register. This disables
 blinking and enables high intensity. Once this is done, you can print
 characters to the screen through the ROM BIOS, using ROM BIOS
 Interrupt 10h, with function 9h. In this way, a background color that
 had previously been blinking is now in high intensity.
 
 More Information:
 
 For a detailed discussion of the Attribute Controller and BIOS
 interrupts, please refer to the following sources:
 
 1. "Programmer's Guide to the EGA and VGA Cards" by Richard F.
    Ferraro.
 
 2. "Programmer's Guide to PC and PS/2 Video Systems" by Richard
    Wilton, published by Microsoft Press (1987). See especially Pages
    53-54 and 466-472.
 
 The following program example demonstrates printing with a high-intensity
 background color; it operates in SCREEN 0 on machines equipped with
 an EGA, VGA, or MCGA graphics card.
 
 Example
 -------
 
 To try this example in VBDOS.EXE:
 
   1. From the File menu, choose New Project.
   2. Copy the code example to the Code window.
   3. Press F5 to run the program.
 
 ' To run this program in the environment, you must invoke the
 ' environment with the /L switch to load the default Quick library:
 ' VBDOS.EXE /L for Visual Basic 1.0 for MS-DOS
 
 ' Use the following include file for Visual Basic 1.0 for MS-DOS:
 REM $INCLUDE: 'VBDOS.BI'
 DIM InReg as RegType, OutReg as RegType
 
 CLS
 COLOR 15,13
 PRINT "Before the call to the interrupt"
 PRINT "CCCCCCCC"
 
 InReg.ax = &H943                   ' Call ROM BIOS interrupt to
 InReg.bx = &HDF                    ' display characters.
 InReg.cx = &H8
 CALL Interrupt(&H10, InReg, OutReg)
 
 LOCATE 4, 1
 INPUT "Press ENTER to change to high intensity..."; a$
 
 InReg.ax = &H1003                  ' Call ROM BIOS interrupt to
 InReg.bx = 0                       ' enable high intensity.
 CALL Interrupt(&H10, InReg, OutReg)
 
 PRINT "After the call to the interrupt"
 PRINT "CCCCCCCC"
 
 InReg.ax = &H943                   ' Call interrupt to print
 InReg.bx = &HDF                    ' characters again. Both
 InReg.cx = &H8                     ' the ROM BIOS-printed sets of
 CALL interrupt(&H10, InReg,OutReg) ' characters will have a
                                    ' high-intensity background.
 END