#include<ultra64.h>

extern Vtx ManChest_c_v[];
extern Vtx ManChest_c_vmcur[];
extern Tri ManChest_c_tri[];
extern Lights1 ManChest_c_material[];
extern Mtx ManChest_c_matrix[];

extern unsigned short Sm1hand_b_txt[];
extern unsigned short Sm1hand_f_txt[];
extern unsigned short Sm1hand_s_txt[];
extern unsigned short Sm1hand_t_txt[];
extern unsigned short Sm1hara_txt[];
extern unsigned short Sm1jacket_b_txt[];
extern unsigned short Sm1jacket_f_txt[];
extern unsigned short Sm1jacket_s_txt[];
extern unsigned short Sm1jacket_t_txt[];
extern unsigned short Sm1loarm_txt[];
extern unsigned short Sm1met_b_txt[];
extern unsigned short Sm1met_f_txt[];
extern unsigned short Sm1met_gl_txt[];
extern unsigned short Sm1met_s_txt[];
extern unsigned short Sm1met_t_txt[];
extern unsigned short Sm1momo_txt[];
extern unsigned short Sm1neck_txt[];
extern unsigned short Sm1shoes_txt[];
extern unsigned short Sm1shoes_b_txt[];
extern unsigned short Sm1sune_txt[];
extern unsigned short Sm1uparm_txt[];
extern unsigned short Sm1waist_b_txt[];
extern unsigned short Sm1waist_f_txt[];
extern unsigned short Sm1waist_s_txt[];
extern unsigned short Sshoes_bottom_txt[];
extern unsigned short black_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
******************************************************************************/

Gfx ManChest_c_model[]={

	gsSPTexture(65535, 65535,0, 0, 1),
	gsDPPipeSync(),
	gsDPSetCombineMode(G_CC_MODULATERGBA,G_CC_PASS2),

	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,8,1,0,0,G_TX_WRAP,3,0,G_TX_WRAP,269198160,0),
	gs_Nin_LoadTextureImage(black_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,8,1,0,7),

	gsSPVertex(&ManChest_c_v[0], 3, 0),
	gsSP1Triangle(0, 1, 2, 0),

	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,32,16,0,0,G_TX_CLAMP,5,0,G_TX_CLAMP,4,0),
	gs_Nin_LoadTextureImage(Sm1jacket_b_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,32,16,0,7),

	gsSPVertex(&ManChest_c_v[3], 4, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(2, 3, 0, 0),

	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,0,G_TX_MIRROR,4,0,G_TX_CLAMP,4,0),
	gs_Nin_LoadTextureImage(Sm1jacket_f_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&ManChest_c_v[7], 6, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(2, 3, 4, 0),
	gsSP1Triangle(4, 5, 2, 0),
	gsSP1Triangle(2, 5, 0, 0),

	gs_Nin_LoadTextureImage(Sm1jacket_t_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&ManChest_c_v[13], 3, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSPEndDisplayList(),
};

Gfx *ManChest_c_modelT = NULL;

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 16 vertices */

/******************************************************************************
	vertex & texture
******************************************************************************/


/******************************************************************************
	vertex & texture
******************************************************************************/


/******************************************************************************
	vertex & texture
******************************************************************************/


/******************************************************************************
	vertex & texture
******************************************************************************/

Vtx ManChest_c_v[]={
	{ 46,-21,9,0, 723, 31, 81, -45, -74, 0 },   /* v0 p2/V1 used 1 times */ 
	{ -46,-21,9,0, -467, 32, -90, 8, -77, 0 },   /* v1 p2/V2 used 1 times */ 
	{ 0,30,1,0, 127, -50, 0, 83, -86, 0 },   /* v2 p2/V3 used 1 times */ 
	{ -75,-37,153,0, -2, 514, -58, -90, 52, 0 },   /* v3 p8/V3 used 2 times */ 
	{ -46,-21,9,0, 201, -106, -90, 8, -77, 0 },   /* v4 p3/V2 used 1 times */ 
	{ 46,-21,9,0, 857, -106, 81, -45, -74, 0 },   /* v5 p8/V1 used 2 times */ 
	{ 75,-37,153,0, 1061, 514, 83, -21, 84, 0 },   /* v6 p8/V2 used 1 times */ 
	{ -46,-21,9,0, 878, 44, -90, 8, -77, 0 },   /* v7 p1/V3 used 2 times */ 
	{ -75,-37,153,0, 1105, 540, -58, -90, 52, 0 },   /* v8 p6/V2 used 1 times */ 
	{ 0,55,138,0, 511, 455, 0, 117, 24, 0 },   /* v9 p1/V1 used 4 times */ 
	{ 75,-37,153,0, -81, 540, 83, -21, 84, 0 },   /* v10 p7/V2 used 1 times */ 
	{ 46,-21,9,0, 145, 44, 81, -45, -74, 0 },   /* v11 p5/V1 used 2 times */ 
	{ 0,30,1,0, 512, 0, 0, 83, -86, 0 },   /* v12 p1/V2 used 2 times */ 
	{ -75,-37,153,0, 1062, 495, -58, -90, 52, 0 },   /* v13 p4/V1 used 1 times */ 
	{ 75,-37,153,0, -38, 495, 83, -21, 84, 0 },   /* v14 p4/V2 used 1 times */ 
	{ 0,55,138,0, 512, 0, 0, 117, 24, 0 },   /* v15 p4/V3 used 1 times */ 
};


/*   0 vertices */
/* 32 x 16  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short Sm1jacket_b_txt[] = {
	0x1e47, 0x1e47, 0x1e07, 0x1e07, 0x1dc7, 0x1dc7, 0x1dc7, 0x25c9, 0x25c7, 0x24cb, 0x18db, 0x1059, 0x1059, 0x859, 0x1059, 0x105b, 0x105b, 0x1059, 0x859, 0x1059, 0x1059, 0x18db, 0x24cb, 0x25c7, 0x25c9, 0x1dc7, 0x1dc7, 0x1dc7, 0x1e07, 0x1e07, 0x1e47, 0x1e47, 
	0xec7, 0xec7, 0x16c7, 0x1ec7, 0x1ec7, 0x1f07, 0x2749, 0x2749, 0x2709, 0x25cb, 0x20dd, 0x185f, 0x185f, 0x105f, 0x105f, 0x1861, 0x1861, 0x105f, 0x105f, 0x105f, 0x185f, 0x20dd, 0x25cb, 0x2709, 0x2749, 0x2749, 0x1f07, 0x1ec7, 0x1ec7, 0x16c7, 0xec7, 0xec7, 
	0x7cc3, 0x7cc3, 0x5443, 0x1605, 0xe03, 0x1685, 0x1f07, 0x2749, 0x2787, 0x2d4f, 0x28a5, 0x28ad, 0x30af, 0x30af, 0x30af, 0x28af, 0x286f, 0x28af, 0x30b1, 0x30af, 0x28ad, 0x28a3, 0x2d4f, 0x2787, 0x2749, 0x1f07, 0x1685, 0xe03, 0x1605, 0x5443, 0x7cc3, 0x7cc3, 
	0xdd03, 0xed43, 0xa403, 0x36cf, 0x36cd, 0x26c9, 0x2747, 0x2749, 0x3f8d, 0x33d7, 0x286b, 0x2873, 0x206f, 0x1029, 0x823, 0x821, 0x821, 0x1023, 0x1027, 0x186b, 0x2871, 0x286d, 0x33d7, 0x3f8d, 0x2749, 0x2747, 0x26c9, 0x36cd, 0x36cf, 0xa403, 0xed43, 0xdd03, 
	0x2f07, 0x3709, 0x2647, 0x2f0d, 0x2f0b, 0x1ec7, 0x1f07, 0x374d, 0x5753, 0x321d, 0x2031, 0x1029, 0x305d, 0x71d9, 0x931b, 0xac21, 0xac63, 0x9b5f, 0x7a5b, 0x3897, 0x81f, 0x182f, 0x321f, 0x5753, 0x374d, 0x1f07, 0x1ec7, 0x2f0b, 0x2f0d, 0x2647, 0x3709, 0x2f07, 
	0x1f49, 0x1f47, 0x1f47, 0x1f07, 0x16c5, 0xec5, 0x1f47, 0x57d5, 0x4e13, 0x1865, 0x2825, 0x931b, 0xe629, 0xbeab, 0xbef1, 0x96ab, 0x9eab, 0xb6ef, 0xc6ed, 0xeeab, 0xabdb, 0x309f, 0x1061, 0x4e13, 0x57d5, 0x1f47, 0xec5, 0x16c5, 0x1f07, 0x1f47, 0x1f47, 0x1f49, 
	0xe05, 0xe05, 0xe45, 0x1685, 0x1645, 0xe85, 0x374d, 0x87df, 0x3b9b, 0x305d, 0xcd1f, 0xcf71, 0x7629, 0x65e5, 0x65a3, 0x7de9, 0x8e29, 0x6de5, 0x3d25, 0x5525, 0xc731, 0xdde3, 0x40d9, 0x3359, 0x87df, 0x374d, 0xe85, 0x1645, 0x1685, 0xe45, 0xe05, 0xe05, 
	0x7c83, 0x7441, 0x53c1, 0xe05, 0xe85, 0x26c9, 0x77db, 0x6e1b, 0x209d, 0xc49f, 0xbf31, 0x65a5, 0x65a3, 0xb6f3, 0xf7fd, 0xaeb9, 0x54ed, 0x556f, 0x6e35, 0x6da7, 0x65a3, 0xaf31, 0xdda3, 0x30db, 0x661b, 0x77db, 0x26c9, 0xe85, 0xe05, 0x53c1, 0x7441, 0x7c83, 
	0xdd43, 0xdd85, 0xb4c5, 0x4f13, 0x4791, 0x57d3, 0x5e95, 0x1921, 0x7165, 0xe72b, 0x7629, 0x5da3, 0xd779, 0xffff, 0xffff, 0xcf7d, 0x146d, 0x46d, 0x9daf, 0xefbb, 0x65a5, 0x6de7, 0xd76f, 0x92a3, 0x1921, 0x5e95, 0x57d3, 0x4791, 0x4f13, 0xb4c5, 0xdd85, 0xdd43, 
	0x2f87, 0x47cd, 0x5f91, 0x67d7, 0x66d7, 0x3c95, 0x2121, 0x1831, 0xa363, 0xc72d, 0x65a5, 0x8629, 0xffff, 0x9df1, 0xe77b, 0x6db1, 0x3d2f, 0x2533, 0x5571, 0xffff, 0x9eaf, 0x5da3, 0xaf2f, 0xcca5, 0x202f, 0x2121, 0x3c95, 0x66d7, 0x67d7, 0x5f91, 0x47cd, 0x2f87, 
	0x2455, 0x3cd7, 0x441b, 0x32db, 0x2963, 0x2029, 0x2833, 0x1833, 0x9b21, 0xc72d, 0x65a5, 0x7e27, 0xd739, 0x1cf1, 0x3c67, 0x14ad, 0x64a7, 0xe77b, 0xffff, 0xffff, 0x8e6b, 0x5da3, 0xb72f, 0xc4a3, 0x2031, 0x2833, 0x2027, 0x2961, 0x32db, 0x441b, 0x3cd7, 0x2455, 
	0x2831, 0x282f, 0x202f, 0x202d, 0x30b1, 0x30ad, 0x2871, 0x2073, 0x6165, 0xe72b, 0x7e2b, 0x55a3, 0x24ab, 0x2caf, 0x44ef, 0x3531, 0x6db1, 0x852d, 0xffff, 0xd779, 0x5d63, 0x75e9, 0xdf6f, 0x8aa1, 0x2031, 0x2871, 0x28ad, 0x3071, 0x202d, 0x202f, 0x282f, 0x2831, 
	0x2871, 0x2873, 0x286f, 0x30af, 0x38ef, 0x392f, 0x28ad, 0x30b1, 0x202d, 0xc463, 0xcf6f, 0x7629, 0x4563, 0x4dab, 0xb6f5, 0xc73b, 0xaf3b, 0x65af, 0xa6af, 0x5da3, 0x75e7, 0xb731, 0xe5a5, 0x306b, 0x30b1, 0x286d, 0x30ed, 0x30ef, 0x30af, 0x286f, 0x2873, 0x2871, 
	0x28e7, 0x28ad, 0x30ed, 0x4131, 0x38ef, 0x4131, 0x30eb, 0x30af, 0x206f, 0x386f, 0xcce3, 0xd76d, 0x9eef, 0x6de5, 0x5da3, 0xa6af, 0xbf35, 0x5da3, 0x5da3, 0x96af, 0xc76f, 0xe5a7, 0x50eb, 0x206f, 0x38f1, 0x28a9, 0x4131, 0x392f, 0x4173, 0x30ed, 0x28ad, 0x28e9, 
	0x49ef, 0x28e3, 0x30ef, 0x38f3, 0x3931, 0x30b3, 0x412f, 0x28af, 0x2871, 0x2033, 0x282f, 0x92e5, 0xe5e9, 0xdf2f, 0xbeed, 0xe7b7, 0xfffb, 0xaeed, 0xdf71, 0xe66b, 0xaba5, 0x386d, 0x2033, 0x30b1, 0x28b1, 0x38ed, 0x30b3, 0x4133, 0x38f3, 0x28ad, 0x28e3, 0x49af, 
	0x49af, 0x49ab, 0x28a7, 0x2873, 0x3073, 0x2873, 0x30b3, 0x30b1, 0x2873, 0x2873, 0x2873, 0x1833, 0x386d, 0x71eb, 0x9b27, 0xabe7, 0xabe5, 0xa367, 0x7a29, 0x40ad, 0x2033, 0x2073, 0x2871, 0x2873, 0x2873, 0x30b3, 0x2873, 0x30b3, 0x2873, 0x28a7, 0x49ab, 0x396d, 
};

/* 16 x 16  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short Sm1jacket_f_txt[] = {
	0x24c9, 0x2449, 0x2449, 0x2489, 0x2489, 0x3d0f, 0x44d1, 0x18cf, 0x101b, 0x101d, 0x101f, 0x101f, 0x101d, 0x1059, 0x101b, 0x811, 
	0x24c9, 0x24c9, 0x2509, 0x2549, 0x2549, 0x358b, 0x3c11, 0x209d, 0x2069, 0x1827, 0x1825, 0x1827, 0x1829, 0x1825, 0x105b, 0x1867, 
	0x2e8b, 0x26c9, 0x1f09, 0x1f49, 0x1f49, 0x2ec9, 0x34cf, 0x20a1, 0x1827, 0x101d, 0x1821, 0x202d, 0x1027, 0x821, 0x819, 0x81b, 
	0x24c7, 0x1cc5, 0x1d45, 0x1d05, 0x2487, 0x2447, 0x2a8d, 0x1857, 0x185d, 0x1021, 0x1821, 0x101b, 0x419d, 0x735f, 0x3153, 0x49d5, 
	0xd3c1, 0xd3c1, 0xd401, 0xd3c1, 0xd381, 0xd3c1, 0xd441, 0xdc81, 0x69d5, 0x102f, 0x2027, 0xab01, 0xedd9, 0xbc97, 0xb521, 0xe6f3, 
	0xf583, 0xf5c5, 0xf587, 0xed43, 0xed85, 0xf5c7, 0xf589, 0xf587, 0x829f, 0x28bb, 0x38f3, 0xc40b, 0xfea1, 0x9393, 0xcda5, 0xfffd, 
	0x47cd, 0x47cd, 0x5fd5, 0x6f99, 0x97e3, 0x7e9f, 0x30e3, 0x40b3, 0x4135, 0x49b7, 0x4135, 0x2873, 0x6ab5, 0x9c73, 0x626d, 0x7b6b, 
	0x3fcf, 0x47d1, 0x6fdb, 0x97e5, 0xcff1, 0x5bdf, 0x282d, 0x38b9, 0x286b, 0x1821, 0x1823, 0x2033, 0x3075, 0x38f5, 0x2069, 0x19, 
	0x374f, 0x5759, 0x7fa1, 0xaf6d, 0x7621, 0x109b, 0x282f, 0x2873, 0x1867, 0x101f, 0x1021, 0x182d, 0x20a7, 0x3123, 0x205f, 0x1053, 
	0x7bc7, 0x83c7, 0x8c0d, 0x8bcb, 0x7287, 0x6989, 0x6a0b, 0x6a09, 0x38db, 0x1029, 0x1825, 0x514b, 0xa41b, 0xc561, 0x839f, 0xace3, 
	0xfcc1, 0xfcc1, 0xfd41, 0xfd01, 0xfd01, 0xfd81, 0xfdc1, 0xfe01, 0x7a59, 0x1837, 0x30af, 0xdc81, 0xfed9, 0x92cd, 0xcd5f, 0xfffb, 
	0xb751, 0xb6d1, 0x9413, 0x8ad7, 0x9b1f, 0x9b61, 0x9321, 0x92df, 0x61eb, 0x497b, 0x4135, 0x7a61, 0xbd2d, 0xb4e5, 0xb4ed, 0xdeb9, 
	0x4557, 0x2a5d, 0x1825, 0x2031, 0x28b9, 0x2879, 0x2037, 0x1837, 0x2875, 0x4171, 0x30f1, 0x1837, 0x30f5, 0x5a35, 0x412b, 0x28df, 
	0x2063, 0x282b, 0x30b1, 0x38f3, 0x30b5, 0x3075, 0x2875, 0x2835, 0x2031, 0x202f, 0x2031, 0x2873, 0x2871, 0x30b1, 0x416b, 0x189f, 
	0x30b1, 0x48f9, 0x40f7, 0x38f3, 0x3075, 0x2875, 0x2873, 0x2873, 0x2833, 0x2833, 0x2033, 0x2871, 0x30f1, 0x4971, 0x49e9, 0x20a3, 
	0x28a7, 0x412d, 0x4935, 0x38f5, 0x30b5, 0x2875, 0x2873, 0x2873, 0x2871, 0x2871, 0x2871, 0x38f1, 0x49af, 0x5229, 0x395d, 0x30e7, 
};

/* 16 x 16  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short Sm1jacket_t_txt[] = {
	0x30a7, 0x38ef, 0x416b, 0x38f5, 0x30b5, 0x3075, 0x2873, 0x2873, 0x2871, 0x2871, 0x2873, 0x30b3, 0x51f1, 0x49e9, 0x416b, 0x30e1, 
	0x3885, 0x289b, 0x392d, 0x392b, 0x30b5, 0x30b5, 0x2873, 0x2871, 0x2871, 0x2873, 0x30b1, 0x49ab, 0x41a9, 0x49a9, 0x28d7, 0x1001, 
	0x58c3, 0x3083, 0x285d, 0x312b, 0x38ed, 0x30b5, 0x30b3, 0x2871, 0x2031, 0x2871, 0x3965, 0x3125, 0x3927, 0x3889, 0x4881, 0x58c1, 
	0x8983, 0x58c3, 0x3043, 0x30a3, 0x392d, 0x38f1, 0x38f5, 0x2871, 0x2033, 0x28eb, 0x28e1, 0x4129, 0x3047, 0x5081, 0x9183, 0x9983, 
	0xba43, 0x8143, 0x48c3, 0x2847, 0x30ab, 0x30eb, 0x38f3, 0x3071, 0x202f, 0x20a5, 0x30ab, 0x3891, 0x7101, 0xb205, 0xb247, 0x9983, 
	0xc285, 0x99c5, 0x6903, 0x3881, 0x2857, 0x30ed, 0x3931, 0x38b3, 0x202d, 0x1867, 0x30a3, 0x3881, 0x9981, 0xa9c3, 0x9183, 0x9981, 
	0xc2c5, 0xba85, 0x8183, 0x50c1, 0x2047, 0x28a9, 0x38ef, 0x4933, 0x30af, 0x2065, 0x3097, 0x58c1, 0x99c3, 0xa1c3, 0xa1c1, 0xa181, 
	0xc285, 0xdb4b, 0xc30b, 0x6943, 0x2841, 0x28a1, 0x416f, 0x6a77, 0x51b1, 0x28a5, 0x2893, 0x6941, 0xaa87, 0xb287, 0xaa45, 0xa9c3, 
	0xc285, 0xe38d, 0xdb8f, 0x7145, 0x4081, 0x309b, 0x49b3, 0x7af7, 0x59b1, 0x28e3, 0x2895, 0x50c1, 0x9205, 0xb285, 0xaa45, 0xa9c3, 
	0xba45, 0xd309, 0xc2c9, 0x6903, 0x3081, 0x289b, 0x4173, 0x6237, 0x4975, 0x28a3, 0x2899, 0x3881, 0x7101, 0x9983, 0xa9c3, 0xa9c3, 
	0xba45, 0xba85, 0x99c3, 0x5903, 0x2841, 0x289d, 0x3931, 0x4937, 0x40fb, 0x20a3, 0x30e3, 0x2843, 0x4881, 0x78c1, 0x9981, 0xa181, 
	0xc285, 0xb203, 0x8143, 0x50c1, 0x2845, 0x30ab, 0x38f1, 0x40b7, 0x283d, 0x20ad, 0x28e3, 0x289f, 0x1801, 0x4841, 0x68c1, 0x7901, 
	0xba45, 0xa1c3, 0x7101, 0x4081, 0x2857, 0x38ef, 0x38b1, 0x30b5, 0x2035, 0x1835, 0x18a5, 0x30e5, 0x30e3, 0x204f, 0x2847, 0x2847, 
	0xa1c3, 0x7941, 0x4081, 0x284d, 0x28ab, 0x30ab, 0x38b5, 0x3075, 0x2873, 0x2873, 0x2875, 0x28a9, 0x30e7, 0x392b, 0x30e7, 0x30e9, 
	0x7901, 0x4881, 0x284d, 0x28a9, 0x30eb, 0x306f, 0x2875, 0x2875, 0x2033, 0x2073, 0x2873, 0x30b5, 0x30b1, 0x38ed, 0x3929, 0x392b, 
	0x3889, 0x201f, 0x28ad, 0x30ad, 0x386f, 0x2833, 0x1831, 0x1831, 0x1831, 0x182f, 0x1831, 0x2031, 0x2073, 0x2873, 0x28b3, 0x28b3, 
};

/* 8 x 1  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short black_txt[] = {
	0x39cf, 0x39cf, 0x39cf, 0x39cf, 0x39cf, 0x39cf, 0x39cf, 0x39cf, 
};

