home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c070 / 4.ddi / TOOLS.4 / TCTSRC1.EXE / SCBLINK.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-31  |  1.9 KB  |  73 lines

  1. /**
  2. *
  3. * Name        scblink -- Choose role of attribute bit 7 on EGA:
  4. *               foreground blink or background intensity
  5. *
  6. * Synopsis    ercode = scblink(option);
  7. *
  8. *        int ercode      0 if successful,
  9. *                  1 if operation not valid for current
  10. *                       video adapter.
  11. *        int option      SC_BLINK to cause attribute bit 7
  12. *                    to control foreground blinking;
  13. *                  SC_INTENSITY to cause attribute bit 7
  14. *                    to control background intensity.
  15. *
  16. * Description    This function controls the role of attribute bit 7 as
  17. *        used in text modes on the Enhanced Graphics Adapter.
  18. *
  19. *        If SC_BLINK is specified, attribute bit 7 controls the
  20. *        blinking of the character.  This is the default
  21. *        condition established when the video adapter is reset.
  22. *        Eight colors are available for background, as specified
  23. *        by attribute bits 4-6.
  24. *
  25. *        If SC_INTENSITY is specified, attribute bit 7 is used
  26. *        along with attribute bits 4-6 to specify the background
  27. *        color.    This allows a choice of the same sixteen
  28. *        background colors as are available for the foreground.
  29. *        Blinking is not available.
  30. *
  31. * Returns    ercode          0 if successful,
  32. *                  1 if operation not valid for current
  33. *                       video adapter.
  34. *
  35. * Version    6.00 (C)Copyright Blaise Computing Inc.  1987,1989
  36. *
  37. **/
  38.  
  39. #include <dos.h>
  40.  
  41. #include <bscreens.h>
  42.  
  43. #define BLINK_BIT     0x20
  44.  
  45. #define  OK            0          /* Error codes.          */
  46. #define  INVALID_REQUEST    1
  47.  
  48. int scblink(option)
  49. int option;
  50. {
  51.     int        result;
  52.     int        mode,act_page,columns;
  53.     union REGS inregs,outregs;
  54.  
  55.     scequip();
  56.     scmode(&mode,&columns,&act_page);
  57.  
  58.     if (   b_device  == b_ega
  59.     || b_device  == b_vga
  60.     || b_device  == b_mcga
  61.     || b_pcmodel == IBM_JR)
  62.     {
  63.     inregs.x.ax = 0x1003;          /* Set intensify/blinking bit.  */
  64.     inregs.h.bl = (unsigned char) option;
  65.     int86(0x10,&inregs,&outregs);
  66.     result = OK;
  67.     }
  68.     else
  69.     result = INVALID_REQUEST;
  70.  
  71.     return result;
  72. }
  73.