inp.h 3.55 KB
#include <cc.h>

static void
printHeader(void)
{
	printf("#\n");
	printf("#  RDP/CC test vectors\n");
	printf("#\n");

	printf("gclk			@C 0(8) 1(8)\n");
	printf("st_span			@I @E 0\n");
	printf("ncyc			@I @E 0\n");
	printf("key_en			@I @E 0\n");
	printf("texture_edge_mode	@I @E 0\n");
	printf("cvg_times_alpha		@I @E 0\n");
	printf("alpha_cvg_select	@I @E 0\n");
	printf("cc_x_sel_0_r[3:0]	@I\n");
	printf("cc_y_sel_0_r[3:0]	@I\n");
	printf("cc_a_sel_0_r[4:0]	@I\n");
	printf("cc_c_sel_0_r[2:0]	@I\n");
	printf("cc_x_sel_0_a[2:0]	@I\n");
	printf("cc_y_sel_0_a[2:0]	@I\n");
	printf("cc_a_sel_0_a[2:0]	@I\n");
	printf("cc_c_sel_0_a[2:0]	@I\n");
	printf("cc_x_sel_1_r[3:0]	@I\n");
	printf("cc_y_sel_1_r[3:0]	@I\n");
	printf("cc_a_sel_1_r[4:0]	@I\n");
	printf("cc_c_sel_1_r[2:0]	@I\n");
	printf("cc_x_sel_1_a[2:0]	@I\n");
	printf("cc_y_sel_1_a[2:0]	@I\n");
	printf("cc_a_sel_1_a[2:0]	@I\n");
	printf("cc_c_sel_1_a[2:0]	@I\n");
	printf("st_r[7:0]		@I\n");
	printf("st_g[7:0]		@I\n");
	printf("st_b[7:0]		@I\n");
	printf("st_a[7:0]		@I\n");
	printf("tf_r[7:0]		@I\n");
	printf("tf_g[7:0]		@I\n");
	printf("tf_b[7:0]		@I\n");
	printf("tf_a[7:0]		@I\n");
	printf("tf_lod_frac[8:0]	@I\n");
	printf("tf_lge1			@I\n");
	printf("prim_lod_frac[8:0]	@I\n");
	printf("prim_r[7:0]		@I\n");
	printf("prim_g[7:0]		@I\n");
	printf("prim_b[7:0]		@I\n");
	printf("prim_a[7:0]		@I\n");
	printf("env_r[7:0]		@I\n");
	printf("env_g[7:0]		@I\n");
	printf("env_b[7:0]		@I\n");
	printf("env_a[7:0]		@I\n");
	printf("center_r[7:0]		@I\n");
	printf("center_g[7:0]		@I\n");
	printf("center_b[7:0]		@I\n");
	printf("scale_r[7:0]		@I\n");
	printf("scale_g[7:0]		@I\n");
	printf("scale_b[7:0]		@I\n");
	printf("width_r[11:0]		@I\n");
	printf("width_g[11:0]		@I\n");
	printf("width_b[11:0]		@I\n");
	printf("k4_coeff[8:0]		@I\n");
	printf("k5_coeff[8:0]		@I\n");
	printf("noise[8:0]		@I\n");
	printf("cvg[3:0]		@I\n");
	printf("dither_en		@I\n");
	printf("dv_0			@I\n");
	printf("\n");
}

static void
printVector(cc_t *ccp, int dv_0)
{
	printf("%x %x %x %x %x %x   ",
		ccp->st_span, ccp->ncyc, ccp->key_en, ccp->texture_edge_mode,
		ccp->cvg_times_alpha, ccp->alpha_cvg_select);
	printf("0x%x 0x%x 0x%02x 0x%x ",
		ccp->cc_x_sel_0_r, ccp->cc_y_sel_0_r,
		ccp->cc_a_sel_0_r, ccp->cc_c_sel_0_r);
	printf("0x%x 0x%x 0x%x 0x%x  ",
		ccp->cc_x_sel_0_a, ccp->cc_y_sel_0_a,
		ccp->cc_a_sel_0_a, ccp->cc_c_sel_0_a);
	printf("0x%x 0x%x 0x%02x 0x%x ",
		ccp->cc_x_sel_1_r, ccp->cc_y_sel_1_r,
		ccp->cc_a_sel_1_r, ccp->cc_c_sel_1_r);
	printf("0x%x 0x%x 0x%x 0x%x ",
		ccp->cc_x_sel_1_a, ccp->cc_y_sel_1_a,
		ccp->cc_a_sel_1_a, ccp->cc_c_sel_1_a);
	printf("0x%02x 0x%02x 0x%02x 0x%02x        ",
		ccp->st_r, ccp->st_g, ccp->st_b, ccp->st_a);
	printf("0x%03x 0x%03x 0x%03x 0x%03x        ",
		ccp->tf_r, ccp->tf_g, ccp->tf_b, ccp->tf_a);
	printf("0x%03x %x 0x%03x         ",
		ccp->tf_lod_frac, ccp->tf_lge1, ccp->prim_lod_frac);
	printf("0x%02x 0x%02x 0x%02x 0x%02x  ",
		ccp->prim_r, ccp->prim_g, ccp->prim_b, ccp->prim_a);
	printf("0x%02x 0x%02x 0x%02x 0x%02x  ",
		ccp->env_r, ccp->env_g, ccp->env_b, ccp->env_a);
	printf("0x%02x 0x%02x 0x%02x  ",
		ccp->center_r, ccp->center_g, ccp->center_b);
	printf("0x%02x 0x%02x 0x%02x        ",
		ccp->scale_r, ccp->scale_g, ccp->scale_b);
	printf("0x%03x 0x%03x 0x%03x        ",
		ccp->width_r, ccp->width_g, ccp->width_b);
	printf("0x%03x 0x%03x 0x%03x 0x%x %d %d\n",
		ccp->k4_coeff, ccp->k5_coeff, ccp->noise,
		ccp->cvg, ccp->dither_en, dv_0);
}

static void
printTrailingCycles(void)
{
	cc_t cc;
	cc_t *ccp = &cc;
	int i;

	bzero(ccp, sizeof(cc));

	printf("# Trailing cycles\n");
	for (i = 0; i < 4; i++)
		printVector(ccp, 0);
}