home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / c / pcw_c.zip / VGETMODE.C < prev    next >
Text File  |  1990-01-16  |  2KB  |  46 lines

  1. /***********************************************************/
  2. /* File Id.                  Vgetmode.C                    */
  3. /* Author.                   Stan Milam.                   */
  4. /* Date Written.             11/19/88.                     */
  5. /* Date Last Modified.                                     */
  6. /*                                                         */
  7. /*          (c) Copyright 1989-90 by Stan Milam            */
  8. /*                                                         */
  9. /* Comments:  This function will call BIOS to get the      */
  10. /* current video mode.  It takes to pointers to type INT.  */
  11. /* these pointer will be return the number of columns for  */
  12. /* the current video mode if there is one, and the video   */
  13. /* mode itself.                                            */
  14. /***********************************************************/
  15.  
  16. #include <stdio.h>
  17. #include <string.h>
  18. #include <dos.h>
  19. #include "pcwproto.h"
  20.  
  21. static union REGS regs;
  22.  
  23. void vgetmode(int *cols, int *mode, int *activepage)  {
  24.  
  25.      memset(®s,'\0',sizeof (union REGS));
  26.      regs.x.ax = 0x0f00;
  27.      int86(0x10,®s,®s);
  28.      *cols       = regs.h.ah;
  29.      *mode       = regs.h.al;
  30.      *activepage = regs.h.bh;
  31. }
  32.  
  33. /**********************************************************/
  34. /*                        vsetmode()                      */
  35. /*                                                        */
  36. /* Add vsetmode() to set the video mode when I need to.   */
  37. /**********************************************************/
  38.  
  39. void vsetmode(int mode) {
  40.  
  41.    memset(®s,'\0', sizeof (union REGS));
  42.    regs.h.ah = 0;
  43.    regs.h.al = (char) mode;
  44.    int86(0x10,®s,®s);
  45. }
  46.