#include<ultra64.h>

extern Vtx ZO_border_v[];
extern Vtx ZO_border_vmcur[];
extern Tri ZO_border_tri[];
extern Mtx ZO_border_matrix[];

extern unsigned short ZO_border_TX02_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 */


/* ======== DXFdata ======== */

Gfx ZO_border[]={

	gs_Nin_SetUpTileDescrip(G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,0,G_TX_CLAMP,4,0,G_TX_CLAMP,4,0),
	gs_Nin_LoadTextureImage(ZO_border_TX02_txt,G_IM_FMT_RGBA,G_IM_SIZ_16b,16,16,0,7),

	gsSPVertex(&ZO_border_v[0],30,0),
	gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
	gsSP2Triangles(6, 7, 8, 0, 9, 10, 11, 0),
	gsSP2Triangles(12, 13, 14, 0, 15, 16, 17, 0),
	gsSP2Triangles(18, 19, 20, 0, 21, 22, 23, 0),
	gsSP2Triangles(24, 25, 26, 0, 27, 28, 29, 0),
	gsSPVertex(&ZO_border_v[30],6,0),
	gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
	gsSPEndDisplayList(),
}; /* DXFdata */ 

#undef G_CC_PRIMSHADE

#undef gs_Nin_LoadTextureImage

#undef gs_Nin_SetUpTileDescrip

/* 36 vertices */
Vtx ZO_border_v[]={
	{   -14,    40,   -14,     0,   256,  -302,   -59,    85,   -60,   255},	/* 0 */
	{   -16,    20,   -39,     0,  -209,   512,   -59,    85,   -60,   255},	/* 1 */
	{   -39,    20,   -16,     0,   721,   512,   -59,    85,   -60,   255},	/* 2 */
	{    39,   -20,    16,     0,   721,   512,    60,   -84,    59,   255},	/* 3 */
	{    16,   -20,    39,     0,  -209,   512,    60,   -84,    59,   255},	/* 4 */
	{    14,   -40,    14,     0,   256,  -302,    60,   -84,    59,   255},	/* 5 */
	{   -16,   -20,    39,     0,   721,   512,   -59,   -84,    59,   255},	/* 6 */
	{   -39,   -20,    16,     0,  -209,   512,   -59,   -84,    59,   255},	/* 7 */
	{   -14,   -40,    14,     0,   256,  -302,   -59,   -84,    59,   255},	/* 8 */
	{   -39,   -20,   -16,     0,   721,   512,   -59,   -84,   -60,   255},	/* 9 */
	{   -16,   -20,   -39,     0,  -209,   512,   -59,   -84,   -60,   255},	/* 10 */
	{   -14,   -40,   -14,     0,   256,  -302,   -59,   -84,   -60,   255},	/* 11 */
	{    16,   -20,   -39,     0,   721,   512,    60,   -84,   -60,   255},	/* 12 */
	{    39,   -20,   -16,     0,  -209,   512,    60,   -84,   -60,   255},	/* 13 */
	{    14,   -40,   -14,     0,   256,  -302,    60,   -84,   -60,   255},	/* 14 */
	{    14,    40,   -14,     0,   256,  -302,    60,    85,   -60,   255},	/* 15 */
	{    39,    20,   -16,     0,  -209,   512,    60,    85,   -60,   255},	/* 16 */
	{    16,    20,   -39,     0,   721,   512,    60,    85,   -60,   255},	/* 17 */
	{     0,    23,    42,     0,   256,  -302,     0,     0,   119,   255},	/* 18 */
	{   -16,    -5,    42,     0,  -209,   512,     0,     0,   119,   255},	/* 19 */
	{    16,    -5,    42,     0,   721,   512,     0,     0,   119,   255},	/* 20 */
	{    42,    23,     0,     0,   256,  -302,   120,     0,     0,   255},	/* 21 */
	{    42,    -5,    16,     0,  -209,   512,   120,     0,     0,   255},	/* 22 */
	{    42,    -5,   -16,     0,   721,   512,   120,     0,     0,   255},	/* 23 */
	{     0,    23,   -42,     0,   256,  -302,     0,     0,  -120,   255},	/* 24 */
	{    16,    -5,   -42,     0,  -209,   512,     0,     0,  -120,   255},	/* 25 */
	{   -16,    -5,   -42,     0,   721,   512,     0,     0,  -120,   255},	/* 26 */
	{   -42,    23,     0,     0,   256,  -302,  -119,     0,     0,   255},	/* 27 */
	{   -42,    -5,   -16,     0,  -209,   512,  -119,     0,     0,   255},	/* 28 */
	{   -42,    -5,    16,     0,   721,   512,  -119,     0,     0,   255},	/* 29 */
	{   -14,    40,    14,     0,   256,  -302,   -59,    85,    59,   255},	/* 30 */
	{   -39,    20,    16,     0,  -209,   512,   -59,    85,    59,   255},	/* 31 */
	{   -16,    20,    39,     0,   721,   512,   -59,    85,    59,   255},	/* 32 */
	{    14,    40,    14,     0,   256,  -302,    60,    85,    59,   255},	/* 33 */
	{    16,    20,    39,     0,  -209,   512,    60,    85,    59,   255},	/* 34 */
	{    39,    20,    16,     0,   721,   512,    60,    85,    59,   255},	/* 35 */
};


/*   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 short ZO_border_TX02_txt[] = {
	0x9a4, 0x9a4, 0x9a4, 0x9a4, 0x9a4, 0x9a4, 0x9a4, 0x9a4, 0x9a4, 0x9a4, 0x9a4, 0x9a4, 0x9a4, 0x9a4, 0x9a4, 0x9a4, 
	0x9a4, 0x9a4, 0x9a4, 0x9a4, 0x9a4, 0x3aab, 0x42ed, 0x4b31, 0x4331, 0x3af1, 0x3aad, 0x9a4, 0x9a4, 0x9a4, 0x9a4, 0x9a4, 
	0x9a4, 0x9a4, 0x9a4, 0x9a4, 0x332f, 0x3aed, 0x42ef, 0x4373, 0x4335, 0x3af1, 0x32ef, 0x32ad, 0x9a4, 0x9a4, 0x9a4, 0x9a4, 
	0x9a4, 0x9a4, 0x9a4, 0x2b2f, 0x3371, 0x3bb3, 0x3bb5, 0x3bf7, 0x3bb7, 0x3b75, 0x3331, 0x32ef, 0x2aaf, 0x9a4, 0x9a4, 0x9a4, 
	0x9a4, 0x9a4, 0x33f3, 0x3c77, 0x3c79, 0x3cfb, 0x3d3d, 0x3d3d, 0x3cbd, 0x343b, 0x33b7, 0x3331, 0x32af, 0x2aad, 0x9a4, 0x9a4, 
	0x9a4, 0x5535, 0x457b, 0x45bf, 0x45ff, 0x4e7f, 0x4e7f, 0x467f, 0x3e3f, 0x357f, 0x347d, 0x3bb5, 0x3b31, 0x3aad, 0x3aab, 0x9a4, 
	0x9a4, 0x55fd, 0x4ebf, 0x5f3f, 0x67bf, 0x67ff, 0x67ff, 0x57ff, 0x477f, 0x36bf, 0x357f, 0x3c3b, 0x43b5, 0x3b31, 0x3aad, 0x9a4, 
	0x9a4, 0x6ebf, 0x6fff, 0x77ff, 0x87ff, 0x8fff, 0x87ff, 0x77ff, 0x57ff, 0x3f7f, 0x36bf, 0x3cff, 0x43f7, 0x4333, 0x42ef, 0x9a4, 
	0x9a4, 0x76ff, 0x77ff, 0x8fff, 0xafff, 0xc7ff, 0xafff, 0x97ff, 0x67ff, 0x4fff, 0x3f3f, 0x457f, 0x4437, 0x4373, 0x4331, 0x9a4, 
	0x9a4, 0x6ebf, 0x77ff, 0x9fff, 0xcfff, 0xcfff, 0xc7ff, 0xa7ff, 0x7fff, 0x57ff, 0x477f, 0x45bf, 0x4477, 0x3bb1, 0x4331, 0x9a4, 
	0x9a4, 0x55b9, 0x5f3f, 0x9fff, 0xbfff, 0xcfff, 0xcfff, 0xbfff, 0x8fff, 0x67ff, 0x57bf, 0x4dbd, 0x4475, 0x4c35, 0x32ab, 0x9a4, 
	0x9a4, 0x9a4, 0x463d, 0x57ff, 0x97ff, 0xbfff, 0xc7ff,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