#include<ultra64.h>

extern Vtx SZ_ISBM_HeadLight_v[];

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


/* ======== g15 ======== */

Gfx SZ_ISBM_HeadLight[]={

	gsDPSetTextureLUT(G_TT_RGBA16),
	gsDPLoadTLUT_pal256(&SZ_ISBMTX05_CI8_txt[256]),
	gsDPLoadTextureBlock(SZ_ISBMTX05_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_ISBM_HeadLight_v[0], 16, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(3, 4, 5, 0),
	gsSP1Triangle(6, 7, 8, 0),
	gsSP1Triangle(9, 10, 11, 0),
	gsSP1Triangle(12, 13, 14, 0),
	gsSP1Triangle(12, 14, 15, 0),
	gsDPPipeSync(),
        gsDPSetTextureLUT(G_TT_NONE),
	gsSPEndDisplayList(),
}; /* g15 */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 16 vertices */
Vtx SZ_ISBM_HeadLight_v[]={
	{ -30,52,170,0, 563, 460, 0,56,105,255 },   /* v0 used p266/V1 2 times */
	{ 30,52,170,0, -51, 460, 0,56,105,255 },   /* v1 used p266/V2 2 times */
	{ 0,90,150,0, 255, 20, 0,56,105,255 },   /* v2 used p266/V3 2 times */
	{ 0,-90,150,0, 255, 20, 0,-55,105,255 },   /* v3 used p265/V1 2 times */
	{ 30,-52,170,0, -51, 460, 0,-55,105,255 },   /* v4 used p265/V2 2 times */
	{ -30,-52,170,0, 563, 460, 0,-55,105,255 },   /* v5 used p265/V3 2 times */
	{ -30,-52,0,0, 563, 460, 0,-55,-106,255 },   /* v6 used p264/V1 2 times */
	{ 30,-52,0,0, -51, 460, 0,-55,-106,255 },   /* v7 used p264/V2 2 times */
	{ 0,-90,20,0, 255, 20, 0,-55,-106,255 },   /* v8 used p264/V3 2 times */
	{ 0,90,20,0, 255, 20, 0,56,-106,255 },   /* v9 used p211/V1 2 times */
	{ 30,52,0,0, -51, 460, 0,56,-106,255 },   /* v10 used p211/V2 2 times */
	{ -30,52,0,0, 563, 460, 0,56,-106,255 },   /* v11 used p211/V3 2 times */
	{ -20,-20,270,0, 0, 512, 0,0,119,255 },   /* v12 used p207/V1 2 times */
	{ 20,-20,270,0, 512, 512, 0,0,119,255 },   /* v13 used p207/V2 2 times */
	{ 20,20,270,0, 512, 0, 0,0,119,255 },   /* v14 used p207/V3 2 times */
	{ -20,20,270,0, 0, 0, 0,0,119,255 },   /* v15 used p207/V4 2 times */
};


/*   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 SZ_ISBMTX05_CI8_txt[] = {
	0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 
	0x0, 0x1, 0x1, 0x2, 0x1, 0x3, 0x3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