Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- QWIKC20 & Multi-Level Virtual Windows - <b>---------------------------------------------------------------------------</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ---------------------------------------------------------------------------
 qvscrtoscr                                                            QWIKC
 ---------------------------------------------------------------------------
 Function       Copies a rows-by-columns block from a virtual screen to
                another location on the current screen.
 Syntax         void qvscrtoscr( unsigned char row, unsigned char col,
                                 unsigned char rows, unsigned char cols,
                                 unsigned char vrow, unsigned char vcol,
                                 unsigned char vwidth, void far *vscrptr );
 Remarks        row, col, rows, and cols locates the destination on the
                current screen (scr) as specified by qscr.  A block will be
                copied from the virtual screen (vscr) at the location of
                vrow and vcol.  But since vscr may have a different column
                width than scr, vwidth sets the width.  vscrptr is the base
                address of the virtual screen.  By changing qscr, you can
                even copy blocks from one virtual screen to another!  Only
                the scr side checks for possible snow.
 Return value   None.
 Screens        All video pages and virtual screens.
 EOS            Unaltered.
 Restrictions   Stay within the screen limits.  Not intended for copying
                between video pages (esp. CGA).
 Example        Copy a 12x40 block from the CRT screen at (5,10) to a
                virtual screen at (3,2) and look at the result on the CRT:

   #include <stdio.h>
   #include <conio.h>
   #include "qwikc20.h"

   #define vscrrows 20
   #define vscrcols 60

   /* Storage size in bytes required is: rows * cols << 1 */
   int vscr[vscrrows][vscrcols];     /* 20 x 60 virtual screen */
   vscr_t crt,myvscr;

   main() {
       qinit();

       /* create specs for virtual screen */
       myvscr.vrows=vscrrows;
       myvscr.vcols=vscrcols;
       myvscr.vsize=sizeof(vscr);
       myvscr.vsnow=0;             /* qwikest when 0 */
       myvscr.veosofs=0;
       myvscr.vscrptr=&vscr;

       qfill( 1, 1, crt_rows, crt_cols, WHITE+BLUE_BG, '*' ); /* Fill CRT */
       crt=qscr;                                        /* Save CRT specs */
       qscr=myvscr;                                  /* Set virtual specs */
       qfill(1, 1, vscrrows, vscrcols, BLACK+BROWN_BG, '?'); /* Fill vscr */
       qscr=crt;                                     /* Restore CRT specs */
       qscrtovscr( 5, 10, 12, 40, 3, 2, vscrcols, vscr );   /* Copy Block */
       qstoretoscr( 1, 1, vscrrows, vscrcols, vscr );      /* Take a look */
       getch();

       return;
   }


See Also: qscrtovscr()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson