#include<ultra64.h>

extern Vtx VS_Minislippy_arm01_v[];
extern Vtx VS_Minislippy_arm01_vmcur[];
extern Tri VS_Minislippy_arm01_tri[];
extern Mtx VS_Minislippy_arm01_matrix[];

extern unsigned short VS_A_tx03_txt[];
extern unsigned short VS_A_tx04_txt[];
extern unsigned short VS_A_tx06_txt[];
extern unsigned short VS_Minislippy_green_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)

Gfx VS_Minislippy_arm01[]={

	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(VS_A_tx03_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,32,16,0,7),


	gsSPVertex(&VS_Minislippy_arm01_v[0],3,0),
	gsSP1Triangle(0, 1, 2, 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(VS_A_tx04_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),


	gsSPVertex(&VS_Minislippy_arm01_v[3],7,0),
	gsSP2Triangles(0, 1, 2, 0, 2, 1, 3, 0),
	gsSP2Triangles(4, 5, 6, 0, 5, 3, 6, 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(VS_A_tx06_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&VS_Minislippy_arm01_v[10],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,8,8,0,0,G_TX_MIRROR,3,0,G_TX_MIRROR,3,0),
	gs_Nin_LoadTextureImage(VS_Minislippy_green_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,8,8,0,7),

	gsSPVertex(&VS_Minislippy_arm01_v[19],5,0),
	gsSP2Triangles(0, 1, 2, 0, 3, 4, 2, 0),
	gsSP2Triangles(2, 4, 0, 0, 2, 1, 3, 0),
	gsSP2Triangles(3, 1, 0, 0, 0, 4, 3, 0),
	gsSPEndDisplayList(),
}; /* o2 */ 

/* 25 vertices */
Vtx VS_Minislippy_arm01_v[]={
	{    15,    -4,    17,     0,  1024,   511,    90,   -74,    25,     0},	/* 0 */
	{    20,     0,     8,     0,   520,  -669,    92,   -75,    11,     0},	/* 1 */
	{    15,     4,    17,     0,     0,   511,    82,     0,    87,     0},	/* 2 */
	{    15,    -4,    17,     0,   512,   512,   -36,  -113,    -6,     0},	/* 3 */
	{    11,     0,    17,     0,   255,   494,   -79,    89,     2,     0},	/* 4 */
	{     9,     0,   -21,     0,   234,   -51,   -38,   113,    -6,     0},	/* 5 */
	{    15,     4,    17,     0,     0,   512,    -5,   120,    -6,     0},	/* 6 */
	{    15,    -4,    17,     0,   512,   512,    90,   -74,    25,     0},	/* 7 */
	{    18,     0,   -32,     0,   202,  -215,    24,  -116,    -8,     0},	/* 8 */
	{    20,     0,     8,     0,   247,   392,    92,   -75,    11,     0},	/* 9 */
	{    15,     4,    17,     0,     0,   511,    82,     0,    87,     0},	/* 10 */
	{    11,     0,    17,     0,   256,   801,     7,     0,   119,     0},	/* 11 */
	{    15,    -4,    17,     0,   512,   511,    90,   -74,    25,     0},	/* 12 */
	{     9,     0,   -21,     0,     0,   512,   -36,  -113,    -6,     0},	/* 13 */
	{    18,     0,   -32,     0,   511,   511,    24,  -116,    -8,     0},	/* 14 */
	{    15,    -4,    17,     0,  -908,  -582,   -36,  -113,    -6,     0},	/* 15 */
	{    15,     4,    17,     0,  1422,  -584,    -5,   120,    -6,     0},	/* 16 */
	{    18,     0,   -32,     0,     0,   512,    23,   118,    -8,     0},	/* 17 */
	{     9,     0,   -21,     0,   511,   512,   -38,   113,    -6,     0},	/* 18 */
	{     4,    -4,    -1,     0,   187,   108,     1,  -119,     0,     0},	/* 19 */
	{    12,     1,     5,     0,     0,   256,     0,   120,     0,     0},	/* 20 */
	{    -1,     0,     2,     0,   135,   -19,     0,   120,     0,     0},	/* 21 */
	{    10,     1,    -5,     0,   256,   256,     0,   120,     0,     0},	/* 22 */
	{    -2,     0,    -2,     0,   256,     0,   -41,   -88,   -69,     0},	/* 23 */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
/* 8 x 8  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned short VS_Minislippy_green_txt[] = {
	0x2c1, 0x2c1, 0x301, 0x341, 0x341, 0x301, 0x2c1, 0x2c1, 
	0x2c1, 0x301, 0xb83, 0xc03, 0xc03, 0xb83, 0x301, 0x2c1, 
	0x301, 0xb83, 0x1c87, 0x2d0b, 0x2d0b, 0x1c87, 0xb83, 0x301, 
	0x341, 0xc03, 0x2d0b, 0xffff, 0xffff, 0x2d0b, 0xc03, 0x341, 
	0x341, 0xc03, 0x2d0b, 0x86a1, 0x86a1, 0x2d0b, 0xc03, 0x341, 
	0x301, 0xb83, 0x1c87, 0x2d0b, 0x2d0b, 0x1c87, 0xb83, 0x301, 
	0x2c1, 0x301, 0xb83, 0xc03, 0xc03, 0xb83, 0x301, 0x2c1, 
	0x2c1, 0x2c1, 0x301, 0x341, 0x341, 0x301, 0x2c1, 0x2c1, 
};

