#include #include char buf[64000]; char *vram=(char *)0xA0000000L; void setrgb(int c,int r,int g,int b) { outp(0x3c8,c); outp(0x3c9,r); outp(0x3c9,g); outp(0x3c9,b); } int cx=76,cy=58,ymax=120,xmax=150; double full; void lenscalc(int x,int y,int *px,int *py) { double now,new,fx,fy; now=full-(double)(x*x+(y*9/8)*(y*9/8)); if(now<1.0) now=1.0; new=250.0/pow(now,0.69); fx=(double)(rand()-16384)/30000.0; fy=(double)(rand()-16384)/30000.0; *px=(int)(((double)x+fx)*new); *py=(int)(((double)y+fy)*new); } void squeeze(int factor) { int a,x,y,x1,y1,x2,y2; for(y=ymax-1;y>=0;y--) for(x=0;xbx) bx=x; if(y>by) by=y; } if(col==1) { if(vram[x+y*320] && vram[x+y*320]!=4) { if(z==-1) { rd[rdp++]=x; z=x+y*320; } x1=x-cx; y1=y-cy; lenscalc(x1,y1,&x2,&y2); a=(x2&15)+(y2&15)+16; vram[(xmax+cx+x1)+(cy+y1)*320]=a; vram[(xmax+cx+x2)+(160+y2)*320]=y+16; rd[rdp++]=(cx+x2)+(cy+y2)*320-z; } } else if(col==4) { if(vram[x+y*320]==4) { if(z==-1) { rd[rdp++]=0; z=x+y*320; } rd[rdp++]=x; vram[(xmax+x)+(y)*320]=0; } } else { if(vram[x+y*320]==col) { if(z==-1) { rd[rdp++]=x; z=x+y*320; } x1=x-cx; y1=y-cy; lenscalc(x1,y1,&x2,&y2); a=(x2&15)+(y2&15)+16; vram[(xmax+cx+x1)+(cy+y1)*320]=a; vram[(xmax+cx+x2)+(160+y2)*320]=y+16; rd[rdp++]=x+y*320-z; rd[rdp++]=(cx+x2)+(cy+y2)*320-z; } } } c=rdp-rowbeg[y]-1; if(c<0) c=0; if(col==1 || col==4) rowcnt[y]=c; else rowcnt[y]=c/2; } sprintf(tmp,"lens.ex%i",col); f1=fopen(tmp,"wb"); for(a=0;a