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