#include <stdio.h>

#define		unshort		unsigned short
#define		unchar		unsigned char
/*#define	  FILE_NO	  18*/

FILE		*fpw0,*fpr0;

int		i,j;

unchar		scr_data_0[8192];
unchar		scr_data_1[4096];

main()
{
	if(( fpr0 = fopen( "map-2bit.SCR","r" )) == NULL ){
		printf( "map-2bit.SCR not open \n" );
		exit(1);
	}

	if(( fpw0 = fopen( "cors.dat","w" )) == NULL ){
		printf( "cors.dat not open \n" );
		exit(1);
	}

	while(( fread( scr_data_0,sizeof(unchar),8192,fpr0 )) == NULL ){
		printf( "read error\n" );
		exit(1);
	}

	for( i=0;i<4096;i++ ){
		j = i*2;
		scr_data_1[i] = scr_data_0[j];
	}

	while(( fwrite( scr_data_1,sizeof(unchar),4096,fpw0 )) == NULL ){
		printf( "write error\n" );
		exit(1);
	}
}
