#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], 15, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(1, 3, 2, 0),
	gsSP1Triangle(4, 5, 6, 0),
	gsSP1Triangle(4, 6, 7, 0),
	gsSP1Triangle(8, 9, 10, 0),
	gsSP1Triangle(8, 11, 9, 0),
	gsSP1Triangle(12, 13, 14, 0),
	gsSPVertex(&MAP_pep03_v[13], 3, 0),
	gsSP1Triangle(0, 2, 1, 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 },   /* v0 used p94/V1 2 times */
	{ 30,-24,20,0, 544, 477, -44,89,66,255 },   /* v1 used p94/V2 2 times */
	{ -20,-14,0,0, -256, 0, 61,77,68,255 },   /* v2 used p94/V3 2 times */
	{ 20,-14,0,0, 384, 0, -88,45,66,255 },   /* v3 used p93/V2 2 times */
	{ -20,16,0,0, -256, 0, 29,-97,62,255 },   /* v4 used p92/V1 2 times */
	{ 20,16,0,0, 384, 0, -58,-78,68,255 },   /* v5 used p92/V2 2 times */
	{ 30,26,20,0, 544, 477, -60,-76,68,255 },   /* v6 used p92/V3 2 times */
	{ -30,26,20,0, -416, 477, 79,-58,68,255 },   /* v7 used p91/V3 2 times */
	{ 20,-14,0,0, -224, 0, -88,45,66,255 },   /* v8 used p75/V1 4 times */
	{ 30,26,20,0, 416, 477, -60,-76,68,255 },   /* v9 used p75/V3 4 times */
	{ 20,16,0,0, 256, 0, -58,-78,68,255 },   /* v10 used p74/V3 2 times */
	{ 30,-24,20,0, -384, 477, -44,89,66,255 },   /* v11 used p75/V2 2 times */
	{ -20,16,0,0, 256, 0, 29,-97,62,255 },   /* v12 used p89/V1 2 times */
	{ -30,26,20,0, 416, 477, 79,-58,68,255 },   /* v13 used p89/V2 4 times */
	{ -20,-14,0,0, -224, 0, 61,77,68,255 },   /* v14 used p89/V3 4 times */
	{ -30,-24,20,0, -384, 477, 63,75,68,255 },   /* v15 used p90/V2 2 times */
};


/*   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, 
};

