#include<ultra64.h>

extern Vtx DEMO_Peppy_arm06_v[];
extern Vtx DEMO_Peppy_arm06_vmcur[];
extern Tri DEMO_Peppy_arm06_tri[];
extern Mtx DEMO_Peppy_arm06_matrix[];

extern unsigned short DEMO_Hand_01_txt[];
extern unsigned short DEMO_Hand_02_txt[];
extern unsigned short DEMO_Hand_03_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 DEMO_Peppy_arm06[]={

	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,32,32,0,0,G_TX_MIRROR,5,0,G_TX_MIRROR,5,0),
	gs_Nin_LoadTextureImage(DEMO_Hand_01_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,32,32,0,7),


	gsSPVertex(&DEMO_Peppy_arm06_v[0],8,0),
	gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
	gsSP2Triangles(4, 5, 6, 0, 4, 6, 7, 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(DEMO_Hand_02_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),


	gsSPVertex(&DEMO_Peppy_arm06_v[8],8,0),
	gsSP2Triangles(0, 1, 2, 0, 2, 3, 0, 0),
	gsSP2Triangles(4, 5, 6, 0, 6, 7, 4, 0),
	gs_Nin_LoadTextureImage(DEMO_Hand_03_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&DEMO_Peppy_arm06_v[16],13,0),
	gsSP2Triangles(0, 1, 2, 0, 3, 1, 4, 0),
	gsSP2Triangles(3, 5, 1, 0, 6, 7, 8, 0),
	gsSP2Triangles(9, 10, 11, 0, 9, 12, 10, 0),
	gsSPEndDisplayList(),
}; /* o1 */ 

/* 30 vertices */
Vtx DEMO_Peppy_arm06_v[]={
	{    29,   -15,    20,     0,  1208,   148,    71,   -95,    11,     0},	/* 0 */
	{    35,   -15,   -17,     0,  -150,   114,    34,  -114,     4,     0},	/* 1 */
	{    49,     9,   -13,     0,     0,  1024,   103,   -58,    17,     0},	/* 2 */
	{    43,     9,    15,     0,  1028,  1024,   104,   -55,    21,     0},	/* 3 */
	{    18,    11,    17,     0,  1078,   107,    -4,    94,    74,     0},	/* 4 */
	{    43,     9,    15,     0,  1024,  1024,    15,    90,    76,     0},	/* 5 */
	{    49,     9,   -13,     0,     0,  1024,    15,   112,   -41,     0},	/* 6 */
	{    24,    11,   -15,     0,  -106,    73,   -10,   102,   -62,     0},	/* 7 */
	{    35,   -15,   -17,     0,     3,    -7,    -5,     7,  -120,     0},	/* 8 */
	{    -1,     6,   -12,     0,   915,   346,   -57,    46,   -95,     0},	/* 9 */
	{    24,    11,   -15,     0,   512,   511,   -10,   102,   -62,     0},	/* 10 */
	{    49,     9,   -13,     0,     0,   511,    15,   112,   -41,     0},	/* 11 */
	{    18,    11,    17,     0,   512,   512,    -4,    94,    74,     0},	/* 12 */
	{     0,   -13,    15,     0,   619,   -56,   -63,    -1,   101,     0},	/* 13 */
	{    29,   -15,    20,     0,    69,   -27,    -4,     9,   119,     0},	/* 14 */
	{    43,     9,    15,     0,     6,   513,    15,    90,    76,     0},	/* 15 */
	{    18,    11,    17,     0,   262,   370,    -4,    94,    74,     0},	/* 16 */
	{    -1,     6,    15,     0,     0,   512,  -103,    51,    30,     0},	/* 17 */
	{     0,   -13,    15,     0,    88,   790,   -63,    -1,   101,     0},	/* 18 */
	{    24,    11,   -15,     0,   512,     0,   -10,   102,   -62,     0},	/* 19 */
	{    18,    11,    17,     0,   -81,   119,    -4,    94,    74,     0},	/* 20 */
	{    -1,     6,   -12,     0,   512,   512,   -57,    46,   -95,     0},	/* 21 */
	{    35,   -15,   -17,     0,  -545,   788,    -5,     7,  -120,     0},	/* 22 */
	{     0,   -13,   -12,     0,   -33,   788,   -82,   -71,   -47,     0},	/* 23 */
	{    -1,     6,   -12,     0,     0,   512,   -57,    46,   -95,     0},	/* 24 */
	{    35,   -15,   -17,     0,  -141,   973,    34,  -114,     4,     0},	/* 25 */
	{     0,   -13,    15,     0,   367,   570,    -7,  -119,    -1,     0},	/* 26 */
	{     0,   -13,   -12,     0,     0,   512,   -82,   -71,   -47,     0},	/* 27 */
	{    29,   -15,    20,     0,   370,   973,    71,   -95,    11,     0},	/* 28 */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
