trivial.h 1.87 KB
/*
 * Header file for 'trivial' program
 *
 * Included by: trivial.c; static.c; cfb.c; zbuf.c; spec
 *
 * This file #include's <ultra64.h> as soon as it gets past the
 * stuff which has to be used by the spec file
 *
 */

#ifndef __TRIVIAL_H__
#define __TRIVIAL_H__

/*
 * Do #define's required by the 'spec' file first.  The spec file
 * does not agree well with C code.
 */

/*
 * Define stack size for R4300 threads
 * This definition is in a header file because it is required by both
 * trivial.c (for declaring the stacks), and by the spec file for
 * indicating the top of the stack.
 *
 */

/* Stacksize in bytes */
#define STACKSIZE 0x2000

/*
 * Define RSP segment numbers
 * These definitions are required both by the 'spec' file, and by the
 * code in 'trivial.c' which sets up the RSP segment table.
 */

#define STATIC_SEG  1
#define DYNAMIC_SEG 2

/* Now do the stuff only required by .c files */
#ifdef _LANGUAGE_C

#include <ultra64.h>

/*
 * Define screensize.
 * This definition is in a header file because it is required by the
 * cfb.c and zbuf.c files, as well as the trivial.c and static.c files.
 * Note that changing these variables is not sufficient to change the
 * screen size -- the video modes must be changed as well in trivial.c,
 * and probably some of the init stuff in static.c.
 */

#define SCREEN_HT 240
#define SCREEN_WD 320

/*
 * Define dynamic data structure
 * This definition is required both by 'trivial.c' and by 'dynamic.c'
 * The R4300 addressible version (and the one that reserves physical memory)
 * is defined in trivial.c.  The RSP addressible version is defined in
 * dynamic.c
 */

#define GLIST_SIZE 2048
typedef struct {
  Mtx projection;
  Mtx modeling;
  Mtx increment;  
  Gfx glist[GLIST_SIZE];
  /* Could devine verticies here too, but don't need them yet */
} Dynamic;

extern u64 rspdrambuf1[];


#endif  /* _LANGUAGE_C */

#endif  /* __TRIVIAL_H__ */