#include<ultra64.h>

extern Vtx MAP_pep03_v[];

extern unsigned char MAP_right_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 */


/* ======== g6 ======== */

Gfx MAP_pep03[]={

	gs_Nin_SetUpTileDescrip(G_IM_FMT_IA,G_IM_SIZ_8b,8,16,0,0,G_TX_WRAP,3,0,G_TX_CLAMP,4,0),
	gs_Nin_LoadTextureImage(MAP_right_txt,G_IM_FMT_IA,G_IM_SIZ_8b,8,16,0,7),

	gsSPVertex(&MAP_pep03_v[0],16,0),
	gsSP2Triangles(0, 1, 2, 0, 1, 3, 2, 0),
	gsSP2Triangles(4, 5, 6, 0, 4, 6, 7, 0),
	gsSP1Quadrangle(8, 11, 9, 10, 0),
	gsSP1Quadrangle(12, 13, 15, 14, 0),
	gsSPEndDisplayList(),
}; /* g6 */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 16 vertices */
Vtx MAP_pep03_v[]={
	{   -30,   -24,    20,     0,  -416,   477,    63,    75,    68,   255},	/* 0 */
	{    30,   -24,    20,     0,   544,   477,   -44,    89,    66,   255},	/* 1 */
	{   -20,   -14,     0,     0,  -256,     0,    61,    77,    68,   255},	/* 2 */
	{    20,   -14,     0,     0,   384,     0,   -88,    45,    66,   255},	/* 3 */
	{   -20,    16,     0,     0,  -256,     0,    29,   -97,    62,   255},	/* 4 */
	{    20,    16,     0,     0,   384,     0,   -58,   -78,    68,   255},	/* 5 */
	{    30,    26,    20,     0,   544,   477,   -60,   -76,    68,   255},	/* 6 */
	{   -30,    26,    20,     0,  -416,   477,    79,   -58,    68,   255},	/* 7 */
	{    20,   -14,     0,     0,  -224,     0,   -88,    45,    66,   255},	/* 8 */
	{    30,    26,    20,     0,   416,   477,   -60,   -76,    68,   255},	/* 9 */
	{    20,    16,     0,     0,   256,     0,   -58,   -78,    68,   255},	/* 10 */
	{    30,   -24,    20,     0,  -384,   477,   -44,    89,    66,   255},	/* 11 */
	{   -20,    16,     0,     0,   256,     0,    29,   -97,    62,   255},	/* 12 */
	{   -30,    26,    20,     0,   416,   477,    79,   -58,    68,   255},	/* 13 */
	{   -20,   -14,     0,     0,  -224,     0,    61,    77,    68,   255},	/* 14 */
	{   -30,   -24,    20,     0,  -384,   477,    63,    75,    68,   255},	/* 15 */
};


/*   0 vertices */
/*   1 Materials */

#define	LDIRX	0
#define	LDIRY	0
#define	LDIRZ	120
#define	AMBDIV	1
/* 8 x 16  G_IM_SIZ_8b  G_IM_FMT_IA    */
unsigned char MAP_right_txt[] = {
	0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 
	0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 
	0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 
	0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 
	0x49, 0x49, 0x49, 0x49, 0x49, 0x49, 0x49, 0x49, 
	0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 
	0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 
	0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 
	0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 
	0xa5, 0xa5, 0xa5, 0xa4, 0xa5, 0xa5, 0xa5, 0xa5, 
	0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb4, 0xb4, 0xb4, 
	0xc2, 0xc2, 0xc2, 0xc1, 0xc2, 0xc2, 0xc2, 0xc2, 
	0xd1, 0xd1, 0xd1, 0xd1, 0xd1, 0xd1, 0xd1, 0xd1, 
	0xe1, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 
	0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 
	0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 
};

