/****************************************************************
*	Mario chip test MAP file convert			*
****************************************************************/

#include	<stdio.h>
#include	<math.h>

main(argc, argv)
{
	double          x, y, r, a;
	int             i;

	x = 32;
	for (y = -32; y < 32; y=y+2) {
		i = 0;
		for (r = -16; r < 16; r++) {
			a = y / x * r;
			a = (int) a & 0x03ff;
			a = (int) a | 0x6000;
			if (!(i & 0x7)) {
				printf("\n\t\tWORD\t\t%05XH", (int) a);
			} else {
				printf(",%05XH", (int) a);
			}
			i++;
		}
		printf("\n;");
	}
	printf("\n");
}
