perf.h 4.28 KB
/**************************************************************************
 *                                                                        *
 *               Copyright (C) 1994, Silicon Graphics, Inc.               *
 *                                                                        *
 *  These coded instructions, statements, and computer programs  contain  *
 *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
 *  are protected by Federal copyright  law.  They  may not be disclosed  *
 *  to  third  parties  or copied or duplicated in any form, in whole or  *
 *  in part, without the prior written consent of Silicon Graphics, Inc.  *
 *                                                                        *
 *************************************************************************/

#define	STATIC_SEGMENT		     1
#define	DYNAMIC_SEGMENT		     2

#define	MAX_STATIC_GFX_SIZE	   256

#define	SCREEN_HT	           240
#define	SCREEN_WD	           320

#define	STACKSIZE               0x4000

#if 0
#define MRDPBUFF                307299
#define MAXGLIST                 12800
#define MAXTRI                      10

#else

#define MRDPBUFF                 65536
#define MAXGLIST                253000 /* 385000 */
#define MAXTRI                      10
#endif

#define RDRAM                        1
#define XBUS                         0

#ifdef _LANGUAGE_C

extern float TICKSPERSEC;

extern unsigned short RGBA16cbar[];


typedef struct {
	Mtx	projection;
	Mtx	modeling;
        Vtx     border[4];
	Vtx	v[MAXTRI * 3];
	Gfx	glist[MAXGLIST];
} Dynamic;

extern Gfx	*glistp;	/* global for test case procs */

extern unsigned short cfb_16_a[];
extern unsigned short zbuffer[];

extern unsigned int foobarblech;

extern int verbose;
extern int rdp_DRAM_io;
extern int OutputRSP;
extern int OutputRDP;
extern int OutputMEM;
extern int debugger;
extern int verbose;
extern int timing; 
extern int TestKind;
extern int TestKind; 
extern int TestFuncNum;
extern int FrameRate; 
extern int HangAfterDump;
extern int UseSmallTri;
extern int LoopTestFuncNum;
extern int UseAAMode;
extern int UseZMode;
extern int ClearScreen;
extern int ClearZBuffer;

extern u32 dummy_val;

#define V(p, x, y, z, f, s, t, r, g, b, a) {				\
        (p)->v.ob[0] = (x);						\
        (p)->v.ob[1] = (y);						\
	(p)->v.ob[2] = (z);						\
	(p)->v.flag  = (f);						\
	(p)->v.tc[0] = (s);						\
	(p)->v.tc[1] = (t);						\
	(p)->v.cn[0] = (r);						\
	(p)->v.cn[1] = (g);						\
	(p)->v.cn[2] = (b);						\
	(p)->v.cn[3] = (a);						\
}

typedef struct 
{
  void (*TestFunctionPtr)(Dynamic *);
  void (*TestPrintPtr)(OSTime);
  void (*ControllerFunc)(void);
  u32  ClearGeometryMode;
  u32  SetGeometryMode;
} TestStruct;

#define R(y) (xrand()%(y))

#define BORDER 200
	   
extern int      cfb_size;
extern void     *cfb_ptrs[1];

extern int	current;
extern int      framecount;

extern OSMesgQueue     dmaMessageQ, rspMessageQ, rdpMessageQ, retraceMessageQ;
extern OSMesg          dmaMessageBuf, rspMessageBuf, rdpMessageBuf, retraceMessageBuf;
extern OSMesg          dummyMessage;
extern OSIoMesg        dmaIOMessageBuf;

extern char		*staticSegment;
extern OSMesg		dummyMesg;
extern OSTask		*tlistp;
extern Dynamic		*dynamicp;

extern char _codeSegmentEnd[];
extern char _dynamicSegmentEnd[];

/* these are fixed sizes: */
#define SP_UCODE_SIZE           4096
#define SP_UCODE_DATA_SIZE      2048

/*
 * Symbols generated by "makerom" to tell us where the static segment is
 * in ROM.
 */
extern char _staticSegmentRomStart[], _staticSegmentRomEnd[];

extern OSTask    tlist[2];       /* globaltask lists */
extern Gfx	 *glistp;	 /* global for test case procs */

extern Dynamic	dynamicBuffer[1];

extern u64	dram_yield[OS_YIELD_DATA_SIZE/sizeof(u64)];
extern unsigned long long int dram_stack[SP_DRAM_STACK_SIZE64];

extern u64      rdp_output_len;
extern u64	rdp_output[];	

#define DEFAULTCLEARMODE G_SHADE|G_LIGHTING|G_SHADING_SMOOTH|G_ZBUFFER|G_TEXTURE_GEN|G_FOG|G_LOD|G_CULL_BOTH

void CreateMessageQueues(void);
void DMAStaticSegment(void);
void SetupViSwapBuffer(void);
void CreateTaskStructure(void);
void SetupSegments(void);
void clearFrameBuffer(void);
void clearZBuffer(int);
void rdpInit(void);
void rspInit(Dynamic *, Vtx *, TestStruct *);

void doRDP(void *);
void doRSP(void *);
void doMonkey(void *);

#endif	/* _LANGUAGE_C */