#include<ultra64.h>

extern Vtx CN_Tetu_v[];
extern Vtx CN_Tetu_vmcur[];
extern Tri CN_Tetu_tri[];
extern Mtx CN_Tetu_matrix[];

extern unsigned short CN_AirshipTX_03_txt[];
extern unsigned short CN_Bill_09_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)

/* main display list */


/* ======== o1 ======== */

Gfx CN_Tetu[]={

	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(CN_Bill_09_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),


	gsSPVertex(&CN_Tetu_v[0],24,0),
	gsSP1Quadrangle(0, 1, 2, 3, 0),
	gsSP1Quadrangle(4, 5, 6, 7, 0),
	gsSP1Quadrangle(8, 9, 10, 11, 0),
	gsSP1Quadrangle(12, 15, 13, 14, 0),
	gsSP1Quadrangle(16, 19, 17, 18, 0),
	gsSP1Quadrangle(20, 21, 22, 23, 0),
	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,0,G_TX_CLAMP,4,0,G_TX_CLAMP,4,0),
	gs_Nin_LoadTextureImage(CN_AirshipTX_03_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&CN_Tetu_v[24],12,0),
	gsSP1Quadrangle(0, 1, 2, 3, 0),
	gsSP2Triangles(2, 4, 3, 0, 0, 5, 1, 0),
	gsSP1Quadrangle(6, 7, 8, 9, 0),
	gsSP2Triangles(8, 10, 9, 0, 6, 11, 7, 0),
	gsSPEndDisplayList(),
}; /* o1 */ 

/* 36 vertices */
Vtx CN_Tetu_v[]={
	{  -488,     0,   -17,     0,     0, 10995,     0,   -22,  -118,     0},	/* 0 */
	{  -488,    41,   -41,     0,   511, 10995,     0,   -60,  -104,     0},	/* 1 */
	{   488,    41,   -41,     0,   511,   511,     0,   -60,  -104,     0},	/* 2 */
	{   488,     0,   -17,     0,     0,   511,     0,    23,  -118,     0},	/* 3 */
	{   488,   -41,   -41,     0,   511, -5550,     0,  -119,     0,     0},	/* 4 */
	{   488,   -41,    41,     0,     0, -5550,     0,  -119,     0,     0},	/* 5 */
	{  -488,   -41,    41,     0,     0,   512,     0,  -119,     0,     0},	/* 6 */
	{  -488,   -41,   -41,     0,   512,   512,     0,  -119,     0,     0},	/* 7 */
	{  -488,    41,   -41,     0,     0,  6574,     0,   120,     0,     0},	/* 8 */
	{  -488,    41,    41,     0,   512,  6574,     0,   120,     0,     0},	/* 9 */
	{   488,    41,    41,     0,   512,   511,     0,   120,     0,     0},	/* 10 */
	{   488,    41,   -41,     0,     0,   511,     0,   120,     0,     0},	/* 11 */
	{   488,     0,   -17,     0,     0,   512,     0,    23,  -118,     0},	/* 12 */
	{  -488,   -41,   -41,     0,   511, -9971,     0,    61,  -104,     0},	/* 13 */
	{  -488,     0,   -17,     0,     0, -9971,     0,   -22,  -118,     0},	/* 14 */
	{   488,   -41,   -41,     0,   511,   512,     0,    61,  -104,     0},	/* 15 */
	{  -488,     0,    17,     0,     0,   511,     0,    23,   117,     0},	/* 16 */
	{   488,   -41,    41,     0,   512, 10995,     0,    61,   103,     0},	/* 17 */
	{   488,     0,    17,     0,     0, 10995,     0,   -22,   117,     0},	/* 18 */
	{  -488,   -41,    41,     0,   512,   511,     0,    61,   103,     0},	/* 19 */
	{   488,     0,    17,     0,     0, -9971,     0,   -22,   117,     0},	/* 20 */
	{   488,    41,    41,     0,   511, -9971,     0,   -60,   103,     0},	/* 21 */
	{  -488,    41,    41,     0,   511,   511,     0,   -60,   103,     0},	/* 22 */
	{  -488,     0,    17,     0,     0,   512,     0,    23,   117,     0},	/* 23 */
	{   488,     0,   -17,     0,   139,  -278,   120,     0,     0,     0},	/* 24 */
	{   488,    41,    41,     0,     6,  -885,   120,     0,     0,     0},	/* 25 */
	{   488,     0,    17,     0,   -80,  -479,   120,     0,     0,     0},	/* 26 */
	{   488,   -41,   -41,     0,    52,   126,   120,     0,     0,     0},	/* 27 */
	{   488,   -41,    41,     0,  -476,  -357,   120,     0,     0,     0},	/* 28 */
	{   488,    41,   -41,     0,   535,  -401,   120,     0,     0,     0},	/* 29 */
	{  -488,     0,    17,     0, -1293, -2043,  -119,     0,     0,     0},	/* 30 */
	{  -488,    41,   -41,     0,  -311, -2833,  -119,     0,     0,     0},	/* 31 */
	{  -488,     0,   -17,     0, -1126, -2625,  -119,     0,     0,     0},	/* 32 */
	{  -488,   -41,    41,     0, -2109, -1835,  -119,     0,     0,     0},	/* 33 */
	{  -488,   -41,   -41,     0, -1708, -3234,  -119,     0,     0,     0},	/* 34 */
	{  -488,    41,    41,     0,  -712, -1434,  -119,     0,     0,     0},	/* 35 */
};


/*   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 CN_AirshipTX_03_txt[] = {
	0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 
	0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0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