home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / c / pcw_c.zip / VGASCAN.C < prev    next >
C/C++ Source or Header  |  1990-12-17  |  2KB  |  42 lines

  1. /**********************************************************/
  2. /* File Id.                  Vgascan.C                    */
  3. /* Author.                   Stan Milam.                  */
  4. /* Date Written.             25 Sep 89.                   */
  5. /*                                                        */
  6. /*          (c) Copyright 1989-90 by Stan Milam           */
  7. /*                                                        */
  8. /* Comments: Used to set the number of scan lines used for*/
  9. /* character on the display screen if a VGA is in use.    */
  10. /*                                                        */
  11. /* Arguments:                                             */
  12. /*      0 = 200 scan lines (CGA style ughh!)              */
  13. /*      1 = 350 scan lines (EGA style)                    */
  14. /*      3 = 400 scan lines (VGA style)                    */
  15. /**********************************************************/
  16.  
  17. #include <dos.h>
  18. #include "pcwproto.h"
  19.  
  20. void set_vga_scan_lines(int arg) {
  21.  
  22.    union REGS regs;
  23.    int   mxr,mxc;
  24.  
  25.    chk_video_state(&mxr,&mxc);         /* Initialize: make sure */
  26.    if (_adaptor == VGA) {              /* Check for VGA to do this */
  27.       switch(arg) {                    /* Verify our arguments */
  28.          case 0 :
  29.          case 1 :
  30.          case 2 : break;
  31.          default: return;
  32.       }
  33.       regs.h.ah = 0x12;                /* BIOS function 12 sub-function 30 */
  34.       regs.h.al = (char) arg;
  35.       regs.h.bl = 0x30;
  36.       int86(0x10,®s,®s);
  37.       if (_monitor == COLOR) vsetmode(3);
  38.       else vsetmode(7);
  39. /*      (_monitor == COLOR) ? vsetmode(3) : vsetmode(7);*/ /* Reset video mode */
  40.    }
  41. }
  42.