#include<ultra64.h>

extern Vtx MOJI_pol_DOT_v[];

extern unsigned char MOJI_polmoji_CI4_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 */


/* ======== . ======== */

Gfx MOJI_pol_DOT[]={

	gsDPLoadTLUT_pal16(0,&MOJI_polmoji_CI4_txt[32]),
	gsDPLoadTextureBlock_4b(MOJI_polmoji_CI4_txt,G_IM_FMT_CI,8,8,0,G_TX_WRAP,G_TX_WRAP,3,3,0,0),
	gsDPSetTextureLUT(G_TT_RGBA16),

	gsSPVertex(&MOJI_pol_DOT_v[0], 14, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(0, 3, 1, 0),
	gsSP1Triangle(4, 5, 6, 0),
	gsSP1Triangle(4, 6, 7, 0),
	gsSP1Triangle(7, 8, 4, 0),
	gsSP1Triangle(7, 9, 8, 0),
	gsSP1Triangle(10, 11, 12, 0),
	gsSP1Triangle(10, 13, 11, 0),
	gsSPVertex(&MOJI_pol_DOT_v[11], 1, 0),
	gsSPVertex(&MOJI_pol_DOT_v[13], 7, 1),
	gsSP1Triangle(2, 0, 1, 0),
	gsSP1Triangle(2, 1, 4, 0),
	gsSP1Triangle(3, 5, 6, 0),
	gsSP1Triangle(3, 6, 7, 0),
	gsSPEndDisplayList(),
}; /* _ */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 20 vertices */
Vtx MOJI_pol_DOT_v[]={
	{ 15,-20,-10,0, 64, 192, 116,-28,0,255 },   /* v0 used p1868/V1 2 times */
	{ 10,-40,10,0, -64, 320, 91,-77,0,255 },   /* v1 used p1868/V2 2 times */
	{ 10,-40,-10,0, 64, 320, 42,-111,0,255 },   /* v2 used p1868/V3 2 times */
	{ 15,-20,10,0, -64, 192, 116,-28,0,255 },   /* v3 used p1869/V2 2 times */
	{ -10,-20,-10,0, -60, 192, -41,112,0,255 },   /* v4 used p1871/V1 6 times */
	{ -10,-20,10,0, -60, 320, -90,78,0,255 },   /* v5 used p1871/V2 2 times */
	{ 15,-20,10,0, 92, 320, 0,120,0,255 },   /* v6 used p1871/V3 4 times */
	{ 15,-20,-10,0, 92, 192, 0,120,0,255 },   /* v7 used p1870/V3 6 times */
	{ -15,-40,-10,0, -92, 320, 0,0,-120,255 },   /* v8 used p1873/V3 4 times */
	{ 10,-40,-10,0, 60, 320, 0,0,-120,255 },   /* v9 used p1873/V2 2 times */
	{ -10,-20,10,0, -60, 192, 0,0,119,255 },   /* v10 used p1863/V1 4 times */
	{ 10,-40,10,0, 60, 320, 0,0,119,255 },   /* v11 used p1863/V3 6 times */
	{ 15,-20,10,0, 92, 192, 0,0,119,255 },   /* v12 used p1862/V3 2 times */
	{ -15,-40,10,0, -92, 320, 0,0,119,255 },   /* v13 used p1863/V2 6 times */
	{ 10,-40,-10,0, 60, 192, 42,-111,0,255 },   /* v14 used p1867/V1 4 times */
	{ -15,-40,-10,0, 64, 320, -115,29,0,255 },   /* v15 used p1865/V1 4 times */
	{ -15,-40,-10,0, -92, 192, 0,-119,0,255 },   /* v16 used p1866/V3 2 times */
	{ -15,-40,10,0, -64, 320, -115,29,0,255 },   /* v17 used p1865/V2 2 times */
	{ -10,-20,10,0, -64, 192, -90,78,0,255 },   /* v18 used p1865/V3 4 times */
	{ -10,-20,-10,0, 64, 192, -41,112,0,255 },   /* v19 used p1864/V3 2 times */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
/* 8 x 8  G_IM_SIZ_16b G_IM_FMT_RGBA  */
unsigned char MOJI_polmoji_CI4_txt[] = {
	0x00, 0x00, 0x00, 0x00, 
	0x12, 0x11, 0x23, 0x41, 
	0x56, 0x77, 0x86, 0x69, 
	0xaa, 0x52, 0xbc, 0x8d, 
	0x6c, 0x5c, 0xeb, 0x7d, 
	0x52, 0x22, 0xe4, 0xad, 
	0xc3, 0x00, 0x33, 0xc5, 
	0x20, 0x00, 0x00, 0x32, 

/* 16colors */
0xF7, 0xBD, 0xA5, 0x29, 0xBD, 0xEF, 0xE7, 0x39, 0xC6, 0x31, 0x4A, 0x53, 0x39, 0xCF, 0x21, 0x9, 0x8, 0x43, 0x52, 0x95, 0x31, 0x8D, 0x8C, 0x63, 0x6B, 0x5B, 0x0, 0x1, 0xDE, 0xF7, 0xFF, 0xFE, 
};

