#include<ultra64.h>

extern Vtx AC_Boss_FujitsuboC_v[];

extern unsigned char AC_BossTX03_CI8_txt[];
extern unsigned char AC_BossTX05_CI8_txt[];



#define gs_Nin_LoadTextureImage(timg,fmt,siz,width,height,tmem,tt)	\
	gsDPSetTextureImage(fmt,siz,1,timg),	\
	gsDPTileSync(),	\
	gsDPSetTile(fmt,siz,0,tmem,tt,0,0,0,0,0,0,0),	\
	gsDPLoadSync(),	\
	gsDPLoadBlock(tt,0,0,width*height-1,CALC_DXT(width,siz##_BYTES))

#define gs_Nin_SetUpTileDescrip(fmt,siz,width,height,tmem,tt,cs,ms,ss,ct,mt,st)	\
	gsDPTileSync(),	\
	gsDPSetTile(fmt,siz,((((width)*siz##_LINE_BYTES)+7)>>3),tmem,tt,0,ct,mt,st,cs,ms,ss),	\
	gsDPSetTileSize(tt,0,0,(width-1)<<G_TEXTURE_IMAGE_FRAC,(height-1)<<G_TEXTURE_IMAGE_FRAC)

#define G_CC_PRIMSHADE PRIMITIVE,0,SHADE,0,0,0,0,SHADE

/* main display list */


/* ======== DXFdata ======== */

Gfx AC_Boss_FujitsuboC[]={

	gsDPSetTextureLUT(G_TT_RGBA16),
	gsDPLoadTLUT_pal256(&AC_BossTX03_CI8_txt[1024]),
	gsDPLoadTextureBlock(AC_BossTX03_CI8_txt,G_IM_FMT_CI,G_IM_SIZ_8b,32,32,0,G_TX_WRAP,G_TX_CLAMP,5,5,0,0),

	gsSPVertex(&AC_Boss_FujitsuboC_v[0], 16, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(0, 3, 1, 0),
	gsSP1Triangle(4, 5, 6, 0),
	gsSP1Triangle(7, 4, 6, 0),
	gsSP1Triangle(4, 8, 5, 0),
	gsSP1Triangle(9, 10, 11, 0),
	gsSP1Triangle(9, 12, 10, 0),
	gsSP1Triangle(13, 14, 15, 0),
	gsSPVertex(&AC_Boss_FujitsuboC_v[6], 2, 0),
	gsSPVertex(&AC_Boss_FujitsuboC_v[13], 2, 2),
	gsSPVertex(&AC_Boss_FujitsuboC_v[16], 2, 4),
	gsSP1Triangle(2, 4, 3, 0),
	gsSP1Triangle(1, 0, 5, 0),

	gsDPLoadTLUT_pal256(&AC_BossTX05_CI8_txt[256]),
	gsDPLoadTextureBlock(AC_BossTX05_CI8_txt,G_IM_FMT_CI,G_IM_SIZ_8b,16,16,0,G_TX_WRAP,G_TX_CLAMP,4,4,0,0),

	gsSPVertex(&AC_Boss_FujitsuboC_v[18], 15, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(3, 0, 2, 0),
	gsSP1Triangle(2, 4, 3, 0),
	gsSP1Triangle(2, 1, 5, 0),
	gsSP1Triangle(5, 4, 2, 0),
	gsSP1Triangle(1, 0, 6, 0),
	gsSP1Triangle(1, 6, 7, 0),
	gsSP1Triangle(5, 1, 7, 0),
	gsSP1Triangle(5, 7, 8, 0),
	gsSP1Triangle(4, 5, 8, 0),
	gsSP1Triangle(0, 3, 9, 0),
	gsSP1Triangle(3, 10, 9, 0),
	gsSP1Triangle(3, 4, 10, 0),
	gsSP1Triangle(4, 8, 10, 0),
	gsSP1Triangle(0, 9, 6, 0),
	gsSP1Triangle(11, 12, 13, 0),
	gsSP1Triangle(12, 14, 13, 0),
	gsSPVertex(&AC_Boss_FujitsuboC_v[29], 1, 0),
	gsSPVertex(&AC_Boss_FujitsuboC_v[31], 4, 1),
	gsSP1Triangle(2, 3, 1, 0),
	gsSP1Triangle(4, 0, 1, 0),
	gsSP1Triangle(3, 4, 1, 0),
	gsDPPipeSync(),
        gsDPSetTextureLUT(G_TT_NONE),
	gsSPEndDisplayList(),
}; /* DXFdata */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 35 vertices */
Vtx AC_Boss_FujitsuboC_v[]={
	{ 82,264,113,0, 312, 37, 50,38,101,255 },   /* v0 used p28/V1 4 times */
	{ 147,408,-48,0, 958, 1024, 119,-11,-11,255 },   /* v1 used p28/V3 4 times */
	{ 91,408,125,0, 279, 1024, 47,-11,109,255 },   /* v2 used p29/V3 2 times */
	{ 133,264,-43,0, 924, 37, 113,39,-15,255 },   /* v3 used p28/V2 2 times */
	{ 0,264,-140,0, 682, 95, 20,38,-112,255 },   /* v4 used p10/V1 3 times */
	{ -147,408,-48,0, 179, 1078, -102,-11,-61,255 },   /* v5 used p10/V3 4 times */
	{ 0,408,-155,0, 682, 1078, 26,-11,-116,255 },   /* v6 used p11/V3 3 times */
	{ 133,264,-43,0, 1136, 95, 113,39,-15,255 },   /* v7 used p4/V1 4 times */
	{ -133,264,-43,0, 229, 95, -99,38,-54,255 },   /* v8 used p10/V2 2 times */
	{ -82,264,113,0, 402, 95, -81,39,78,255 },   /* v9 used p23/V1 2 times */
	{ 91,408,125,0, 993, 1078, 47,-11,109,255 },   /* v10 used p23/V2 2 times */
	{ -91,408,125,0, 371, 1078, -89,-11,78,255 },   /* v11 used p23/V3 2 times */
	{ 82,264,113,0, 962, 95, 50,38,101,255 },   /* v12 used p22/V2 2 times */
	{ -133,264,-43,0, 405, 37, -99,38,-54,255 },   /* v13 used p16/V1 4 times */
	{ -91,408,125,0, 1051, 1023, -89,-11,78,255 },   /* v14 used p16/V3 4 times */
	{ -147,408,-48,0, 372, 1023, -102,-11,-61,255 },   /* v15 used p17/V3 2 times */
	{ -82,264,113,0, 1017, 37, -81,39,78,255 },   /* v16 used p16/V2 2 times */
	{ 147,408,-48,0, 1186, 1078, 119,-11,-11,255 },   /* v17 used p5/V3 2 times */
	{ -268,0,-86,0, -913, 365, -64,47,-89,255 },   /* v18 used p8/V2 5 times */
	{ 1,0,-280,0, 2, 365, -39,-47,-102,255 },   /* v19 used p89/V2 5 times */
	{ 0,-173,0,0, 0, 618, 0,-119,0,255 },   /* v20 used p89/V1 5 times */
	{ -166,0,227,0, -567, 365, -42,10,111,255 },   /* v21 used p20/V1 5 times */
	{ 165,0,226,0, 563, 365, 0,47,109,255 },   /* v22 used p20/V2 10 times */
	{ 268,0,-87,0, 915, 365, 100,-65,-1,255 },   /* v23 used p89/V3 5 times */
	{ -133,264,-43,0, -453, -20, -99,38,-54,255 },   /* v24 used p9/V2 3 times */
	{ 0,264,-140,0, 0, -20, 20,38,-112,255 },   /* v25 used p2/V3 6 times */
	{ 133,264,-43,0, 453, -20, 113,39,-15,255 },   /* v26 used p27/V2 3 times */
	{ -82,264,113,0, -280, -20, -81,39,78,255 },   /* v27 used p21/V3 3 times */
	{ 82,264,113,0, 280, -20, 50,38,101,255 },   /* v28 used p20/V3 6 times */
	{ -147,408,-48,0, -51, 116, 56,104,17,255 },   /* v29 used p12/V2 4 times */
	{ -91,408,125,0, 77, 116, 35,104,-48,255 },   /* v30 used p24/V1 2 times */
	{ 0,320,0,0, 284, 718, 0,120,0,255 },   /* v31 used p24/V3 5 times */
	{ 91,408,125,0, 491, 116, -34,104,-48,255 },   /* v32 used p24/V2 2 times */
	{ 147,408,-48,0, 620, 116, -55,104,17,255 },   /* v33 used p6/V1 4 times */
	{ 0,408,-155,0, 284, 116, 0,104,58,255 },   /* v34 used p6/V2 4 times */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
