#include<ultra64.h>

extern Vtx BO_pole_R_v[];

extern unsigned short BO_base_TX03_txt[];
extern unsigned short BO_base_TX04_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 */


/* ======== g5 ======== */

Gfx BO_pole_R[]={

	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,16,32,0,0,G_TX_WRAP,4,0,G_TX_WRAP,5,0),
	gs_Nin_LoadTextureImage(BO_base_TX03_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,32,0,7),


	gsSPVertex(&BO_pole_R_v[0],20,0),
	gsSP2Triangles(0, 1, 2, 0, 2, 3, 0, 0),
	gsSP2Triangles(4, 5, 6, 0, 6, 7, 4, 0),
	gsSP2Triangles(8, 9, 10, 0, 11, 12, 13, 0),
	gsSP2Triangles(14, 15, 16, 0, 17, 18, 19, 0),
	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,0,G_TX_WRAP,4,0,G_TX_WRAP,4,0),
	gs_Nin_LoadTextureImage(BO_base_TX04_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&BO_pole_R_v[20],4,0),
	gsSP2Triangles(0, 1, 2, 0, 3, 1, 0, 0),
	gsSPEndDisplayList(),
}; /* g5 */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 26 vertices */
Vtx BO_pole_R_v[]={
	{   -24,   240,   -26,     0,   283,  1030,  -118,    14,    -5,   255},	/* 0 */
	{   -10,    21,   -86,     0,   388,  1584,  -117,    -1,   -22,   255},	/* 1 */
	{   -29,   -62,    22,     0,   -40,  1744,  -114,     6,    31,   255},	/* 2 */
	{    10,   234,    26,     0,   -21,  1030,   -91,    18,    73,   255},	/* 3 */
	{   -10,    21,   -86,     0,  -555,  1300,    79,   -11,   -89,   255},	/* 4 */
	{   -24,   240,   -26,     0,     0,  1024,  -118,    14,    -5,   255},	/* 5 */
	{    10,   253,   -39,     0,   511,  1024,   105,    11,   -57,   255},	/* 6 */
	{    21,    11,   -23,     0,  -504,  2239,   118,   -13,   -17,   255},	/* 7 */
	{    10,   234,    26,     0,   512,     0,   120,     4,     8,   255},	/* 8 */
	{    12,   -20,    57,     0,   512,  1023,   119,   -15,     7,   255},	/* 9 */
	{    21,    11,   -23,     0,     0,  1023,   118,   -13,   -17,   255},	/* 10 */
	{    10,   234,    26,     0,   -17,  1081,   -91,    18,    73,   255},	/* 11 */
	{    10,   253,   -39,     0,     0,  1024,   -29,   111,    32,   255},	/* 12 */
	{   -24,   240,   -26,     0,    25,  1046,  -118,    14,    -5,   255},	/* 13 */
	{    10,   234,    26,     0,   403,   101,   -91,    18,    73,   255},	/* 14 */
	{   -29,   -62,    22,     0,    99,   708,  -114,     6,    31,   255},	/* 15 */
	{    12,   -20,    57,     0,   403,   708,   -83,    10,    84,   255},	/* 16 */
	{    10,   253,   -39,     0,   512,  1023,   105,    11,   -57,   255},	/* 17 */
	{    10,   234,    26,     0,     0,  1023,   120,     4,     8,   255},	/* 18 */
	{    21,    11,   -23,     0,   512,     0,   118,   -13,   -17,   255},	/* 19 */
	{    21,    11,   -23,     0,     0,   512,   118,   -13,   -17,   255},	/* 20 */
	{   -29,   -62,    22,     0,   512,     0,    84,   -78,   -35,   255},	/* 21 */
	{   -10,    21,   -86,     0,   511,   512,    79,   -11,   -89,   255},	/* 22 */
	{    12,   -20,    57,     0,   512,   512,   119,   -15,     7,   255},	/* 23 */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
/* 16 x 16  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short BO_base_TX04_txt[] = {
	0x20c3, 0x30c3, 0x520b, 0x8419, 0xb5a9, 0xffff, 0x1, 0xf801, 0xf801, 0x1, 0xe737, 0xa523, 0x6b13, 0x4987, 0x2883, 0x1883, 
	0x1883, 0x2881, 0x4987, 0x7b95, 0xad67, 0xe737, 0x1, 0x1, 0x1, 0x1, 0xe735, 0x9d23, 0x6b11, 0x4145, 0x2041, 0x1041, 
	0x1881, 0x2881, 0x4145, 0x7353, 0x9ce1, 0xce2b, 0x1, 0x1, 0x1, 0x1, 0xce2d, 0x8c5d, 0x5a8d, 0x3103, 0x1841, 0x1041, 
	0x1041, 0x2841, 0x3903, 0x62cf, 0x949f, 0xbda7, 0x1, 0x1, 0x1, 0x1, 0xa4a3, 0x7bd9, 0x4a09, 0x30c3, 0x1841, 0x841, 
	0x1041, 0x2041, 0x30c3, 0x524b, 0x841b, 0xa4e3, 0x1, 0x7001, 0x7001, 0x1, 0x8bdb, 0x7399, 0x41c7, 0x2881, 0x1841, 0x801, 
	0x801, 0x2041, 0x2881, 0x41c9, 0x7357, 0x8bdb, 0x1, 0x1, 0x1, 0x1, 0x7b57, 0x6b57, 0x3987, 0x2041, 0x1801, 0x801, 
	0x801, 0x1801, 0x1841, 0x2905, 0x5291, 0x5a93, 0x1, 0x1, 0x1, 0x1, 0x5a93, 0x4a91, 0x2905, 0x1841, 0x1801, 0x801, 
	0x1, 0x1001, 0x801, 0x18c5, 0x4a51, 0x5251, 0x1, 0x1, 0x1, 0x1, 0x4a11, 0x4a51, 0x2105, 0x1001, 0x1001, 0x1, 
	0x2907, 0x30c3, 0x4989, 0x7b95, 0xa565, 0xef79, 0x1, 0xf801, 0xf801, 0x1, 0xdef3, 0xad67, 0x7395, 0x51c9, 0x28c3, 0x1883, 
	0x20c5, 0x30c3, 0x4147, 0x7353, 0x9ce3, 0xd6b1, 0x1, 0x1, 0x1, 0x1, 0xdef3, 0xa565, 0x7353, 0x4187, 0x2883, 0x1883, 
	0x1883, 0x2881, 0x3945, 0x62cf, 0x949f, 0xbda9, 0x1, 0x1, 0x1, 0x1, 0xce2d, 0x9ce1, 0x630f, 0x4145, 0x2081, 0x1043, 
	0x1881, 0x2881, 0x3905, 0x5a8d, 0x841b, 0xad23, 0x1, 0x1, 0x1, 0x1, 0xad25, 0x8c5d, 0x5a8d, 0x3903, 0x2041, 0x1041, 
	0x1041, 0x2041, 0x3103, 0x524b, 0x7bd9, 0x9c5f, 0x1, 0x7001, 0x7001, 0x1, 0x9c5f, 0x7bd9, 0x524b, 0x28c1, 0x1841, 0x801, 
	0x1041, 0x2041, 0x28c1, 0x4209, 0x7397, 0x8bdb, 0x1, 0x1, 0x1, 0x1, 0x8bdb, 0x7397, 0x4207, 0x2081, 0x1841, 0x801, 
	0x1041, 0x2041, 0x1841, 0x2945, 0x5291, 0x6295, 0x1, 0x1, 0x1, 0x1, 0x62d5, 0x5291, 0x3145, 0x1841, 0x1841, 0x801, 
	0x801, 0x1801, 0x1841, 0x18c5, 0x4251, 0x5253, 0x1, 0x1, 0x1, 0x1, 0x5253, 0x41cf, 0x2105, 0x1041, 0x801, 0x1, 
};

