viint.h
6.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#ifndef _VIINT_H_
#define _VIINT_H_
/*====================================================================
* viint.h
*
* Copyright 1995, Silicon Graphics, Inc.
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
* Inc.; the contents of this file may not be disclosed to third
* parties, copied or duplicated in any form, in whole or in part,
* without the prior written permission of Silicon Graphics, Inc.
*
* RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights
* in Technical Data and Computer Software clause at DFARS
* 252.227-7013, and/or in similar or successor clauses in the FAR,
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
* Copyright Laws of the United States.
*====================================================================*/
/**************************************************************************
*
* $Revision: 1.1.1.2 $
* $Date: 2002/10/29 08:06:43 $
* $Source: /root/leakn64/depot/rf/sw/bbplayer/libultra/include/viint.h,v $
*
* Description:
* This file contains defines and structures used internally in the VI
* APIs.
*
**************************************************************************/
#ifdef _LANGUAGE_C_PLUS_PLUS
extern "C" {
#endif
#ifdef _LANGUAGE_C
/**************************************************************************
* Video mode definitions
*
* Use 5 bits to uniquely define a mode
*
* video format
* | resolution
* | | pixel size
* | | | antialiasing(aa)/point-sampling(ps)
* | | | | interlace
* mode | | | | |
* --------- - - - - -
* vi_ntsc_lpn1 ntsc lo 16 ps non-interlace
* vi_ntsc_lpf1 ntsc lo 16 ps interlace
* vi_ntsc_lan1 ntsc lo 16 aa non-interlace
* vi_ntsc_laf1 ntsc lo 16 aa interlace
* vi_ntsc_lpn2 ntsc lo 32 ps non-interlace
* vi_ntsc_lpf2 ntsc lo 32 ps interlace
* vi_ntsc_lan2 ntsc lo 32 aa non-interlace
* vi_ntsc_laf2 ntsc lo 32 aa interlace
* vi_ntsc_hpn1 ntsc hi 16 ps normal interlace
* vi_ntsc_hpf1 ntsc hi 16 ps deflickered interlace
* vi_ntsc_han1 ntsc hi 16 aa normal interlace
* vi_ntsc_haf1 ntsc hi 16 aa deflickered interlace
* vi_ntsc_hpn2 ntsc hi 32 ps normal interlace
* vi_ntsc_hpf2 ntsc hi 32 ps deflickered interlace
*
* vi_pal_lpn1 pal lo 16 ps non-interlace
* vi_pal_lpf1 pal lo 16 ps interlace
* vi_pal_lan1 pal lo 16 aa non-interlace
* vi_pal_laf1 pal lo 16 aa interlace
* vi_pal_lpn2 pal lo 32 ps non-interlace
* vi_pal_lpf2 pal lo 32 ps interlace
* vi_pal_lan2 pal lo 32 aa non-interlace
* vi_pal_laf2 pal lo 32 aa interlace
* vi_pal_hpn1 pal hi 16 ps normal interlace
* vi_pal_hpf1 pal hi 16 ps deflickered interlace
* vi_pal_han1 pal hi 16 aa normal interlace
* vi_pal_haf1 pal hi 16 aa deflickered interlace
* vi_pal_hpn2 pal hi 32 ps normal interlace
* vi_pal_hpf2 pal hi 32 ps deflickered interlace
*
* Bit 0: non-interlace (lores)
* Bit 1: interlace (lores)
* Bit 2: normal interlace (hires)
* Bit 3: deflickered interlace (hires)
* Bit 4: antialiasing (aa)
* Bit 5: point-sampling (ps)
* Bit 6: 16-bit pixel size
* Bit 7: 32-bit pixel size
* Bit 8: low resolution
* Bit 9: high resolution
* Bit 10: NTSC video format
* Bit 11: PAL video format
*
**************************************************************************/
#define VI_FIELD1 0
#define VI_FIELD2 1
/**************************************************************************
* VI internal states
*/
#define VI_STATE_NORMAL 0x00
#define VI_STATE_MODE 0x01
#define VI_STATE_X_SCALE 0x02
#define VI_STATE_Y_SCALE 0x04
#define VI_STATE_CONTROL 0x08
#define VI_STATE_FRAME 0x10
#define VI_STATE_BLACK 0x20
#define VI_STATE_REPEAT_LINE 0x40
#define VI_STATE_FADE 0x80
/**************************************************************************
* Structure to hold scaling value (x, y)
*/
typedef struct {
f32 factor; /* Scaling factor 0.0 <= x <= 1.0 */
u16 offset; /* Result origin offset (16-bit) */
u32 scale; /* Result scale (12-bit) */
} __OSViScale;
/**************************************************************************
* Structure for VI context
*/
typedef struct {
u16 state; /* internal state */
u16 retraceCount; /* Number of retrace before get msg */
void *framep; /* pointer to frame buffer */
OSViMode *modep; /* pointer to standard mode struct */
u32 control; /* VI control value */
OSMesgQueue *msgq; /* Application message queue */
OSMesg msg; /* Application message */
__OSViScale x; /* X-scaling */
__OSViScale y; /* Y-scaling */
} __OSViContext;
/**************************************************************************
*
* Extern global variables
*
*/
extern OSDevMgr __osViDevMgr;
extern __OSViContext *__osViCurr;
extern __OSViContext *__osViNext;
extern u32 __additional_scanline;
/**************************************************************************
*
* Function prototypes
*
*/
extern void __osViCreateAccessQueue(void);
extern OSMesgQueue *__osViGetAccessQueue(void);
extern void __osViGetAccess(void);
extern void __osViRelAccess(void);
extern void __osViInit(void);
extern __OSViContext *__osViGetCurrentContext(void);
extern __OSViContext *__osViGetNextContext(void);
extern void __osViSwapContext(void);
#endif /* _LANGUAGE_C */
#ifdef _LANGUAGE_C_PLUS_PLUS
}
#endif
#endif /* _VIINT_H_ */