1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
#include<dos.h>
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
void write2screen(int row,int column,char c,int attb);
void writestring(int row,int column,char *c,int attb);
void savevdo(int sr,int er,int sc,int ec,int *imager);
void showvdo(int sr,int er,int sc,int ec,int *imager);
int *buffer;int *buffers;
void main()
{
gotoxy(5,6);
printf("fghhgf");
writestring(16,16,"dfggdfsdgf",146);
write2screen(10,8,'j',146);
buffer=(int*)malloc(800);buffers=(int*)malloc(400);
savevdo(1,1,20,20,buffer);
getch();
clrscr();
showvdo(1,1,20,20);
getch();
}
void write2screen(int row,int column,char c,int attb)
{
char far *vid;
vid=(char far*)0xB8000000+row*160+column*2;
*vid=c;
vid++;
*vid=attb;
}
void savevdo(int sr,int er,int sc,int ec,int *imager)
{
int i,j;
char far *vid;
int count=0;
for(i=sr;i<=er;i++)
{for(j=sc;j<=ec;j++)
{
vid=(char far*)0xB8000000+i*160+j*2;
*(imager+count)=*vid;
*(imager+count+1)=*(vid+1);
count+=2;
}}
}
void showvdo(int sr,int er,int sc,int ec,int *imager)
{
int i,j;
|