static.c 10.2 KB
/********************************************************************************
						   NINTENDO64 Disk Drive IPL4

							   static data module

								January 6, 1997
 ********************************************************************************/

#include <ultra64.h>
#include "static.h"

#include "mark_texture.inc"
#include "ncube_texture.inc"
#include "clock_texture.inc"

/********************************************************************************/
/*																				*/
/*	Identity matrix																*/
/*																				*/
/********************************************************************************/

Mtx IdentMatrix = {
	0x00010000, 0x00000000, 0x00000001, 0x00000000,
	0x00000000, 0x00010000, 0x00000000, 0x00000001,
	0x00000000, 0x00000000, 0x00000000, 0x00000000,
	0x00000000, 0x00000000, 0x00000000, 0x00000000
};

/********************************************************************************/
/*																				*/
/*	View port record.															*/
/*																				*/
/********************************************************************************/

Vp ViewPort = {
	640, 480, G_MAXZ/2, 0,
	640, 480, G_MAXZ/2, 0
};

/********************************************************************************/
/*																				*/
/*	Light records.																*/
/*																				*/
/********************************************************************************/

Light CubeDiffuseLight = { 255,255,255,0,  255,255,255,0,   24, 70, 66,0 };
Light CubeAmbientLight = { 127,127,127,0,  127,127,127,0,    0,  0,  0,0 };
Light WaveDiffuseLight = { 255,255,255,0,  255,255,255,0,   24, 56, 66,0 };
Light WaveAmbientLight = {  72, 72, 72,0,   72, 72, 72,0,    0,  0,  0,0 };


/********************************************************************************/
/*																				*/
/*	Wave plane.																	*/
/*																				*/
/********************************************************************************/

Gfx Gfx_WavePlaneA[] = {
	gsSP2Triangles( 0,13, 1, 0,    13,14, 1, 0),
	gsSP2Triangles( 1,15, 2, 0,    14,15, 1, 0),
	gsSP2Triangles( 2,15, 3, 0,    15,16, 3, 0),
	gsSP2Triangles( 3,17, 4, 0,    16,17, 3, 0),
	gsSP2Triangles( 4,17, 5, 0,    17,18, 5, 0),
	gsSP2Triangles( 5,19, 6, 0,    18,19, 5, 0),
	gsSP2Triangles( 6,19, 7, 0,    19,20, 7, 0),
	gsSP2Triangles( 7,21, 8, 0,    20,21, 7, 0),
	gsSP2Triangles( 8,21, 9, 0,    21,22, 9, 0),
	gsSP2Triangles( 9,23,10, 0,    22,23, 9, 0),
	gsSP2Triangles(10,23,11, 0,    23,24,11, 0),
	gsSP2Triangles(11,25,12, 0,    24,25,11, 0),
	gsSPEndDisplayList()
};
Gfx Gfx_WavePlaneB[] = {
	gsSP2Triangles( 0, 1,13, 0,    13, 1,14, 0),
	gsSP2Triangles( 1, 2,15, 0,    14, 1,15, 0),
	gsSP2Triangles( 2, 3,15, 0,    15, 3,16, 0),
	gsSP2Triangles( 3, 4,17, 0,    16, 3,17, 0),
	gsSP2Triangles( 4, 5,17, 0,    17, 5,18, 0),
	gsSP2Triangles( 5, 6,19, 0,    18, 5,19, 0),
	gsSP2Triangles( 6, 7,19, 0,    19, 7,20, 0),
	gsSP2Triangles( 7, 8,21, 0,    20, 7,21, 0),
	gsSP2Triangles( 8, 9,21, 0,    21, 9,22, 0),
	gsSP2Triangles( 9,10,23, 0,    22, 9,23, 0),
	gsSP2Triangles(10,11,23, 0,    23,11,24, 0),
	gsSP2Triangles(11,12,25, 0,    24,11,25, 0),
	gsSPEndDisplayList()
};

/********************************************************************************/
/*																				*/
/*	Flat plane																	*/
/*																				*/
/********************************************************************************/

static Vtx Vtx_FlatPlane[] = {
	{  -2896, 0, -2896-1326, 0,0, 0, 0,127,0, 255 },
	{  -2896, 0,  2896-1326, 0,0, 0, 0,127,0, 255 },
	{   2896, 0,  2896-1326, 0,0, 0, 0,127,0, 255 },
	{   2896, 0, -2896-1326, 0,0, 0, 0,127,0, 255 }
};

Gfx Gfx_FlatPlane[] = {
	gsDPSetRenderMode (G_RM_AA_ZB_XLU_SURF, G_RM_AA_ZB_XLU_SURF2),
	gsDPSetCombineMode(G_CC_ENVSHADE, G_CC_ENVSHADE),

	gsSPMatrix	 (&IdentMatrix, G_MTX_MODELVIEW|G_MTX_LOAD|G_MTX_NOPUSH),
	gsSPVertex	 (Vtx_FlatPlane, 4, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(0, 2, 3, 0),

	gsSPEndDisplayList()
};
/********************************************************************************/
/*																				*/
/*	Mask plane																	*/
/*																				*/
/********************************************************************************/

static Vtx Vtx_MaskPlane[] = {
	{  -160,  120, 0, 0,0, 0, 0,127,0, 128 },
	{  -160, -120, 0, 0,0, 0, 0,127,0, 128 },
	{   160, -120, 0, 0,0, 0, 0,127,0, 128 },
	{   160,  120, 0, 0,0, 0, 0,127,0, 128 }
};

Gfx Gfx_MaskPlane[] = {
	gsDPSetCycleType(G_CYC_1CYCLE),
	gsDPSetRenderMode (G_RM_AA_XLU_SURF, G_RM_AA_XLU_SURF2),
	gsDPSetCombineMode(G_CC_FADER, G_CC_FADER),

	gsSPMatrix	 (&IdentMatrix, G_MTX_MODELVIEW|G_MTX_LOAD|G_MTX_NOPUSH),
	gsSPVertex	 (Vtx_MaskPlane, 4, 0),
	gsSP1Triangle(0, 1, 2, 0),
	gsSP1Triangle(0, 2, 3, 0),

	gsSPEndDisplayList()
};
/********************************************************************************/
/*																				*/
/*	Leaf data.																	*/
/*																				*/
/********************************************************************************/

static Vtx Vtx_Leaf[] = {
	{ -120, -120, 0,  0,   0<<5, 15<<5,	255, 255, 255, 255 },
	{  120, -120, 0,  0,  15<<5, 15<<5,	255, 255, 255, 255 },
	{  120,  120, 0,  0,  15<<5,  0<<5,	255, 255, 255, 255 },
	{ -120,  120, 0,  0,   0<<5,  0<<5,	255, 255, 255, 255 },
};
static unsigned short LeafTexture[] = {
    0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  
    0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0483,  0x0483,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  
    0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0483,  0x03c1,  0x0401,  0x0483,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  
    0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0c85,  0x03c1,  0x0403,  0x0441,  0x0403,  0x0cc3,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  
    0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0c85,  0x0383,  0x0403,  0x0443,  0x0483,  0x0443,  0x0c03,  0x1d09,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  
    0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0381,  0x0c03,  0x0443,  0x0443,  0x0483,  0x0503,  0x0443,  0x0c85,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  
    0x0b42,  0x0b42,  0x0b42,  0x0c85,  0x03c3,  0x0483,  0x04c3,  0x0483,  0x0483,  0x0543,  0x0503,  0x0483,  0x0c85,  0x0b42,  0x0b42,  0x0b42,  
    0x0b42,  0x0b42,  0x0b42,  0x0b43,  0x0483,  0x0543,  0x0583,  0x04c3,  0x0483,  0x0543,  0x0583,  0x0543,  0x0403,  0x0b42,  0x0b42,  0x0b42,  
    0x0b42,  0x0b42,  0x0b42,  0x0383,  0x0503,  0x05c3,  0x05c5,  0x04c3,  0x0483,  0x0503,  0x0583,  0x0583,  0x0443,  0x0b42,  0x0b42,  0x0b42,  
    0x0b42,  0x0b42,  0x0b42,  0x0bc3,  0x0583,  0x05c5,  0x05c3,  0x0483,  0x0403,  0x0503,  0x0543,  0x0583,  0x0483,  0x0b42,  0x0b42,  0x0b42,  
    0x0b42,  0x0b42,  0x0b42,  0x0bc5,  0x0503,  0x05c5,  0x0543,  0x04c3,  0x03c3,  0x04c3,  0x0543,  0x0543,  0x0c85,  0x0b42,  0x0b42,  0x0b42,  
    0x0b42,  0x0b42,  0x0b42,  0x0b43,  0x0403,  0x0503,  0x04c3,  0x0403,  0x0383,  0x0483,  0x04c3,  0x0c43,  0x1407,  0x0b42,  0x0b42,  0x0b42,  
    0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0341,  0x0381,  0x03c1,  0x03c3,  0x0383,  0x0401,  0x03c1,  0x0b85,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  
    0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0281,  0x02c1,  0x0301,  0x0343,  0x02c1,  0x0ac3,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  
    0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x02c1,  0x02c1,  0x02c1,  0x02c1,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  
    0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  0x0b42,  
};
Gfx Gfx_Leaf[] = {
	gsDPPipeSync(),
	gsSPClearGeometryMode(G_LIGHTING | G_CULL_BACK),
	gsDPSetRenderMode (G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2),
	gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
	gsSPTexture(0xffff, 0xffff, 0, G_TX_RENDERTILE, G_ON),

    gsDPLoadTextureBlock(LeafTexture, G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 16, 0,
				G_TX_CLAMP|G_TX_NOMIRROR, G_TX_CLAMP|G_TX_NOMIRROR,
				4, 4, G_TX_NOLOD, G_TX_NOLOD
	),
	gsSPVertex(&Vtx_Leaf[0], 4, 0),
	gsSP2Triangles(0, 1, 2, 0,    0, 2, 3, 0),

    gsSPTexture		   (0xffff, 0xffff, 0, G_TX_RENDERTILE, G_OFF),
	gsSPSetGeometryMode(G_LIGHTING | G_CULL_BACK),
	gsSPEndDisplayList()
};
/********************************************************************************/
/*																				*/
/*	Begin kanji																	*/
/*																				*/
/********************************************************************************/

Gfx Gfx_BeginKanji[] = {
    gsDPPipeSync	   (),
    gsDPSetTexturePersp(G_TP_NONE),
	gsDPSetTextureFilter(G_TF_BILERP),
//	gsDPSetTextureFilter(G_TF_POINT),
	gsDPSetEnvColor(255,255,255,255),

	gsSPTexture		  (0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON),
	gsDPSetCombineMode(G_CC_INTENVCOL, G_CC_INTENVCOL),
	gsDPSetRenderMode (G_RM_XLU_SURF, G_RM_XLU_SURF2),
	gsSPEndDisplayList()
};
/********************************************************************************/
/*																				*/
/*	End kanji																	*/
/*																				*/
/********************************************************************************/

Gfx Gfx_EndKanji[] = {
	gsDPPipeSync	   (),
	gsDPSetTexturePersp(G_TP_PERSP),
	gsDPSetTextureFilter(G_TF_BILERP),
	gsSPTexture		   (0xffff, 0xffff, 0, 0, G_OFF),
	gsSPEndDisplayList()
};
/********************************************************************************/
/*																				*/
/*	Begin message window  														*/
/*																				*/
/********************************************************************************/

Gfx Gfx_BeginWindow[] = {
	gsDPPipeSync(),
    gsDPSetTexturePersp(G_TP_NONE),
	gsDPSetTextureFilter(G_TF_POINT),

	gsDPSetPrimColor(0,0,0,0,0,180),
	gsDPSetRenderMode(G_RM_AA_XLU_SURF, G_RM_AA_XLU_SURF2),
	gsDPSetCombineMode(G_CC_PRIMITIVE, G_CC_PRIMITIVE),
	gsSPEndDisplayList() 
};

/********************************************************************************/
/*																				*/
/*	End message window															*/
/*																				*/
/********************************************************************************/

Gfx Gfx_EndWindow[] = {
	gsDPPipeSync(),
    gsDPSetTexturePersp(G_TP_PERSP),
    gsDPSetTextureFilter(G_TF_BILERP),
	gsSPEndDisplayList() 
};