home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / prof_c / 05oslib / bios / setvmode.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-08-11  |  1.2 KB  |  51 lines

  1. /*
  2.  *    setvmode -- set the video mode
  3.  *    (color/graphics systems only)
  4.  */
  5.  
  6. #include <dos.h>
  7. #include <local\std.h>
  8. #include <local\bioslib.h>
  9.  
  10. /***********************************************************
  11. *
  12. * mode # (m)    description
  13. * ------------- ---------------------------------
  14. * PC MODES:
  15. *     0    40x25 Mono text    (c/g default)
  16. *     1    40x25 Color text
  17. *    2    80x25 Mono text
  18. *    3    80x25 Color text
  19. *    4    320x200 4-color graphics (med res)
  20. *    5    320x200 Mono graphics (med res)
  21. *    6    640x200 2-color graphics (hi res)
  22. *    7    80x25 on monochrome adapter 
  23. *
  24. * PCjr MODES:
  25. *    8    160x200 16-color graphics
  26. *    9    320x200 16-color graphics
  27. *    10    640x200 4-color fraphics
  28. *
  29. * EGA MODES:
  30. *    13    320x200 16-color graphics
  31. *    14    620x200 16-color graphics
  32. *    15    640x350 mono graphics
  33. *    16    640x350 color graphics (4- or 16-color)
  34. ***********************************************************/
  35.  
  36. int
  37. setvmode(vmode)
  38. unsigned int vmode;    /* user-specified mode number */
  39. {
  40.     union REGS inregs, outregs;
  41.  
  42.     inregs.h.ah = SET_MODE;
  43.     inregs.h.al = vmode;    /* value not checked */
  44.     int86(VIDEO_IO, &inregs, &outregs);
  45.  
  46.     /* update video structure */
  47.     getstate();
  48.  
  49.     return (outregs.x.cflag);
  50. }
  51.