#include <dos.h> #include <math.h> #include <alloc.h> char far * vram=(char far *)0xa0000000; #define pixel(x,y,c) (*(vram+(x)+(y)*320)=(char)(c)) void drawredflag(int x,int y,int width,int height) { while(!kbhit()) { static float angle=0; static unsigned int tx,ty,i; for(i=0;i<64000;i++) { *(vram+i)=0; } angle+=0.05; for(tx=0;tx<=width;tx++) { char c=tx==0||tx==width?14:12; ty=(height/20 *tx*4.0/width*sin(tx*3.14/width+angle)) *sin( tx*3.14*1.52/width+angle ); for(i=1;i<height;i++) pixel(tx+x,ty+y+i,c); pixel(tx+x,ty+y,14),pixel(tx+x,ty+y+height,14); } movedata(FP_SEG(vram),FP_OFF(vram),0xa000,0,64000L); } }
int main(void) { _AX=0x13;__int__(0x10); vram=(char far *)farmalloc(64000L); drawredflag(40,40,200,120); getch(); _AX=3;__int__(0x10); farfree(vram);
getch(); return 0;
}