34 #include <sys/cdefs.h>
261 #define PVR_LIST_OP_POLY 0
262 #define PVR_LIST_OP_MOD 1
263 #define PVR_LIST_TR_POLY 2
264 #define PVR_LIST_TR_MOD 3
265 #define PVR_LIST_PT_POLY 4
276 #define PVR_SHADE_FLAT 0
277 #define PVR_SHADE_GOURAUD 1
286 #define PVR_DEPTHCMP_NEVER 0
287 #define PVR_DEPTHCMP_LESS 1
288 #define PVR_DEPTHCMP_EQUAL 2
289 #define PVR_DEPTHCMP_LEQUAL 3
290 #define PVR_DEPTHCMP_GREATER 4
291 #define PVR_DEPTHCMP_NOTEQUAL 5
292 #define PVR_DEPTHCMP_GEQUAL 6
293 #define PVR_DEPTHCMP_ALWAYS 7
304 #define PVR_CULLING_NONE 0
305 #define PVR_CULLING_SMALL 1
306 #define PVR_CULLING_CCW 2
307 #define PVR_CULLING_CW 3
313 #define PVR_DEPTHWRITE_ENABLE 0
314 #define PVR_DEPTHWRITE_DISABLE 1
320 #define PVR_TEXTURE_DISABLE 0
321 #define PVR_TEXTURE_ENABLE 1
331 #define PVR_BLEND_ZERO 0
332 #define PVR_BLEND_ONE 1
333 #define PVR_BLEND_DESTCOLOR 2
334 #define PVR_BLEND_INVDESTCOLOR 3
335 #define PVR_BLEND_SRCALPHA 4
336 #define PVR_BLEND_INVSRCALPHA 5
337 #define PVR_BLEND_DESTALPHA 6
338 #define PVR_BLEND_INVDESTALPHA 7
344 #define PVR_BLEND_DISABLE 0
345 #define PVR_BLEND_ENABLE 1
355 #define PVR_FOG_TABLE 0
356 #define PVR_FOG_VERTEX 1
357 #define PVR_FOG_DISABLE 2
358 #define PVR_FOG_TABLE2 3
367 #define PVR_USERCLIP_DISABLE 0
368 #define PVR_USERCLIP_INSIDE 2
369 #define PVR_USERCLIP_OUTSIDE 3
379 #define PVR_CLRCLAMP_DISABLE 0
380 #define PVR_CLRCLAMP_ENABLE 1
395 #define PVR_SPECULAR_DISABLE 0
396 #define PVR_SPECULAR_ENABLE 1
406 #define PVR_ALPHA_DISABLE 0
407 #define PVR_ALPHA_ENABLE 1
417 #define PVR_TXRALPHA_ENABLE 0
418 #define PVR_TXRALPHA_DISABLE 1
424 #define PVR_UVFLIP_NONE 0
425 #define PVR_UVFLIP_V 1
426 #define PVR_UVFLIP_U 2
427 #define PVR_UVFLIP_UV 3
433 #define PVR_UVCLAMP_NONE 0
434 #define PVR_UVCLAMP_V 1
435 #define PVR_UVCLAMP_U 2
436 #define PVR_UVCLAMP_UV 3
442 #define PVR_FILTER_NONE 0
443 #define PVR_FILTER_NEAREST 0
444 #define PVR_FILTER_BILINEAR 2
445 #define PVR_FILTER_TRILINEAR1 4
446 #define PVR_FILTER_TRILINEAR2 6
452 #define PVR_MIPBIAS_NORMAL PVR_MIPBIAS_1_00
453 #define PVR_MIPBIAS_0_25 1
454 #define PVR_MIPBIAS_0_50 2
455 #define PVR_MIPBIAS_0_75 3
456 #define PVR_MIPBIAS_1_00 4
457 #define PVR_MIPBIAS_1_25 5
458 #define PVR_MIPBIAS_1_50 6
459 #define PVR_MIPBIAS_1_75 7
460 #define PVR_MIPBIAS_2_00 8
461 #define PVR_MIPBIAS_2_25 9
462 #define PVR_MIPBIAS_2_50 10
463 #define PVR_MIPBIAS_2_75 11
464 #define PVR_MIPBIAS_3_00 12
465 #define PVR_MIPBIAS_3_25 13
466 #define PVR_MIPBIAS_3_50 14
467 #define PVR_MIPBIAS_3_75 15
473 #define PVR_TXRENV_REPLACE 0
474 #define PVR_TXRENV_MODULATE 1
475 #define PVR_TXRENV_DECAL 2
476 #define PVR_TXRENV_MODULATEALPHA 3
482 #define PVR_MIPMAP_DISABLE 0
483 #define PVR_MIPMAP_ENABLE 1
493 #define PVR_TXRFMT_NONE 0
494 #define PVR_TXRFMT_VQ_DISABLE (0 << 30)
495 #define PVR_TXRFMT_VQ_ENABLE (1 << 30)
496 #define PVR_TXRFMT_ARGB1555 (0 << 27)
497 #define PVR_TXRFMT_RGB565 (1 << 27)
498 #define PVR_TXRFMT_ARGB4444 (2 << 27)
499 #define PVR_TXRFMT_YUV422 (3 << 27)
500 #define PVR_TXRFMT_BUMP (4 << 27)
501 #define PVR_TXRFMT_PAL4BPP (5 << 27)
502 #define PVR_TXRFMT_PAL8BPP (6 << 27)
503 #define PVR_TXRFMT_TWIDDLED (0 << 26)
504 #define PVR_TXRFMT_NONTWIDDLED (1 << 26)
505 #define PVR_TXRFMT_NOSTRIDE (0 << 21)
506 #define PVR_TXRFMT_STRIDE (1 << 21)
513 #define PVR_TXRFMT_8BPP_PAL(x) ((x) << 25)
517 #define PVR_TXRFMT_4BPP_PAL(x) ((x) << 21)
526 #define PVR_CLRFMT_ARGBPACKED 0
527 #define PVR_CLRFMT_4FLOATS 1
528 #define PVR_CLRFMT_INTENSITY 2
529 #define PVR_CLRFMT_INTENSITY_PREV 3
535 #define PVR_UVFMT_32BIT 0
536 #define PVR_UVFMT_16BIT 1
542 #define PVR_MODIFIER_DISABLE 0
543 #define PVR_MODIFIER_ENABLE 1
546 #define PVR_MODIFIER_CHEAP_SHADOW 0
547 #define PVR_MODIFIER_NORMAL 1
557 #define PVR_MODIFIER_OTHER_POLY 0
558 #define PVR_MODIFIER_INCLUDE_LAST_POLY 1
559 #define PVR_MODIFIER_EXCLUDE_LAST_POLY 2
806 #define PVR_PACK_COLOR(a, r, g, b) ( \
807 ( ((uint8)( a * 255 ) ) << 24 ) | \
808 ( ((uint8)( r * 255 ) ) << 16 ) | \
809 ( ((uint8)( g * 255 ) ) << 8 ) | \
810 ( ((uint8)( b * 255 ) ) << 0 ) )
820 return (((*((
uint32 *) &u)) >> 0) & 0xFFFF0000) |
821 (((*((
uint32 *) &v)) >> 16) & 0x0000FFFF);
831 #define PVR_CMD_POLYHDR 0x80840000
833 #define PVR_CMD_VERTEX 0xe0000000
834 #define PVR_CMD_VERTEX_EOL 0xf0000000
835 #define PVR_CMD_USERCLIP 0x20000000
836 #define PVR_CMD_MODIFIER 0x80000000
837 #define PVR_CMD_SPRITE 0xA0000000
848 #define PVR_TA_CMD_TYPE_SHIFT 24
849 #define PVR_TA_CMD_TYPE_MASK (7 << PVR_TA_CMD_TYPE_SHIFT)
851 #define PVR_TA_CMD_USERCLIP_SHIFT 16
852 #define PVR_TA_CMD_USERCLIP_MASK (3 << PVR_TA_CMD_USERCLIP_SHIFT)
854 #define PVR_TA_CMD_CLRFMT_SHIFT 4
855 #define PVR_TA_CMD_CLRFMT_MASK (7 << PVR_TA_CMD_CLRFMT_SHIFT)
857 #define PVR_TA_CMD_SPECULAR_SHIFT 2
858 #define PVR_TA_CMD_SPECULAR_MASK (1 << PVR_TA_CMD_SPECULAR_SHIFT)
860 #define PVR_TA_CMD_SHADE_SHIFT 1
861 #define PVR_TA_CMD_SHADE_MASK (1 << PVR_TA_CMD_SHADE_SHIFT)
863 #define PVR_TA_CMD_UVFMT_SHIFT 0
864 #define PVR_TA_CMD_UVFMT_MASK (1 << PVR_TA_CMD_UVFMT_SHIFT)
866 #define PVR_TA_CMD_MODIFIER_SHIFT 7
867 #define PVR_TA_CMD_MODIFIER_MASK (1 << PVR_TA_CMD_MODIFIER_SHIFT)
869 #define PVR_TA_CMD_MODIFIERMODE_SHIFT 6
870 #define PVR_TA_CMD_MODIFIERMODE_MASK (1 << PVR_TA_CMD_MODIFIERMODE_SHIFT)
872 #define PVR_TA_PM1_DEPTHCMP_SHIFT 29
873 #define PVR_TA_PM1_DEPTHCMP_MASK (7 << PVR_TA_PM1_DEPTHCMP_SHIFT)
875 #define PVR_TA_PM1_CULLING_SHIFT 27
876 #define PVR_TA_PM1_CULLING_MASK (3 << PVR_TA_PM1_CULLING_SHIFT)
878 #define PVR_TA_PM1_DEPTHWRITE_SHIFT 26
879 #define PVR_TA_PM1_DEPTHWRITE_MASK (1 << PVR_TA_PM1_DEPTHWRITE_SHIFT)
881 #define PVR_TA_PM1_TXRENABLE_SHIFT 25
882 #define PVR_TA_PM1_TXRENABLE_MASK (1 << PVR_TA_PM1_TXRENABLE_SHIFT)
884 #define PVR_TA_PM1_MODIFIERINST_SHIFT 29
885 #define PVR_TA_PM1_MODIFIERINST_MASK (3 << PVR_TA_PM1_MODIFIERINST_SHIFT)
887 #define PVR_TA_PM2_SRCBLEND_SHIFT 29
888 #define PVR_TA_PM2_SRCBLEND_MASK (7 << PVR_TA_PM2_SRCBLEND_SHIFT)
890 #define PVR_TA_PM2_DSTBLEND_SHIFT 26
891 #define PVR_TA_PM2_DSTBLEND_MASK (7 << PVR_TA_PM2_DSTBLEND_SHIFT)
893 #define PVR_TA_PM2_SRCENABLE_SHIFT 25
894 #define PVR_TA_PM2_SRCENABLE_MASK (1 << PVR_TA_PM2_SRCENABLE_SHIFT)
896 #define PVR_TA_PM2_DSTENABLE_SHIFT 24
897 #define PVR_TA_PM2_DSTENABLE_MASK (1 << PVR_TA_PM2_DSTENABLE_SHIFT)
899 #define PVR_TA_PM2_FOG_SHIFT 22
900 #define PVR_TA_PM2_FOG_MASK (3 << PVR_TA_PM2_FOG_SHIFT)
902 #define PVR_TA_PM2_CLAMP_SHIFT 21
903 #define PVR_TA_PM2_CLAMP_MASK (1 << PVR_TA_PM2_CLAMP_SHIFT)
905 #define PVR_TA_PM2_ALPHA_SHIFT 20
906 #define PVR_TA_PM2_ALPHA_MASK (1 << PVR_TA_PM2_ALPHA_SHIFT)
908 #define PVR_TA_PM2_TXRALPHA_SHIFT 19
909 #define PVR_TA_PM2_TXRALPHA_MASK (1 << PVR_TA_PM2_TXRALPHA_SHIFT)
911 #define PVR_TA_PM2_UVFLIP_SHIFT 17
912 #define PVR_TA_PM2_UVFLIP_MASK (3 << PVR_TA_PM2_UVFLIP_SHIFT)
914 #define PVR_TA_PM2_UVCLAMP_SHIFT 15
915 #define PVR_TA_PM2_UVCLAMP_MASK (3 << PVR_TA_PM2_UVCLAMP_SHIFT)
917 #define PVR_TA_PM2_FILTER_SHIFT 12
918 #define PVR_TA_PM2_FILTER_MASK (7 << PVR_TA_PM2_FILTER_SHIFT)
920 #define PVR_TA_PM2_MIPBIAS_SHIFT 8
921 #define PVR_TA_PM2_MIPBIAS_MASK (15 << PVR_TA_PM2_MIPBIAS_SHIFT)
923 #define PVR_TA_PM2_TXRENV_SHIFT 6
924 #define PVR_TA_PM2_TXRENV_MASK (3 << PVR_TA_PM2_TXRENV_SHIFT)
926 #define PVR_TA_PM2_USIZE_SHIFT 3
927 #define PVR_TA_PM2_USIZE_MASK (7 << PVR_TA_PM2_USIZE_SHIFT)
929 #define PVR_TA_PM2_VSIZE_SHIFT 0
930 #define PVR_TA_PM2_VSIZE_MASK (7 << PVR_TA_PM2_VSIZE_SHIFT)
932 #define PVR_TA_PM3_MIPMAP_SHIFT 31
933 #define PVR_TA_PM3_MIPMAP_MASK (1 << PVR_TA_PM3_MIPMAP_SHIFT)
935 #define PVR_TA_PM3_TXRFMT_SHIFT 0
936 #define PVR_TA_PM3_TXRFMT_MASK 0xffffffff
948 #define PVR_GET(REG) (* ( (uint32*)( 0xa05f8000 + (REG) ) ) )
954 #define PVR_SET(REG, VALUE) PVR_GET(REG) = (VALUE)
963 #define PVR_ID 0x0000
964 #define PVR_REVISION 0x0004
965 #define PVR_RESET 0x0008
966 #define PVR_ISP_START 0x0014
967 #define PVR_UNK_0018 0x0018
968 #define PVR_ISP_VERTBUF_ADDR 0x0020
969 #define PVR_ISP_TILEMAT_ADDR 0x002c
970 #define PVR_SPANSORT_CFG 0x0030
971 #define PVR_FB_CFG_1 0x0044
972 #define PVR_FB_CFG_2 0x0048
973 #define PVR_RENDER_MODULO 0x004c
974 #define PVR_RENDER_ADDR 0x0060
975 #define PVR_RENDER_ADDR_2 0x0064
976 #define PVR_PCLIP_X 0x0068
977 #define PVR_PCLIP_Y 0x006c
978 #define PVR_CHEAP_SHADOW 0x0074
979 #define PVR_OBJECT_CLIP 0x0078
980 #define PVR_UNK_007C 0x007c
981 #define PVR_UNK_0080 0x0080
982 #define PVR_TEXTURE_CLIP 0x0084
983 #define PVR_BGPLANE_Z 0x0088
984 #define PVR_BGPLANE_CFG 0x008c
985 #define PVR_UNK_0098 0x0098
986 #define PVR_UNK_00A0 0x00a0
987 #define PVR_UNK_00A8 0x00a8
988 #define PVR_FOG_TABLE_COLOR 0x00b0
989 #define PVR_FOG_VERTEX_COLOR 0x00b4
990 #define PVR_FOG_DENSITY 0x00b8
991 #define PVR_COLOR_CLAMP_MAX 0x00bc
992 #define PVR_COLOR_CLAMP_MIN 0x00c0
993 #define PVR_GUN_POS 0x00c4
994 #define PVR_UNK_00C8 0x00c8
995 #define PVR_VPOS_IRQ 0x00cc
996 #define PVR_TEXTURE_MODULO 0x00e4
997 #define PVR_VIDEO_CFG 0x00e8
998 #define PVR_SCALER_CFG 0x00f4
999 #define PVR_PALETTE_CFG 0x0108
1000 #define PVR_SYNC_STATUS 0x010c
1001 #define PVR_UNK_0110 0x0110
1002 #define PVR_UNK_0114 0x0114
1003 #define PVR_UNK_0118 0x0118
1004 #define PVR_TA_OPB_START 0x0124
1005 #define PVR_TA_VERTBUF_START 0x0128
1006 #define PVR_TA_OPB_END 0x012c
1007 #define PVR_TA_VERTBUF_END 0x0130
1008 #define PVR_TA_OPB_POS 0x0134
1009 #define PVR_TA_VERTBUF_POS 0x0138
1010 #define PVR_TILEMAT_CFG 0x013c
1011 #define PVR_OPB_CFG 0x0140
1012 #define PVR_TA_INIT 0x0144
1013 #define PVR_YUV_ADDR 0x0148
1014 #define PVR_YUV_CFG_1 0x014c
1015 #define PVR_UNK_0160 0x0160
1016 #define PVR_TA_OPB_INIT 0x0164
1017 #define PVR_FOG_TABLE_BASE 0x0200
1018 #define PVR_PALETTE_TABLE_BASE 0x1000
1022 #define PVR_TA_INPUT 0x10000000
1023 #define PVR_RAM_BASE 0xa5000000
1024 #define PVR_RAM_INT_BASE 0xa4000000
1026 #define PVR_RAM_SIZE (8*1024*1024)
1028 #define PVR_RAM_TOP (PVR_RAM_BASE + PVR_RAM_SIZE)
1029 #define PVR_RAM_INT_TOP (PVR_RAM_INT_BASE + PVR_RAM_SIZE)
1041 #define PVR_RESET_ALL 0xffffffff
1042 #define PVR_RESET_NONE 0x00000000
1043 #define PVR_RESET_TA 0x00000001
1044 #define PVR_RESET_ISPTSP 0x00000002
1047 #define PVR_ISP_START_GO 0xffffffff
1049 #define PVR_TA_INIT_GO 0x80000000
1060 #define PVR_BINSIZE_0 0
1061 #define PVR_BINSIZE_8 8
1062 #define PVR_BINSIZE_16 16
1063 #define PVR_BINSIZE_32 32
1085 int vertex_buf_size;
1108 int autosort_disabled;
1241 #define PVR_PAL_ARGB1555 0
1242 #define PVR_PAL_RGB565 1
1243 #define PVR_PAL_ARGB4444 2
1244 #define PVR_PAL_ARGB8888 3
1580 int pvr_prim(
void * data,
int size);
1589 #define pvr_dr_init(vtx_buf_ptr) do { \
1590 (vtx_buf_ptr) = 0; \
1591 QACR0 = ((((uint32)PVR_TA_INPUT) >> 26) << 2) & 0x1c; \
1592 QACR1 = ((((uint32)PVR_TA_INPUT) >> 26) << 2) & 0x1c; \
1604 #define pvr_dr_target(vtx_buf_ptr) \
1605 ({ (vtx_buf_ptr) ^= 32; \
1606 (pvr_vertex_t *)(0xe0000000 | (vtx_buf_ptr)); \
1614 #define pvr_dr_commit(addr) __asm__ __volatile__("pref @%0" : : "r" (addr))
1719 int textureformat,
int tw,
int th,
pvr_ptr_t textureaddr,
1760 int textureformat,
int tw,
int th,
pvr_ptr_t textureaddr,
1829 int textureformat,
int tw,
int th,
1831 int textureformat2,
int tw2,
int th2,
1832 pvr_ptr_t textureaddr2,
int filtering2);
1857 #define PVR_TXRLOAD_4BPP 0x01
1858 #define PVR_TXRLOAD_8BPP 0x02
1859 #define PVR_TXRLOAD_16BPP 0x03
1860 #define PVR_TXRLOAD_FMT_MASK 0x0f
1862 #define PVR_TXRLOAD_VQ_LOAD 0x10
1863 #define PVR_TXRLOAD_INVERT_Y 0x20
1864 #define PVR_TXRLOAD_FMT_VQ 0x40
1865 #define PVR_TXRLOAD_FMT_TWIDDLED 0x80
1866 #define PVR_TXRLOAD_FMT_NOTWIDDLE 0x80
1867 #define PVR_TXRLOAD_DMA 0x8000
1868 #define PVR_TXRLOAD_NONBLOCK 0x4000
1869 #define PVR_TXRLOAD_SQ 0x2000
1972 #define PVR_DMA_VRAM64 0
1973 #define PVR_DMA_VRAM32 1
1974 #define PVR_DMA_TA 2
void pvr_poly_compile(pvr_poly_hdr_t *dst, pvr_poly_cxt_t *src)
Compile a polygon context into a polygon header.
uint32 d2
Dummy value.
Definition: pvr.h:576
void pvr_fog_table_color(float a, float r, float g, float b)
Set the table fog color.
int pvr_list_flush(pvr_list_t list)
Flush the buffered data of the given list type to the TA.
int write
Enable or disable depth writes.
Definition: pvr.h:224
uint32 auv
First U/V texture coordinates.
Definition: pvr.h:743
uint32 vbl_count
VBlank count.
Definition: pvr.h:1203
int dst
Dest blending mode.
Definition: pvr.h:214
uint32 flags
TA command (vertex flags)
Definition: pvr.h:661
int pvr_check_ready()
Check if the PVR system is ready for another frame to be submitted.
int fog_type
Fog type outside modifier.
Definition: pvr.h:84
uint32 oargb
Vertex offset color.
Definition: pvr.h:668
int list_type
Primitive list.
Definition: pvr.h:77
uint32 cmd
TA command.
Definition: pvr.h:606
uint32 mode1
Parameter word 1.
Definition: pvr.h:572
void pvr_fog_table_custom(float tbl1[])
Set a custom fog table from float values.
int vtx_buffer_used
Number of bytes used in the vertex buffer for the last frame.
Definition: pvr.h:1208
int src
Source blending mode outside modifier.
Definition: pvr.h:103
uint32 mode1
Parameter word 1.
Definition: pvr.h:589
float az
First Z coordinate.
Definition: pvr.h:757
uint32 frame_count
Total number of rendered/viewed frames.
Definition: pvr.h:1211
PVR statistics structure.
Definition: pvr.h:1201
uint32 mode3
Parameter word 3.
Definition: pvr.h:574
pvr_ptr_t base
Texture pointer.
Definition: pvr.h:155
void pvr_sprite_cxt_txr(pvr_sprite_cxt_t *dst, pvr_list_t list, int textureformat, int tw, int th, pvr_ptr_t textureaddr, int filtering)
Fill in a sprite context for a textured sprite.
int write
Enable or disable depth writes.
Definition: pvr.h:131
float cx
Third X coordinate.
Definition: pvr.h:761
int alpha
Enable or disable alpha.
Definition: pvr.h:198
float cz
Third Z coordinate.
Definition: pvr.h:739
int pvr_txr_load_dma(void *src, pvr_ptr_t dest, uint32 count, int block, pvr_dma_callback_t callback, ptr_t cbdata)
Load a texture using PVR DMA.
float az
First Z coordinate.
Definition: pvr.h:781
float cy
Third Y coordinate.
Definition: pvr.h:786
uint32 d3
Dummy value.
Definition: pvr.h:790
PVR vertex type: Untextured sprite.
Definition: pvr.h:753
uint32 enabled_list_mask
Which lists are enabled?
Definition: pvr.h:1202
int src
Source blending mode.
Definition: pvr.h:212
float y
Y coordinate.
Definition: pvr.h:701
uint32 d6
Dummy value.
Definition: pvr.h:649
int filter
Filtering mode.
Definition: pvr.h:137
uint32 pvr_mem_available()
Return the number of bytes available still in the PVR RAM pool.
void pvr_set_bg_color(float r, float g, float b)
Set the background plane color.
int height
Texture height (requires a power of 2)
Definition: pvr.h:245
Functions to access the SH4 Store Queues.
PVR polygon header.
Definition: pvr.h:570
Platform-independent image type.
uint32 d4
Dummy value.
Definition: pvr.h:647
static void pvr_set_pal_entry(uint32 idx, uint32 value)
Set a palette value.
Definition: pvr.h:1273
uint32 argb0
Vertex color (outside volume)
Definition: pvr.h:684
void pvr_vertbuf_written(pvr_list_t list, uint32 amt)
Notify the PVR system that data have been written into the output buffer for the given list...
uint32 d2
Dummy value.
Definition: pvr.h:712
static uint32 PVR_PACK_16BIT_UV(float u, float v)
Pack two floating point coordinates into one 32-bit value, truncating them to 16-bits each...
Definition: pvr.h:819
uint32 mode2
Parameter word 2.
Definition: pvr.h:590
int pvr_dma_ready()
Is PVR DMA is inactive?
int dst_enable
Dest blending enable.
Definition: pvr.h:218
int color
Color format in vertex.
Definition: pvr.h:121
#define PVR_PALETTE_TABLE_BASE
Base of the palette table.
Definition: pvr.h:1019
void * pvr_ptr_t
PVR texture memory pointer.
Definition: pvr.h:49
uint32 d3
Dummy value.
Definition: pvr.h:646
void pvr_fog_vertex_color(float a, float r, float g, float b)
Set the vertex fog color.
int color_clamp
Color clamp enable/disable.
Definition: pvr.h:204
int enable
Enable/disable texturing.
Definition: pvr.h:135
PVR vertex type: Non-textured, packed color, affected by modifier volume.
Definition: pvr.h:679
uint32 mode2
Parameter word 2.
Definition: pvr.h:626
int rnd_last_time
Rendering time for the last frame in milliseconds.
Definition: pvr.h:1207
uint32 cmd
TA command.
Definition: pvr.h:642
void pvr_set_pal_format(int fmt)
Set the palette format.
float ax
First X coordinate.
Definition: pvr.h:779
int dst_enable2
Dest blending mode inside modifier.
Definition: pvr.h:117
int pvr_get_stats(pvr_stats_t *stat)
Get the current statistics from the PVR.
uint32 argb0
Vertex color (outside)
Definition: pvr.h:705
int culling
Culling mode.
Definition: pvr.h:86
float cx
Third X coordinate.
Definition: pvr.h:785
float cx
Third X coordinate.
Definition: pvr.h:737
float frame_rate
Current frame rate (per second)
Definition: pvr.h:1205
uint32 d4
Dummy value.
Definition: pvr.h:769
float dy
Fourth Y coordinate.
Definition: pvr.h:741
int uv_clamp
Enable/disable U/V clamping.
Definition: pvr.h:238
void * pvr_set_vertbuf(pvr_list_t list, void *buffer, int len)
Setup a vertex buffer for one of the list types.
float dy
Fourth Y coordinate.
Definition: pvr.h:765
uint32 argb
Vertex color.
Definition: pvr.h:667
int uv_flip
Enable/disable U/V flipping.
Definition: pvr.h:143
uint32 mode2_0
Parameter word 2 (outside volume)
Definition: pvr.h:608
int pvr_vertex_dma_enabled()
Is vertex DMA enabled?
void pvr_fog_table_exp(float density)
Initialize the fog table using an exp algorithm (like GL_EXP).
int width
Texture width (requires a power of 2)
Definition: pvr.h:244
float bx
Second X coordinate.
Definition: pvr.h:734
void pvr_sprite_compile(pvr_sprite_hdr_t *dst, pvr_sprite_cxt_t *src)
Compile a sprite context into a sprite header.
int uv_clamp
Enable/disable U/V clamping.
Definition: pvr.h:145
uint32 d4
Dummy value.
Definition: pvr.h:578
void pvr_txr_load(void *src, pvr_ptr_t dst, uint32 count)
Load raw texture data from an SH-4 buffer into PVR RAM.
float by
Second Y coordinate.
Definition: pvr.h:735
int pvr_dma_transfer(void *src, uint32 dest, uint32 count, int type, int block, pvr_dma_callback_t callback, ptr_t cbdata)
Perform a DMA transfer to the PVR.
int specular
Offset color enable/disable.
Definition: pvr.h:208
uint32 d2
Dummy value.
Definition: pvr.h:631
float az
First Z coordinate.
Definition: pvr.h:733
uint32 cuv
Third U/V texture coordinates.
Definition: pvr.h:745
float x
X coordinate.
Definition: pvr.h:681
uint32 argb1
Vertex color (inside volume)
Definition: pvr.h:685
float z
Z coordinate.
Definition: pvr.h:683
int pvr_dma_load_ta(void *src, uint32 count, int block, pvr_dma_callback_t callback, ptr_t cbdata)
Load vertex data to the TA using PVR DMA.
pvr_ptr_t pvr_mem_malloc(size_t size)
Allocate a chunk of memory from texture space.
uint32 mode1
Parameter word 1.
Definition: pvr.h:643
int mipmap
Enable/disable mipmaps.
Definition: pvr.h:139
uint32 mode2
Parameter word 2.
Definition: pvr.h:573
uint32 pvr_list_t
PVR list specification.
Definition: pvr.h:58
float a
Face color alpha component.
Definition: pvr.h:592
int filter
Filtering mode.
Definition: pvr.h:230
float bz
Second Z coordinate.
Definition: pvr.h:736
uint32 mode1
Parameter word 1.
Definition: pvr.h:625
float z
Z coordinate.
Definition: pvr.h:702
uint32 cmd
TA command.
Definition: pvr.h:624
uint32 mode3_1
Parameter word 3 (inside volume)
Definition: pvr.h:611
void pvr_scene_begin()
Begin collecting data for a frame of 3D output to the off-screen frame buffer.
float bx
Second X coordinate.
Definition: pvr.h:758
PVR polygon header with intensity color.
Definition: pvr.h:587
Platform-indpendent image type.
Definition: img.h:44
uint32 d5
Dummy value.
Definition: pvr.h:648
PVR polygon header to be used with modifier volumes.
Definition: pvr.h:605
float dx
Fourth X coordinate.
Definition: pvr.h:740
uint32 flags
TA command (vertex flags)
Definition: pvr.h:680
float g
Face color green component.
Definition: pvr.h:594
pvr_ptr_t base
Texture pointer.
Definition: pvr.h:248
float bz
Second Z coordinate.
Definition: pvr.h:760
uint32 dummy
Dummy value.
Definition: pvr.h:742
int pvr_init_defaults()
Simple PVR initialization.
int pvr_list_begin(pvr_list_t list)
Begin collecting data for the given list type.
float dx
Fourth X coordinate.
Definition: pvr.h:764
uint32 d2
Dummy value.
Definition: pvr.h:767
float y
Y coordinate.
Definition: pvr.h:663
void pvr_txr_load_kimg(kos_img_t *img, pvr_ptr_t dst, uint32 flags)
Load a KOS Platform Independent Image (subject to constraint checking).
int dst2
Dest blending mode inside modifier.
Definition: pvr.h:113
void pvr_set_presort_mode(int presort)
Set the translucent polygon sort mode for the next frame.
float v1
Texture V coordinate (inside)
Definition: pvr.h:708
int reg_last_time
Registration time for the last frame in milliseconds.
Definition: pvr.h:1206
int pvr_wait_ready()
Block the caller until the PVR system is ready for another frame to be submitted. ...
void pvr_scene_begin_txr(pvr_ptr_t txr, uint32 *rx, uint32 *ry)
Begin collecting data for a frame of 3D output to the specified texture.
void pvr_set_shadow_scale(int enable, float scale_value)
Set cheap shadow parameters.
PVR polygon context.
Definition: pvr.h:76
float cy
Third Y coordinate.
Definition: pvr.h:762
uint32 flags
TA command (vertex flags)
Definition: pvr.h:730
float v0
Texture V coordinate (outside)
Definition: pvr.h:704
uint32 d2
Dummy value.
Definition: pvr.h:645
uint32 d3
Dummy value.
Definition: pvr.h:768
int specular
Offset color enable/disable outside modifier.
Definition: pvr.h:93
PVR vertex type: Textured sprite.
Definition: pvr.h:729
int alpha2
Enable/disable alpha inside modifier.
Definition: pvr.h:95
void pvr_poly_cxt_txr(pvr_poly_cxt_t *dst, pvr_list_t list, int textureformat, int tw, int th, pvr_ptr_t textureaddr, int filtering)
Fill in a polygon context for a textured polygon.
float ay
First Y coordinate.
Definition: pvr.h:756
uint32 ptr_t
Pointer arithmetic type.
Definition: types.h:47
int uv_flip
Enable/disable U/V flipping.
Definition: pvr.h:236
int comparison
Depth comparison mode.
Definition: pvr.h:129
uint32 d1
Dummy value.
Definition: pvr.h:686
int mipmap
Enable/disable mipmaps.
Definition: pvr.h:232
uint32 pvr_dr_state_t
Direct Rendering state variable type.
Definition: pvr.h:1584
int pvr_scene_finish()
Call this after you have finished submitting all data for a frame.
uint32 d1
Dummy value.
Definition: pvr.h:575
void pvr_poly_mod_compile(pvr_poly_mod_hdr_t *dst, pvr_poly_cxt_t *src)
Compile a polygon context into a polygon header that is affected by modifier volumes.
int src_enable
Source blending enable outside modifier.
Definition: pvr.h:107
uint32 oargb1
Vertex offset color (inside)
Definition: pvr.h:710
int enable
Enable/disable texturing.
Definition: pvr.h:228
float u
Texture U coordinate.
Definition: pvr.h:665
uint32 argb
Sprite face color.
Definition: pvr.h:628
uint32 d1
Dummy value.
Definition: pvr.h:644
uint32 buv
Second U/V texture coordinates.
Definition: pvr.h:744
float by
Second Y coordinate.
Definition: pvr.h:783
unsigned long uint32
32-bit unsigned integer
Definition: types.h:28
void pvr_sprite_cxt_col(pvr_sprite_cxt_t *dst, pvr_list_t list)
Fill in a sprite context for non-textured sprites.
int mipmap_bias
Mipmap bias.
Definition: pvr.h:141
void * pvr_vertbuf_tail(pvr_list_t list)
Retrieve a pointer to the current output location in the DMA buffer for the requested list...
#define PVR_SET(REG, VALUE)
Set a PVR register value.
Definition: pvr.h:955
int pvr_prim(void *data, int size)
Submit a primitive of the current list type.
int mipmap_bias
Mipmap bias.
Definition: pvr.h:234
void pvr_poly_cxt_col(pvr_poly_cxt_t *dst, pvr_list_t list)
Fill in a polygon context for non-textured polygons.
int pvr_init(pvr_init_params_t *params)
Initialize the PVR chip to ready status.
void pvr_mem_stats()
Print statistics about the PVR RAM pool.
uint32 cmd
TA command.
Definition: pvr.h:588
uint32 oargb
Sprite offset color.
Definition: pvr.h:629
uint32 d4
Dummy value.
Definition: pvr.h:714
PVR sprite context.
Definition: pvr.h:194
float ay
First Y coordinate.
Definition: pvr.h:780
PVR vertex type: Modifier volume.
Definition: pvr.h:777
Modifier volume header.
Definition: pvr.h:641
int color_clamp
Color clamp enable/disable outside modifier.
Definition: pvr.h:88
int list_type
Primitive list.
Definition: pvr.h:195
void pvr_fog_table_exp2(float density)
Initialize the fog table using an exp2 algorithm (like GL_EXP2).
PVR vertex type: Textured, packed color, affected by modifer volume.
Definition: pvr.h:698
float y
Y coordinate.
Definition: pvr.h:682
int dst
Dest blending mode outside modifier.
Definition: pvr.h:105
PVR initialization structure.
Definition: pvr.h:1077
float z
Z coordinate.
Definition: pvr.h:664
int pvr_list_finish()
End collecting data for the current list type.
int env
Texture color contribution.
Definition: pvr.h:242
float v
Texture V coordinate.
Definition: pvr.h:666
uint32 d1
Dummy value.
Definition: pvr.h:766
void pvr_mem_reset()
Reset the PVR RAM pool.
uint32 mode3
Parameter word 3.
Definition: pvr.h:627
int uv
U/V data format in vertex.
Definition: pvr.h:123
int width
Texture width (requires a power of 2)
Definition: pvr.h:151
uint32 d6
Dummy value.
Definition: pvr.h:793
float u0
Texture U coordinate (outside)
Definition: pvr.h:703
uint32 mode1
Parameter word 1.
Definition: pvr.h:607
int shading
Shading type.
Definition: pvr.h:82
uint32 d5
Dummy value.
Definition: pvr.h:792
uint32 d3
Dummy value.
Definition: pvr.h:577
void pvr_mem_free(pvr_ptr_t chunk)
Free a block of allocated memory in the PVR RAM pool.
float x
X coordinate.
Definition: pvr.h:700
uint32 d4
Dummy value.
Definition: pvr.h:791
float ay
First Y coordinate.
Definition: pvr.h:732
uint32 d2
Dummy value.
Definition: pvr.h:687
uint32 mode3
Parameter word 3.
Definition: pvr.h:591
uint32 d1
Dummy value.
Definition: pvr.h:612
uint32 oargb0
Vertex offset color (outside)
Definition: pvr.h:706
int frame_last_time
Ready-to-Ready length for the last frame in milliseconds.
Definition: pvr.h:1204
uint32 flags
TA command (vertex flags)
Definition: pvr.h:778
int pvr_list_prim(pvr_list_t list, void *data, int size)
Submit a primitive of the given list type.
float b
Face color blue component.
Definition: pvr.h:595
uint32 d1
Dummy value.
Definition: pvr.h:788
void pvr_poly_cxt_col_mod(pvr_poly_cxt_t *dst, pvr_list_t list)
Fill in a polygon context for non-textured polygons affected by a modifier volume.
int culling
Culling mode.
Definition: pvr.h:202
float x
X coordinate.
Definition: pvr.h:662
Generic PVR vertex type.
Definition: pvr.h:660
int fog_type
Fog type.
Definition: pvr.h:200
uint32 flags
TA command (vertex flags)
Definition: pvr.h:754
PVR polygon header specifically for sprites.
Definition: pvr.h:623
int height
Texture height (requires a power of 2)
Definition: pvr.h:152
uint32 flags
TA command (vertex flags)
Definition: pvr.h:699
void pvr_mem_print_list()
Print the list of allocated blocks in the PVR RAM pool.
void pvr_fog_table_linear(float start, float end)
Initialize the fog table using a linear algorithm (like GL_LINEAR).
float bx
Second X coordinate.
Definition: pvr.h:782
uint32 d1
Dummy value.
Definition: pvr.h:711
int modifier_mode
Modifier mode.
Definition: pvr.h:92
float by
Second Y coordinate.
Definition: pvr.h:759
int format
Texture format.
Definition: pvr.h:153
float ax
First X coordinate.
Definition: pvr.h:731
uint32 argb1
Vertex color (inside)
Definition: pvr.h:709
struct pvr_stats pvr_stats_t
PVR statistics structure.
void pvr_fog_far_depth(float d)
Set the fog far depth.
int clip_mode
Clipping mode.
Definition: pvr.h:206
void pvr_mod_compile(pvr_mod_hdr_t *dst, pvr_list_t list, uint32 mode, uint32 cull)
Create a modifier volume header.
float ax
First X coordinate.
Definition: pvr.h:755
int src_enable
Source blending enable.
Definition: pvr.h:216
void pvr_poly_cxt_txr_mod(pvr_poly_cxt_t *dst, pvr_list_t list, int textureformat, int tw, int th, pvr_ptr_t textureaddr, int filtering, int textureformat2, int tw2, int th2, pvr_ptr_t textureaddr2, int filtering2)
Fill in a polygon context for a textured polygon affected by modifier volumes.
int fog_type2
Fog type inside modifier.
Definition: pvr.h:97
float cz
Third Z coordinate.
Definition: pvr.h:787
uint32 mode2_1
Parameter word 2 (inside volume)
Definition: pvr.h:610
uint32 d1
Dummy value.
Definition: pvr.h:630
float u1
Texture U coordinate (inside)
Definition: pvr.h:707
float cz
Third Z coordinate.
Definition: pvr.h:763
int dst_enable
Dest blending enable outside modifier.
Definition: pvr.h:109
void pvr_dma_init()
Initialize PVR DMA.
int comparison
Depth comparison mode.
Definition: pvr.h:222
uint32 d2
Dummy value.
Definition: pvr.h:613
void(* pvr_dma_callback_t)(ptr_t data)
PVR DMA interrupt callback type.
Definition: pvr.h:1937
int src2
Source blending mode inside modifier.
Definition: pvr.h:111
void pvr_dma_shutdown()
Shut down PVR DMA.
int pvr_get_vbl_count()
Retrieve the current VBlank count.
int color_clamp2
Color clamp enable/disable inside modifier.
Definition: pvr.h:99
void pvr_txr_load_ex(void *src, pvr_ptr_t dst, uint32 w, uint32 h, uint32 flags)
Load texture data from an SH-4 buffer into PVR RAM, twiddling it in the process.
uint32 d3
Dummy value.
Definition: pvr.h:713
int env
Texture color contribution.
Definition: pvr.h:149
float cy
Third Y coordinate.
Definition: pvr.h:738
int buf_last_time
DMA buffer file time for the last frame in milliseconds.
Definition: pvr.h:1210
float bz
Second Z coordinate.
Definition: pvr.h:784
int format
Texture format.
Definition: pvr.h:246
int alpha
Enable or disable alpha outside modifier.
Definition: pvr.h:80
int clip_mode
Clipping mode.
Definition: pvr.h:90
int vtx_buffer_used_max
Number of bytes used in the vertex buffer for the largest frame.
Definition: pvr.h:1209
uint32 mode3_0
Parameter word 3 (outside volume)
Definition: pvr.h:609
uint32 cmd
TA command.
Definition: pvr.h:571
int src_enable2
Source blending mode inside modifier.
Definition: pvr.h:115
float r
Face color red component.
Definition: pvr.h:593
int pvr_shutdown()
Shut down the PVR chip from ready status.
uint32 d2
Dummy value.
Definition: pvr.h:789
int modifier
Enable or disable modifier effect.
Definition: pvr.h:125