KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
pvr_header.h
Go to the documentation of this file.
1/* KallistiOS ##version##
2
3 dc/pvr/pvr_header.h
4 Copyright (C) 2025 Paul Cercueil
5*/
6
7/** \file dc/pvr/pvr_header.h
8 \brief Polygon/Sprite header definitions
9 \ingroup pvr
10
11 \author Paul Cercueil
12*/
13
14#ifndef __DC_PVR_PVR_HEADER_H
15#define __DC_PVR_PVR_HEADER_H
16
17#include <stdalign.h>
18#include <stdint.h>
19#include <stdio.h>
20
21#include <kos/cdefs.h>
22__BEGIN_DECLS
23
24#include <dc/pvr/pvr_regs.h>
25
26/** \defgroup pvr_primitives_headers Headers
27 \brief Structs relative to PVR headers
28 \ingroup pvr_primitives
29 \headerfile dc/pvr/pvr_header.h
30
31 @{
32*/
33
34/** \brief Vertex color formats
35
36 These control how colors are represented in polygon data.
37*/
38typedef enum pvr_color_fmts {
39 PVR_CLRFMT_ARGBPACKED, /**< 32-bit integer ARGB */
40 PVR_CLRFMT_4FLOATS, /**< 4 floating point values */
41 PVR_CLRFMT_INTENSITY, /**< Intensity color */
42 PVR_CLRFMT_INTENSITY_PREV, /**< Use last intensity */
44
45/** \brief Primitive clipping modes
46
47 These control how primitives are clipped against the user clipping area.
48*/
49typedef enum pvr_clip_mode {
50 PVR_USERCLIP_DISABLE = 0, /**< Disable clipping */
51 PVR_USERCLIP_INSIDE = 2, /**< Enable clipping inside area */
52 PVR_USERCLIP_OUTSIDE = 3, /**< Enable clipping outside area */
54
55/** \brief PVR rendering lists
56
57 Each primitive submitted to the PVR must be placed in one of these lists,
58 depending on its characteristics.
59*/
60typedef enum pvr_list_type {
61 PVR_LIST_OP_POLY, /**< Opaque polygon list */
62 PVR_LIST_OP_MOD, /**< Opaque modifier list */
63 PVR_LIST_TR_POLY, /**< Translucent polygon list */
64 PVR_LIST_TR_MOD, /**< Translucent modifier list */
65 PVR_LIST_PT_POLY, /**< Punch-thru polygon list */
66 PVR_LIST_NONE = -1 /**< Used internally to signal unset values */
68
69#define pvr_list_type_t pvr_list_t
70
71/** \brief Primitive culling modes
72
73 These culling modes can be set by polygons to determine when they are
74 culled. They work pretty much as you'd expect them to if you've ever used
75 any 3D hardware before.
76*/
77typedef enum pvr_cull_mode {
78 PVR_CULLING_NONE, /**< Disable culling */
79 PVR_CULLING_SMALL, /**< Cull if small */
80 PVR_CULLING_CCW, /**< Cull if counterclockwise */
81 PVR_CULLING_CW, /**< Cull if clockwise */
83
84/** \brief Depth comparison modes
85
86 These set the depth function used for comparisons.
87*/
88typedef enum pvr_depthcmp_mode {
89 PVR_DEPTHCMP_NEVER, /**< Never pass */
90 PVR_DEPTHCMP_LESS, /**< Less than */
91 PVR_DEPTHCMP_EQUAL, /**< Equal to */
92 PVR_DEPTHCMP_LEQUAL, /**< Less than or equal to */
93 PVR_DEPTHCMP_GREATER, /**< Greater than */
94 PVR_DEPTHCMP_NOTEQUAL, /**< Not equal to */
95 PVR_DEPTHCMP_GEQUAL, /**< Greater than or equal to */
96 PVR_DEPTHCMP_ALWAYS, /**< Always pass */
98
99/** \brief Texture U/V size */
110
111/** \brief Texture color calculation modes.
112
113 The shading mode specifies how the pixel value used as the "foreground" or
114 "source" for blending is computed.
115
116 Here, "tex" represents the pixel value from the texture, and "col"
117 represents the pixel value from the polygon's color. RGB() represents the
118 color channels, A() represents the alpha channel, and ARGB() represents the
119 whole pixel (color + alpha).
120
121 Note that the offset color (aka. oargb), if specular lighting is enabled,
122 is added to the result. Its alpha channel is ignored.
123*/
124typedef enum pvr_txr_shading_mode {
125 PVR_TXRENV_REPLACE, /**< px = ARGB(tex) */
126 PVR_TXRENV_MODULATE, /**< px = A(tex) + RGB(col) * RGB(tex) */
127 PVR_TXRENV_DECAL, /**< px = A(col) + RGB(tex) * A(tex) + RGB(col) * (1 - A(tex)) */
128 PVR_TXRENV_MODULATEALPHA, /**< px = ARGB(col) * ARGB(tex) */
130
131/** \brief Texture sampling modes */
132typedef enum pvr_filter_mode {
133 PVR_FILTER_NEAREST, /**< No filtering (point sample) */
134 PVR_FILTER_BILINEAR, /**< Bilinear interpolation */
135 PVR_FILTER_TRILINEAR1, /**< Trilinear interpolation pass 1 */
136 PVR_FILTER_TRILINEAR2, /**< Trilinear interpolation pass 2 */
139
140/** \brief Fog modes
141
142 Each polygon can decide what fog type is used by specifying the fog mode
143 in its header.
144*/
145typedef enum pvr_fog_type {
146 PVR_FOG_TABLE, /**< Table fog */
147 PVR_FOG_VERTEX, /**< Vertex fog */
148 PVR_FOG_DISABLE, /**< Disable fog */
149 PVR_FOG_TABLE2, /**< Table fog mode 2 */
151
152/** \brief Blending modes
153
154 These are all the blending modes that can be done with regard to alpha
155 blending on the PVR.
156*/
157typedef enum pvr_blend_mode {
158 PVR_BLEND_ZERO, /**< None of this color */
159 PVR_BLEND_ONE, /**< All of this color */
160 PVR_BLEND_DESTCOLOR, /**< Destination color */
161 PVR_BLEND_INVDESTCOLOR, /**< Inverse of destination color */
162 PVR_BLEND_SRCALPHA, /**< Blend with source alpha */
163 PVR_BLEND_INVSRCALPHA, /**< Blend with inverse source alpha */
164 PVR_BLEND_DESTALPHA, /**< Blend with destination alpha */
165 PVR_BLEND_INVDESTALPHA, /**< Blend with inverse destination alpha */
167
168/** \brief Texture formats
169
170 These are the texture formats that the PVR supports.
171*/
172typedef enum pvr_pixel_mode {
173 PVR_PIXEL_MODE_ARGB1555, /**< 16-bit ARGB1555 */
174 PVR_PIXEL_MODE_RGB565, /**< 16-bit RGB565 */
175 PVR_PIXEL_MODE_ARGB4444, /**< 16-bit ARGB4444 */
176 PVR_PIXEL_MODE_YUV422, /**< YUV422 format */
177 PVR_PIXEL_MODE_BUMP, /**< Bumpmap format */
178 PVR_PIXEL_MODE_PAL_4BPP, /**< 4BPP paletted format */
179 PVR_PIXEL_MODE_PAL_8BPP, /**< 8BPP paletted format */
181
182/** \brief Triangle strip length
183
184 This sets the maximum number of triangles the TA stores per strip piece.
185 Longer strips are split into pieces of at most this many triangles, each
186 with its own copy of the header in the vertex buffer and its own entry in
187 the object lists. Longer pieces use less vertex buffer memory for long
188 triangle strips.
189*/
196
197/** \brief Polygon header type
198
199 This enum contains the possible PVR header types.
200*/
208
209/** \brief Texture address
210
211 This type represents an address of a texture in VRAM,
212 pre-processed to be used in headers.
213*/
214typedef uint32_t pvr_txr_ptr_t;
215
216/** \brief Get texture address from VRAM address
217
218 This function can be used to get a texture address that can be used
219 in a PVR header from the texture's VRAM address.
220
221 \param addr The texture's address in VRAM
222 \return The pre-processed texture address
223*/
225 return ((uint32_t)addr & (PVR_RAM_SIZE - 1)) >> 3;
226}
227
228/** \brief Get texture address form VRAM address
229
230 Alias macro for to_pvr_txr_ptr().
231*/
232#define pvr_to_pvr_txr_ptr(addr) to_pvr_txr_ptr(addr)
233
234/** \brief PVR header command
235
236 This structure contains all the fields for the command of PVR headers.
237*/
238typedef struct pvr_poly_hdr_cmd {
239 bool uvfmt_f16 :1; /* 0 */ /**< Use 16-bit floating-point U/Vs */
240 bool gouraud :1; /* 1 */ /**< Enable gouraud shading */
241 bool oargb_en :1; /* 2 */ /**< Enable specular lighting */
242 bool txr_en :1; /* 3 */ /**< Enable texturing */
243 pvr_color_fmts_t color_fmt :2; /* 5-4 */ /**< Select color encoding */
244 bool mod_normal :1; /* 6 */ /**< true: normal, false: cheap shadow */
245 bool modifier_en :1; /* 7 */ /**< Enable modifier effects */
246 uint32_t :8; /* 15-8 */
247 pvr_clip_mode_t clip_mode :2; /* 17-16 */ /**< Clipping mode */
248 pvr_strip_len_t strip_len :2; /* 19-18 */ /**< Triangle strips length (applied when auto_strip_len/Group_En is set) */
249 uint32_t :3; /* 22-20 */
250 bool auto_strip_len :1; /* 23 */ /**< Group_En: apply this header's strip_len.
251 If unset, the previous setting stays in effect.
252 (Per spec this also gates clip_mode, but due to
253 a hardware bug clip_mode is always taken from
254 every header.) */
255 pvr_list_t list_type :3; /* 26-24 */ /**< Render list to use */
256 uint32_t :1; /* 27 */
257 bool strip_end :1; /* 28 */ /**< Mark an end-of-strip */
258 pvr_hdr_type_t hdr_type :3; /* 31-29 */ /**< Header type */
260
261/** \brief PVR header mode1
262
263 This structure contains all the fields for the mode1 parameter of
264 PVR headers.
265*/
266typedef struct pvr_poly_hdr_mode1 {
267 uint32_t :25; /* 24-0 */
268 bool txr_en :1; /* 25 */ /**< Enable texturing (2nd bit) */
269 bool depth_write_dis :1; /* 26 */ /**< Disable depth writes */
270 pvr_cull_mode_t culling :2; /* 28-27 */ /**< Culling mode */
271 pvr_depthcmp_mode_t depth_cmp :3; /* 31-29 */ /**< Depth comparison mode */
273
274/** \brief PVR header mode2
275
276 This structure contains all the fields for the mode2 parameter of
277 PVR headers.
278*/
279typedef struct pvr_poly_hdr_mode2 {
280 pvr_uv_size_t v_size :3; /* 2-0 */ /**< Texture height */
281 pvr_uv_size_t u_size :3; /* 5-3 */ /**< Texture width */
282 pvr_txr_shading_mode_t shading :2; /* 7-6 */ /**< Shading mode */
283 uint32_t mip_bias :4; /* 11-8 */ /**< Bias for mipmaps */
284 bool supersampling :1; /* 12 */ /**< Enable texture supersampling */
285 pvr_filter_mode_t filter_mode :2; /* 14-13 */ /**< Texture filtering mode */
286 bool v_clamp :1; /* 15 */ /**< Clamp V to 1.0 */
287 bool u_clamp :1; /* 16 */ /**< Clamp U to 1.0 */
288 bool v_flip :1; /* 17 */ /**< Flip V after 1.0 */
289 bool u_flip :1; /* 18 */ /**< Flip U after 1.0 */
290 bool txralpha_dis :1; /* 19 */ /**< Disable alpha channel in textures */
291 bool alpha :1; /* 20 */ /**< Enable alpha channel in vertex colors */
292 bool fog_clamp :1; /* 21 */ /**< Enable fog clamping */
293 pvr_fog_type_t fog_type :2; /* 23-22 */ /**< Select fog type */
294 bool blend_dst_acc2 :1; /* 24 */ /**< Blend to the 2nd accumulation buffer */
295 bool blend_src_acc2 :1; /* 25 */ /**< Blend from the 2nd accumulation buffer */
296 pvr_blend_mode_t blend_dst :3; /* 28-26 */ /**< Blend mode for the background */
297 pvr_blend_mode_t blend_src :3; /* 31-29 */ /**< Blend mode for the foreground */
299
300/** \brief PVR header mode3
301
302 This structure contains all the fields for the mode3 parameter of
303 PVR headers.
304*/
305typedef struct pvr_poly_hdr_mode3 {
306 pvr_txr_ptr_t txr_base :25; /* 24-0 */ /**< Pre-processed texture address */
307 bool x32stride :1; /* 25 */ /**< Set if texture stride is multiple of 32 */
308 bool nontwiddled :1; /* 26 */ /**< Set if texture is not twiddled */
309 pvr_pixel_mode_t pixel_mode :3; /* 29-27 */ /**< Select the texture's pixel format */
310 bool vq_en :1; /* 30 */ /**< Set if the texture is VQ encoded */
311 bool mipmap_en :1; /* 31 */ /**< Enable mipmaps */
313
314/** \brief PVR polygon header.
315
316 This structure contains information about how the following polygons should
317 be rendered.
318*/
319typedef __attribute__((aligned(32))) struct pvr_poly_hdr {
320 union {
321 uint32_t cmd; /**< Raw access to cmd param */
322 pvr_poly_hdr_cmd_t m0; /**< command parameters */
323 };
324 union {
325 uint32_t mode1; /**< Raw access to mode1 param */
326 pvr_poly_hdr_mode1_t m1; /**< mode1 parameters */
327 };
328 union {
329 uint32_t mode2; /**< Raw access to mode2 param */
330 uint32_t mode2_0; /**< Legacy name */
331 pvr_poly_hdr_mode2_t m2; /**< mode2 parameters (modifiers: outside volume) */
332 };
333 union {
334 uint32_t mode3; /**< Raw access to mode3 param */
335 uint32_t mode3_0; /**< Legacy name */
336 pvr_poly_hdr_mode3_t m3; /**< mode3 parameters (modifiers: outside volume) */
337 };
338 union {
339 struct {
340 /* Intensity color */
341 float a; /**< Intensity color alpha */
342 float r; /**< Intensity color red */
343 float g; /**< Intensity color green */
344 float b; /**< Intensity color blue */
345 };
346 struct {
347 /* Modifier volume */
348 union {
349 struct {
350 uint32_t mode2_1; /**< Legacy name */
351 uint32_t mode3_1; /**< Legacy name */
352 };
353 struct {
354 pvr_poly_hdr_mode2_t m2; /**< mode2 parameters (modifiers: inside volume) */
355 pvr_poly_hdr_mode3_t m3; /**< mode3 parameters (modifiers: inside volume) */
356 } modifier; /**< Modifier volume parameters */
357 };
358 };
359 struct {
360 /* Sprite */
361 uint32_t argb; /**< 32-bit ARGB vertex color for sprites */
362 uint32_t oargb; /**< 32-bit ARGB specular color for sprites */
363 };
364 struct {
365 /* User clip area */
366 uint32_t start_x; /**< Left (inclusive) border of user clip area */
367 uint32_t start_y; /**< Top (inclusive) border of user clip area */
368 uint32_t end_x; /**< Right (inclusive) border of user clip area */
369 uint32_t end_y; /**< Bottom (inclusive) border of user clip area */
370 };
371 };
373
374_Static_assert(sizeof(pvr_poly_hdr_t) == 32, "Invalid header size");
375
376/** @} */
377
378__END_DECLS
379
380#endif /* __DC_PVR_PVR_HEADER_H */
Various common macros used throughout the codebase.
#define PVR_RAM_SIZE
RAM size in bytes.
Definition pvr_regs.h:198
static pvr_txr_ptr_t to_pvr_txr_ptr(pvr_ptr_t addr)
Get texture address from VRAM address.
Definition pvr_header.h:224
pvr_txr_shading_mode_t
Texture color calculation modes.
Definition pvr_header.h:124
pvr_uv_size_t
Texture U/V size.
Definition pvr_header.h:100
pvr_pixel_mode_t
Texture formats.
Definition pvr_header.h:172
pvr_filter_mode_t
Texture sampling modes.
Definition pvr_header.h:132
pvr_cull_mode_t
Primitive culling modes.
Definition pvr_header.h:77
pvr_fog_type_t
Fog modes.
Definition pvr_header.h:145
pvr_depthcmp_mode_t
Depth comparison modes.
Definition pvr_header.h:88
pvr_color_fmts_t
Vertex color formats.
Definition pvr_header.h:38
pvr_hdr_type_t
Polygon header type.
Definition pvr_header.h:201
uint32_t pvr_txr_ptr_t
Texture address.
Definition pvr_header.h:214
pvr_strip_len_t
Triangle strip length.
Definition pvr_header.h:190
pvr_blend_mode_t
Blending modes.
Definition pvr_header.h:157
pvr_clip_mode_t
Primitive clipping modes.
Definition pvr_header.h:49
pvr_list_t
PVR rendering lists.
Definition pvr_header.h:60
@ PVR_TXRENV_MODULATE
px = A(tex) + RGB(col) * RGB(tex)
Definition pvr_header.h:126
@ PVR_TXRENV_REPLACE
px = ARGB(tex)
Definition pvr_header.h:125
@ PVR_TXRENV_MODULATEALPHA
px = ARGB(col) * ARGB(tex)
Definition pvr_header.h:128
@ PVR_TXRENV_DECAL
px = A(col) + RGB(tex) * A(tex) + RGB(col) * (1 - A(tex))
Definition pvr_header.h:127
@ PVR_UV_SIZE_64
Definition pvr_header.h:104
@ PVR_UV_SIZE_8
Definition pvr_header.h:101
@ PVR_UV_SIZE_1024
Definition pvr_header.h:108
@ PVR_UV_SIZE_128
Definition pvr_header.h:105
@ PVR_UV_SIZE_512
Definition pvr_header.h:107
@ PVR_UV_SIZE_16
Definition pvr_header.h:102
@ PVR_UV_SIZE_256
Definition pvr_header.h:106
@ PVR_UV_SIZE_32
Definition pvr_header.h:103
@ PVR_PIXEL_MODE_YUV422
YUV422 format.
Definition pvr_header.h:176
@ PVR_PIXEL_MODE_PAL_4BPP
4BPP paletted format
Definition pvr_header.h:178
@ PVR_PIXEL_MODE_BUMP
Bumpmap format.
Definition pvr_header.h:177
@ PVR_PIXEL_MODE_RGB565
16-bit RGB565
Definition pvr_header.h:174
@ PVR_PIXEL_MODE_ARGB1555
16-bit ARGB1555
Definition pvr_header.h:173
@ PVR_PIXEL_MODE_PAL_8BPP
8BPP paletted format
Definition pvr_header.h:179
@ PVR_PIXEL_MODE_ARGB4444
16-bit ARGB4444
Definition pvr_header.h:175
@ PVR_FILTER_TRILINEAR2
Trilinear interpolation pass 2.
Definition pvr_header.h:136
@ PVR_FILTER_NONE
Definition pvr_header.h:137
@ PVR_FILTER_BILINEAR
Bilinear interpolation.
Definition pvr_header.h:134
@ PVR_FILTER_NEAREST
No filtering (point sample)
Definition pvr_header.h:133
@ PVR_FILTER_TRILINEAR1
Trilinear interpolation pass 1.
Definition pvr_header.h:135
@ PVR_CULLING_CW
Cull if clockwise.
Definition pvr_header.h:81
@ PVR_CULLING_NONE
Disable culling.
Definition pvr_header.h:78
@ PVR_CULLING_SMALL
Cull if small.
Definition pvr_header.h:79
@ PVR_CULLING_CCW
Cull if counterclockwise.
Definition pvr_header.h:80
@ PVR_FOG_TABLE2
Table fog mode 2.
Definition pvr_header.h:149
@ PVR_FOG_VERTEX
Vertex fog.
Definition pvr_header.h:147
@ PVR_FOG_DISABLE
Disable fog.
Definition pvr_header.h:148
@ PVR_FOG_TABLE
Table fog.
Definition pvr_header.h:146
@ PVR_DEPTHCMP_LESS
Less than.
Definition pvr_header.h:90
@ PVR_DEPTHCMP_GEQUAL
Greater than or equal to.
Definition pvr_header.h:95
@ PVR_DEPTHCMP_GREATER
Greater than.
Definition pvr_header.h:93
@ PVR_DEPTHCMP_LEQUAL
Less than or equal to.
Definition pvr_header.h:92
@ PVR_DEPTHCMP_NOTEQUAL
Not equal to.
Definition pvr_header.h:94
@ PVR_DEPTHCMP_ALWAYS
Always pass.
Definition pvr_header.h:96
@ PVR_DEPTHCMP_EQUAL
Equal to.
Definition pvr_header.h:91
@ PVR_DEPTHCMP_NEVER
Never pass.
Definition pvr_header.h:89
@ PVR_CLRFMT_4FLOATS
4 floating point values
Definition pvr_header.h:40
@ PVR_CLRFMT_INTENSITY_PREV
Use last intensity.
Definition pvr_header.h:42
@ PVR_CLRFMT_INTENSITY
Intensity color.
Definition pvr_header.h:41
@ PVR_CLRFMT_ARGBPACKED
32-bit integer ARGB
Definition pvr_header.h:39
@ PVR_HDR_EOL
Definition pvr_header.h:202
@ PVR_HDR_OBJECT_LIST_SET
Definition pvr_header.h:204
@ PVR_HDR_SPRITE
Definition pvr_header.h:206
@ PVR_HDR_POLY
Definition pvr_header.h:205
@ PVR_HDR_USERCLIP
Definition pvr_header.h:203
@ PVR_STRIP_LEN_2
Definition pvr_header.h:192
@ PVR_STRIP_LEN_1
Definition pvr_header.h:191
@ PVR_STRIP_LEN_4
Definition pvr_header.h:193
@ PVR_STRIP_LEN_6
Definition pvr_header.h:194
@ PVR_BLEND_DESTCOLOR
Destination color.
Definition pvr_header.h:160
@ PVR_BLEND_DESTALPHA
Blend with destination alpha.
Definition pvr_header.h:164
@ PVR_BLEND_SRCALPHA
Blend with source alpha.
Definition pvr_header.h:162
@ PVR_BLEND_ZERO
None of this color.
Definition pvr_header.h:158
@ PVR_BLEND_ONE
All of this color.
Definition pvr_header.h:159
@ PVR_BLEND_INVSRCALPHA
Blend with inverse source alpha.
Definition pvr_header.h:163
@ PVR_BLEND_INVDESTCOLOR
Inverse of destination color.
Definition pvr_header.h:161
@ PVR_BLEND_INVDESTALPHA
Blend with inverse destination alpha.
Definition pvr_header.h:165
@ PVR_USERCLIP_INSIDE
Enable clipping inside area.
Definition pvr_header.h:51
@ PVR_USERCLIP_OUTSIDE
Enable clipping outside area.
Definition pvr_header.h:52
@ PVR_USERCLIP_DISABLE
Disable clipping.
Definition pvr_header.h:50
@ PVR_LIST_PT_POLY
Punch-thru polygon list.
Definition pvr_header.h:65
@ PVR_LIST_OP_MOD
Opaque modifier list.
Definition pvr_header.h:62
@ PVR_LIST_OP_POLY
Opaque polygon list.
Definition pvr_header.h:61
@ PVR_LIST_TR_POLY
Translucent polygon list.
Definition pvr_header.h:63
@ PVR_LIST_TR_MOD
Translucent modifier list.
Definition pvr_header.h:64
@ PVR_LIST_NONE
Used internally to signal unset values.
Definition pvr_header.h:66
void * pvr_ptr_t
PVR texture memory pointer.
Definition pvr_mem.h:45
PVR Driver Registers.
Basic sys/stdio.h file from newlib.
PVR header command.
Definition pvr_header.h:238
bool txr_en
< Enable specular lighting
Definition pvr_header.h:242
bool uvfmt_f16
Definition pvr_header.h:239
bool auto_strip_len
Definition pvr_header.h:250
pvr_hdr_type_t hdr_type
< Mark an end-of-strip
Definition pvr_header.h:258
pvr_strip_len_t strip_len
< Clipping mode
Definition pvr_header.h:248
bool strip_end
Definition pvr_header.h:257
pvr_color_fmts_t color_fmt
< Enable texturing
Definition pvr_header.h:243
bool mod_normal
< Select color encoding
Definition pvr_header.h:244
bool gouraud
< Use 16-bit floating-point U/Vs
Definition pvr_header.h:240
pvr_clip_mode_t clip_mode
Definition pvr_header.h:247
pvr_list_t list_type
< Group_En: apply this header's strip_len.
Definition pvr_header.h:255
bool modifier_en
< true: normal, false: cheap shadow
Definition pvr_header.h:245
bool oargb_en
< Enable gouraud shading
Definition pvr_header.h:241
PVR header mode1.
Definition pvr_header.h:266
bool depth_write_dis
< Enable texturing (2nd bit)
Definition pvr_header.h:269
pvr_depthcmp_mode_t depth_cmp
< Culling mode
Definition pvr_header.h:271
bool txr_en
Definition pvr_header.h:268
pvr_cull_mode_t culling
< Disable depth writes
Definition pvr_header.h:270
PVR header mode2.
Definition pvr_header.h:279
bool txralpha_dis
< Flip U after 1.0
Definition pvr_header.h:290
pvr_txr_shading_mode_t shading
< Texture width
Definition pvr_header.h:282
pvr_filter_mode_t filter_mode
< Enable texture supersampling
Definition pvr_header.h:285
bool fog_clamp
< Enable alpha channel in vertex colors
Definition pvr_header.h:292
pvr_blend_mode_t blend_src
< Blend mode for the background
Definition pvr_header.h:297
uint32_t mip_bias
< Shading mode
Definition pvr_header.h:283
pvr_fog_type_t fog_type
< Enable fog clamping
Definition pvr_header.h:293
bool supersampling
< Bias for mipmaps
Definition pvr_header.h:284
bool v_clamp
< Texture filtering mode
Definition pvr_header.h:286
bool u_clamp
< Clamp V to 1.0
Definition pvr_header.h:287
pvr_uv_size_t u_size
< Texture height
Definition pvr_header.h:281
pvr_uv_size_t v_size
Definition pvr_header.h:280
bool alpha
< Disable alpha channel in textures
Definition pvr_header.h:291
bool blend_dst_acc2
< Select fog type
Definition pvr_header.h:294
pvr_blend_mode_t blend_dst
< Blend from the 2nd accumulation buffer
Definition pvr_header.h:296
bool v_flip
< Clamp U to 1.0
Definition pvr_header.h:288
bool blend_src_acc2
< Blend to the 2nd accumulation buffer
Definition pvr_header.h:295
bool u_flip
< Flip V after 1.0
Definition pvr_header.h:289
PVR header mode3.
Definition pvr_header.h:305
bool vq_en
< Select the texture's pixel format
Definition pvr_header.h:310
bool nontwiddled
< Set if texture stride is multiple of 32
Definition pvr_header.h:308
pvr_pixel_mode_t pixel_mode
< Set if texture is not twiddled
Definition pvr_header.h:309
bool x32stride
< Pre-processed texture address
Definition pvr_header.h:307
pvr_txr_ptr_t txr_base
Definition pvr_header.h:306
bool mipmap_en
< Set if the texture is VQ encoded
Definition pvr_header.h:311
PVR polygon header.
Definition pvr_header.h:319
uint32_t mode3_0
Legacy name.
Definition pvr_header.h:335
uint32_t start_x
Left (inclusive) border of user clip area.
Definition pvr_header.h:366
uint32_t end_y
Bottom (inclusive) border of user clip area.
Definition pvr_header.h:369
uint32_t mode2_0
Legacy name.
Definition pvr_header.h:330
uint32_t cmd
Raw access to cmd param.
Definition pvr_header.h:321
pvr_poly_hdr_mode1_t m1
mode1 parameters
Definition pvr_header.h:326
float b
Intensity color blue.
Definition pvr_header.h:344
uint32_t mode3
Raw access to mode3 param.
Definition pvr_header.h:334
float r
Intensity color red.
Definition pvr_header.h:342
uint32_t mode2_1
Legacy name.
Definition pvr_header.h:350
uint32_t mode1
Raw access to mode1 param.
Definition pvr_header.h:325
uint32_t mode3_1
Legacy name.
Definition pvr_header.h:351
uint32_t mode2
Raw access to mode2 param.
Definition pvr_header.h:329
uint32_t start_y
Top (inclusive) border of user clip area.
Definition pvr_header.h:367
uint32_t end_x
Right (inclusive) border of user clip area.
Definition pvr_header.h:368
float a
Intensity color alpha.
Definition pvr_header.h:341
float g
Intensity color green.
Definition pvr_header.h:343
uint32_t oargb
32-bit ARGB specular color for sprites
Definition pvr_header.h:362
pvr_poly_hdr_mode3_t m3
mode3 parameters (modifiers: outside volume)
Definition pvr_header.h:336
pvr_poly_hdr_mode2_t m2
mode2 parameters (modifiers: outside volume)
Definition pvr_header.h:331
uint32_t argb
32-bit ARGB vertex color for sprites
Definition pvr_header.h:361
pvr_poly_hdr_cmd_t m0
command parameters
Definition pvr_header.h:322