#include<ultra64.h>

extern Vtx SZ_Gomi02_v[];

extern unsigned char SZ_GomiTX01_CI8_txt[];
extern unsigned char SZ_HashiraTX02_CI8_txt[];
extern unsigned char SZ_HashitaTX01_CI8_txt[];
extern unsigned char SZ_KogeTX01_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 */


/* ======== g7 ======== */

static	Gfx SZ_Gomi02_grp_g7[]={

	gsDPLoadTLUT_pal256(&SZ_GomiTX01_CI8_txt[1024]),
	gsDPLoadTextureBlock(SZ_GomiTX01_CI8_txt,G_IM_FMT_CI,G_IM_SIZ_8b,32,32,0,G_TX_WRAP,G_TX_WRAP,5,5,0,0),
	gsDPSetTextureLUT(G_TT_RGBA16),

	gsSPVertex(&SZ_Gomi02_v[0], 15, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(1, 3, 2, 0),
	gsSP1Triangle(4, 5, 6, 0),
	gsSP1Triangle(5, 7, 6, 0),
	gsSP1Triangle(8, 9, 10, 0),
	gsSP1Triangle(9, 11, 10, 0),
	gsSP1Triangle(12, 13, 14, 0),
	gsSPVertex(&SZ_Gomi02_v[13], 11, 0),
	gsSP1Triangle(0, 2, 1, 0),
	gsSP1Triangle(3, 7, 8, 0),
	gsSP1Triangle(4, 3, 8, 0),
	gsSP1Triangle(5, 9, 10, 0),
	gsSP1Triangle(6, 5, 10, 0),

	gsDPLoadTLUT_pal256(&SZ_KogeTX01_CI8_txt[256]),
	gsDPLoadTextureBlock(SZ_KogeTX01_CI8_txt,G_IM_FMT_CI,G_IM_SIZ_8b,16,16,0,G_TX_WRAP,G_TX_WRAP,4,4,0,0),

	gsSPVertex(&SZ_Gomi02_v[24], 12, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(0, 3, 1, 0),
	gsSP1Triangle(4, 5, 6, 0),
	gsSP1Triangle(4, 7, 5, 0),
	gsSP1Triangle(8, 9, 10, 0),
	gsSP1Triangle(8, 11, 9, 0),

	gsDPLoadTLUT_pal256(&SZ_HashiraTX02_CI8_txt[64]),
	gsDPLoadTextureBlock(SZ_HashiraTX02_CI8_txt,G_IM_FMT_CI,G_IM_SIZ_8b,8,8,0,G_TX_WRAP,G_TX_WRAP,3,3,0,0),

	gsSPVertex(&SZ_Gomi02_v[36], 16, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(0, 2, 3, 0),
	gsSP1Triangle(4, 5, 6, 0),
	gsSP1Triangle(4, 7, 5, 0),
	gsSP1Triangle(8, 9, 10, 0),
	gsSP1Triangle(8, 10, 11, 0),
	gsSP1Triangle(12, 13, 14, 0),
	gsSP1Triangle(12, 14, 15, 0),

	gsDPLoadTLUT_pal256(&SZ_HashitaTX01_CI8_txt[256]),
	gsDPLoadTextureBlock(SZ_HashitaTX01_CI8_txt,G_IM_FMT_CI,G_IM_SIZ_8b,16,16,0,G_TX_WRAP,G_TX_WRAP,4,4,0,0),

	gsSPVertex(&SZ_Gomi02_v[52], 16, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(0, 3, 1, 0),
	gsSP1Triangle(4, 5, 6, 0),
	gsSP1Triangle(4, 7, 5, 0),
	gsSP1Triangle(8, 9, 10, 0),
	gsSP1Triangle(8, 11, 9, 0),
	gsSP1Triangle(12, 13, 14, 0),
	gsSP1Triangle(12, 14, 15, 0),
	gsDPPipeSync(),
        gsDPSetTextureLUT(G_TT_NONE),
	gsSPEndDisplayList(),
}; /* g7 */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 68 vertices */
Vtx SZ_Gomi02_v[]={
	{ -500,-300,350,0, 1023, 576, 0,0,119,255 },   /* v0 used p142/V1 2 times */
	{ 500,-300,350,0, -255, 576, 0,0,119,255 },   /* v1 used p141/V1 4 times */
	{ -500,-240,350,0, 1023, 768, 0,0,119,255 },   /* v2 used p141/V3 4 times */
	{ 500,-240,350,0, -255, 768, 0,0,119,255 },   /* v3 used p141/V2 2 times */
	{ -500,-300,350,0, 1024, -180, 0,-119,0,255 },   /* v4 used p144/V1 2 times */
	{ -500,-300,-350,0, 1024, 873, 0,-119,0,255 },   /* v5 used p144/V2 2 times */
	{ 500,-300,350,0, -255, -180, 0,-119,0,255 },   /* v6 used p144/V3 2 times */
	{ 500,-300,-350,0, -255, 873, 0,-119,0,255 },   /* v7 used p143/V2 2 times */
	{ 500,-240,350,0, -255, -180, 0,120,0,255 },   /* v8 used p146/V1 2 times */
	{ 500,-240,-350,0, -255, 873, 0,120,0,255 },   /* v9 used p145/V1 4 times */
	{ -500,-240,350,0, 1024, -180, 0,120,0,255 },   /* v10 used p145/V3 4 times */
	{ -500,-240,-350,0, 1024, 873, 0,120,0,255 },   /* v11 used p145/V2 2 times */
	{ 500,-300,350,0, 667, -180, 120,0,0,255 },   /* v12 used p136/V1 2 times */
	{ 500,-300,-350,0, 667, 873, 120,0,0,255 },   /* v13 used p136/V2 2 times */
	{ 500,-240,350,0, 801, -180, 120,0,0,255 },   /* v14 used p136/V3 2 times */
	{ 500,-240,-350,0, 801, 873, 120,0,0,255 },   /* v15 used p135/V2 2 times */
	{ -500,-300,-350,0, 1024, 970, 0,0,-120,255 },   /* v16 used p137/V1 4 times */
	{ 500,-300,-350,0, -255, 970, 0,0,-120,255 },   /* v17 used p138/V1 2 times */
	{ -500,-300,350,0, -192, -180, -119,0,0,255 },   /* v18 used p139/V1 4 times */
	{ -500,-300,-350,0, -192, 873, -119,0,0,255 },   /* v19 used p140/V1 2 times */
	{ -500,-240,-350,0, 1024, 808, 0,0,-120,255 },   /* v20 used p137/V2 2 times */
	{ 500,-240,-350,0, -255, 808, 0,0,-120,255 },   /* v21 used p137/V3 4 times */
	{ -500,-240,350,0, 0, -180, -119,0,0,255 },   /* v22 used p139/V2 2 times */
	{ -500,-240,-350,0, 0, 873, -119,0,0,255 },   /* v23 used p139/V3 4 times */
	{ 410,540,200,0, 512, 512, 0,120,0,255 },   /* v24 used p168/V1 2 times */
	{ 350,540,140,0, 0, 0, 0,9,-120,255 },   /* v25 used p168/V2 2 times */
	{ 350,540,200,0, 0, 512, 0,120,0,255 },   /* v26 used p168/V3 2 times */
	{ 410,540,140,0, 512, 0, 0,9,-120,255 },   /* v27 used p167/V2 2 times */
	{ 320,-30,460,0, 0, 512, 0,0,119,255 },   /* v28 used p149/V1 4 times */
	{ 380,30,460,0, 511, 0, 0,120,5,255 },   /* v29 used p149/V3 4 times */
	{ 320,30,460,0, 0, 0, 0,120,5,255 },   /* v30 used p150/V3 2 times */
	{ 380,-30,460,0, 511, 512, 0,0,119,255 },   /* v31 used p149/V2 2 times */
	{ 380,-30,-750,0, 0, 512, 0,-119,-6,255 },   /* v32 used p158/V1 2 times */
	{ 320,30,-750,0, 511, 0, 0,0,-120,255 },   /* v33 used p158/V2 2 times */
	{ 380,30,-750,0, 0, 0, 0,0,-120,255 },   /* v34 used p158/V3 2 times */
	{ 320,-30,-750,0, 511, 511, 0,-119,-6,255 },   /* v35 used p157/V2 2 times */
	{ 410,540,200,0, 406, -240, 0,0,119,255 },   /* v36 used p166/V1 2 times */
	{ 350,540,200,0, 338, -286, 0,0,119,255 },   /* v37 used p165/V2 2 times */
	{ 350,-270,200,0, -372, 1543, 0,0,119,255 },   /* v38 used p166/V2 2 times */
	{ 410,-270,200,0, -304, 1588, 0,0,119,255 },   /* v39 used p166/V3 2 times */
	{ 350,540,140,0, 338, -286, 0,9,-120,255 },   /* v40 used p161/V1 4 times */
	{ 410,-270,140,0, -304, 1588, 0,0,-120,255 },   /* v41 used p161/V3 4 times */
	{ 350,-270,140,0, -372, 1543, 0,0,-120,255 },   /* v42 used p162/V3 2 times */
	{ 410,540,140,0, 406, -240, 0,9,-120,255 },   /* v43 used p161/V2 2 times */
	{ 320,30,-750,0, -265, -1002, 0,120,0,255 },   /* v44 used p153/V1 4 times */
	{ 320,30,460,0, 196, 384, 0,120,5,255 },   /* v45 used p153/V2 2 times */
	{ 380,30,460,0, 278, 324, 0,120,5,255 },   /* v46 used p153/V3 4 times */
	{ 380,30,-750,0, -183, -1062, 0,120,0,255 },   /* v47 used p154/V3 2 times */
	{ 380,-30,-750,0, -183, -1062, 0,-119,-6,255 },   /* v48 used p155/V1 4 times */
	{ 380,-30,460,0, 278, 324, 0,-119,0,255 },   /* v49 used p155/V2 2 times */
	{ 320,-30,460,0, 196, 384, 0,-119,0,255 },   /* v50 used p155/V3 4 times */
	{ 320,-30,-750,0, -265, -1002, 0,-119,-6,255 },   /* v51 used p156/V3 2 times */
	{ 350,540,200,0, 4095, 512, -119,0,0,255 },   /* v52 used p159/V1 4 times */
	{ 350,-270,140,0, -51, 0, -119,0,0,255 },   /* v53 used p159/V3 4 times */
	{ 350,-270,200,0, -51, 512, -119,0,0,255 },   /* v54 used p160/V3 2 times */
	{ 350,540,140,0, 4095, 0, -119,0,0,255 },   /* v55 used p159/V2 2 times */
	{ 410,540,140,0, 4095, 0, 120,0,0,255 },   /* v56 used p164/V1 2 times */
	{ 410,-270,200,0, -51, 512, 120,0,0,255 },   /* v57 used p164/V2 2 times */
	{ 410,-270,140,0, -51, 0, 120,0,0,255 },   /* v58 used p164/V3 2 times */
	{ 410,540,200,0, 4095, 512, 120,0,0,255 },   /* v59 used p163/V2 2 times */
	{ 380,-30,460,0, 0, 512, 120,0,0,255 },   /* v60 used p152/V1 2 times */
	{ 380,30,-750,0, 6195, 0, 120,0,0,255 },   /* v61 used p152/V2 2 times */
	{ 380,30,460,0, 0, 0, 120,0,0,255 },   /* v62 used p152/V3 2 times */
	{ 380,-30,-750,0, 6195, 511, 120,0,0,255 },   /* v63 used p151/V2 2 times */
	{ 320,-30,-750,0, 6195, 511, -119,0,0,255 },   /* v64 used p147/V1 4 times */
	{ 320,-30,460,0, 0, 512, -119,0,0,255 },   /* v65 used p147/V2 2 times */
	{ 320,30,460,0, 0, 0, -119,0,0,255 },   /* v66 used p147/V3 4 times */
	{ 320,30,-750,0, 6195, 0, -119,0,0,255 },   /* v67 used p148/V3 2 times */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
