home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name scborder -- Set border color of current video display.
- *
- * Synopsis ercode = scborder(color);
- *
- * int ercode SC_NO_ERROR if successful,
- * SC_BAD_OPT if operation not valid for
- * current video adapter and mode.
- * unsigned color Color to select.
- *
- * Description This function sets the border color of the current video
- * device. Resetting the adapter sets the border color to
- * 0 (black).
- *
- * See SCPAL1 for a description of the color values on the
- * Enhanced Graphics Adapter.
- *
- * (The Enhanced Color Display supports a border color only
- * in 200-line modes.)
- *
- * Returns ercode SC_NO_ERROR if successful,
- * SC_BAD_OPT if operation not valid for
- * current video adapter.
- *
- * Version 6.00 (C)Copyright Blaise Computing Inc. 1987,1988,1989
- *
- **/
-
- #include <dos.h>
-
- #include <bscreens.h>
-
- int scborder(color)
- unsigned color;
- {
- int result;
- int mode,act_page,columns;
- union REGS inregs,outregs;
-
- scequip(); /* Sense equipment and switch */
- /* settings. */
-
- scmode(&mode,&columns,&act_page); /* Retrieve current device */
- /* (b_device). */
-
- if (mode == 7) /* Rule out monochrome text mode*/
- result = SC_BAD_OPT;
- else if ( b_device == b_ega
- || b_device == b_vga
- || b_pcmodel == IBM_JR)
- { /* Rule out Enhanced Color */
- /* Display 350-line modes. */
- if ( (mode <= 3 || mode == 15 || mode == 16)
- && b_device == b_ega
- && (b_sw_ega == 3 || b_sw_ega == 9))
- result = SC_BAD_OPT;
- else
- { /* Use BIOS function. */
- inregs.x.ax = 0x1001;
- inregs.h.bh = (unsigned char) color;
- int86(SC_BIOS_INT,&inregs,&outregs);
- result = SC_NO_ERROR;
- }
- }
- else
- { /* Use the CGA BIOS function. */
- inregs.h.ah = 0x0b;
- inregs.h.bh = 0;
- inregs.h.bl = (unsigned char) color;
- int86(SC_BIOS_INT,&inregs,&outregs);
- result = SC_NO_ERROR;
- }
- return result;
- }