#include<ultra64.h>

extern Vtx MC_BTbase_BodyLOD_v[];

extern unsigned char MC_BTTX02_CI8_txt[];
extern unsigned char MC_BTTX03_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 */


/* ======== g24 ======== */

Gfx MC_BTbase_BodyLOD[]={

	gsDPSetTextureLUT(G_TT_RGBA16),
	gsDPLoadTLUT_pal256(&MC_BTTX03_CI8_txt[256]),
	gsDPLoadTextureBlock(MC_BTTX03_CI8_txt,G_IM_FMT_CI,G_IM_SIZ_8b,16,16,0,G_TX_WRAP,G_TX_WRAP,4,4,0,0),

	gsSPVertex(&MC_BTbase_BodyLOD_v[0], 12, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(0, 2, 3, 0),
	gsSP1Triangle(4, 5, 6, 0),
	gsSP1Triangle(4, 6, 7, 0),
	gsSP1Triangle(8, 9, 10, 0),
	gsSP1Triangle(8, 10, 11, 0),
	gsDPPipeSync(),
        gsDPSetTextureLUT(G_TT_NONE),
	gsSPEndDisplayList(),
}; /* g24 */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 12 vertices */
Vtx MC_BTbase_BodyLOD_v[]={
	{ -110,70,670,0, 0, 512, -113,0,36,255 },   /* v0 used p175/V1 2 times */
	{ 110,70,670,0, 2048, 512, 0,0,119,255 },   /* v1 used p174/V2 2 times */
	{ 110,100,670,0, 2048, 0, 0,0,119,255 },   /* v2 used p175/V2 2 times */
	{ -110,100,670,0, 0, 0, -119,0,9,255 },   /* v3 used p175/V3 2 times */
	{ -110,70,-670,0, 3037, 512, -119,0,0,255 },   /* v4 used p173/V1 2 times */
	{ -110,70,670,0, 0, 512, -113,0,36,255 },   /* v5 used p172/V2 2 times */
	{ -110,100,670,0, 0, 0, -119,0,9,255 },   /* v6 used p173/V2 2 times */
	{ -110,100,-670,0, 3037, 0, -119,0,0,255 },   /* v7 used p173/V3 2 times */
	{ 110,70,670,0, 0, 512, 120,0,0,255 },   /* v8 used p169/V1 2 times */
	{ 110,70,-670,0, 3037, 512, 120,0,0,255 },   /* v9 used p168/V2 2 times */
	{ 110,100,-670,0, 3037, 0, 120,0,0,255 },   /* v10 used p169/V2 2 times */
	{ 110,100,670,0, 0, 0, 120,0,0,255 },   /* v11 used p169/V3 2 times */
};


/*   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 char MC_BTTX03_CI8_txt[] = {
	0x0, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x2, 
	0x2, 0x3, 0x0, 0x4, 0x5, 0x6, 0x2, 0x2, 0x6, 0x4, 0x6, 0x7, 0x2, 0x0, 0x3, 0x8, 
	0x2, 0x3, 0x1, 0x4, 0x5, 0x5, 0x1, 0x6, 0x5, 0x1, 0x7, 0x2, 0x6, 0x1, 0x3, 0x8, 
	0x2, 0x9, 0x2, 0x5, 0x5, 0x0, 0x2, 0x6, 0x4, 0x2, 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