home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / multitsk / vid_scrn / vid_scrn.doc < prev    next >
Encoding:
Text File  |  1987-11-22  |  28.0 KB  |  803 lines

  1.  VID_SCRN.DOC
  2.     Jerry Joplin [70441,2627] CIS
  3.     Version 1.0  23-Nov-1987
  4.  
  5.     VID_SCRN.ASM is the assembly language source to a set of very fast
  6. video manipulation routines providing direct access to video memory
  7. while maintaining Microsoft Windows and DESQview __good_screen_behavior__
  8. compatibility. Also provided is VID_SCRN.LIB which contains the assembled
  9. object module.
  10.  
  11.     i)   Many of the included functions directly access video memory, yet
  12.          remain Microsoft Windows and DESQview compatible by checking
  13.          to see if a virtual screen buffer has been established for
  14.          the current process.  This enables programs written using
  15.          these techniques to run under these operating environments
  16.          in a well behaved window.
  17.     ii)  Some functions are especially useful for an application
  18.          running under a control program, but all the functions will
  19.          perform identical operations when a control program is not
  20.          present.
  21.     iii) Snow suppression is used when non-monochrome real video memory
  22.          is accessed.
  23.     iv)  Absolutely no error checking is done on any of the functions
  24.          in order to provide maximum throughput.
  25.     v)   The functions have been designed to work with the small and
  26.          tiny models only.  They also work fine with MSC V4.0 and 5.0
  27.     vi)  I dont ask for any compensation for this library of routines
  28.          but would like to see any improvements or enhancements that
  29.          may come from them.
  30.     vii) Included functions -
  31.  
  32.                vid_puts            ;Write string w/attr
  33.                vid_readc           ;Read char/attr
  34.  
  35.                vid_memread         ;Video memory block read
  36.                vid_memwrite        ;Video memory block write
  37.  
  38.                vid_putc            ;Write character w/attr
  39.  
  40.                vid_begin           ;Begin a video update
  41.                vid_update          ;End a video update
  42.                vid_buffc           ;Write a char/attr in an update
  43.  
  44.                vid_clearbox        ;Clear a window
  45.                vid_scrollbox       ;Scroll a window
  46.                vid_drawbox         ;Draw a box around a window
  47.                vid_setbox          ;Set a box character set
  48.  
  49.                vid_setpage         ;Set the active video page
  50.                vid_setmode         ;Set the video mode
  51.                vid_poscurs         ;Position the cursor
  52.  
  53. Released into the public domain by the author. Windows is a registered
  54. trademark of Microsoft Corporation.  DESQview is a registered trademark
  55. of Quarterdeck.
  56.  
  57. /***********************************************************************/
  58.  
  59. function vid_puts
  60.  
  61.  
  62.     int vid_puts(string,row,col,attr)
  63.     char *string;
  64.     int row;
  65.     int col;
  66.     int attr;
  67.  
  68.          Parameter descriptions
  69.               string - pointer to a null terminated character string
  70.               row    - row at which to display string
  71.               col    - column at which to display string
  72.               attr   - video attribute for the displayed string
  73.  
  74.          Summary
  75.               This function displays a null terminated string to
  76.               a row and column on the video screen with the
  77.               specified attribute.
  78.  
  79.          Return values
  80.               none
  81.  
  82.          Example
  83.               /*
  84.               Display a string at top left corner of screen
  85.               in reverse video
  86.               */
  87.  
  88.               #define REVERSE 0x0070
  89.               vid_puts("Hello world",0,0,REVERSE);
  90.  
  91.  
  92.          Notes for use under a control program
  93.               If a control program is present the string is written
  94.               to the process virtual screen.  A request is then sent to
  95.               update the altered positions of the virtual screen onto
  96.               the real screen.  Since several characters lying in a
  97.               contigious block of video memory can be included in one
  98.               real screen update request, this function is very fast.
  99.  
  100.  
  101. /***********************************************************************/
  102.  
  103. function vid_readc
  104.  
  105.  
  106.     unsigned vid_readc(row,col)
  107.     int row;
  108.     int col;
  109.  
  110.          Parameter descriptions
  111.               row    - row from which to read a character/attribute
  112.               col    - column from which to read a character/attribute
  113.  
  114.          Summary
  115.               This function reads a character and its attribute
  116.               from a row and column on the video screen.
  117.  
  118.          Return values
  119.               Unsigned integer containing the character read from the
  120.               screen in the low byte of the word, and the attribute
  121.               in the high byte of the word.
  122.  
  123.          Example
  124.               /*
  125.               Read character/attr from the top left corner of screen
  126.               */
  127.  
  128.               #define REVERSE 0x0070
  129.               unsigned char_attr;
  130.               char_attr = vid_readc(0,0);
  131.               if ( (char_attr & 0x00ff) == 'H') {
  132.                   ....
  133.                   }
  134.               if ( (char_attr >> 8) == REVERSE) {
  135.                   ....
  136.                   }
  137.  
  138.          Notes for use under a control program
  139.               If a control program is present the char/attr is read
  140.               straight from the process virtual screen.
  141.  
  142.  
  143. /***********************************************************************/
  144.  
  145. function vid_memread
  146.  
  147.  
  148.     int vid_memread(buffer,row,col,count)
  149.     void *buffer;
  150.     int row;
  151.     int col;
  152.     int count;
  153.  
  154.          Parameter descriptions
  155.               buffer - near pointer to a buffer of size (count * 2)
  156.                        where the block will be stored
  157.               row    - row at which to start the video block read
  158.               col    - column at which to start the video block read
  159.               count  - number of CHARACTER positions to read
  160.  
  161.          Summary
  162.               This function reads a block of memory from the video
  163.               screen.  Each word of memory will contain both the
  164.               attribute and the character values for (count) positions
  165.               in the memory block.
  166.  
  167.          Return values
  168.               none
  169.  
  170.          Example
  171.               /*
  172.               Save 20 characters and attributes from the top left
  173.               corner of the screen
  174.               */
  175.  
  176.               void *buffer;
  177.  
  178.               void = malloc( 20 * 2);
  179.               vid_memread(buffer,0,0,20);
  180.  
  181.          Notes for use under a control program
  182.               If a control program is present the block is read
  183.               straight from the process virtual screen.
  184.  
  185.  
  186. /***********************************************************************/
  187.  
  188. function vid_memwrite
  189.  
  190.  
  191.     int vid_memwrite(buffer,row,col,count)
  192.     void *buffer;
  193.     int row;
  194.     int col;
  195.     int count;
  196.  
  197.          Parameter descriptions
  198.               buffer - near pointer to a buffer of size (count * 2)
  199.                        which will be transfered to video memory
  200.               row    - row at which to start the video block write
  201.               col    - column at which to start the video block write
  202.               count  - number of CHARACTER positions to write
  203.  
  204.          Summary
  205.               This function writes a block of video memory from a saved
  206.               buffer.  Each word of memory should contain both the
  207.               attribute and the character values for (count) positions
  208.               in the memory block.  The buffer is generally created
  209.               using a call to vid_memread.
  210.  
  211.          Return values
  212.               none
  213.  
  214.          Example
  215.               /*
  216.               Save 20 characters and attributes from the top left
  217.               corner of the screen then write the same block of
  218.               memory to row 1 column 5 of the screen
  219.               */
  220.  
  221.               void *buffer;
  222.  
  223.               void = malloc( 20 * 2);
  224.               vid_memread(buffer,0,0,20);
  225.               vid_memwrite(buffer,1,5,20);
  226.  
  227.  
  228.          Notes for use under a control program
  229.               If a control program is present the block is written
  230.               to the process virtual screen.  A request is then
  231.               sent to update the altered positions of the virtual
  232.               screen onto the real screen.  All positions written to
  233.               the screen will lie in a contigious block of video memory
  234.               making this function very fast.
  235.  
  236.  
  237. /***********************************************************************/
  238.  
  239. function vid_putc
  240.  
  241.  
  242.     int vid_putc(chr,row,col,attr)
  243.     char chr;
  244.     int row;
  245.     int col;
  246.     int attr;
  247.  
  248.          Parameter descriptions
  249.               chr    - character to display
  250.               row    - row at which to display chr
  251.               col    - column at which to display chr
  252.               attr   - video attribute for the displayed chr
  253.  
  254.          Summary
  255.               This function displays a character to a row and
  256.               column on the video screen with the specified attribute.
  257.  
  258.          Return values
  259.               none
  260.  
  261.          Example
  262.               /*
  263.               Display a 'H' to the top left corner of screen
  264.               in reverse video
  265.               */
  266.  
  267.               #define REVERSE 0x0070
  268.               vid_putc('H',0,0,REVERSE);
  269.  
  270.  
  271.          Notes for use under a control program
  272.               If a control program is present the character is written
  273.               to the process virtual screen.  A request is then sent to
  274.               update the altered position of the virtual screen onto
  275.               the real screen.  There is a small amount of overhead
  276.               for updating the character onto the real screen. Thus
  277.               this function probably shouldn't be used if more chars
  278.               are going to be displayed that will lie in a contigious
  279.               block of video memory OR if they are clustered together
  280.               in a small block of contigious video memory.
  281.  
  282.  
  283. /***********************************************************************/
  284.  
  285. function vid_begin
  286.  
  287.  
  288.     int vid_begin()
  289.  
  290.          Parameter descriptions
  291.               none
  292.  
  293.          Summary
  294.               This function is used to mark the begining of
  295.               a video update.  It is especially useful under
  296.               environments running Microsoft Windows or DESQview
  297.               and has no effect if neither is detected.
  298.  
  299.          Return values
  300.               none
  301.  
  302.          Example
  303.               /*
  304.               See vid_update
  305.               */
  306.  
  307.  
  308.          Notes for use under a control program
  309.               This is especially designed for environments running
  310.               Microsoft Windows or DESQview. It can be used in
  311.               conjuction with vid_buffc, and vid_update to obtain
  312.               high performance displays under these control programs.
  313.               See example under vid_update.
  314.  
  315. /***********************************************************************/
  316.  
  317. function vid_buffc
  318.  
  319.  
  320.     int vid_buffc(chr,row,col,attr)
  321.     char chr;
  322.     int row;
  323.     int col;
  324.     int attr;
  325.  
  326.          Parameter descriptions
  327.               chr    - character to write to video buffer
  328.               row    - row at which to place  chr
  329.               col    - column at which to place chr
  330.               attr   - video attribute for the buffered chr
  331.  
  332.          Summary
  333.               This function places a character with attribute to
  334.               a row and column on the video buffer. It is especially
  335.               useful under environments running Microsoft Windows or
  336.               DESQview.  Otherwise the function is functionally
  337.               equivalent to to vid_putc since the location of the
  338.               video buffer is the real video screen.
  339.  
  340.          Return values
  341.               none
  342.  
  343.          Example
  344.               /*
  345.               See vid_update
  346.               */
  347.  
  348.          Notes for use under a control program
  349.               This is especially designed for environments running
  350.               Microsoft Windows or DESQview. It can be used in
  351.               conjuction with vid_begin, and vid_update to obtain
  352.               high performance displays under these control programs.
  353.               See example under vid_update.
  354.  
  355.  
  356. /***********************************************************************/
  357.  
  358. function vid_update
  359.  
  360.  
  361.     int vid_update()
  362.  
  363.          Parameter descriptions
  364.               none
  365.  
  366.          Summary
  367.               This function is used to mark the end of a video
  368.               update and to transfer all the changed positions of
  369.               the process video buffer to the real video screen.
  370.               It is especially useful under environments running
  371.               Microsoft Windows or DESQview and has no effect if
  372.               neither is detected.
  373.  
  374.          Return values
  375.               none
  376.  
  377.          Example
  378.               /*
  379.               Case 1 : vid_begin, vid_buffc, and vid_update are
  380.               used to build a portion of the video screen that is
  381.               a closely contigious portion of video memory.  This is
  382.               comparared to a slower usage of vid_putc to achieve
  383.               the same output.
  384.               */
  385.  
  386.               /* display message at the top left corner of screen   */
  387.               #define REVERSE 0x0070
  388.               vid_puts("Hello world",0,0,REVERSE);
  389.  
  390.               vid_begin();                   /* Mark start of update */
  391.               vid_buffc('J',0,0,REVERSE);    /* Change               */
  392.               vid_buffc('B',0,6,REVERSE);    /*        "Hello world" */
  393.               vid_buffc('w',0,8,REVERSE);    /* to                   */
  394.               vid_buffc(' ',0,10,REVERSE);   /*        "Jello Bowl " */
  395.               vid_update();                  /* Move Jello Bowl to   */
  396.                                              /* the real video screen*/
  397.                                              /* The control program, */
  398.                                              /* if present, will move*/
  399.                                              /* 10 characters on the */
  400.                                              /* call to vid_update.  */
  401.  
  402.  
  403.               /* redisplay original message at the top left corner   */
  404.               #define REVERSE 0x0070
  405.               vid_puts("Hello world",0,0,REVERSE);
  406.  
  407.               vid_putc('J',0,0,REVERSE);    /* Change               */
  408.               vid_putc('B',0,6,REVERSE);    /*        "Hello world" */
  409.               vid_putc('w',0,8,REVERSE);    /* to                   */
  410.               vid_putc(' ',0,10,REVERSE);   /*         "Jello Bowl "*/
  411.                                             /* This is slower than  */
  412.                                             /* above use since each */
  413.                                             /* character is updated */
  414.                                             /* to the real screen as*/
  415.                                             /* it is written.       */
  416.  
  417.  
  418.               /*
  419.               Case 2 : vid_begin, vid_buffc, and vid_update are
  420.               used to build a portion of the video screen that is
  421.               not in a closely contigious portion of video memory.
  422.               This is comparared to a faster usage of vid_putc to
  423.               achieve the same output.
  424.               */
  425.  
  426.               /* define normal attribute */
  427.               #define NORM      7
  428.               /* define the characters of the corners of a box */
  429.               #define UPLEFT    218
  430.               #define UPRIGHT   191
  431.               #define LOWLEFT   217
  432.               #define LOWRIGHT  192
  433.  
  434.               /* display the corners of a box characters */
  435.  
  436.               vid_begin();                   /* Mark start of update */
  437.               vid_buffc(UPLEFT,0,0,NORM);    /* Buffer upper left,   */
  438.               vid_buffc(UPRIGHT,0,19,NORM);  /*  upper right,        */
  439.               vid_buffc(LOWLEFT,19,0,NORM);  /*  lower left          */
  440.               vid_buffc(LOWRIGHT,19,19,NORM);/*  and lower right.    */
  441.               vid_update();                  /* Move the chracters to*/
  442.                                              /* the real video screen*/
  443.                                              /* The control program, */
  444.                                              /* if present, will move*/
  445.                                              /* (20 * 20) = 400 words*/
  446.                                              /* at call to vid_update*/
  447.                                              /* This causes noticable*/
  448.                                              /* flicker under Windows*/
  449.  
  450.  
  451.               /* redisplay the corners of a box using vid_putc */
  452.               vid_buffc(UPLEFT,0,0,NORM);    /* Display upper left,  */
  453.               vid_buffc(UPRIGHT,0,19,NORM);  /*  upper right,        */
  454.               vid_buffc(LOWLEFT,19,0,NORM);  /*  lower left          */
  455.               vid_buffc(LOWRIGHT,19,19,NORM);/*  and lower right.    */
  456.                                              /* Here the screen is   */
  457.                                              /* updated 4 times but  */
  458.                                              /* the control program, */
  459.                                              /* if present, will only*/
  460.                                              /* move 4 words to the  */
  461.                                              /* real screen.         */
  462.  
  463.  
  464.          Notes for use under a control program
  465.               This is especially designed for environments running
  466.               Microsoft Windows or DESQview. It can be used in
  467.               conjuction with vid_begin, and vid_buffc to obtain
  468.               high performance displays under these control programs.
  469.  
  470.  
  471. /***********************************************************************/
  472.  
  473. function vid_clearbox
  474.  
  475.  
  476.     int vid_clearbox(toprow,leftcol,lowrow,rightcol,attr)
  477.     int toprow;
  478.     int leftcol;
  479.     int lowrow;
  480.     int rightcol;
  481.     int attr;
  482.  
  483.          Parameter descriptions
  484.               toprow   - top row of the window to be cleared
  485.               leftcol  - left column of the window to be cleared
  486.               lowrow   - bottom row of the window to be cleared
  487.               rightcol - right column of the window to be cleared
  488.               attr     - video attribute of the cleared area
  489.  
  490.          Summary
  491.               This function clears a window of the video screen
  492.               and sets it to a specified video attribute.
  493.  
  494.          Return values
  495.               none
  496.  
  497.          Example
  498.               /*
  499.               Clear the entire 80 X 25 screen and set it to
  500.               a normal video attribute
  501.               */
  502.  
  503.               #define NORM 7
  504.               vid_clearbox(0,0,24,79,NORM);
  505.  
  506.  
  507.          Notes for use under a control program
  508.               No special action is taken if a control program is
  509.               present since this calls on the BIOS scroll box
  510.               video function to clear the area of the screen and
  511.               both Windows and DESQview do an excellant job of
  512.               intercepting this call and performing it quickly.
  513.  
  514.  
  515.  
  516. /***********************************************************************/
  517.  
  518. function vid_scrollbox
  519.  
  520.  
  521.     int vid_scrollbox(toprow,leftcol,lowrow,rightcol,attr,direct,lines)
  522.     int toprow;
  523.     int leftcol;
  524.     int lowrow;
  525.     int rightcol;
  526.     int attr;
  527.     int direct;
  528.     int lines;
  529.  
  530.          Parameter descriptions
  531.               toprow   - top row of the window to be scrolled
  532.               leftcol  - left column of the window to be scrolled
  533.               lowrow   - bottom row of the window to be scrolled
  534.               rightcol - right column of the window to be scrolled
  535.               attr     - video attribute for new lines
  536.               direct   - direction of the scroll
  537.                             0 = scroll up
  538.                             1 = scroll down
  539.               lines    - number of lines to scroll
  540.  
  541.  
  542.          Summary
  543.               This function scrolls a window of the video screen
  544.               a certain number of lines in a specified direction,
  545.               setting the new lines from the scroll to an attribute.
  546.               If the number of lines is given as 0 then this becomes
  547.               a functional equivalent to vid_clearbox.
  548.  
  549.          Return values
  550.               none
  551.  
  552.          Example
  553.               /*
  554.               Scroll a box down by 3 lines setting the new lines
  555.               in the top of the window to normal video attributes
  556.               */
  557.  
  558.               #define NORM     7
  559.               #define TOP      0
  560.               #define LEFT     0
  561.               #define BOTTOM   19
  562.               #define RIGHT    50
  563.               vid_clearbox(TOP,LEFT,BOTTOM,RIGHT,NORM,1,3);
  564.  
  565.  
  566.          Notes for use under a control program
  567.               No special action is taken if a control program is
  568.               present since this calls on the BIOS scroll box
  569.               video function to scroll the area of the screen and
  570.               both Windows and DESQview do an excellant job of
  571.               intercepting this call and performing it quickly.
  572.  
  573.  
  574.  
  575.  
  576. /***********************************************************************/
  577.  
  578. function vid_drawbox
  579.  
  580.  
  581.     int vid_drawbox(toprow,leftcol,lowrow,rightcol,attr,boxset)
  582.     int toprow;
  583.     int leftcol;
  584.     int lowrow;
  585.     int rightcol;
  586.     int attr;
  587.     int boxset;
  588.  
  589.          Parameter descriptions
  590.               toprow   - top row of the box
  591.               leftcol  - left column of the box
  592.               lowrow   - bottom row of the box
  593.               rightcol - right column of the box
  594.               attr     - video attribute for characters of the box
  595.               boxset   - character set to use for the box
  596.                          use vid_setbox to establish a character set
  597.                          default boxsets are set as
  598.                             1 = single line box
  599.                             2 = double line box
  600.                          up to 8 box sets can be created ( 0 thru 7 )
  601.  
  602.          Summary
  603.               This function draws a border around a specified window
  604.               of the video screen.  The characters to use for the
  605.               border are specified as a box set number from 0 to 7.
  606.               These characters can be set using vid_setbox.
  607.  
  608.          Return values
  609.               none
  610.  
  611.          Example
  612.               /*
  613.               Draw a double line box around a window setting the box
  614.               characters to reverse video
  615.               */
  616.  
  617.               #define REVERSE  0x70
  618.               #define TOP      0
  619.               #define LEFT     0
  620.               #define BOTTOM   19
  621.               #define RIGHT    50
  622.               vid_drawbox(TOP,LEFT,BOTTOM,RIGHT,REVERSE,2);
  623.  
  624.  
  625.          Notes for use under a control program
  626.               This function calls upon vs_begin, vs_buffc, and
  627.               vs_update to draw the top and bottom lines of the
  628.               box.  The right and left edges of the box are drawn
  629.               using vs_putc.
  630.  
  631.  
  632. /***********************************************************************/
  633.  
  634. function vid_setbox
  635.  
  636.  
  637.     int vid_setbox(set,topleft,top,topright,right,lowright,low,lowleft,left)
  638.     int set;
  639.     int topleft;
  640.     int top;
  641.     int topright;
  642.     int right;
  643.     int lowright;
  644.     int low;
  645.     int lowleft;
  646.     int left;
  647.  
  648.          Parameter descriptions
  649.               set      - number of the boxset to establish
  650.                          must be a value from 0 to 7 .
  651.                          two default boxsets are initialized :
  652.                             1 = single line box
  653.                             2 = double line box
  654.               topleft  - the character for the top left corner
  655.               top      - the character for the top side
  656.               topright - the character for the top right corner
  657.               right    - the character for the right side
  658.               lowright - the character for the bottom right corner
  659.               low      - the character for the bottom side
  660.               lowleft  - the character for the bottom left corner
  661.               left     - the character for the left side
  662.  
  663.          Summary
  664.               This function establishes a character set to use for
  665.               drawing a border around a specified window of the video
  666.               screen using vid_drawbox.
  667.  
  668.          Return values
  669.               none
  670.  
  671.          Example
  672.               /*
  673.               Establish box set 0  with the top and bottom lines
  674.               as double line characters and the sides of the box as
  675.               single line characters. Then draw the box around a window
  676.               in reverse video.
  677.               */
  678.  
  679.               #define REVERSE  0x70
  680.               #define NORMAL   0x07
  681.               #define TOP      0
  682.               #define LEFT     0
  683.               #define BOTTOM   19
  684.               #define RIGHT    59
  685.               vid_setbox(0,213,205,184,179,190,205,212,179);
  686.               vid_clearbox(TOP,LEFT,BOTTOM,RIGHT,NORMAL);
  687.               vid_drawbox(TOP,LEFT,BOTTOM,RIGHT,REVERSE,0);
  688.  
  689.  
  690.          Notes for use under a control program
  691.               This function doesn't actually perform any video
  692.               screen IO.
  693.  
  694.  
  695. /***********************************************************************/
  696.  
  697. function vid_poscurs
  698.  
  699.  
  700.     int vid_poscurs(row,col)
  701.     int row;
  702.     int col;
  703.  
  704.          Parameter descriptions
  705.               row    - row to position cursor
  706.               col    - column to position cursor
  707.  
  708.          Summary
  709.               This function sets the cursor to row and
  710.               column on the video screen.
  711.  
  712.          Return values
  713.               none
  714.  
  715.          Example
  716.               /*
  717.               Hide the cursor by positioning it to row 25 column 0
  718.               */
  719.  
  720.               vid_poscurs(25,0);
  721.  
  722.  
  723.          Notes for use under a control program
  724.               No special action is taken if a control program is
  725.               present since this calls on the BIOS set cursor position
  726.               video function, which both Windows and DESQview
  727.               intercept nicely.
  728.  
  729.  
  730. /***********************************************************************/
  731.  
  732. function vid_setpage
  733.  
  734.  
  735.     int vid_setpage(vidpage)
  736.     int vidpage;
  737.  
  738.          Parameter descriptions
  739.               vidpage - video page
  740.  
  741.          Summary
  742.               This function sets the current video page.  The only
  743.               supported page in this library is page 0.  The function
  744.               is only provided to make sure the video page has been
  745.               initialized to zero.
  746.  
  747.          Return values
  748.               none
  749.  
  750.          Example
  751.               /*
  752.               Initialize the video page to 0
  753.               */
  754.  
  755.               vid_setpage(0);
  756.  
  757.  
  758.          Notes for use under a control program
  759.               No special action is taken if a control program is
  760.               present since this calls on the BIOS set video page
  761.               video function, which both Windows and DESQview
  762.               intercept nicely.
  763.  
  764.  
  765.  
  766. /***********************************************************************/
  767.  
  768. function vid_setmode
  769.  
  770.  
  771.     int vid_setmode(vidmode)
  772.     int vidmode;
  773.  
  774.          Parameter descriptions
  775.               vidmode - video mode
  776.  
  777.          Summary
  778.               This function establishes the current video mode.
  779.               The following modes are supported in this library
  780.                    2       80  X 25   blank and white text
  781.                    3       80  X 25   color text
  782.                    7       80  X 25   monochrome text
  783.  
  784.          Return values
  785.               none
  786.  
  787.          Example
  788.               /*
  789.               Set the video mode to 80 X 25 color text
  790.               */
  791.  
  792.               vid_setmode(3);
  793.  
  794.  
  795.          Notes for use under a control program
  796.               No special action is taken if a control program is
  797.               present since this calls on the BIOS set video mode
  798.               video function, which both Windows and DESQview
  799.               intercept nicely.
  800.  
  801. /***********************************************************************/
  802.  
  803.