#include<ultra64.h>

extern Vtx SN_ishi02_v[];

extern unsigned char SN_ishi02_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 */


/* ======== g2 ======== */

Gfx SN_ishi02[]={

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

	gsSPVertex(&SN_ishi02_v[0],10,0),
	gsSP2Triangles(0, 1, 2, 0, 3, 4, 0, 0),
	gsSP2Triangles(5, 1, 0, 0, 5, 0, 4, 0),
	gsSP2Triangles(6, 1, 5, 0, 2, 1, 6, 0),
	gsSP2Triangles(6, 3, 2, 0, 2, 3, 0, 0),
	gsSP2Triangles(4, 3, 7, 0, 6, 8, 3, 0),
	gsSP2Triangles(7, 3, 8, 0, 7, 8, 9, 0),
	gsSP2Triangles(9, 4, 7, 0, 5, 9, 8, 0),
	gsSP2Triangles(4, 9, 5, 0, 8, 6, 5, 0),
	gsDPPipeSync(),
        gsDPSetTextureLUT(G_TT_NONE),
	gsSPEndDisplayList(),
}; /* g2 */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 16 vertices */
Vtx SN_ishi02_v[]={
	{    30,   -10,   -40,     0,   384,   384,    40,    -7,  -113,   255},	/* 0 */
	{    60,     0,     0,     0,   896,   640,   114,    38,     0,   255},	/* 1 */
	{    50,   -50,     0,     0,   640,  -128,    58,   -57,   -87,   255},	/* 2 */
	{     0,   -60,     0,     0,     0,  -256,    -9,   -81,   -87,   255},	/* 3 */
	{   -30,   -10,   -40,     0,  -128,   640,   -42,     9,  -112,   255},	/* 4 */
	{    20,    40,     0,     0,   256,  1280,     0,   106,   -56,   255},	/* 5 */
	{    30,   -10,    40,     0,   384,   384,    40,    -7,   112,   255},	/* 6 */
	{   -50,   -30,     0,     0,  -640,   128,  -106,   -53,     0,   255},	/* 7 */
	{   -30,   -10,    40,     0,  -128,   640,   -42,     9,   111,   255},	/* 8 */
	{   -40,    20,     0,     0,  -768,   896,   -84,    85,     0,   255},	/* 9 */
};


/*   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 SN_ishi02_CI8_txt[] = {
	0x0, 0x1, 0x2, 0x3, 0x4, 0x4, 0x4, 0x5, 0x5, 0x6, 0x7, 0x7, 0x8, 0x9, 0xa, 0xb, 
	0xc, 0xd, 0xe, 0x3, 0x4, 0x4, 0xf, 0x5, 0x6, 0x10, 0x7, 0x7, 0x8, 0x11, 0x12, 0x0, 
	0x11, 0x8, 0xf, 0x4, 0x4, 0x4, 0x13, 0x5, 0x6, 0x10, 0x7, 0x7, 0x8, 0x11, 0xe, 0x14, 
	0x8, 0x8, 0x8, 0x11, 0x4, 0x3, 0x15, 0x13, 0x6, 0x10, 0x7, 0x7, 0x11, 0xc, 0xb, 0x8, 
	0x8, 0x8, 0x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