Microsoft KB Archive/74031

{|
 * width="100%"|

How to Create Blinking Output in EGA or VGA Graphics Mode

 * }

Q74031

-

The information in this article applies to:


 * The C Run-Time (CRT), included with:
 * Microsoft C for MS-DOS, versions 5.1, 6.0, 6.0a, and 6.0ax
 * Microsoft C/C++ for MS-DOS, version 7.0
 * Microsoft Visual C++, versions 1.0, 1.5

-

SUMMARY
With Microsoft C in the EGA or VGA graphics mode you can create blinking output for both text and graphics figures by calling Interrupt 10h, Function 10h, Subfunction 03h. This interrupt will either set or clear the enable blink bit of the attribute controller's mode control register (bit 3 of register 10H at port 3COH).

MORE INFORMATION
The enable blink bit of the attribute controller determines whether the most significant bit of a pixel value will cause either a blinking or a more intense output color. The enable blink bit defaults to a 0 (zero), which represents intensity. Changing it to a 1 (one) will enable blinking.

When the enable blink bit is not set and the default palette register is being used, the first eight colors will be a high intensity color. Setting the enable blink bit reverses this and causes the first eight colors to default to a lower intensity. It also changes the normal background color from black to light gray.

The sample program below illustrates the effect of setting the enable blink bit. The color values of 0 through 7 remain constant, while 8 through 15 will blink. If you are using the default palette, the output will switch between high and low intensity colors as the first eight palette registers are being alternated with the last eight.

For more information on blinking output in graphics mode, see the Microsoft Press book &quot;Programmer's Guide to PC & PS/2 Video Systems&quot; by Richard Wilton.

Sample Code
/* Compile options needed: none void main(void) {  int i, j;   long colors[16] = { _GRAY, _LIGHTBLUE, _LIGHTGREEN, _LIGHTCYAN, _LIGHTRED,_LIGHTMAGENTA, _YELLOW, _WHITE, _BLACK, _BLUE, _GREEN, _CYAN, _RED, _MAGENTA, _BROWN, _BRIGHTWHITE }; _setvideomode( _VRES16COLOR ); _remapallpalette( colors ); _asm{ mov bl, 1 mov ax, 1003h int 10h }  for ( i = 0, j = 1 ; i < 16 ; i++, j += 20) { _setcolor( i ); _ellipse( _GFILLINTERIOR, j, j, j + 15, j + 15); }  getch; _setvideomode( _DEFAULTMODE ); } Additional query words: kbinf 5.10 6.00 6.00a 6.00ax 7.00 1.00 1.50
 * 1) include 
 * 2) include 
 * 3) include 
 * 1) include 

Keywords : kb16bitonly

Issue type :

Technology : kbVCsearch kbAudDeveloper kbCRT