Mario Kart 64
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 #include <PR/gbi.h>
64 
65 /**************************************************************************
66  *
67  * Audio Binary Interface
68  *
69  **************************************************************************/
70 
71 #include <PR/abi.h>
72 
73 /**************************************************************************
74  *
75  * Task list
76  *
77  **************************************************************************/
78 
79 #define M_GFXTASK 1
80 #define M_AUDTASK 2
81 #define M_VIDTASK 3
82 #define M_HVQTASK 6
83 #define M_HVQMTASK 7
84 
85 /**************************************************************************
86  *
87  * Segment macros and definitions
88  *
89  **************************************************************************/
90 
91 #define NUM_SEGMENTS (16)
92 #define SEGMENT_OFFSET(a) ((unsigned int)(a) & 0x00ffffff)
93 #define SEGMENT_NUMBER(a) (((unsigned int)(a) << 4) >> 28)
94 #define SEGMENT_NUMBER2(a) ((unsigned int)(a) >> 24)
95 #define SEGMENT_ADDR(num, off) (((num) << 24) + (off))
96 
97 #ifndef NULL
98 #define NULL 0
99 #endif
100 
101 #endif /* !_MBI_H_ */