#include <stdio.h>
#include <stdlib.h>
#include <msdos.cf>
#include <ysuty2.h>
#include <egb.h>

char egb[EgbWorkSize];

putZoom(short *dat,int lx,int ly,int x1,int y1,int x2,int y2)
{
	int x,y,sx,sy,mb,mi;

	sx=x2-x1+1;
	sy=y2-y1+1;
	for(y=y1; y<y2; y++)
	{
		mb=(y-y1)*ly/sy*lx;
		for(x=x1; x<x2; x++)
		{
			mi=(x-x1)*lx/sx;
			if(dat[mb+mi]==0)continue;
			YGB_color(egb,dat[mb+mi]);
			YGB_pset(egb,x,y);
		}
	}
}

main()
{
	FILE *fp;
	int len;
	short *pat;

	fp=fopen("ys11mark.col","rb");
	len=YSC_fsize(fp);
	pat=(short *)malloc(len);
	fread(pat,1,len,fp);
	fclose(fp);

	YGB_init(egb,5,5);
	YGB_writeMode(egb,MATTE);
	putZoom(pat,64,32,0,0,79,39);
	putZoom(pat,64,32,80,40,239,99);
	putZoom(pat,64,32,24,64,48,76);
	putZoom(pat,64,32,0,100,255,239);
}
