#include<ultra64.h>

extern Vtx CN_Boss_Head_v[];

extern unsigned short CN_Bill_Moji_txt[];
extern unsigned short CN_BossTX_01_txt[];
extern unsigned short CN_BossTX_03_txt[];
extern unsigned short CN_BossTX_04_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 */


/* ======== o1 ======== */

Gfx CN_Boss_Head[]={

	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,64,32,0,0,G_TX_WRAP,6,0,G_TX_WRAP,5,0),
	gs_Nin_LoadTextureImage(CN_Bill_Moji_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,64,32,0,7),


	gsSPVertex(&CN_Boss_Head_v[0],12,0),
	gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
	gsSP2Triangles(6, 7, 8, 0, 9, 10, 11, 0),
	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,32,32,0,0,G_TX_WRAP,5,0,G_TX_WRAP,5,0),
	gs_Nin_LoadTextureImage(CN_BossTX_01_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,32,32,0,7),


	gsSPVertex(&CN_Boss_Head_v[12],24,0),
	gsSP2Triangles(0, 1, 2, 0, 2, 3, 0, 0),
	gsSP2Triangles(0, 4, 1, 0, 5, 6, 7, 0),
	gsSP2Triangles(7, 8, 5, 0, 5, 9, 6, 0),
	gsSP2Triangles(5, 10, 9, 0, 11, 12, 13, 0),
	gsSP2Triangles(13, 14, 11, 0, 11, 15, 12, 0),
	gsSP2Triangles(13, 16, 14, 0, 17, 18, 19, 0),
	gsSP2Triangles(17, 20, 18, 0, 19, 21, 17, 0),
	gsSP2Triangles(19, 22, 21, 0, 2, 23, 3, 0),
	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,0,G_TX_MIRROR,4,0,G_TX_MIRROR,4,0),
	gs_Nin_LoadTextureImage(CN_BossTX_03_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),


	gsSPVertex(&CN_Boss_Head_v[36],32,0),
	gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
	gsSP2Triangles(6, 7, 8, 0, 9, 10, 11, 0),
	gsSP2Triangles(12, 13, 9, 0, 14, 15, 12, 0),
	gsSP2Triangles(16, 17, 11, 0, 18, 19, 20, 0),
	gsSP2Triangles(21, 22, 23, 0, 24, 25, 26, 0),
	gsSP2Triangles(2, 27, 0, 0, 23, 28, 29, 0),
	gsSP1Triangle(30, 31, 18, 0),
	gsSPVertex(&CN_Boss_Head_v[68],9,0),
	gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
	gsSP1Triangle(6, 7, 8, 0),
	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,32,32,0,0,G_TX_WRAP,5,0,G_TX_WRAP,5,0),
	gs_Nin_LoadTextureImage(CN_BossTX_04_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,32,32,0,7),

	gsSPVertex(&CN_Boss_Head_v[77],20,0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Quadrangle(3, 4, 0, 2, 0),
	gsSP2Triangles(1, 5, 2, 0, 3, 6, 4, 0),
	gsSP2Triangles(6, 7, 4, 0, 8, 9, 10, 0),
	gsSP2Triangles(11, 12, 13, 0, 14, 15, 16, 0),
	gsSP1Triangle(17, 18, 19, 0),
	gsSPEndDisplayList(),
}; /* o1 */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 104 vertices */
Vtx CN_Boss_Head_v[]={
	{   180,     8,   -29,     0,  9118,  1575,    59,   -75,    71,   255},	/* 0 */
	{   111,   -11,     0,     0,  8988,  1060,    77,   -91,     0,   255},	/* 1 */
	{   181,   -29,   -29,     0,  8858,  1575,    52,   -22,   105,   255},	/* 2 */
	{   181,   -29,    29,     0,  9115,  1575,    57,    78,   -72,   255},	/* 3 */
	{   111,   -11,     0,     0,  8987,  1066,    77,   -91,     0,   255},	/* 4 */
	{   180,     8,    29,     0,  8858,  1575,    59,   -75,   -72,   255},	/* 5 */
	{   180,     8,    29,     0,  9866,  1575,    59,   -75,   -72,   255},	/* 6 */
	{   111,   -11,     0,     0,  9665,  1071,    77,   -91,     0,   255},	/* 7 */
	{   180,     8,   -29,     0,  9464,  1575,    59,   -75,    71,   255},	/* 8 */
	{   181,   -29,   -29,     0,  9265,  1575,    35,   114,   -11,   255},	/* 9 */
	{   111,   -11,     0,     0,  9061,  1066,    30,   116,     0,   255},	/* 10 */
	{   181,   -29,    29,     0,  8858,  1575,    57,    78,   -72,   255},	/* 11 */
	{    -2,   -65,     0,     0,   512,  1024,   -31,  -114,    -9,   255},	/* 12 */
	{   181,   -48,   -57,     0,     0,     0,    16,  -104,   -55,   255},	/* 13 */
	{   217,   -63,     0,     0,   512,  -199,     6,  -118,    11,   255},	/* 14 */
	{    -2,   -50,    57,     0,  1024,  1024,   -21,  -106,    49,   255},	/* 15 */
	{    -2,   -50,   -57,     0,     0,  1024,   -42,   -82,   -76,   255},	/* 16 */
	{    -2,   -13,    80,     0,   511,  1024,     0,     0,   119,   255},	/* 17 */
	{   216,   -10,    80,     0,   512,  -199,    35,    59,    98,   255},	/* 18 */
	{   180,    27,    57,     0,  1024,     0,    14,    51,   107,   255},	/* 19 */
	{    -3,    25,    57,     0,  1024,  1024,   -61,    85,    56,   255},	/* 20 */
	{   181,   -48,    57,     0,     0,     0,    17,   -84,    82,   255},	/* 21 */
	{    -2,   -50,    57,     0,     0,  1024,   -21,  -106,    49,   255},	/* 22 */
	{    -2,   -13,   -80,     0,   512,  1024,     0,    21,  -118,   255},	/* 23 */
	{   180,    27,   -57,     0,     0,     0,    15,    85,   -83,   255},	/* 24 */
	{   216,   -10,   -80,     0,   512,  -199,    35,    59,   -99,   255},	/* 25 */
	{    -2,   -50,   -57,     0,  1024,  1024,   -42,   -82,   -76,   255},	/* 26 */
	{    -3,    25,   -57,     0,     0,  1024,   -17,   107,   -51,   255},	/* 27 */
	{   181,   -48,   -57,     0,  1024,     0,    16,  -104,   -55,   255},	/* 28 */
	{    -3,    40,     0,     0,   512,  1024,   -20,   118,     8,   255},	/* 29 */
	{   180,    27,    57,     0,     0,     0,     9,   117,    23,   255},	/* 30 */
	{   215,    42,     0,     0,   512,  -199,     4,   120,    -6,   255},	/* 31 */
	{    -3,    25,    57,     0,     0,  1024,   -61,    85,    56,   255},	/* 32 */
	{    -3,    25,   -57,     0,  1024,  1024,   -17,   107,   -51,   255},	/* 33 */
	{   180,    27,   -57,     0,  1024,     0,    15,    85,   -83,   255},	/* 34 */
	{   181,   -48,    57,     0,  1024,     0,    17,   -84,    82,   255},	/* 35 */
	{   216,    16,     0,     0,   512,     0,    93,   -74,     0,   255},	/* 36 */
	{   215,    42,     0,     0,   512,   512,     4,   120,    -6,   255},	/* 37 */
	{   180,    27,    57,     0,     0,   512,    14,    51,   107,   255},	/* 38 */
	{   181,   -48,    57,     0,     0,   511,    17,   -84,    82,   255},	/* 39 */
	{   217,   -63,     0,     0,   512,   511,     6,  -118,    11,   255},	/* 40 */
	{   216,   -36,     0,     0,   512,     0,    92,    78,     0,   255},	/* 41 */
	{   216,   -36,     0,     0,     0,   511,    92,    78,     0,   255},	/* 42 */
	{   217,   -63,     0,     0,   511,   511,   102,     1,   -63,   255},	/* 43 */
	{   181,   -48,   -57,     0,   512,     0,    16,  -104,   -55,   255},	/* 44 */
	{   216,   -10,    40,     0,   512,     0,   105,     1,   -58,   255},	/* 45 */
	{   216,   -10,    80,     0,   512,   511,    35,    59,    98,   255},	/* 46 */
	{   181,   -48,    57,     0,     0,   512,    17,   -84,    82,   255},	/* 47 */
	{   180,    27,    57,     0,     0,   511,     9,   117,    23,   255},	/* 48 */
	{   216,   -10,    80,     0,   511,   511,    35,    59,    98,   255},	/* 49 */
	{   216,   -10,    40,     0,   511,     0,   105,     1,   -58,   255},	/* 50 */
	{   180,     8,    29,     0,   512,   511,    59,   -75,   -72,   255},	/* 51 */
	{   216,   -36,     0,     0,   511,     0,    92,    78,     0,   255},	/* 52 */
	{   181,   -29,    29,     0,   511,   511,    62,    86,    55,   255},	/* 53 */
	{   216,   -10,   -40,     0,     0,   512,    81,   -84,    23,   255},	/* 54 */
	{   181,   -29,   -29,     0,   512,   512,    52,   -22,   105,   255},	/* 55 */
	{   181,   -48,   -57,     0,   511,     0,    64,   -84,    55,   255},	/* 56 */
	{   216,    16,     0,     0,     0,   511,    93,   -74,     0,   255},	/* 57 */
	{   180,     8,   -29,     0,   511,   511,    64,   -84,   -56,   255},	/* 58 */
	{   180,    27,   -57,     0,   511,     0,    15,    85,   -83,   255},	/* 59 */
	{   216,   -10,   -40,     0,   512,     0,    77,    71,    57,   255},	/* 60 */
	{   216,   -10,   -80,     0,   512,   512,    35,    59,   -99,   255},	/* 61 */
	{   180,    27,   -57,     0,     0,   512,    15,    85,   -83,   255},	/* 62 */
	{   180,     8,    29,     0,   511,   511,    64,   -84,    55,   255},	/* 63 */
	{   215,    42,     0,     0,   512,   512,   102,     1,   -63,   255},	/* 64 */
	{   216,    16,     0,     0,     0,   512,    93,   -74,     0,   255},	/* 65 */
	{   181,   -48,   -57,     0,   511,     0,    16,  -104,   -55,   255},	/* 66 */
	{   216,   -10,   -80,     0,   511,   511,    35,    59,   -99,   255},	/* 67 */
	{   180,    27,   -57,     0,     0,   511,    62,    86,    55,   255},	/* 68 */
	{   180,     8,   -29,     0,   512,   512,    59,   -75,    71,   255},	/* 69 */
	{   216,   -10,   -40,     0,   512,     0,    77,    71,    57,   255},	/* 70 */
	{   181,   -48,    57,     0,   511,     0,    64,   -84,   -56,   255},	/* 71 */
	{   181,   -29,    29,     0,   511,   512,    57,    78,   -72,   255},	/* 72 */
	{   216,   -10,    40,     0,     0,   511,   105,     1,   -58,   255},	/* 73 */
	{   181,   -48,   -57,     0,   511,     0,    16,  -104,   -55,   255},	/* 74 */
	{   181,   -29,   -29,     0,   511,   512,    35,   114,   -11,   255},	/* 75 */
	{   216,   -36,     0,     0,     0,   512,    92,    78,     0,   255},	/* 76 */
	{    -3,    40,     0,     0,  -199,   248,  -119,     0,     0,   255},	/* 77 */
	{    -3,    25,   -57,     0,     0,  1024,   -17,   107,   -51,   255},	/* 78 */
	{    -2,   -50,   -57,     0,  1024,  1024,   -42,   -82,   -76,   255},	/* 79 */
	{    -2,   -65,     0,     0,  1223,   248,  -119,     0,     0,   255},	/* 80 */
	{    -3,    25,    57,     0,     0,  -526,   -61,    85,    56,   255},	/* 81 */
	{    -2,   -13,   -80,     0,   512,  1326,  -119,     0,     0,   255},	/* 82 */
	{    -2,   -50,    57,     0,  1023,  -526,   -21,  -106,    49,   255},	/* 83 */
	{    -2,   -13,    80,     0,   511,  -829,  -119,     0,    -1,   255},	/* 84 */
	{   180,     8,   -29,     0,  1024,  1023,    59,   -75,    71,   255},	/* 85 */
	{   216,    16,     0,     0,   512,   372,    93,   -74,     0,   255},	/* 86 */
	{   180,     8,    29,     0,     0,  1023,    59,   -75,   -72,   255},	/* 87 */
	{   180,     8,    29,     0,  1024,  1023,    59,   -75,   -72,   255},	/* 88 */
	{   216,   -10,    40,     0,   512,    12,   105,     1,   -58,   255},	/* 89 */
	{   181,   -29,    29,     0,     0,  1023,    57,    78,   -72,   255},	/* 90 */
	{   181,   -29,    29,     0,     0,  1024,    57,    78,   -72,   255},	/* 91 */
	{   216,   -36,     0,     0,   512,  1675,    92,    78,     0,   255},	/* 92 */
	{   181,   -29,   -29,     0,  1024,  1024,    35,   114,   -11,   255},	/* 93 */
	{   181,   -29,   -29,     0,     0,  1024,    52,   -22,   105,   255},	/* 94 */
	{   216,   -10,   -40,     0,   512,  2035,    77,    71,    57,   255},	/* 95 */
	{   180,     8,   -29,     0,  1024,  1024,    59,   -75,    71,   255},	/* 96 */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
