KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches

Compiled headers for polygons and sprites More...

Topics

 Constants and Masks
 Polygon header constants and masks
 
 TA Command Values
 Command values for submitting data to the TA
 

Data Structures

struct  pvr_poly_hdr_cmd
 PVR header command. More...
 
struct  pvr_poly_hdr_mode1
 PVR header mode1. More...
 
struct  pvr_poly_hdr_mode2
 PVR header mode2. More...
 
struct  pvr_poly_hdr_mode3
 PVR header mode3. More...
 
struct  pvr_poly_hdr_t
 PVR polygon header. More...
 

Macros

#define pvr_poly_ic_hdr   pvr_poly_hdr
 PVR polygon header with intensity color.
 
#define pvr_poly_mod_hdr   pvr_poly_hdr
 PVR polygon header to be used with modifier volumes.
 
#define pvr_sprite_hdr   pvr_poly_hdr
 PVR polygon header specifically for sprites.
 
#define pvr_mod_hdr   pvr_poly_hdr
 Modifier volume header.
 

Typedefs

typedef pvr_poly_hdr_t pvr_poly_ic_hdr_t
 
typedef pvr_poly_hdr_t pvr_poly_mod_hdr_t
 
typedef pvr_poly_hdr_t pvr_sprite_hdr_t
 
typedef pvr_poly_hdr_t pvr_mod_hdr_t
 
typedef uint32_t pvr_txr_ptr_t
 Texture address.
 

Enumerations

enum  pvr_color_fmts { PVR_CLRFMT_ARGBPACKED , PVR_CLRFMT_4FLOATS , PVR_CLRFMT_INTENSITY , PVR_CLRFMT_INTENSITY_PREV }
 Vertex color formats. More...
 
enum  pvr_clip_mode { PVR_USERCLIP_DISABLE = 0 , PVR_USERCLIP_INSIDE = 2 , PVR_USERCLIP_OUTSIDE = 3 }
 Primitive clipping modes. More...
 
enum  pvr_list_type {
  PVR_LIST_OP_POLY , PVR_LIST_OP_MOD , PVR_LIST_TR_POLY , PVR_LIST_TR_MOD ,
  PVR_LIST_PT_POLY
}
 PVR rendering lists. More...
 
enum  pvr_cull_mode { PVR_CULLING_NONE , PVR_CULLING_SMALL , PVR_CULLING_CCW , PVR_CULLING_CW }
 Primitive culling modes. More...
 
enum  pvr_depthcmp_mode {
  PVR_DEPTHCMP_NEVER , PVR_DEPTHCMP_LESS , PVR_DEPTHCMP_EQUAL , PVR_DEPTHCMP_LEQUAL ,
  PVR_DEPTHCMP_GREATER , PVR_DEPTHCMP_NOTEQUAL , PVR_DEPTHCMP_GEQUAL , PVR_DEPTHCMP_ALWAYS
}
 Depth comparison modes. More...
 
enum  pvr_uv_size {
  PVR_UV_SIZE_8 , PVR_UV_SIZE_16 , PVR_UV_SIZE_32 , PVR_UV_SIZE_64 ,
  PVR_UV_SIZE_128 , PVR_UV_SIZE_256 , PVR_UV_SIZE_512 , PVR_UV_SIZE_1024
}
 Texture U/V size. More...
 
enum  pvr_txr_shading_mode { PVR_TXRENV_REPLACE , PVR_TXRENV_MODULATE , PVR_TXRENV_DECAL , PVR_TXRENV_MODULATEALPHA }
 Texture color calculation modes. More...
 
enum  pvr_filter_mode {
  PVR_FILTER_NEAREST , PVR_FILTER_BILINEAR , PVR_FILTER_TRILINEAR1 , PVR_FILTER_TRILINEAR2 ,
  PVR_FILTER_NONE = PVR_FILTER_NEAREST
}
 Texture sampling modes. More...
 
enum  pvr_fog_type { PVR_FOG_TABLE , PVR_FOG_VERTEX , PVR_FOG_DISABLE , PVR_FOG_TABLE2 }
 Fog modes. More...
 
enum  pvr_blend_mode {
  PVR_BLEND_ZERO , PVR_BLEND_ONE , PVR_BLEND_DESTCOLOR , PVR_BLEND_INVDESTCOLOR ,
  PVR_BLEND_SRCALPHA , PVR_BLEND_INVSRCALPHA , PVR_BLEND_DESTALPHA , PVR_BLEND_INVDESTALPHA
}
 Blending modes. More...
 
enum  pvr_pixel_mode {
  PVR_PIXEL_MODE_ARGB1555 , PVR_PIXEL_MODE_RGB565 , PVR_PIXEL_MODE_ARGB4444 , PVR_PIXEL_MODE_YUV422 ,
  PVR_PIXEL_MODE_BUMP , PVR_PIXEL_MODE_PAL_4BPP , PVR_PIXEL_MODE_PAL_8BPP
}
 Texture formats. More...
 
enum  pvr_strip_len { PVR_STRIP_LEN_1 , PVR_STRIP_LEN_2 , PVR_STRIP_LEN_4 , PVR_STRIP_LEN_6 }
 Triangle strip length. More...
 
enum  pvr_hdr_type {
  PVR_HDR_EOL = 0 , PVR_HDR_USERCLIP = 1 , PVR_HDR_OBJECT_LIST_SET = 2 , PVR_HDR_POLY = 4 ,
  PVR_HDR_SPRITE = 5
}
 Polygon header type. More...
 

Functions

static pvr_txr_ptr_t to_pvr_txr_ptr (pvr_ptr_t addr)
 Get texture address from VRAM address.
 

Detailed Description

Compiled headers for polygons and sprites

Structs relative to PVR headers

Macro Definition Documentation

◆ pvr_mod_hdr

#define pvr_mod_hdr   pvr_poly_hdr

Modifier volume header.

This is the header that should be submitted when dealing with setting a modifier volume.

◆ pvr_poly_ic_hdr

#define pvr_poly_ic_hdr   pvr_poly_hdr

PVR polygon header with intensity color.

This is the equivalent of pvr_poly_hdr_t, but for use with intensity color.

◆ pvr_poly_mod_hdr

#define pvr_poly_mod_hdr   pvr_poly_hdr

PVR polygon header to be used with modifier volumes.

This is the equivalent of a pvr_poly_hdr_t for use when a polygon is to be used with modifier volumes.

◆ pvr_sprite_hdr

#define pvr_sprite_hdr   pvr_poly_hdr

PVR polygon header specifically for sprites.

This is the equivalent of a pvr_poly_hdr_t for use when a quad/sprite is to be rendered. Note that the color data is here, not in the vertices.

Typedef Documentation

◆ pvr_mod_hdr_t

◆ pvr_poly_ic_hdr_t

◆ pvr_poly_mod_hdr_t

◆ pvr_sprite_hdr_t

◆ pvr_txr_ptr_t

typedef uint32_t pvr_txr_ptr_t

Texture address.

This type represents an address of a texture in VRAM, pre-processed to be used in headers.

Enumeration Type Documentation

◆ pvr_blend_mode

Blending modes.

These are all the blending modes that can be done with regard to alpha blending on the PVR.

Enumerator
PVR_BLEND_ZERO 

None of this color.

PVR_BLEND_ONE 

All of this color.

PVR_BLEND_DESTCOLOR 

Destination color.

PVR_BLEND_INVDESTCOLOR 

Inverse of destination color.

PVR_BLEND_SRCALPHA 

Blend with source alpha.

PVR_BLEND_INVSRCALPHA 

Blend with inverse source alpha.

PVR_BLEND_DESTALPHA 

Blend with destination alpha.

PVR_BLEND_INVDESTALPHA 

Blend with inverse destination alpha.

◆ pvr_clip_mode

Primitive clipping modes.

These control how primitives are clipped against the user clipping area.

Enumerator
PVR_USERCLIP_DISABLE 

Disable clipping.

PVR_USERCLIP_INSIDE 

Enable clipping inside area.

PVR_USERCLIP_OUTSIDE 

Enable clipping outside area.

◆ pvr_color_fmts

Vertex color formats.

These control how colors are represented in polygon data.

Enumerator
PVR_CLRFMT_ARGBPACKED 

32-bit integer ARGB

PVR_CLRFMT_4FLOATS 

4 floating point values

PVR_CLRFMT_INTENSITY 

Intensity color.

PVR_CLRFMT_INTENSITY_PREV 

Use last intensity.

◆ pvr_cull_mode

Primitive culling modes.

These culling modes can be set by polygons to determine when they are culled. They work pretty much as you'd expect them to if you've ever used any 3D hardware before.

Enumerator
PVR_CULLING_NONE 

Disable culling.

PVR_CULLING_SMALL 

Cull if small.

PVR_CULLING_CCW 

Cull if counterclockwise.

PVR_CULLING_CW 

Cull if clockwise.

◆ pvr_depthcmp_mode

Depth comparison modes.

These set the depth function used for comparisons.

Enumerator
PVR_DEPTHCMP_NEVER 

Never pass.

PVR_DEPTHCMP_LESS 

Less than.

PVR_DEPTHCMP_EQUAL 

Equal to.

PVR_DEPTHCMP_LEQUAL 

Less than or equal to.

PVR_DEPTHCMP_GREATER 

Greater than.

PVR_DEPTHCMP_NOTEQUAL 

Not equal to.

PVR_DEPTHCMP_GEQUAL 

Greater than or equal to.

PVR_DEPTHCMP_ALWAYS 

Always pass.

◆ pvr_filter_mode

Texture sampling modes.

Enumerator
PVR_FILTER_NEAREST 

No filtering (point sample)

PVR_FILTER_BILINEAR 

Bilinear interpolation.

PVR_FILTER_TRILINEAR1 

Trilinear interpolation pass 1.

PVR_FILTER_TRILINEAR2 

Trilinear interpolation pass 2.

PVR_FILTER_NONE 

◆ pvr_fog_type

Fog modes.

Each polygon can decide what fog type is used by specifying the fog mode in its header.

Enumerator
PVR_FOG_TABLE 

Table fog.

PVR_FOG_VERTEX 

Vertex fog.

PVR_FOG_DISABLE 

Disable fog.

PVR_FOG_TABLE2 

Table fog mode 2.

◆ pvr_hdr_type

Polygon header type.

This enum contains the possible PVR header types.

Enumerator
PVR_HDR_EOL 
PVR_HDR_USERCLIP 
PVR_HDR_OBJECT_LIST_SET 
PVR_HDR_POLY 
PVR_HDR_SPRITE 

◆ pvr_list_type

PVR rendering lists.

Each primitive submitted to the PVR must be placed in one of these lists, depending on its characteristics.

Enumerator
PVR_LIST_OP_POLY 

Opaque polygon list.

PVR_LIST_OP_MOD 

Opaque modifier list.

PVR_LIST_TR_POLY 

Translucent polygon list.

PVR_LIST_TR_MOD 

Translucent modifier list.

PVR_LIST_PT_POLY 

Punch-thru polygon list.

◆ pvr_pixel_mode

Texture formats.

These are the texture formats that the PVR supports.

Enumerator
PVR_PIXEL_MODE_ARGB1555 

16-bit ARGB1555

PVR_PIXEL_MODE_RGB565 

16-bit RGB565

PVR_PIXEL_MODE_ARGB4444 

16-bit ARGB4444

PVR_PIXEL_MODE_YUV422 

YUV422 format.

PVR_PIXEL_MODE_BUMP 

Bumpmap format.

PVR_PIXEL_MODE_PAL_4BPP 

4BPP paletted format

PVR_PIXEL_MODE_PAL_8BPP 

8BPP paletted format

◆ pvr_strip_len

Triangle strip length.

This sets the maximum length of a triangle strip, if not configured in auto mode.

Enumerator
PVR_STRIP_LEN_1 
PVR_STRIP_LEN_2 
PVR_STRIP_LEN_4 
PVR_STRIP_LEN_6 

◆ pvr_txr_shading_mode

Texture color calculation modes.

The shading mode specifies how the pixel value used as the "foreground" or "source" for blending is computed.

Here, "tex" represents the pixel value from the texture, and "col" represents the pixel value from the polygon's color. RGB() represents the color channels, A() represents the alpha channel, and ARGB() represents the whole pixel (color + alpha).

Note that the offset color (aka. oargb), if specular lighting is enabled, is added to the result. Its alpha channel is ignored.

Enumerator
PVR_TXRENV_REPLACE 

px = ARGB(tex)

PVR_TXRENV_MODULATE 

px = A(tex) + RGB(col) * RGB(tex)

PVR_TXRENV_DECAL 

px = A(col) + RGB(tex) * A(tex) + RGB(col) * (1 - A(tex))

PVR_TXRENV_MODULATEALPHA 

px = ARGB(col) * ARGB(tex)

◆ pvr_uv_size

Texture U/V size.

Enumerator
PVR_UV_SIZE_8 
PVR_UV_SIZE_16 
PVR_UV_SIZE_32 
PVR_UV_SIZE_64 
PVR_UV_SIZE_128 
PVR_UV_SIZE_256 
PVR_UV_SIZE_512 
PVR_UV_SIZE_1024 

Function Documentation

◆ to_pvr_txr_ptr()

static pvr_txr_ptr_t to_pvr_txr_ptr ( pvr_ptr_t addr)
inlinestatic

Get texture address from VRAM address.

This function can be used to get a texture address that can be used in a PVR header from the texture's VRAM address.

Parameters
addrThe texture's address in VRAM
Returns
The pre-processed texture address