home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / vidhandl / crttest.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-03  |  17.6 KB  |  576 lines

  1. /* VIDEO HANDLING FUNCTIONS EXAMPLE/DEMO PROGRAM                          */
  2. /* By Márcio Afonso Arimura Fialho                                        */
  3. /* For further information read README.TXT in this subdirectory           */
  4.  
  5. /* IMPORTANT: If you are running this demo under a MS-Windows MS-DOS      */
  6. /* prompt be sure that it is running in full screen mode to see the
  7. /* effect of all functions, because some functions are not effective when */
  8. /* they run in a MSDOS-prompt window */
  9.  
  10. #define CRT_FULL
  11. #include <crt.h>
  12. #include <conio.h>
  13. #include <stdio.h>
  14. #include <stdlib.h>
  15.  
  16. #undef savevideo
  17. #undef savevideowin
  18. #undef savevideow
  19. #undef restorevideo
  20. #undef restorevideowin
  21. #undef restorevideow
  22.  
  23. #define LEFT_TEXT 0
  24. #define CENTER_TEXT 1
  25. #define RIGHT_TEXT 2
  26.  
  27. int video_adapter;
  28.  
  29. int pause () //similar to getch, but if user hits ESC, exits from program
  30.  {
  31.     int a0;
  32.     a0=getch();
  33.     if (a0==0x1b)
  34.      {
  35.         setcrtmode (3);
  36.         exit(0);
  37.      }
  38.     return a0;
  39.  }
  40.  
  41. void scrpause() //pauses and displays a message
  42.  {
  43.     crt_init (video_adapter);
  44.     printsj ("- - - HIT ANY KEY TO CONTINUE, ESC EXITS - - -",vmode_y-1,0x9f);
  45.     pause();
  46.  }
  47.  
  48. void dispstatus () //displays current video status
  49.  {
  50.     char *msg[2]={"TEXT","GRAPHICS"};
  51.     crt_detect (video_adapter); //updates vmode_mode,crt_direct,crt_page,... values to current video status
  52.     fillscr (' ',0x19);
  53.     prints ("CURRENT VIDEO STATUS:",2,2,0x1e);
  54.     printxf(5,4,0x1b,"Current video mode\t\t= \6\37%d (%.2X)h",vmode_mode,vmode_mode);
  55.     printxf(6,5,0x1b,"%s mode selected",msg[crt_direct]);
  56.     printxf(5,7,0x1b,"Active display page\t= \6\37%d",crt_page);
  57.     if (!crt_direct)
  58.         printxf(5,8,0x1b,"Active display page base\n      \
  59. address in text video RAM\t= \6\37%Fp",video_addr);
  60.     printxf (5,10,0x1b,"number of screen columns\t= \6\37%d",vmode_x);
  61.     printxf (5,11,0x1b,"number of screen rows\t= \6\37%d",vmode_y);
  62.  
  63.     printxf (2,(vmode_y*4)/5,0x1a,
  64.       "getcrtmode returned \6\37%d\6\32 after being called.", getcrtmode());
  65.       //getcrtmode example
  66.  
  67.     scrpause ();
  68.  }
  69.  
  70. void disppalette (int xi, int yi, int tcolor, int fcolor) //displays the palette
  71. //(xi,yi) == upper left corner
  72. //tcolor = text color        fcolor = inside color
  73.  {
  74.     int c0;
  75.     barcolor (xi,yi,xi+42,yi+17,fcolor);
  76.     for (c0=0;c0<16;c0++)
  77.      {
  78.         printsf (xi+1,yi+c0+1,tcolor,"palette register %.2d value = %.3d color =",
  79.             c0,getpalreg(c0));
  80.         printc ('█',xi+41,yi+c0+1,c0);
  81.      }
  82.  }
  83.  
  84. void dispbordercolor () //displays current border (overscan) color
  85.  {
  86.     unsigned a0;
  87.     a0=getbordercolor();
  88.     printsf (5,10,0x1f,"Current overscan color = %d (%.2X)h",a0,a0);
  89.     scrpause ();
  90.  }
  91.  
  92. void dispdacvalues () //display DAC register associated with each palette
  93.     //register and it's value
  94.  {
  95.     unsigned u0,u1,u2,c0,red,green,blue;
  96.     prints ("Selected      DAC colors   ",50,1,0x1f);
  97.     printx ("DAC Reg.\5\x1c*    Red Green Blue",50,2,0x1f);
  98.  
  99.     u0=getdacpgstate();
  100.     if (u0%256u)
  101.         u1=16;
  102.      else
  103.         u1=64;
  104.     for (c0=0;c0<16;c0++)
  105.      {
  106.         u2=(unsigned)getpalreg(c0)%u1+(u0/256u)*u1;
  107.         getdacreg(u2,&(char)red,&(char)green,&(char)blue);
  108.         printsf(51,4+c0,0x1f," %.3d        %.2Xh  %.2Xh  %.2Xh ",
  109.             u2,(unsigned char)red,(unsigned char)green,(unsigned char)blue);
  110.      }
  111.     printx ("\5\x0c* by palette register on the left",10,21,0x0f);
  112.     printsf (10,22,0x1f,"Current DAC page = %d.   Page size = %d (in DAC registers)",u0/256u,u1);
  113.  }
  114.  
  115. void dispascii ()
  116.  {
  117.     int a0;
  118.     int c0,c1;
  119.  
  120.     for (c0=0;c0<8;c0++)
  121.         for (c1=0;c1<16;c1++)
  122.          {
  123.             printc (c0*16+c1,c1+17,c0+8,0x17);
  124.             printc (c0*16+c1+128,c1+42,c0+8,0x17);
  125.          }
  126.         prints ("Current Font Character Set:",25,3,0x1e);
  127.         for (c0=0;c0<8;c0++)
  128.          {
  129.             prints ("(00)h ",10,8+c0,0x1f);
  130.             prints ("(80)h ",60,8+c0,0x1f);
  131.             printc (c0+0x30,11,8+c0,0x1f);
  132.             printc (c0+0x3f,61,8+c0,0x1f);
  133.             printc ('║',37,8+c0,0x1f);
  134.          }
  135.         printc ('8',61,8,0x1f);
  136.         printc ('9',61,9,0x1f);
  137.         for (c0=0;c0<16;c0++)
  138.          {
  139.             printc ('0',c0+17,5,0x1f);
  140.             printc ('0',c0+42,5,0x1f);
  141.             if (c0<10)
  142.                 a0=c0+'0';
  143.              else
  144.                 a0=c0+0x37;
  145.             printc (a0,c0+17,6,0x1f);
  146.             printc (a0,c0+42,6,0x1f);
  147.          }
  148.  }
  149.  
  150. //this file contains the 8x16 handscript font patterns for characters
  151. //0x20 through 0xAFh (font array) (used by changechar example)
  152. #include "handscr.cpp"
  153.  
  154. //this file contains the 8x12 font information (used by changechar example)
  155. #include "font12.cpp"
  156.  
  157. //this file contains the 8x8 font information for changecharg example
  158. #include "crazy8.cpp"
  159.  
  160. void main ()
  161.  {
  162.     int c0,c1,c2,c3;
  163.     int a0,a1,a2,a3;
  164.     unsigned u0,u1,u2;
  165.     unsigned red,green,blue;
  166.  
  167.     char *ex_msg="EXAMPLE.";
  168.     char buffer[4096];
  169.     char buffer2[4096];
  170.     char windowbuf[1000];
  171.     char windowbuf2[1000];
  172.     char *p;
  173.     struct crtwin licos,deflt;
  174.     struct crtwin_inp lelecos; //input values for crtwindow function
  175.  
  176.  //Displays a warning message
  177.     printf ("\n\
  178. WARNING: If you are running this demo from a MS-WINDOWS MS-DOS prompt and\n\
  179.  you want to see everything be sure that the MS-DOS prompt is running in full\n\
  180.  screen mode, because some functions in this demo aren't effective in a\n\
  181.  MSDOS prompt window.\n\
  182. \tTo toggle a MS-WINDOWS MS-DOS prompt between full screen mode / window\n\
  183.  mode type ALT-ENTER.\n");
  184.  
  185.  //Startup, selects video adapter type
  186.     printf ("\nWhat is your video adapter?\n\
  187. \t1 - CGA\n\
  188. \t2 - MCGA\n\
  189. \t3 - EGA\n\
  190. \t4 - EGA + UltraVision v2+\n\
  191. \t9 - VGA\SVGA+\n");
  192.     video_adapter=getch()-0x30;
  193.     if (video_adapter!=1 && video_adapter!=2 && video_adapter!=3 &&
  194.         video_adapter!=4 && video_adapter!=9)
  195.      {
  196.         printf ("Unknow adapter type. Aborting...");
  197.         exit (1);
  198.      }
  199.     crt_init(video_adapter); //autodetects number of rows,columns, active page, current
  200.                     //video mode, etc. And updates crtwin_dta. But not essential
  201.                     //to other Video Handling Functions
  202.  
  203.  //Introduction
  204.     fillscr('░',BLUE*BKCOLOR+LIGHTBLUE);
  205.     printsj ("* * * CRT FUNCTIONS TEST AND DEMO PROGRAM * * *",0,0x1e);
  206.     pause ();
  207.  
  208.  //Example of capabilities to work in different screen size (EGA+)
  209.     if (video_adapter >2) //if video_adapter >= EGA
  210.      {
  211.         textmode (64);
  212.         videomode (64); //obsolete function
  213.         fillscr ('1',0x17);
  214.         pause ();
  215.      }
  216.  
  217.  //Example of capability to work in many video modes
  218.     dispstatus ();
  219.  
  220.     setcrtmode (1);
  221.     setcrtpage (2);
  222.     dispstatus (); //displays current status
  223.  
  224.     setcrtpage (0);//required due to a Windows 95 bug (see notice below)
  225.     setcrtmode (3);
  226.     setcrtpage (3);
  227.     dispstatus ();
  228.  
  229.     setcrtpage (0);//required due to a Windows 95 bug (see notice below)
  230.     setcrtmode (6);
  231.     dispstatus ();
  232.  
  233.     //NOTICE: I had to include these calls to setcrtpage with zero
  234.     //(setcrtpage(0);) before calling setcrtmode due to a Windows 95 BUG
  235.     //that occured while I was running this program under Windows 95.
  236.     //The bug is that if a program running in a MS-DOS prompt (in full
  237.     //screen mode) calls INT 10h/AH=0 (this is the BIOS function that changes
  238.     //the video mode and is used by setcrtmode) with active display page
  239.     //other than zero, the system halts and the CPU seems to switch to sleep
  240.     //mode, and all the user can do is to reset the machine.
  241.     //Notice that this BUG doesn't occur in MSDOS, Windows 3.11 and Windows 95
  242.     //running in real MSDOS mode. Notice also that this BUG may also be caused
  243.     //by a misconfiguration of the computer or that you have a Windows 95/98
  244.     //version free of this BUG. If your Windows 95/98 version is free of this
  245.     //BUG the calls to setcrtpage(0) before setcrtmode will be redundant and
  246.     //you may remove them. (unhapply there's no safe way to check your computer
  247.     //for this BUG, but if you try, please report to me the results)
  248.  
  249.  //Cursor positioning functions
  250.     setcrtmode(3);
  251.     crt_detect(video_adapter);
  252.     fillscr ('░',0x19);
  253.     crt_gotoxy (37,16);
  254.     pause ();
  255.     crt_getxy(&a0,&a1);
  256.     a0/=2; a1/=2;
  257.     crt_gotoxy(a0,a1);
  258.     pause ();
  259.  
  260.  //Character input/output functions
  261.     a2=getcrtchar(a0,a1)-0x30;
  262.     a3=getcrtcolor(a0,a1)+0x03;
  263.     biosprintc (a2,10,5,0x3b,9);
  264.     biosprintc (a2,15,5,0x3b,10);
  265.     printcn (a2,20,5);
  266.     printc (a2,25,5,a3);
  267.     pause ();
  268.     changecolor (25,5,0x1f);
  269.     pause ();
  270.     for (c0=0;c0<4;c0++)
  271.         printct ('A'+c0,45+5*c0,5,0x3b,c0);
  272.     pause ();
  273.  
  274.  //String output functions example
  275.     printsn ("PRINTSN EXAMPLE",10,7);
  276.     prints ("PRINTS EXAMPLE",30,7,0x1e);
  277.     printxy ("PRINTXY EXAMPLE",50,7,2,0,0x1f);
  278.     printx ("PRINTX EXAMPLE\6\33\n\tHIT ANY KEY TO SEE THE TEXT BOX EXAMPLE\25",
  279.         10,8,0x1f);
  280.  
  281.   //String output inside a box
  282.     setcrtwin (20,12,60,20); //defines box coordinates
  283.     molduradw (0x1F); //draws the box
  284.     fillbarw (' ',0x17); //fills the box internally
  285.     //crtwin_just=CENTER_TEXT; //required for printsj...; CENTER_TEXT is default
  286.     printtext ("PRINTTEXT EXAMPLE",30,0,0x1a);
  287.     printsj ("PRINTSJ EXAMPLE",2,0x1e); //prints text in the center
  288.     printsjc ("PRINTSJC \6\37EXAMPLE",3,0x1b);
  289.     scrpause ();
  290.  
  291.  //Formatted string output functions example
  292.     fillscr ('░',0x19);
  293.     printsnf (10,2,"PRINTSNF %s",ex_msg);
  294.     printsf (10,3,0x1f,"PRINTSF %s",ex_msg);
  295.     printxyf (10,4,2,0,0x1e,"PRINTXYF %s",ex_msg);
  296.     printxf (10,5,0x1e,"PRINTXF \6%c%s",YELLOW+BKCOLOR*BLUE,ex_msg);
  297.     printx ("HIT ANY KEY TO SEE THE TEXT BOX EXAMPLE\25",10,8,0x1f);
  298.  
  299.   //Formatted string output example inside a box
  300.     setcrtwin (20,10,60,20); //defines box coordinates
  301.     molduradw (0x1F); //draws the box
  302.     fillbarw (' ',0x17); //fills the box internally
  303.     printtextf (29,0,0x1c,"PRINTTEXTF %s",ex_msg);
  304.     printsjf (3,0x1e,"PRINTSJF AND PRINTSJCF %s",ex_msg);
  305.     printsj ("CURRENT TEXT BOX COORDINATES",4,0x1f);
  306.     printsjcf (5,0x1a,"(defined by crtwin_dta)=\6\%c(%d,%d),(%d,%d)",
  307.         LIGHTCYAN+BKCOLOR*BLUE, crtwin_dta.left, crtwin_dta.top,
  308.         crtwin_dta.right, crtwin_dta.bottom);
  309.     scrpause ();
  310.  
  311.  //Text window (or text box) manipulation functions
  312.     fillscr ('░',0x19);
  313.     moldurad(10,12,30,18,0x1f);
  314.     fillbar('■',11,13,29,17,0x18);
  315.     pause ();
  316.     linhad_hor(15,10,30,0x1e);
  317.     linhad_ver(20,12,18,0x1e);
  318.     barcolor(16,14,24,16,0x1a);
  319.     printc('│',20,20,0x1f);
  320.     mkline_aux(20,20,0,3,0x18);
  321.     pause ();
  322.     for (c0=0;c0<4;c0++)
  323.      {
  324.         a0=(c0&0x01)*10;
  325.         a1=((c0&0x02)>>1)*3;
  326.         fillbox('█',11+a0,13+a1,19+a0,14+a1,0x1b,c0);
  327.      }
  328.     pause ();
  329.  
  330.   //Text window functions with coordinates given by crtwin_dta
  331.     setcrtwin (50,12,70,18);
  332.     molduradw (0x1e);
  333.     fillbarw ('#',0x19);
  334.     pause ();
  335.     fillboxw (' ',0x1b,2);
  336.     pause ();
  337.  
  338.   //Titled text box example
  339.     lelecos.title="CRTWIN EXAMPLE"; //box title
  340.     lelecos.tcolor=0x1b; //box title color
  341.     lelecos.fchr='*'; //box internal character
  342.     lelecos.fcolor=0x19; //box internal color
  343.     lelecos.bcolor=0x1e; //border color
  344.     lelecos.btype=1; //border type (same as crtframe)
  345.     setcrtwin (20,5,60,10); //load coordinate values in crtwin_dta
  346.     crtwindow (lelecos); //coordinates are given by crtwin_dta
  347.     scrpause ();
  348.  
  349.  //Screen data save/restore functions
  350.     savevideo (buffer);
  351.     fillscr (' ',0x07);
  352.     crt_gotoxy(0,0);
  353.     pause ();
  354.     restorevideo (buffer);
  355.     pause ();
  356.     savevideowin(windowbuf,10,12,30,18);
  357.     fillscr (' ',0x07);
  358.     pause ();
  359.     restorevideowin(windowbuf,30,12,50,18);
  360.     pause ();
  361.     licos.left=31; //licos is a crtwin struct
  362.     licos.top=13;
  363.     licos.right=49;
  364.     licos.bottom=17;
  365.     crtwin_dta=licos;  //another way of assigning values to crtwin_dta, instead of using setcrtwin
  366.     savevideow(windowbuf);
  367.     fillscr(' ',0x07);
  368.     pause ();
  369.     crtwin_dta.top-=5;
  370.     crtwin_dta.bottom-=5;
  371.     restorevideow(windowbuf);
  372.     scrpause ();
  373.  
  374.  //Screen data save/restore functions with mode
  375.     crt_direct=0;
  376.     video_addr=(char far*)buffer2; //writes and reads buffer2 as if it where
  377.     restorevideo(buffer);            //video RAM memory (this only happens when crt_direct==0)
  378.     p=(char *)savecrt(buffer,2); //saves first the characters
  379.     savecrt(p,3);    //then the attributes
  380.     p=(char *)savecrtwin(windowbuf,10,12,30,18,2); //same as above, but
  381.     savecrtwin(p,10,12,30,18,3); //now with a text window
  382.     setcrtwin(50,12,70,18); //crtwin_dta=text window coordinates
  383.     savecrtw(windowbuf2,0); //saves in windowbuf2 a text window
  384.     crt_detect(video_adapter); //restores default video RAM address
  385.  
  386.     fillscr(' ',0x07);
  387.     pause ();
  388.     p=(char *)restorecrt(buffer,2);
  389.     pause ();
  390.     restorecrt(p,3);
  391.     pause ();
  392.     fillscr (' ',0x07);
  393.     pause ();
  394.     p=(char *)restorecrtwin(windowbuf,30,12,50,18,2);
  395.     pause();
  396.     restorecrtwin(p,30,12,50,18,3);
  397.     pause ();
  398.     setcrtwin(30,2,50,8);
  399.     restorecrtw(windowbuf2,1); //ooops, character has been exchanged with color
  400.     pause ();
  401.     restorecrtw(windowbuf2,0); //now OK
  402.     scrpause ();
  403.  
  404.  //Cursor functions
  405.     fillscr('░',0x19);
  406.     prints ("LOOK AT THE CURSOR = >  ",10,3,0x1f);
  407.     crt_gotoxy(33,3);
  408.     pause ();
  409.     a0=getcursorsh();
  410.     setcursorsh(0x020c);
  411.     pause ();
  412.     setcursorsh(a0);
  413.     pause ();
  414.  
  415.   //These examples require an EGA (with UltraVision v2+) or VGA+ video adapter
  416.     if (video_adapter>3)
  417.      {
  418.         fillscr (' ',0x19);
  419.  //Changes palette color
  420.         disppalette (4,4,0x17,0x1f);
  421.         scrpause ();
  422.         for (c0=0;c0<16;c0++)
  423.             setpalreg (c0,c0+16);
  424.         disppalette (4,4,0x17,0x1f);
  425.         scrpause ();
  426.         setcrtmode (3); //a mode change restores default palette colors
  427.  //Changes screen border (overscan) color
  428.         fillscr ('░',0x19);
  429.         a0=getbordercolor ();
  430.         dispbordercolor ();//displays current screen border (overscan) color
  431.         setbordercolor (1);
  432.         dispbordercolor ();
  433.         setbordercolor (15);
  434.         dispbordercolor ();
  435.         setbordercolor (a0);
  436.         dispbordercolor ();
  437.         setcrtmode (3); //a mode change restores default border color
  438.      }
  439.  
  440.     //P.S: In MCGA adapters, the palette color (value) is in fact the number
  441.     //of a DAC register, that defines the actual color    for that palette
  442.     //register. So in MCGA adapters, it's possible to change a color without
  443.     //changing palette registers values, but changing the DAC register value
  444.     //associated to that palette register.
  445.     //In VGA+ adapters, the selected DAC register for a palette register is
  446.     //also affected by DAC register paging. The MSB bits of selected DAC
  447.     //register is given by current DAC page value and the LSB bits by the LSB
  448.     //bits of palette register. And there exists two modes of paging,
  449.     //mode 0: where DAC register number is given by the 6 LSB bits of palette value
  450.     //  plus 2 lower bits of current page times 64
  451.     //mode 1: where DAC register number is given by the 4 LSB bits of palette value
  452.     //  plus 4 lower bits by current page times 16
  453.     //Border (overscan) color register works just in the same way as palette
  454.     //registers,except that they are not affected by DAC paging (in VGA+)
  455.     //WARNING: This information may not be accurate.
  456.     //The example below illustrates this.
  457.  
  458.  //Changes DAC registers values, paging mode, DAC page,...
  459.  //This example requires a VGA+ video adapter
  460.     if (video_adapter==9)
  461.      {
  462.         fillscr (' ',0x07);
  463.         setbordercolor(0xc0); //changes overscan color (DAC register)
  464.         setpalreg(6,22); //changes palette register 6 DAC register
  465.         disppalette (4,3,0x17,0x1f);
  466.         setcrtwin(-1,-1,vmode_x,vmode_y);
  467.         scrpause ();
  468.         printsj (" - - - PLEASE WAIT, UPDATING VIDEO DAC REGISTERS - - - ",
  469.             vmode_y-1,0x1E);
  470.             //updates the 256 VGA DAC register in a way
  471.             // to create a IIRRGGBB color set.
  472.             // Where I = intensity bit R,G,B=red,green,blue bits
  473.             // normally monitors use IRGB in text mode
  474.         for (c0=0;c0<256;c0++)
  475.          {
  476.             a0=(c0&0xc0)>>4u;
  477.             setdacreg(c0,((c0&0x30u)>>4u)*17u+a0,
  478.                 ((c0&0x0Cu)>>2u)*17u+a0,(c0&0x03u)*17u+a0);
  479.          }
  480.         fillbar (' ',0,24,79,24,7);
  481.  
  482.         dispdacvalues ();//display DAC registers associated to palette register
  483.             // on the left and their values
  484.  
  485.         scrpause ();
  486.  
  487.         for (c0=0;c0<2;c0++)
  488.          {
  489.             setdacpgmode (c0); //selects DAC register paging mode
  490.                 //0 - 4 pages of 64
  491.                 //1 - 16 pages of 16
  492.             for (c1=0;c1<16;c1++)
  493.              {
  494.                 if (!c0 && c1==8)
  495.                     break;
  496.                 setdacpage (c1);
  497.                 dispdacvalues ();
  498.                 pause ();
  499.              }
  500.          }
  501.         setcrtmode (3); //a mode change restores default DAC, palette register values
  502.      }
  503.  
  504.  //setchrboxwidth example (requires a VGA+ adapter)
  505.     if (video_adapter==9)
  506.      {
  507.         fillscr ('░',0x19);
  508.         setchrboxwidth(0);
  509.         prints ("setchrboxwidth => Toggles character box width between 9 and 8 pixels wide",2,10,0x1f);
  510.         prints ("in VGA/SVGA+ video adapters",24,11,0x1f);
  511.         scrpause ();
  512.         setchrboxwidth(1);
  513.         pause ();
  514.         setchrboxwidth(0);
  515.         pause
  516.         ();
  517.      }
  518.  
  519.  //settextblink example (requires a EGA+ adapter)
  520.     if (video_adapter>2)
  521.      {
  522.         fillscr (' ',0x17);
  523.         printsj ("settextblink => Toggles intensity/blinking bit",12,0x9e);
  524.         scrpause ();
  525.         settextblink(0);
  526.         pause ();
  527.         settextblink(1);
  528.         pause ();
  529.  
  530.  //changechar example (requires a EGA+ adapter)
  531.         setcrtmode (3);
  532.         fillscr ('░',0x19);
  533.         printsj ("* * * Changechar Example - Default font character shape * * *",0,0x1e);
  534.         dispascii (); //displays all ascii characters on screen
  535.         scrpause ();
  536.         changechar (handscr,32,144);
  537.         printsj ("* * * Changechar Example - Handscr character shape (20h - AFh) * * *",0,0x1e);
  538.         dispascii ();
  539.         pause ();
  540.  
  541.  //changechar example 2 (requires a EGA+ adapter)
  542.         changechar_height=12;
  543.         changechar_func=CHANGCHR_RECALC;
  544.         setcrtmode (3);
  545.         changechar(font12,0,256);
  546.         crt_detect (video_adapter);
  547.         fillscr ('░',0x19);
  548.         printsj ("* * * Changechar Example - Loaded font 8x12 * * *",0,0x1e);
  549.         dispascii ();
  550.         scrpause ();
  551.  
  552.  //changecharg example (requires a EGA+ adapter)
  553.         setcrtmode (6);
  554.         crt_init (video_adapter);
  555.         printsj ("* * * Changecharg Example - Default font * * *",0,0x1e);
  556.         dispascii ();
  557.         scrpause ();
  558.         setcrtmode (6);
  559.         changecharg (crazy8,25);
  560.         crt_init (video_adapter);
  561.         printsj ("* * * Changecharg Example - Crazy (8x8) font (00h - 7Fh) * * *",0,0x1e);
  562.         dispascii ();
  563.         scrpause ();
  564.         setcrtmode (3);
  565.      }
  566.  
  567.  //The end
  568.     fillscr (' ',0x07);
  569.     prints("THANKS FOR SEEING THIS EXAMPLE / DEMO PROGRAM",0,0,0x0E);
  570.     prints("THE END",0,1,0x0F);
  571.     crt_gotoxy(0,2);
  572.  }
  573.  
  574. //By Márcio Afonso Arimura Fialho
  575. //http://pessoal.iconet.com.br/jlfialho
  576. //e-mail: jlfialho@iconet.com.br OR jlfialho@yahoo.com (alternate)