home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / SCREEN / BORDER.ZIP / BORDER.C next >
Encoding:
C/C++ Source or Header  |  1990-12-01  |  2.3 KB  |  63 lines

  1. /********************************************************************
  2. *    This is a small C routine used to call an assembly function
  3. * which changes the hardware border on your monitor.
  4. *
  5. * Written By: Gary L. Hennigan <ghenniga@NMSU.Edu>
  6. *          New Mexico State University
  7. *          Las Cruces, NM
  8. *
  9. * Date: 11/28/90
  10. *
  11. * Note that in it's current form the program only accepts 0-15 as
  12. * it's input, for CGA compatibility, it could also easily accept
  13. * 0-63 if you have an EGA compatible monitor.
  14. *********************************************************************
  15. * Function Used:
  16. *             bord_change (ASM) - Function which uses the BIOS
  17. *                      to change the border color.
  18. *********************************************************************
  19. * Variable Used:
  20. *          brd_color (int) - the value to change the border
  21. *                    color to.
  22. ********************************************************************/
  23. #include <stdio.h>
  24.  
  25. /*
  26.  * MXCOLOR defines the maximum color the border can be set to. For
  27.  * a CGA and compatible this is 15 while for an EGA/VGA it is 63.
  28.  */
  29. #define MXCOLOR 15
  30.  
  31. extern void bord_change( int );
  32.  
  33. main( int argc, char *argv[] )
  34. {
  35.    int brd_color=0, delay, i, j;
  36.  
  37.    if( argc <= 1 ){
  38.       printf( "\nEnter a number from 0-15 indicating which border color you wish to use. The");
  39.       printf( "\nresults will vary depending on how software has set up the color pallette but ");
  40.       printf( "\nhere's how they correspond on a PS/2 Model 55 with VGA, 80 column text mode,");
  41.       printf( "\nand the default pallette:");
  42.       printf( "\n     0 - Black      5 - Purple      10 - Bright Green     15 - Light Cyan" );
  43.       printf( "\n     1 - Blue       6 - Yellow      11 - Light Cyan" );
  44.       printf( "\n     2 - Green      7 - White       12 - Orange" );
  45.       printf( "\n     3 - Cyan       8 - Dark Green  13 - Purple");
  46.       printf( "\n     4 - Red        9 - Light Blue  14 - Green");
  47.       printf( "\nChoice: ");
  48.       scanf( "%d", &brd_color );
  49.    }
  50.    else{
  51.       sscanf( argv[1], "%d", &brd_color );
  52.       bord_change( brd_color );
  53.    }
  54.  
  55.    while( brd_color < 0 || brd_color > MXCOLOR ){
  56.       printf("\n\aInvalid Entry! Please Enter a number between 0 and 15: ");
  57.       scanf("%d", &brd_color);
  58.    }
  59.    bord_change( brd_color );
  60.  
  61.    return 1;
  62. }
  63.