Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
mbi.h
Go to the documentation of this file.
1 #ifndef _MBI_H_
2 #define _MBI_H_
3 
4 /**************************************************************************
5  * *
6  * Copyright (C) 1994, Silicon Graphics, Inc. *
7  * *
8  * These coded instructions, statements, and computer programs contain *
9  * unpublished proprietary information of Silicon Graphics, Inc., and *
10  * are protected by Federal copyright law. They may not be disclosed *
11  * to third parties or copied or duplicated in any form, in whole or *
12  * in part, without the prior written consent of Silicon Graphics, Inc. *
13  * *
14  **************************************************************************/
15 
16 /**************************************************************************
17  *
18  * $Revision: 1.136 $
19  * $Date: 1999/01/05 13:04:00 $
20  * $Source: /hosts/gate3/exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/mbi.h,v $
21  *
22  **************************************************************************/
23 
24 /*
25  * Header file for the Media Binary Interface
26  *
27  * NOTE: This file is included by the RSP microcode, so any C-specific
28  * constructs must be bracketed by #ifdef _LANGUAGE_C
29  *
30  */
31 
32 
33 /*
34  * the SHIFT macros are used to build display list commands, inserting
35  * bit-fields into a 32-bit word. They take a value, a shift amount,
36  * and a width.
37  *
38  * For the left shift, the lower bits of the value are masked,
39  * then shifted left.
40  *
41  * For the right shift, the value is shifted right, then the lower bits
42  * are masked.
43  *
44  * (NOTE: _SHIFTL(v, 0, 32) won't work, just use an assignment)
45  *
46  */
47 #define _SHIFTL(v, s, w) \
48  ((unsigned int) (((unsigned int)(v) & ((0x01 << (w)) - 1)) << (s)))
49 #define _SHIFTR(v, s, w) \
50  ((unsigned int)(((unsigned int)(v) >> (s)) & ((0x01 << (w)) - 1)))
51 
52 #define _SHIFT _SHIFTL /* old, for compatibility only */
53 
54 #define G_ON (1)
55 #define G_OFF (0)
56 
57 /**************************************************************************
58  *
59  * Graphics Binary Interface
60  *
61  **************************************************************************/
62 
63 #ifdef F3D_OLD
64 #include <PR/gbi_old.h>
65 #else
66 #include <PR/gbi.h>
67 #endif
68 
69 /**************************************************************************
70  *
71  * Audio Binary Interface
72  *
73  **************************************************************************/
74 
75 #include <PR/abi.h>
76 
77 /**************************************************************************
78  *
79  * Task list
80  *
81  **************************************************************************/
82 
83 #define M_GFXTASK 1
84 #define M_AUDTASK 2
85 #define M_VIDTASK 3
86 #define M_HVQTASK 6
87 #define M_HVQMTASK 7
88 
89 /**************************************************************************
90  *
91  * Segment macros and definitions
92  *
93  **************************************************************************/
94 
95 #define NUM_SEGMENTS (16)
96 #define SEGMENT_OFFSET(a) ((unsigned int)(a) & 0x00ffffff)
97 #define SEGMENT_NUMBER(a) (((unsigned int)(a) << 4) >> 28)
98 #define SEGMENT_ADDR(num, off) (((num) << 24) + (off))
99 
100 #ifndef NULL
101 #define NULL 0
102 #endif
103 
104 #endif /* !_MBI_H_ */