FreeBASIC  0.91.0
io_pcopy.c
Go to the documentation of this file.
1 /* console pcopy function */
2 
3 #include "../fb.h"
4 #include "fb_private_console.h"
5 #include <go32.h>
6 
7 int fb_ConsolePageCopy( int src, int dst )
8 {
9  /* use current? */
10  if( src < 0 )
11  src = __fb_con.active;
12 
13  if( dst < 0 )
14  dst = __fb_con.visible;
15 
16  if( src == dst )
17  return fb_ErrorSetNum( FB_RTERROR_OK );
18 
19  /* do the copy */
20  int cols, rows;
21  fb_ConsoleGetSize( &cols, &rows );
22 
23  unsigned long srcAddr = fb_hGetPageAddr( src, cols, rows );
24  unsigned long dstAddr = fb_hGetPageAddr( dst, cols, rows );
25 
26  _movedataw( _dos_ds, srcAddr, _dos_ds, dstAddr, cols * rows );
27 
28  return fb_ErrorSetNum( FB_RTERROR_OK );
29 }