home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / qc_prog / chap14 / savegraf.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-04-08  |  934 b   |  30 lines

  1. /* savegraf.c -- uses DMA to save screen of graphics  */
  2. /*               characters and attributes            */
  3. /* Program list - savegraf.c, initstuf.c, drawchar.c, */
  4. /*                savescrn.c, scrfun.c                */
  5. /* User include files - scrn.h, keys.h, grafchar.h    */
  6. /* Note: activate Screen Swapping On in Debug menu    */
  7.  
  8.  
  9. #include "grafchar.h"
  10. unsigned char Grchr[NUMCHARS];  /* to store graphics set */
  11. void Init_stuff(void);
  12. void Draw_chars(void);
  13. void Save_screen(void);  /* in savescrn.c */
  14.  
  15. main()
  16. {
  17.     int ch;
  18.  
  19.     Init_stuff();  /* initialize vital elements */
  20.     Draw_chars();  /* map keys to graphics characters */
  21.     Setcurs(BOTLINE + 1, 0, PAGE);
  22.     printf("%-80s", "Save screen? <y/n> ");
  23.     Setcurs(BOTLINE + 1, 20, PAGE);
  24.     ch = getche();
  25.     if (ch == 'y' || ch == 'Y')
  26.         Save_screen();
  27.     Setcurs(BOTLINE + 2, 0, PAGE);
  28.     printf("%-80s\n", "BYE!");
  29. }
  30.