home *** CD-ROM | disk | FTP | other *** search
/ Point Programming 1 / PPROG1.ISO / c / sclib31 / examples / charset.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-31  |  1.4 KB  |  62 lines

  1. #include <scl1.h>
  2.  
  3. /* This file shows the use of GetCharSet and ModifyCharSet to modify
  4.    VGA and EGA character definition tables */
  5.  
  6.    /* copyright symbol for the VGA */
  7.  
  8. char VGAcopyr[]={
  9. 0x00,0x00,0x00,0x0f,0x18,0x33,0x26,0x26,0x26,0x26,0x33,0x18,0x0f,0x00,0x00,0x00,
  10. 0x00,0x00,0x00,0xf8,0x0c,0xe6,0x22,0x02,0x02,0x22,0xe6,0x0c,0xf8,0x00,0x00,0x00};
  11.  
  12.    /* copyright symbol for the EGA */
  13.  
  14. char EGAcopyr[]={
  15. 0x00,0x00,0x0f,0x18,0x33,0x26,0x26,0x26,0x26,0x33,0x18,0x0f,0x00,0x00,
  16. 0x00,0x00,0xf8,0x0c,0xe6,0x22,0x02,0x02,0x22,0xe6,0x0c,0xf8,0x00,0x00};
  17.  
  18. main()
  19. {
  20. unsigned char OldChar[32 * 2]; /* Buffer */
  21.  
  22. VideoConfig();
  23. if(VC_Monitor != VC_VGA && VC_Monitor != VC_EGA)
  24.     {
  25.     printf("Your monitor does not support character modification\n");
  26.     exit(-1);
  27.     }
  28.  
  29. /* we'll change ASCII characters 192-193 into a copyright symbol but first 
  30.    we'll copy the original characters so that they can be later restored */
  31.  
  32. GetCharSet(192,2,OldChar);
  33.  
  34. /*   Modify character definition */
  35.  
  36. if(VC_Monitor==VC_VGA)
  37.  
  38.     ModifyCharSet(16,192,2,VGAcopyr);
  39.  
  40. else
  41.  
  42.     ModifyCharSet(14,192,2,EGAcopyr);
  43.  
  44. /*   Write the new copyright character character */
  45.  
  46. printf("The new copyright symbol \xc0\xc1, press any key...\n");
  47.  
  48. WaitKeyMouse();
  49.  
  50. /* restore characters */
  51.  
  52. ModifyCharSet(32,192,2,OldChar);
  53.  
  54. printf("Symbols restored\n");
  55. }
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.