/* Copyright 2008 Jeffrey Lee
   This file is part of GnarlPlot.
   GnarlPlot is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.
   GnarlPlot is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   You should have received a copy of the GNU General Public License
   along with GnarlPlot.  If not, see <http://www.gnu.org/licenses/>. */

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

#include "WoumInclude:lib/sasm.h"

extern int gp_genplot_testmonkey(int *buf,int spr_ps,int spr_mt,int scr_ps,int scr_mt);
extern int gp_genplot_testyeknom(int *buf,int spr_ps,int spr_mt,int scr_ps,int scr_mt);

int main(int argc,char **argv)
{
	int buf[4096];
	int l;
	int spr_ps,spr_mt,scr_ps,scr_mt;
	int i;
	printf("********************************NORMAL PLOTTERS********************************\n");
	for (scr_mt=0;scr_mt<4;scr_mt++)
		for (scr_ps=0;scr_ps<3;scr_ps++)
			for (spr_mt=0;spr_mt<4;spr_mt++)
				for (spr_ps=0;spr_ps<3;spr_ps++)
				{
					printf("Generating code for spr_ps %d, spr_mt %d, scr_ps %d, scr_mt %d\n",spr_ps,spr_mt,scr_ps,scr_mt);
					l = gp_genplot_testmonkey(buf,spr_ps,spr_mt,scr_ps,scr_mt);
					printf("Length=%d\n",l);
					for (i=0;i<l;i+=4)
						printf("%08X : %08X : %s\n",i+((int) buf),buf[i >> 2],sasm_dis(buf+(i >> 2)));
				}
	printf("******************************TRANSFORMED PLOTTERS******************************\n");
	for (scr_mt=0;scr_mt<4;scr_mt++)
		for (scr_ps=0;scr_ps<3;scr_ps++)
			for (spr_mt=0;spr_mt<4;spr_mt++)
				for (spr_ps=0;spr_ps<3;spr_ps++)
				{
					printf("Generating code for spr_ps %d, spr_mt %d, scr_ps %d, scr_mt %d\n",spr_ps,spr_mt,scr_ps,scr_mt);
					l = gp_genplot_testyeknom(buf,spr_ps,spr_mt,scr_ps,scr_mt);
					printf("Length=%d\n",l);
					for (i=0;i<l;i+=4)
						printf("%08X : %08X : %s\n",i+((int) buf),buf[i >> 2],sasm_dis(buf+(i >> 2)));
				}
	return 0;
}
