rdpvector.h 4.44 KB
/**************************************************************************
 *                                                                        *
 *               Copyright (C) 1995, 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.  *
 *                                                                        *
 *************************************************************************/

/*
 * File:	rdpvector.h
 * Creator:	hal@sgi.com
 * Create Date:	Tue Sep 26 14:01:01 PDT 1995
 * Purpose:	Declarations & definitions common across all test modules
 *
 */

/*
 * A separate set of files should be modified when producing display lists for
 * per module testing (e.g. cs.h, cs.c, cs_static.c).  A template display list
 * test has been provided; some real gfx dl's are provided as samples in the ms
 * test series.
 *
 * TO ADD A TEST CASE:
 *
 * decide which module your test will focus on, then:
 *
 * <module_name>.h		- extern the static display list, so that it is
 *				  visible from <module_name>_static.c
 *
 * <module_name>_static.c	- add the static display list for the test.
 *
 * <module_name>.c		- add the procedure to be called to
 *				  perform the test case. (also put it
 *				  in the testCaseProc table appropriate for
 *				  this module)
 *
 *				- put the static display list pointer
 *				  in the testList table (appropriately named
 *				  for your module under test) as a Gfx pointer 
 *				  in the GfxTest_t struct; also provide a name
 *				  for your test so that the rdpascii2rdp tool
 *				  can provide a filename for the resulting
 *				  binary .rdp file.
 *
 * plus any new textures, include files, etc.
 *
 */

#define	STATIC_SEGMENT		1
#define	DYNAMIC_SEGMENT		2
#define	TEXTURE_SEGMENT		3

#define	MAX_STATIC_GFX_SIZE	256
#define	MAX_GRAPHICS_SIZE	1024

#define	SCREEN_HT	240
#define	SCREEN_WD	320

#define	STACKSIZE	0x2000

#define	APP_ZBUFFER	0x00280000

/*
 * ifdef needed because this file is included by "spec"
 */
#ifdef _LANGUAGE_C

#define PRINTF osSyncPrintf

/*
 * Layout of our dynamic segment
 */
typedef struct {
	Mtx	projection;
	Mtx	modeling;
	Mtx	viewing;
        Mtx     identity;
	Mtx	torus;
	Gfx	glist[MAX_GRAPHICS_SIZE];
	LookAt	lookat[10];
	Hilite	hilite[10];
	u16	perspNorm;
} Dynamic;

extern unsigned short	zbuffer[];

extern unsigned short cfb_16_a[];
extern unsigned short cfb_16_b[];

extern Dynamic	dynamic;

extern Gfx	rspinit_dl[];
extern Gfx	rdpinit_dl[];
extern Gfx	clear_16fb_z[];
extern Gfx	clear_32fb_z[];
extern Gfx	clear_16fb[];
extern Gfx	clear_32fb[];
extern Gfx 	regression_viewport[];
extern Gfx 	bigscreen_viewport[];

typedef void (*CaseProc_t)(Dynamic *, Gfx *);

typedef struct {
    Gfx	*gfx_dl; 		/* A pointer to the test's static (gfx) DL */
    char testname[80];		/* this becomes the filename for the rdp dl */
    CaseProc_t toplevel_dl;	/* A pointer to the tests's top level DL */
    int	cfb_pixSize;		/* G_IM_SIZ_16b or G_IM_SIZ_32b */
} GfxTest_t;

typedef struct {
	int		testListCount; /* number of tests for this module */
	GfxTest_t	*gfxTests;      /* ptr to this module's dl's */
} ModuleTest_t;

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

extern GfxTest_t testList_cs[];	/* list of per module Gfx display list tests */
extern GfxTest_t testList_ew[];	/* list of per module Gfx display list tests */
extern GfxTest_t testList_st[];	/* list of per module Gfx display list tests */
extern GfxTest_t testList_tm[];	/* list of per module Gfx display list tests */
extern GfxTest_t testList_tc[];	/* list of per module Gfx display list tests */
extern GfxTest_t testList_tf[];	/* list of per module Gfx display list tests */
extern GfxTest_t testList_cc[];	/* list of per module Gfx display list tests */
extern GfxTest_t testList_bl[];	/* list of per module Gfx display list tests */
extern GfxTest_t testList_ms[];	/* list of per module Gfx display list tests */

#endif	/* _LANGUAGE_C */

#define CS_MODULE	0
#define EW_MODULE	1
#define ST_MODULE	2
#define TM_MODULE	3
#define TC_MODULE	4
#define TF_MODULE	5
#define CC_MODULE	6
#define BL_MODULE	7
#define MS_MODULE	8

#define MODULE_COUNT	9