home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_300
/
361_01
/
saverest.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-09-20
|
922b
|
36 lines
/*SaveRest.c ---> Save/Restore a Rectangular Area of CRT Text.
*
* Author: J.Ekwall 13 September 91
*
* Copyrighted to the Public Domain. Unlimited Distribution Authorized.
*
* User Assumes All Risks/Liabilities.
*
* Last Update: 13 September 91/EK
*/
#include <stdek.h>
#include <gadgets.h>
void RestoreBox(int Left, int Top, int Right, int Bottom, char *FootPrint)
{
int X, Y, Addr, *tp1;
for (Y = Top, tp1 = (int *) FootPrint; Y <= Bottom; Y++) {
Addr = Vaddr(Left, Y);
for (X = Left; X++ <= Right; Addr += 2) Vpoke(Addr, *tp1++);
}
}
void SaveBox(int Left, int Top, int Right, int Bottom, char *FootPrint)
{
int X, Y, Addr, *tp1;
for (Y = Top, tp1 = (int *) FootPrint; Y <= Bottom; Y++) {
Addr = Vaddr(Left, Y);
for (X = Left; X++ <= Right; Addr += 2) *tp1++ = Vpeek(Addr);
}
}