#include<ultra64.h>

extern Vtx MC_Tsukidashi02_v[];

extern unsigned char MC_BridgeTX03_CI8_txt[];
extern unsigned char MC_PointTX01_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 MC_Tsukidashi02[]={

	gsDPSetTextureLUT(G_TT_RGBA16),
	gsDPLoadTLUT_pal256(&MC_PointTX01_CI8_txt[256]),
	gsDPLoadTextureBlock(MC_PointTX01_CI8_txt,G_IM_FMT_CI,G_IM_SIZ_8b,16,16,0,G_TX_WRAP,G_TX_WRAP,4,4,0,0),

	gsSPVertex(&MC_Tsukidashi02_v[0], 12, 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, 10, 11, 0),

	gsDPLoadTLUT_pal256(&MC_BridgeTX03_CI8_txt[64]),
	gsDPLoadTextureBlock(MC_BridgeTX03_CI8_txt,G_IM_FMT_CI,G_IM_SIZ_8b,8,8,0,G_TX_WRAP,G_TX_WRAP,3,3,0,0),

	gsSPVertex(&MC_Tsukidashi02_v[12], 4, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(0, 2, 3, 0),
	gsDPPipeSync(),
        gsDPSetTextureLUT(G_TT_NONE),
	gsSPEndDisplayList(),
}; /* Default */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 16 vertices */
Vtx MC_Tsukidashi02_v[]={
	{ 40,0,40,0, 512, 791, 0,0,119,255 },   /* v0 used p328/V1 2 times */
	{ 40,350,40,0, 511, -837, 0,0,119,255 },   /* v1 used p329/V2 2 times */
	{ -40,350,40,0, 0, -837, 0,0,119,255 },   /* v2 used p328/V2 2 times */
	{ -40,0,40,0, 0, 791, 0,0,119,255 },   /* v3 used p328/V3 2 times */
	{ -40,0,40,0, 512, 791, -119,0,0,255 },   /* v4 used p326/V1 2 times */
	{ -40,350,40,0, 511, -837, -119,0,0,255 },   /* v5 used p327/V2 2 times */
	{ -40,350,-40,0, 0, -837, -119,0,0,255 },   /* v6 used p326/V2 2 times */
	{ -40,0,-40,0, 0, 791, -119,0,0,255 },   /* v7 used p326/V3 2 times */
	{ 40,0,-40,0, 512, 791, 120,0,0,255 },   /* v8 used p324/V1 2 times */
	{ 40,350,-40,0, 511, -837, 120,0,0,255 },   /* v9 used p325/V2 2 times */
	{ 40,350,40,0, 0, -837, 120,0,0,255 },   /* v10 used p324/V2 2 times */
	{ 40,0,40,0, 0, 791, 120,0,0,255 },   /* v11 used p324/V3 2 times */
	{ -40,350,40,0, -196, 196, 0,120,0,255 },   /* v12 used p323/V1 4 times */
	{ 40,350,40,0, 170, 512, 0,120,0,255 },   /* v13 used p323/V2 2 times */
	{ 40,350,-40,0, 485, 196, 0,120,0,255 },   /* v14 used p323/V3 4 times */
	{ -40,350,-40,0, 118, -118, 0,120,0,255 },   /* v15 used p322/V3 2 times */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
