
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

FILE *infp;
FILE *outfp;

void main(int argc, char *argv[])
{
	char *infile;
	char outfile[64];
	unsigned char buf0[128*26];
	unsigned char buf1[128*26];
	int xxx;

	if (argc == 2) {
		infile = argv[1];
		strcpy(outfile, infile);
		strcat(outfile, ".flip");

		printf("in out: %s %s\n", infile, outfile);

		infp = fopen(infile, "rb");
		outfp = fopen(outfile, "wb");

		for(xxx = 0; xxx != 77; xxx++) {
			fread(buf0, 1, 128*26, infp);
			fread(buf1, 1, 128*26, infp);

			fwrite(buf1, 1, 128*26, outfp);
			fwrite(buf0, 1, 128*26, outfp);
		}

		fclose(infp);
		fclose(outfp);

	} else 
		printf("usage: %s <infile>\n", argv[0]);
}
