14#ifndef __DC_PVR_PVR_HEADER_H
15#define __DC_PVR_PVR_HEADER_H
38typedef enum pvr_color_fmts {
49typedef enum pvr_clip_mode {
60typedef enum pvr_list_type {
74typedef enum pvr_cull_mode {
85typedef enum pvr_depthcmp_mode {
97typedef enum pvr_uv_size {
121typedef enum pvr_txr_shading_mode {
129typedef enum pvr_filter_mode {
142typedef enum pvr_fog_type {
154typedef enum pvr_blend_mode {
169typedef enum pvr_pixel_mode {
184typedef enum pvr_strip_len {
195typedef enum pvr_hdr_type {
226#define pvr_to_pvr_txr_ptr(addr) to_pvr_txr_ptr(addr)
232typedef struct pvr_poly_hdr_cmd {
256typedef struct pvr_poly_hdr_mode1 {
269typedef struct pvr_poly_hdr_mode2 {
295typedef struct pvr_poly_hdr_mode3 {
309typedef __attribute__((aligned(32))) struct pvr_poly_hdr {
364_Static_assert(
sizeof(
pvr_poly_hdr_t) == 32,
"Invalid header size");
Various common macros used throughout the codebase.
static uint32_t("Please see purupuru_effect_t for modern equivalent.") PURUPURU_EFFECT2_UINTENSITY(uint8_t x)
Definition purupuru.h:96
#define PVR_RAM_SIZE
RAM size in bytes.
Definition pvr_regs.h:179
void * pvr_ptr_t
PVR texture memory pointer.
Definition pvr_mem.h:45
Basic sys/stdio.h file from newlib.
PVR header command.
Definition pvr_header.h:232
bool txr_en
< Enable specular lighting
Definition pvr_header.h:236
bool uvfmt_f16
Definition pvr_header.h:233
bool auto_strip_len
Definition pvr_header.h:244
pvr_hdr_type_t hdr_type
< Mark an end-of-strip
Definition pvr_header.h:248
pvr_strip_len_t strip_len
< Clipping mode
Definition pvr_header.h:242
bool strip_end
Definition pvr_header.h:247
pvr_color_fmts_t color_fmt
< Enable texturing
Definition pvr_header.h:237
bool mod_normal
< Select color encoding
Definition pvr_header.h:238
bool gouraud
< Use 16-bit floating-point U/Vs
Definition pvr_header.h:234
pvr_clip_mode_t clip_mode
Definition pvr_header.h:241
pvr_list_type_t list_type
< Auto select triangle strips length
Definition pvr_header.h:245
bool modifier_en
< true: normal, false: cheap shadow
Definition pvr_header.h:239
bool oargb_en
< Enable gouraud shading
Definition pvr_header.h:235
PVR header mode1.
Definition pvr_header.h:256
bool depth_write_dis
< Enable texturing (2nd bit)
Definition pvr_header.h:259
pvr_depthcmp_mode_t depth_cmp
< Culling mode
Definition pvr_header.h:261
bool txr_en
Definition pvr_header.h:258
pvr_cull_mode_t culling
< Disable depth writes
Definition pvr_header.h:260
PVR header mode2.
Definition pvr_header.h:269
bool txralpha_dis
< Flip U after 1.0
Definition pvr_header.h:280
pvr_txr_shading_mode_t shading
< Texture width
Definition pvr_header.h:272
pvr_filter_mode_t filter_mode
< Enable texture supersampling
Definition pvr_header.h:275
bool fog_clamp
< Enable alpha channel in vertex colors
Definition pvr_header.h:282
pvr_blend_mode_t blend_src
< Blend mode for the background
Definition pvr_header.h:287
uint32_t mip_bias
< Shading mode
Definition pvr_header.h:273
pvr_fog_type_t fog_type
< Enable fog clamping
Definition pvr_header.h:283
bool supersampling
< Bias for mipmaps
Definition pvr_header.h:274
bool v_clamp
< Texture filtering mode
Definition pvr_header.h:276
bool u_clamp
< Clamp V to 1.0
Definition pvr_header.h:277
pvr_uv_size_t u_size
< Texture height
Definition pvr_header.h:271
pvr_uv_size_t v_size
Definition pvr_header.h:270
bool alpha
< Disable alpha channel in textures
Definition pvr_header.h:281
bool blend_dst_acc2
< Select fog type
Definition pvr_header.h:284
pvr_blend_mode_t blend_dst
< Blend from the 2nd accumulation buffer
Definition pvr_header.h:286
bool v_flip
< Clamp U to 1.0
Definition pvr_header.h:278
bool blend_src_acc2
< Blend to the 2nd accumulation buffer
Definition pvr_header.h:285
bool u_flip
< Flip V after 1.0
Definition pvr_header.h:279
PVR header mode3.
Definition pvr_header.h:295
bool vq_en
< Select the texture's pixel format
Definition pvr_header.h:300
bool nontwiddled
< Set if texture stride is multiple of 32
Definition pvr_header.h:298
pvr_pixel_mode_t pixel_mode
< Set if texture is not twiddled
Definition pvr_header.h:299
bool x32stride
< Pre-processed texture address
Definition pvr_header.h:297
pvr_txr_ptr_t txr_base
Definition pvr_header.h:296
bool mipmap_en
< Set if the texture is VQ encoded
Definition pvr_header.h:301
PVR polygon header.
Definition pvr_header.h:309
uint32_t mode3_0
Legacy name.
Definition pvr_header.h:325
uint32_t start_x
Left (inclusive) border of user clip area.
Definition pvr_header.h:356
uint32_t end_y
Bottom (inclusive) border of user clip area.
Definition pvr_header.h:359
uint32_t mode2_0
Legacy name.
Definition pvr_header.h:320
uint32_t cmd
Raw access to cmd param.
Definition pvr_header.h:311
pvr_poly_hdr_mode1_t m1
mode1 parameters
Definition pvr_header.h:316
float b
Intensity color blue.
Definition pvr_header.h:334
uint32_t mode3
Raw access to mode3 param.
Definition pvr_header.h:324
float r
Intensity color red.
Definition pvr_header.h:332
uint32_t mode2_1
Legacy name.
Definition pvr_header.h:340
uint32_t mode1
Raw access to mode1 param.
Definition pvr_header.h:315
uint32_t mode3_1
Legacy name.
Definition pvr_header.h:341
uint32_t mode2
Raw access to mode2 param.
Definition pvr_header.h:319
uint32_t start_y
Top (inclusive) border of user clip area.
Definition pvr_header.h:357
uint32_t end_x
Right (inclusive) border of user clip area.
Definition pvr_header.h:358
float a
Intensity color alpha.
Definition pvr_header.h:331
float g
Intensity color green.
Definition pvr_header.h:333
uint32_t oargb
32-bit ARGB specular color for sprites
Definition pvr_header.h:352
pvr_poly_hdr_mode3_t m3
mode3 parameters (modifiers: outside volume)
Definition pvr_header.h:326
pvr_poly_hdr_mode2_t m2
mode2 parameters (modifiers: outside volume)
Definition pvr_header.h:321
uint32_t argb
32-bit ARGB vertex color for sprites
Definition pvr_header.h:351
pvr_poly_hdr_cmd_t m0
command parameters
Definition pvr_header.h:312