#include<ultra64.h>

extern Vtx JT_i_coin01_v[];
extern unsigned char JT_i_coin01_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 */


/* ======== Default ======== */

Gfx JT_i_coin01[]={

	gsDPPipeSync(),
	gsDPSetTextureLUT(G_TT_RGBA16),
	gsDPLoadTLUT_pal256(&JT_i_coin01_CI8_txt[1024]),
	gsDPLoadTextureBlock(JT_i_coin01_CI8_txt,G_IM_FMT_CI,G_IM_SIZ_8b,32,32,0,G_TX_CLAMP,G_TX_CLAMP,5,5,0,0),

	gsSPVertex(&JT_i_coin01_v[0], 16, 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, 11, 9, 0),
	gsSP1Triangle(12, 13, 14, 0),
	gsSP1Triangle(13, 15, 14, 0),
	gsSPVertex(&JT_i_coin01_v[14], 5, 0),
	gsSPVertex(&JT_i_coin01_v[21], 9, 5),
	gsSP1Triangle(1, 2, 0, 0),
	gsSP1Triangle(2, 5, 0, 0),
	gsSP1Triangle(3, 6, 7, 0),
	gsSP1Triangle(3, 7, 8, 0),
	gsSP1Triangle(3, 8, 9, 0),
	gsSP1Triangle(3, 9, 10, 0),
	gsSP1Triangle(4, 11, 12, 0),
	gsSP1Triangle(4, 12, 13, 0),
	gsSPVertex(&JT_i_coin01_v[19], 2, 0),
	gsSPVertex(&JT_i_coin01_v[30], 6, 2),
	gsSP1Triangle(0, 2, 3, 0),
	gsSP1Triangle(0, 4, 2, 0),
	gsSP1Triangle(1, 5, 6, 0),
	gsSP1Triangle(1, 6, 7, 0),

	gsDPPipeSync(),
	gsDPSetTextureLUT(G_TT_NONE),
	gsSPEndDisplayList(),
};

/* 36 vertices */
Vtx JT_i_coin01_v[]={
	{ 0,-60,10,0, 890, 465, 23,-117,0,255 },   /* v0 used p265/V1 4 times */
	{ 0,-60,-10,0, 845, 544, -22,-117,0,255 },   /* v1 used p265/V2 2 times */
	{ 52,-30,-10,0, 712, 440, 91,-78,0,255 },   /* v2 used p265/V3 4 times */
	{ 52,-30,10,0, 756, 361, 113,-38,0,255 },   /* v3 used p264/V3 2 times */
	{ 52,30,-10,0, 400, 928, 113,39,0,255 },   /* v4 used p262/V1 2 times */
	{ 52,30,10,0, 445, 966, 91,79,0,255 },   /* v5 used p263/V2 2 times */
	{ 52,-30,10,0, 845, 871, 113,-38,0,255 },   /* v6 used p262/V2 2 times */
	{ 52,-30,-10,0, 801, 833, 91,-78,0,255 },   /* v7 used p262/V3 2 times */
	{ 0,60,-10,0, 254, 669, 23,118,0,255 },   /* v8 used p260/V1 2 times */
	{ 52,30,10,0, 338, 893, 91,79,0,255 },   /* v9 used p260/V2 2 times */
	{ 52,30,-10,0, 438, 877, 113,39,0,255 },   /* v10 used p260/V3 2 times */
	{ 0,60,10,0, 153, 685, -22,118,0,255 },   /* v11 used p261/V2 2 times */
	{ 52,-30,10,0, 955, 771, 0,0,119,255 },   /* v12 used p268/V1 2 times */
	{ 52,30,10,0, 955, 259, 0,0,119,255 },   /* v13 used p269/V1 2 times */
	{ 0,-60,10,0, 511, 1027, 0,0,119,255 },   /* v14 used p269/V3 4 times */
	{ 0,60,10,0, 512, 3, 0,0,119,255 },   /* v15 used p269/V2 2 times */
	{ -52,30,10,0, 68, 259, 0,0,119,255 },   /* v16 used p267/V2 2 times */
	{ 0,-60,-10,0, 511, 1027, 0,0,-120,255 },   /* v17 used p250/V1 4 times */
	{ -52,-30,-10,0, 458, 480, -112,-38,0,255 },   /* v18 used p255/V1 4 times */
	{ -52,-30,10,0, 605, 698, -90,-78,0,255 },   /* v19 used p258/V1 2 times */
	{ -52,30,-10,0, 613, 706, -90,79,0,255 },   /* v20 used p256/V1 2 times */
	{ -52,-30,10,0, 68, 771, 0,0,119,255 },   /* v21 used p266/V2 2 times */
	{ -52,-30,-10,0, 68, 771, 0,0,-120,255 },   /* v22 used p253/V2 2 times */
	{ -52,30,-10,0, 68, 259, 0,0,-120,255 },   /* v23 used p252/V2 2 times */
	{ 0,60,-10,0, 512, 3, 0,0,-120,255 },   /* v24 used p251/V2 2 times */
	{ 52,30,-10,0, 955, 259, 0,0,-120,255 },   /* v25 used p250/V2 2 times */
	{ 52,-30,-10,0, 955, 771, 0,0,-120,255 },   /* v26 used p250/V3 2 times */
	{ -52,-30,10,0, 497, 396, -90,-78,0,255 },   /* v27 used p255/V2 2 times */
	{ -52,30,10,0, 718, 362, -112,39,0,255 },   /* v28 used p255/V3 4 times */
	{ -52,30,-10,0, 678, 446, -90,79,0,255 },   /* v29 used p254/V3 2 times */
	{ 0,-60,-10,0, 930, 325, -22,-117,0,255 },   /* v30 used p258/V2 2 times */
	{ 0,-60,10,0, 814, 349, 23,-117,0,255 },   /* v31 used p258/V3 2 times */
	{ -52,-30,-10,0, 721, 674, -112,-38,0,255 },   /* v32 used p259/V2 2 times */
	{ -52,30,10,0, 644, 644, -112,39,0,255 },   /* v33 used p257/V2 2 times */
	{ 0,60,10,0, 530, 530, -22,118,0,255 },   /* v34 used p256/V2 2 times */
	{ 0,60,-10,0, 499, 593, 23,118,0,255 },   /* v35 used p256/V3 2 times */
};
