303#define PVR_LIST_OP_POLY 0
304#define PVR_LIST_OP_MOD 1
305#define PVR_LIST_TR_POLY 2
306#define PVR_LIST_TR_MOD 3
307#define PVR_LIST_PT_POLY 4
325#define PVR_SHADE_FLAT 0
326#define PVR_SHADE_GOURAUD 1
342#define PVR_DEPTHCMP_NEVER 0
343#define PVR_DEPTHCMP_LESS 1
344#define PVR_DEPTHCMP_EQUAL 2
345#define PVR_DEPTHCMP_LEQUAL 3
346#define PVR_DEPTHCMP_GREATER 4
347#define PVR_DEPTHCMP_NOTEQUAL 5
348#define PVR_DEPTHCMP_GEQUAL 6
349#define PVR_DEPTHCMP_ALWAYS 7
362#define PVR_CULLING_NONE 0
363#define PVR_CULLING_SMALL 1
364#define PVR_CULLING_CCW 2
365#define PVR_CULLING_CW 3
373#define PVR_DEPTHWRITE_ENABLE 0
374#define PVR_DEPTHWRITE_DISABLE 1
388#define PVR_TEXTURE_DISABLE 0
389#define PVR_TEXTURE_ENABLE 1
406#define PVR_BLEND_ZERO 0
407#define PVR_BLEND_ONE 1
408#define PVR_BLEND_DESTCOLOR 2
409#define PVR_BLEND_INVDESTCOLOR 3
410#define PVR_BLEND_SRCALPHA 4
411#define PVR_BLEND_INVSRCALPHA 5
412#define PVR_BLEND_DESTALPHA 6
413#define PVR_BLEND_INVDESTALPHA 7
422#define PVR_BLEND_DISABLE 0
423#define PVR_BLEND_ENABLE 1
435#define PVR_FOG_TABLE 0
436#define PVR_FOG_VERTEX 1
437#define PVR_FOG_DISABLE 2
438#define PVR_FOG_TABLE2 3
449#define PVR_USERCLIP_DISABLE 0
450#define PVR_USERCLIP_INSIDE 2
451#define PVR_USERCLIP_OUTSIDE 3
468#define PVR_CLRCLAMP_DISABLE 0
469#define PVR_CLRCLAMP_ENABLE 1
487#define PVR_SPECULAR_DISABLE 0
488#define PVR_SPECULAR_ENABLE 1
500#define PVR_ALPHA_DISABLE 0
501#define PVR_ALPHA_ENABLE 1
513#define PVR_TXRALPHA_ENABLE 0
514#define PVR_TXRALPHA_DISABLE 1
534#define PVR_UVFLIP_NONE 0
535#define PVR_UVFLIP_V 1
536#define PVR_UVFLIP_U 2
537#define PVR_UVFLIP_UV 3
550#define PVR_UVCLAMP_NONE 0
551#define PVR_UVCLAMP_V 1
552#define PVR_UVCLAMP_U 2
553#define PVR_UVCLAMP_UV 3
562#define PVR_FILTER_NONE 0
563#define PVR_FILTER_NEAREST 0
564#define PVR_FILTER_BILINEAR 2
565#define PVR_FILTER_TRILINEAR1 4
566#define PVR_FILTER_TRILINEAR2 6
575#define PVR_MIPBIAS_NORMAL PVR_MIPBIAS_1_00
576#define PVR_MIPBIAS_0_25 1
577#define PVR_MIPBIAS_0_50 2
578#define PVR_MIPBIAS_0_75 3
579#define PVR_MIPBIAS_1_00 4
580#define PVR_MIPBIAS_1_25 5
581#define PVR_MIPBIAS_1_50 6
582#define PVR_MIPBIAS_1_75 7
583#define PVR_MIPBIAS_2_00 8
584#define PVR_MIPBIAS_2_25 9
585#define PVR_MIPBIAS_2_50 10
586#define PVR_MIPBIAS_2_75 11
587#define PVR_MIPBIAS_3_00 12
588#define PVR_MIPBIAS_3_25 13
589#define PVR_MIPBIAS_3_50 14
590#define PVR_MIPBIAS_3_75 15
599#define PVR_TXRENV_REPLACE 0
600#define PVR_TXRENV_MODULATE 1
601#define PVR_TXRENV_DECAL 2
602#define PVR_TXRENV_MODULATEALPHA 3
611#define PVR_MIPMAP_DISABLE 0
612#define PVR_MIPMAP_ENABLE 1
624#define PVR_TXRFMT_NONE 0
625#define PVR_TXRFMT_VQ_DISABLE (0 << 30)
626#define PVR_TXRFMT_VQ_ENABLE (1 << 30)
627#define PVR_TXRFMT_ARGB1555 (0 << 27)
628#define PVR_TXRFMT_RGB565 (1 << 27)
629#define PVR_TXRFMT_ARGB4444 (2 << 27)
630#define PVR_TXRFMT_YUV422 (3 << 27)
631#define PVR_TXRFMT_BUMP (4 << 27)
632#define PVR_TXRFMT_PAL4BPP (5 << 27)
633#define PVR_TXRFMT_PAL8BPP (6 << 27)
634#define PVR_TXRFMT_TWIDDLED (0 << 26)
635#define PVR_TXRFMT_NONTWIDDLED (1 << 26)
636#define PVR_TXRFMT_NOSTRIDE (0 << 21)
637#define PVR_TXRFMT_STRIDE (1 << 21)
646#define PVR_TXRFMT_8BPP_PAL(x) ((x) << 25)
651#define PVR_TXRFMT_4BPP_PAL(x) ((x) << 21)
662#define PVR_CLRFMT_ARGBPACKED 0
663#define PVR_CLRFMT_4FLOATS 1
664#define PVR_CLRFMT_INTENSITY 2
665#define PVR_CLRFMT_INTENSITY_PREV 3
673#define PVR_UVFMT_32BIT 0
674#define PVR_UVFMT_16BIT 1
687#define PVR_MODIFIER_DISABLE 0
688#define PVR_MODIFIER_ENABLE 1
696#define PVR_MODIFIER_CHEAP_SHADOW 0
697#define PVR_MODIFIER_NORMAL 1
710#define PVR_MODIFIER_OTHER_POLY 0
711#define PVR_MODIFIER_INCLUDE_LAST_POLY 1
712#define PVR_MODIFIER_EXCLUDE_LAST_POLY 2
729typedef struct pvr_poly_hdr {
747typedef struct pvr_poly_ic_hdr {
766typedef struct pvr_poly_mod_hdr {
785typedef struct pvr_sprite_hdr {
804typedef struct pvr_mod_hdr {
833typedef struct pvr_vertex {
853typedef struct pvr_vertex_pcm {
873typedef struct pvr_vertex_tpcm {
905typedef struct pvr_sprite_txr {
930typedef struct pvr_sprite_col {
955typedef struct pvr_modifier_vol {
985#define PVR_PACK_COLOR(a, r, g, b) ( \
986 ( ((uint8_t)( (a) * 255 ) ) << 24 ) | \
987 ( ((uint8_t)( (r) * 255 ) ) << 16 ) | \
988 ( ((uint8_t)( (g) * 255 ) ) << 8 ) | \
989 ( ((uint8_t)( (b) * 255 ) ) << 0 ) )
1007 return (u2.i & 0xFFFF0000) | (v2.i >> 16);
1021#define PVR_CMD_POLYHDR 0x80840000
1023#define PVR_CMD_VERTEX 0xe0000000
1024#define PVR_CMD_VERTEX_EOL 0xf0000000
1025#define PVR_CMD_USERCLIP 0x20000000
1026#define PVR_CMD_MODIFIER 0x80000000
1027#define PVR_CMD_SPRITE 0xA0000000
1033#define PVR_TA_CMD_TYPE_SHIFT 24
1034#define PVR_TA_CMD_TYPE_MASK (7 << PVR_TA_CMD_TYPE_SHIFT)
1036#define PVR_TA_CMD_USERCLIP_SHIFT 16
1037#define PVR_TA_CMD_USERCLIP_MASK (3 << PVR_TA_CMD_USERCLIP_SHIFT)
1039#define PVR_TA_CMD_CLRFMT_SHIFT 4
1040#define PVR_TA_CMD_CLRFMT_MASK (7 << PVR_TA_CMD_CLRFMT_SHIFT)
1042#define PVR_TA_CMD_SPECULAR_SHIFT 2
1043#define PVR_TA_CMD_SPECULAR_MASK (1 << PVR_TA_CMD_SPECULAR_SHIFT)
1045#define PVR_TA_CMD_SHADE_SHIFT 1
1046#define PVR_TA_CMD_SHADE_MASK (1 << PVR_TA_CMD_SHADE_SHIFT)
1048#define PVR_TA_CMD_UVFMT_SHIFT 0
1049#define PVR_TA_CMD_UVFMT_MASK (1 << PVR_TA_CMD_UVFMT_SHIFT)
1051#define PVR_TA_CMD_MODIFIER_SHIFT 7
1052#define PVR_TA_CMD_MODIFIER_MASK (1 << PVR_TA_CMD_MODIFIER_SHIFT)
1054#define PVR_TA_CMD_MODIFIERMODE_SHIFT 6
1055#define PVR_TA_CMD_MODIFIERMODE_MASK (1 << PVR_TA_CMD_MODIFIERMODE_SHIFT)
1057#define PVR_TA_PM1_DEPTHCMP_SHIFT 29
1058#define PVR_TA_PM1_DEPTHCMP_MASK (7 << PVR_TA_PM1_DEPTHCMP_SHIFT)
1060#define PVR_TA_PM1_CULLING_SHIFT 27
1061#define PVR_TA_PM1_CULLING_MASK (3 << PVR_TA_PM1_CULLING_SHIFT)
1063#define PVR_TA_PM1_DEPTHWRITE_SHIFT 26
1064#define PVR_TA_PM1_DEPTHWRITE_MASK (1 << PVR_TA_PM1_DEPTHWRITE_SHIFT)
1066#define PVR_TA_PM1_TXRENABLE_SHIFT 25
1067#define PVR_TA_PM1_TXRENABLE_MASK (1 << PVR_TA_PM1_TXRENABLE_SHIFT)
1069#define PVR_TA_PM1_MODIFIERINST_SHIFT 29
1070#define PVR_TA_PM1_MODIFIERINST_MASK (3 << PVR_TA_PM1_MODIFIERINST_SHIFT)
1072#define PVR_TA_PM2_SRCBLEND_SHIFT 29
1073#define PVR_TA_PM2_SRCBLEND_MASK (7 << PVR_TA_PM2_SRCBLEND_SHIFT)
1075#define PVR_TA_PM2_DSTBLEND_SHIFT 26
1076#define PVR_TA_PM2_DSTBLEND_MASK (7 << PVR_TA_PM2_DSTBLEND_SHIFT)
1078#define PVR_TA_PM2_SRCENABLE_SHIFT 25
1079#define PVR_TA_PM2_SRCENABLE_MASK (1 << PVR_TA_PM2_SRCENABLE_SHIFT)
1081#define PVR_TA_PM2_DSTENABLE_SHIFT 24
1082#define PVR_TA_PM2_DSTENABLE_MASK (1 << PVR_TA_PM2_DSTENABLE_SHIFT)
1084#define PVR_TA_PM2_FOG_SHIFT 22
1085#define PVR_TA_PM2_FOG_MASK (3 << PVR_TA_PM2_FOG_SHIFT)
1087#define PVR_TA_PM2_CLAMP_SHIFT 21
1088#define PVR_TA_PM2_CLAMP_MASK (1 << PVR_TA_PM2_CLAMP_SHIFT)
1090#define PVR_TA_PM2_ALPHA_SHIFT 20
1091#define PVR_TA_PM2_ALPHA_MASK (1 << PVR_TA_PM2_ALPHA_SHIFT)
1093#define PVR_TA_PM2_TXRALPHA_SHIFT 19
1094#define PVR_TA_PM2_TXRALPHA_MASK (1 << PVR_TA_PM2_TXRALPHA_SHIFT)
1096#define PVR_TA_PM2_UVFLIP_SHIFT 17
1097#define PVR_TA_PM2_UVFLIP_MASK (3 << PVR_TA_PM2_UVFLIP_SHIFT)
1099#define PVR_TA_PM2_UVCLAMP_SHIFT 15
1100#define PVR_TA_PM2_UVCLAMP_MASK (3 << PVR_TA_PM2_UVCLAMP_SHIFT)
1102#define PVR_TA_PM2_FILTER_SHIFT 12
1103#define PVR_TA_PM2_FILTER_MASK (7 << PVR_TA_PM2_FILTER_SHIFT)
1105#define PVR_TA_PM2_MIPBIAS_SHIFT 8
1106#define PVR_TA_PM2_MIPBIAS_MASK (15 << PVR_TA_PM2_MIPBIAS_SHIFT)
1108#define PVR_TA_PM2_TXRENV_SHIFT 6
1109#define PVR_TA_PM2_TXRENV_MASK (3 << PVR_TA_PM2_TXRENV_SHIFT)
1111#define PVR_TA_PM2_USIZE_SHIFT 3
1112#define PVR_TA_PM2_USIZE_MASK (7 << PVR_TA_PM2_USIZE_SHIFT)
1114#define PVR_TA_PM2_VSIZE_SHIFT 0
1115#define PVR_TA_PM2_VSIZE_MASK (7 << PVR_TA_PM2_VSIZE_SHIFT)
1117#define PVR_TA_PM3_MIPMAP_SHIFT 31
1118#define PVR_TA_PM3_MIPMAP_MASK (1 << PVR_TA_PM3_MIPMAP_SHIFT)
1120#define PVR_TA_PM3_TXRFMT_SHIFT 0
1121#define PVR_TA_PM3_TXRFMT_MASK 0xffffffff
1133#define PVR_TA_CMD_TYPE GENMASK(26, 24)
1134#define PVR_TA_CMD_USERCLIP GENMASK(17, 16)
1135#define PVR_TA_CMD_MODIFIER BIT(7)
1136#define PVR_TA_CMD_MODIFIERMODE BIT(6)
1137#define PVR_TA_CMD_CLRFMT GENMASK(5, 4)
1138#define PVR_TA_CMD_TXRENABLE BIT(3)
1139#define PVR_TA_CMD_SPECULAR BIT(2)
1140#define PVR_TA_CMD_SHADE BIT(1)
1141#define PVR_TA_CMD_UVFMT BIT(0)
1142#define PVR_TA_PM1_DEPTHCMP GENMASK(31, 29)
1143#define PVR_TA_PM1_CULLING GENMASK(28, 27)
1144#define PVR_TA_PM1_DEPTHWRITE BIT(26)
1145#define PVR_TA_PM1_TXRENABLE BIT(25)
1146#define PVR_TA_PM1_MODIFIERINST GENMASK(30, 29)
1147#define PVR_TA_PM2_SRCBLEND GENMASK(31, 29)
1148#define PVR_TA_PM2_DSTBLEND GENMASK(28, 26)
1149#define PVR_TA_PM2_SRCENABLE BIT(25)
1150#define PVR_TA_PM2_DSTENABLE BIT(24)
1151#define PVR_TA_PM2_FOG GENMASK(23, 22)
1152#define PVR_TA_PM2_CLAMP BIT(21)
1153#define PVR_TA_PM2_ALPHA BIT(20)
1154#define PVR_TA_PM2_TXRALPHA BIT(19)
1155#define PVR_TA_PM2_UVFLIP GENMASK(18, 17)
1156#define PVR_TA_PM2_UVCLAMP GENMASK(16, 15)
1157#define PVR_TA_PM2_FILTER GENMASK(14, 12)
1158#define PVR_TA_PM2_MIPBIAS GENMASK(11, 8)
1159#define PVR_TA_PM2_TXRENV GENMASK(7, 6)
1160#define PVR_TA_PM2_USIZE GENMASK(5, 3)
1161#define PVR_TA_PM2_VSIZE GENMASK(2, 0)
1162#define PVR_TA_PM3_MIPMAP BIT(31)
1163#define PVR_TA_PM3_TXRFMT GENMASK(30, 21)
1183#define PVR_GET(REG) (* ( (vuint32*)( 0xa05f8000 + (REG) ) ) )
1190#define PVR_SET(REG, VALUE) PVR_GET(REG) = (VALUE)
1207#define PVR_ID 0x0000
1208#define PVR_REVISION 0x0004
1209#define PVR_RESET 0x0008
1211#define PVR_ISP_START 0x0014
1212#define PVR_UNK_0018 0x0018
1214#define PVR_ISP_VERTBUF_ADDR 0x0020
1216#define PVR_ISP_TILEMAT_ADDR 0x002c
1217#define PVR_SPANSORT_CFG 0x0030
1219#define PVR_BORDER_COLOR 0x0040
1220#define PVR_FB_CFG_1 0x0044
1221#define PVR_FB_CFG_2 0x0048
1222#define PVR_RENDER_MODULO 0x004c
1223#define PVR_FB_ADDR 0x0050
1224#define PVR_FB_IL_ADDR 0x0054
1226#define PVR_FB_SIZE 0x005c
1227#define PVR_RENDER_ADDR 0x0060
1228#define PVR_RENDER_ADDR_2 0x0064
1229#define PVR_PCLIP_X 0x0068
1230#define PVR_PCLIP_Y 0x006c
1232#define PVR_CHEAP_SHADOW 0x0074
1233#define PVR_OBJECT_CLIP 0x0078
1234#define PVR_UNK_007C 0x007c
1235#define PVR_UNK_0080 0x0080
1236#define PVR_TEXTURE_CLIP 0x0084
1237#define PVR_BGPLANE_Z 0x0088
1238#define PVR_BGPLANE_CFG 0x008c
1240#define PVR_UNK_0098 0x0098
1242#define PVR_UNK_00A0 0x00a0
1244#define PVR_UNK_00A8 0x00a8
1246#define PVR_FOG_TABLE_COLOR 0x00b0
1247#define PVR_FOG_VERTEX_COLOR 0x00b4
1248#define PVR_FOG_DENSITY 0x00b8
1249#define PVR_COLOR_CLAMP_MAX 0x00bc
1250#define PVR_COLOR_CLAMP_MIN 0x00c0
1251#define PVR_GUN_POS 0x00c4
1252#define PVR_HPOS_IRQ 0x00c8
1253#define PVR_VPOS_IRQ 0x00cc
1254#define PVR_IL_CFG 0x00d0
1255#define PVR_BORDER_X 0x00d4
1256#define PVR_SCAN_CLK 0x00d8
1257#define PVR_BORDER_Y 0x00dc
1259#define PVR_TEXTURE_MODULO 0x00e4
1260#define PVR_VIDEO_CFG 0x00e8
1261#define PVR_BITMAP_X 0x00ec
1262#define PVR_BITMAP_Y 0x00f0
1263#define PVR_SCALER_CFG 0x00f4
1265#define PVR_PALETTE_CFG 0x0108
1266#define PVR_SYNC_STATUS 0x010c
1267#define PVR_UNK_0110 0x0110
1268#define PVR_UNK_0114 0x0114
1269#define PVR_UNK_0118 0x0118
1271#define PVR_TA_OPB_START 0x0124
1272#define PVR_TA_VERTBUF_START 0x0128
1273#define PVR_TA_OPB_END 0x012c
1274#define PVR_TA_VERTBUF_END 0x0130
1275#define PVR_TA_OPB_POS 0x0134
1276#define PVR_TA_VERTBUF_POS 0x0138
1277#define PVR_TILEMAT_CFG 0x013c
1278#define PVR_OPB_CFG 0x0140
1279#define PVR_TA_INIT 0x0144
1280#define PVR_YUV_ADDR 0x0148
1281#define PVR_YUV_CFG 0x014c
1282#define PVR_YUV_STAT 0x0150
1284#define PVR_UNK_0160 0x0160
1285#define PVR_TA_OPB_INIT 0x0164
1287#define PVR_FOG_TABLE_BASE 0x0200
1289#define PVR_PALETTE_TABLE_BASE 0x1000
1300#define PVR_TA_INPUT 0x10000000
1301#define PVR_TA_YUV_CONV 0x10800000
1302#define PVR_TA_TEX_MEM 0x11000000
1303#define PVR_TA_TEX_MEM_32 0x13000000
1304#define PVR_RAM_BASE_32_P0 0x05000000
1305#define PVR_RAM_BASE_64_P0 0x04000000
1306#define PVR_RAM_BASE 0xa5000000
1307#define PVR_RAM_INT_BASE 0xa4000000
1309#define PVR_RAM_SIZE (8*1024*1024)
1311#define PVR_RAM_TOP (PVR_RAM_BASE + PVR_RAM_SIZE)
1312#define PVR_RAM_INT_TOP (PVR_RAM_INT_BASE + PVR_RAM_SIZE)
1327#define PVR_RESET_ALL 0xffffffff
1328#define PVR_RESET_NONE 0x00000000
1329#define PVR_RESET_TA 0x00000001
1330#define PVR_RESET_ISPTSP 0x00000002
1338#define PVR_ISP_START_GO 0xffffffff
1340#define PVR_TA_INIT_GO 0x80000000
1357#define PVR_BINSIZE_0 0
1358#define PVR_BINSIZE_8 8
1359#define PVR_BINSIZE_16 16
1360#define PVR_BINSIZE_32 32
1535typedef struct pvr_stats {
1586typedef enum pvr_palfmt {
2026#define pvr_dr_target(vtx_buf_ptr) \
2027 ({ (vtx_buf_ptr) ^= 32; \
2028 (pvr_vertex_t *)(MEM_AREA_SQ_BASE | (vtx_buf_ptr)); \
2036#define pvr_dr_commit(addr) sq_flush(addr)
2180 int textureformat,
int tw,
int th,
pvr_ptr_t textureaddr,
2224 int textureformat,
int tw,
int th,
pvr_ptr_t textureaddr,
2297 int textureformat,
int tw,
int th,
2299 int textureformat2,
int tw2,
int th2,
2300 pvr_ptr_t textureaddr2,
int filtering2);
2332#define PVR_TXRLOAD_4BPP 0x01
2333#define PVR_TXRLOAD_8BPP 0x02
2334#define PVR_TXRLOAD_16BPP 0x03
2335#define PVR_TXRLOAD_FMT_MASK 0x0f
2337#define PVR_TXRLOAD_VQ_LOAD 0x10
2338#define PVR_TXRLOAD_INVERT_Y 0x20
2339#define PVR_TXRLOAD_FMT_VQ 0x40
2340#define PVR_TXRLOAD_FMT_TWIDDLED 0x80
2341#define PVR_TXRLOAD_FMT_NOTWIDDLE 0x80
2342#define PVR_TXRLOAD_DMA 0x8000
2343#define PVR_TXRLOAD_NONBLOCK 0x4000
2344#define PVR_TXRLOAD_SQ 0x2000
2370 uint32_t w, uint32_t h, uint32_t flags);
2428typedef enum pvr_dma_type {
Cache management functionality.
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.
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.
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.
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.
void pvr_poly_cxt_col(pvr_poly_cxt_t *dst, pvr_list_t list)
Fill in a polygon context for non-textured polygons.
void pvr_sprite_cxt_col(pvr_sprite_cxt_t *dst, pvr_list_t list)
Fill in a sprite context for non-textured sprites.
void pvr_send_to_ta(void *data)
Upload a 32-byte payload to the Tile Accelerator.
void pvr_dr_init(pvr_dr_state_t *vtx_buf_ptr)
Initialize a state variable for Direct Rendering.
uint32_t pvr_dr_state_t
Direct Rendering state variable type.
Definition pvr.h:2006
void pvr_dr_finish(void)
Finish work with Direct Rendering.
pvr_dma_type_t
Definition pvr.h:2428
@ PVR_DMA_TA
Transfer to the tile accelerator.
Definition pvr.h:2431
@ PVR_DMA_VRAM32_SB
Transfer to/from VRAM using PVR i/f.
Definition pvr.h:2433
@ PVR_DMA_VRAM32
Transfer to VRAM using TA bus.
Definition pvr.h:2430
@ PVR_DMA_YUV
Transfer to the YUV converter (TA)
Definition pvr.h:2432
@ PVR_DMA_VRAM64_SB
Transfer to/from VRAM using PVR i/f.
Definition pvr.h:2434
@ PVR_DMA_VRAM64
Transfer to VRAM using TA bus.
Definition pvr.h:2429
void(* pvr_dma_callback_t)(void *data)
PVR DMA interrupt callback type.
Definition pvr.h:2420
int pvr_dma_transfer(const void *src, uintptr_t dest, size_t count, pvr_dma_type_t type, int block, pvr_dma_callback_t callback, void *cbdata)
Perform a DMA transfer to the PVR RAM over 64-bit TA bus.
int pvr_txr_load_dma(void *src, pvr_ptr_t dest, size_t count, int block, pvr_dma_callback_t callback, void *cbdata)
Load a texture using TA DMA.
int pvr_dma_load_ta(void *src, size_t count, int block, pvr_dma_callback_t callback, void *cbdata)
Load vertex data to the TA using TA DMA.
int pvr_dma_ready(void)
Is PVR DMA is inactive?
int pvr_dma_yuv_conv(void *src, size_t count, int block, pvr_dma_callback_t callback, void *cbdata)
Load yuv data to the YUV converter using TA DMA.
void pvr_dma_init(void)
Initialize TA/PVR DMA.
void pvr_dma_shutdown(void)
Shut down TA/PVR DMA.
void pvr_fog_table_exp2(float density)
Initialize the fog table using an exp2 algorithm (like GL_EXP2).
void pvr_fog_table_linear(float start, float end)
Initialize the fog table using a linear algorithm (like GL_LINEAR).
void pvr_fog_table_custom(float tbl1[])
Set a custom fog table from float values.
void pvr_fog_table_color(float a, float r, float g, float b)
Set the table fog color.
void pvr_fog_far_depth(float d)
Set the fog far depth.
void pvr_fog_table_exp(float density)
Initialize the fog table using an exp algorithm (like GL_EXP).
void pvr_fog_vertex_color(float a, float r, float g, float b)
Set the vertex fog color.
void pvr_set_zclip(float zc)
Set Z clipping depth.
void pvr_set_bg_color(float r, float g, float b)
Set the background plane color.
void pvr_set_shadow_scale(int enable, float scale_value)
Set cheap shadow parameters.
int pvr_shutdown(void)
Shut down the PVR chip from ready status.
int pvr_init_defaults(void)
Simple PVR initialization.
int pvr_init(pvr_init_params_t *params)
Initialize the PVR chip to ready status.
int pvr_list_flush(pvr_list_t list)
Flush the buffered data of the given list type to the TA.
int pvr_list_prim(pvr_list_t list, void *data, int size)
Submit a primitive of the given list type.
void * pvr_set_vertbuf(pvr_list_t list, void *buffer, int len)
Setup a vertex buffer for one of the list types.
int pvr_list_finish(void)
End collecting data for the current list type.
int pvr_prim(void *data, int size)
Submit a primitive of the current list type.
int pvr_list_begin(pvr_list_t list)
Begin collecting data for the given list type.
uint32_t pvr_list_t
PVR list specification.
Definition pvr.h:81
void pvr_mem_reset(void)
Reset the PVR RAM pool.
void pvr_mem_free(pvr_ptr_t chunk)
Free a block of allocated memory in the PVR RAM pool.
void pvr_mem_stats(void)
Print statistics about the PVR RAM pool.
void pvr_mem_print_list(void)
Print the list of allocated blocks in the PVR RAM pool.
pvr_ptr_t pvr_mem_malloc(size_t size)
Allocate a chunk of memory from texture space.
uint32_t pvr_mem_available(void)
Return the number of bytes available still in the PVR RAM pool.
static void pvr_set_pal_entry(uint32_t idx, uint32_t value)
Set a palette value.
Definition pvr.h:1621
void pvr_set_pal_format(pvr_palfmt_t fmt)
Set the palette format.
pvr_palfmt_t
Definition pvr.h:1586
@ PVR_PAL_ARGB1555
16-bit ARGB1555 palette format
Definition pvr.h:1587
@ PVR_PAL_ARGB4444
16-bit ARGB4444 palette format
Definition pvr.h:1589
@ PVR_PAL_RGB565
16-bit RGB565 palette format
Definition pvr.h:1588
@ PVR_PAL_ARGB8888
32-bit ARGB8888 palette format
Definition pvr.h:1590
void pvr_mod_compile(pvr_mod_hdr_t *dst, pvr_list_t list, uint32_t mode, uint32_t cull)
Create a modifier volume header.
void pvr_poly_compile(pvr_poly_hdr_t *dst, const pvr_poly_cxt_t *src)
Compile a polygon context into a polygon header.
void pvr_poly_mod_compile(pvr_poly_mod_hdr_t *dst, const pvr_poly_cxt_t *src)
Compile a polygon context into a polygon header that is affected by modifier volumes.
void pvr_sprite_compile(pvr_sprite_hdr_t *dst, const pvr_sprite_cxt_t *src)
Compile a sprite context into a sprite header.
#define PVR_SET(REG, VALUE)
Set a PVR register value.
Definition pvr.h:1190
#define PVR_PALETTE_TABLE_BASE
Base of the palette table.
Definition pvr.h:1289
int pvr_scene_finish(void)
Call this after you have finished submitting all data for a frame.
void pvr_scene_begin_txr(pvr_ptr_t txr, uint32_t *rx, uint32_t *ry)
Begin collecting data for a frame of 3D output to the specified texture.
void pvr_scene_begin(void)
Begin collecting data for a frame of 3D output to the off-screen frame buffer.
void pvr_set_presort_mode(int presort)
Set the translucent polygon sort mode for the next frame.
int pvr_check_ready(void)
Check if the PVR system is ready for another frame to be submitted.
int pvr_wait_ready(void)
Block the caller until the PVR system is ready for another frame to be submitted.
int pvr_get_vbl_count(void)
Retrieve the current VBlank count.
int pvr_get_stats(pvr_stats_t *stat)
Get the current statistics from the PVR.
void pvr_txr_load(const void *src, pvr_ptr_t dst, uint32_t count)
Load raw texture data from an SH-4 buffer into PVR RAM.
void pvr_txr_load_kimg(const kos_img_t *img, pvr_ptr_t dst, uint32_t flags)
Load a KOS Platform Independent Image (subject to constraint checking).
void pvr_txr_load_ex(const void *src, pvr_ptr_t dst, uint32_t w, uint32_t h, uint32_t flags)
Load texture data from an SH-4 buffer into PVR RAM, twiddling it in the process.
int pvr_vertex_dma_enabled(void)
Is vertex DMA enabled?
void pvr_vertbuf_written(pvr_list_t list, uint32_t amt)
Notify the PVR system that data have been written into the output buffer for the given list.
void * pvr_vertbuf_tail(pvr_list_t list)
Retrieve a pointer to the current output location in the DMA buffer for the requested list.
static uint32_t 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:998
void * pvr_ptr_t
PVR texture memory pointer.
Definition pvr.h:66
void * pvr_sq_set16(void *dest, uint32_t c, size_t n, pvr_dma_type_t type)
Set a block of PVR memory to a 16-bit value.
void * pvr_sq_set32(void *dest, uint32_t c, size_t n, pvr_dma_type_t type)
Set a block of PVR memory to a 32-bit value.
void * pvr_sq_load(void *dest, const void *src, size_t n, pvr_dma_type_t type)
Copy a block of memory to VRAM.
Platform-independent image type.
Constants for areas of the system memory map.
Macros to help dealing with register fields.
Functions to access the SH4 Store Queues.
Platform-indpendent image type.
Definition img.h:51
PVR initialization structure.
Definition pvr.h:1374
int fsaa_enabled
Enable horizontal scaling?
Definition pvr.h:1398
int dma_enabled
Enable vertex DMA?
Definition pvr.h:1391
int vertex_buf_size
Vertex buffer size (should be a nice round number)
Definition pvr.h:1383
int autosort_disabled
Disable translucent polygon autosort?
Definition pvr.h:1406
int opb_overflow_count
OPB Overflow Count.
Definition pvr.h:1417
Modifier volume header.
Definition pvr.h:804
uint32_t d4
Dummy value.
Definition pvr.h:811
uint32_t mode1
Parameter word 1.
Definition pvr.h:807
uint32_t d5
Dummy value.
Definition pvr.h:812
uint32_t d2
Dummy value.
Definition pvr.h:809
uint32_t d3
Dummy value.
Definition pvr.h:810
uint32_t d1
Dummy value.
Definition pvr.h:808
uint32_t d6
Dummy value.
Definition pvr.h:813
PVR vertex type: Modifier volume.
Definition pvr.h:955
uint32_t d1
Dummy value.
Definition pvr.h:967
uint32_t d4
Dummy value.
Definition pvr.h:970
float by
Second Y coordinate.
Definition pvr.h:962
float ay
First Y coordinate.
Definition pvr.h:959
float ax
First X coordinate.
Definition pvr.h:958
uint32_t d3
Dummy value.
Definition pvr.h:969
float cz
Third Z coordinate.
Definition pvr.h:966
float bz
Second Z coordinate.
Definition pvr.h:963
float cy
Third Y coordinate.
Definition pvr.h:965
uint32_t d6
Dummy value.
Definition pvr.h:972
uint32_t d2
Dummy value.
Definition pvr.h:968
uint32_t d5
Dummy value.
Definition pvr.h:971
float bx
Second X coordinate.
Definition pvr.h:961
float az
First Z coordinate.
Definition pvr.h:960
float cx
Third X coordinate.
Definition pvr.h:964
PVR polygon context.
Definition pvr.h:115
int clip_mode
Clipping mode.
Definition pvr.h:129
int modifier_mode
Modifier mode.
Definition pvr.h:131
int mipmap_bias
Mipmap bias.
Definition pvr.h:180
int src2
Source blending mode inside modifier.
Definition pvr.h:150
int write
Enable or disable depth writes.
Definition pvr.h:170
int dst_enable
Dest blending enable outside modifier.
Definition pvr.h:148
int dst
Dest blending mode outside modifier.
Definition pvr.h:144
int fog_type2
Fog type inside modifier.
Definition pvr.h:136
int src
Source blending mode outside modifier.
Definition pvr.h:142
int color_clamp2
Color clamp enable/disable inside modifier.
Definition pvr.h:138
int alpha2
Enable/disable alpha inside modifier.
Definition pvr.h:134
int env
Texture color contribution.
Definition pvr.h:188
pvr_ptr_t base
Texture pointer.
Definition pvr.h:194
int culling
Culling mode.
Definition pvr.h:125
int width
Texture width (requires a power of 2)
Definition pvr.h:190
int color
Color format in vertex.
Definition pvr.h:160
int specular
Offset color enable/disable outside modifier.
Definition pvr.h:132
int height
Texture height (requires a power of 2)
Definition pvr.h:191
int comparison
Depth comparison mode.
Definition pvr.h:168
int src_enable
Source blending enable outside modifier.
Definition pvr.h:146
int dst2
Dest blending mode inside modifier.
Definition pvr.h:152
int fog_type
Fog type outside modifier.
Definition pvr.h:123
int shading
Shading type.
Definition pvr.h:121
int modifier
Enable or disable modifier effect.
Definition pvr.h:164
int uv_flip
Enable/disable U/V flipping.
Definition pvr.h:182
int list_type
Primitive list.
Definition pvr.h:116
int mipmap
Enable/disable mipmaps.
Definition pvr.h:178
int dst_enable2
Dest blending mode inside modifier.
Definition pvr.h:156
int filter
Filtering mode.
Definition pvr.h:176
int src_enable2
Source blending mode inside modifier.
Definition pvr.h:154
int color_clamp
Color clamp enable/disable outside modifier.
Definition pvr.h:127
int uv_clamp
Enable/disable U/V clamping.
Definition pvr.h:184
int alpha
Enable or disable alpha outside modifier.
Definition pvr.h:119
int format
Texture format.
Definition pvr.h:192
int enable
Enable/disable texturing.
Definition pvr.h:174
int uv
U/V data format in vertex.
Definition pvr.h:162
PVR polygon header.
Definition pvr.h:729
uint32_t d1
Dummy value.
Definition pvr.h:735
uint32_t mode3
Parameter word 3.
Definition pvr.h:734
uint32_t mode1
Parameter word 1.
Definition pvr.h:732
uint32_t mode2
Parameter word 2.
Definition pvr.h:733
uint32_t d2
Dummy value.
Definition pvr.h:736
uint32_t d3
Dummy value.
Definition pvr.h:737
uint32_t d4
Dummy value.
Definition pvr.h:738
PVR polygon header with intensity color.
Definition pvr.h:747
float b
Face color blue component.
Definition pvr.h:756
uint32_t mode3
Parameter word 3.
Definition pvr.h:752
float r
Face color red component.
Definition pvr.h:754
uint32_t mode1
Parameter word 1.
Definition pvr.h:750
float a
Face color alpha component.
Definition pvr.h:753
uint32_t mode2
Parameter word 2.
Definition pvr.h:751
float g
Face color green component.
Definition pvr.h:755
PVR polygon header to be used with modifier volumes.
Definition pvr.h:766
uint32_t mode3_1
Parameter word 3 (inside volume)
Definition pvr.h:773
uint32_t d2
Dummy value.
Definition pvr.h:775
uint32_t mode2_0
Parameter word 2 (outside volume)
Definition pvr.h:770
uint32_t d1
Dummy value.
Definition pvr.h:774
uint32_t mode2_1
Parameter word 2 (inside volume)
Definition pvr.h:772
uint32_t mode1
Parameter word 1.
Definition pvr.h:769
uint32_t mode3_0
Parameter word 3 (outside volume)
Definition pvr.h:771
PVR vertex type: Untextured sprite.
Definition pvr.h:930
float bz
Second Z coordinate.
Definition pvr.h:938
float ay
First Y coordinate.
Definition pvr.h:934
uint32_t d3
Dummy value.
Definition pvr.h:946
float cz
Third Z coordinate.
Definition pvr.h:941
float bx
Second X coordinate.
Definition pvr.h:936
uint32_t d1
Dummy value.
Definition pvr.h:944
float cy
Third Y coordinate.
Definition pvr.h:940
float ax
First X coordinate.
Definition pvr.h:933
float by
Second Y coordinate.
Definition pvr.h:937
uint32_t d4
Dummy value.
Definition pvr.h:947
float dy
Fourth Y coordinate.
Definition pvr.h:943
uint32_t d2
Dummy value.
Definition pvr.h:945
float cx
Third X coordinate.
Definition pvr.h:939
float az
First Z coordinate.
Definition pvr.h:935
float dx
Fourth X coordinate.
Definition pvr.h:942
PVR sprite context.
Definition pvr.h:234
int color_clamp
Color clamp enable/disable.
Definition pvr.h:244
int write
Enable or disable depth writes.
Definition pvr.h:264
int env
Texture color contribution.
Definition pvr.h:282
int enable
Enable/disable texturing.
Definition pvr.h:268
int src_enable
Source blending enable.
Definition pvr.h:256
int dst
Dest blending mode.
Definition pvr.h:254
int clip_mode
Clipping mode.
Definition pvr.h:246
int list_type
Primitive list.
Definition pvr.h:235
int dst_enable
Dest blending enable.
Definition pvr.h:258
int specular
Offset color enable/disable.
Definition pvr.h:248
int src
Source blending mode.
Definition pvr.h:252
int alpha
Enable or disable alpha.
Definition pvr.h:238
int width
Texture width (requires a power of 2)
Definition pvr.h:284
int filter
Filtering mode.
Definition pvr.h:270
int comparison
Depth comparison mode.
Definition pvr.h:262
pvr_ptr_t base
Texture pointer.
Definition pvr.h:288
int mipmap
Enable/disable mipmaps.
Definition pvr.h:272
int mipmap_bias
Mipmap bias.
Definition pvr.h:274
int uv_flip
Enable/disable U/V flipping.
Definition pvr.h:276
int uv_clamp
Enable/disable U/V clamping.
Definition pvr.h:278
int fog_type
Fog type.
Definition pvr.h:240
int height
Texture height (requires a power of 2)
Definition pvr.h:285
int format
Texture format.
Definition pvr.h:286
int culling
Culling mode.
Definition pvr.h:242
PVR polygon header specifically for sprites.
Definition pvr.h:785
uint32_t oargb
Sprite offset color.
Definition pvr.h:792
uint32_t d2
Dummy value.
Definition pvr.h:794
uint32_t mode1
Parameter word 1.
Definition pvr.h:788
uint32_t mode2
Parameter word 2.
Definition pvr.h:789
uint32_t d1
Dummy value.
Definition pvr.h:793
uint32_t mode3
Parameter word 3.
Definition pvr.h:790
uint32_t argb
Sprite face color.
Definition pvr.h:791
PVR vertex type: Textured sprite.
Definition pvr.h:905
float bz
Second Z coordinate.
Definition pvr.h:913
float dx
Fourth X coordinate.
Definition pvr.h:917
float az
First Z coordinate.
Definition pvr.h:910
float ax
First X coordinate.
Definition pvr.h:908
uint32_t buv
Second U/V texture coordinates.
Definition pvr.h:921
float cz
Third Z coordinate.
Definition pvr.h:916
uint32_t dummy
Dummy value.
Definition pvr.h:919
float by
Second Y coordinate.
Definition pvr.h:912
uint32_t auv
First U/V texture coordinates.
Definition pvr.h:920
float dy
Fourth Y coordinate.
Definition pvr.h:918
float cx
Third X coordinate.
Definition pvr.h:914
uint32_t cuv
Third U/V texture coordinates.
Definition pvr.h:922
float bx
Second X coordinate.
Definition pvr.h:911
float cy
Third Y coordinate.
Definition pvr.h:915
float ay
First Y coordinate.
Definition pvr.h:909
PVR statistics structure.
Definition pvr.h:1535
size_t vtx_buffer_used
Number of bytes used in the vertex buffer for the last frame.
Definition pvr.h:1542
size_t vtx_buffer_used_max
Number of bytes used in the vertex buffer for the largest frame.
Definition pvr.h:1543
uint64_t buf_last_time
DMA buffer file time for the last frame in nanoseconds.
Definition pvr.h:1539
size_t frame_count
Total number of rendered/viewed frames.
Definition pvr.h:1540
uint64_t frame_last_time
Ready-to-Ready length for the last frame in nanoseconds.
Definition pvr.h:1536
float frame_rate
Current frame rate (per second)
Definition pvr.h:1544
uint32_t enabled_list_mask
Which lists are enabled?
Definition pvr.h:1545
size_t vbl_count
VBlank count.
Definition pvr.h:1541
uint64_t reg_last_time
Registration time for the last frame in nanoseconds.
Definition pvr.h:1537
uint64_t rnd_last_time
Rendering time for the last frame in nanoseconds.
Definition pvr.h:1538
PVR vertex type: Non-textured, packed color, affected by modifier volume.
Definition pvr.h:853
float z
Z coordinate.
Definition pvr.h:858
uint32_t d1
Dummy value.
Definition pvr.h:861
uint32_t argb0
Vertex color (outside volume)
Definition pvr.h:859
float x
X coordinate.
Definition pvr.h:856
float y
Y coordinate.
Definition pvr.h:857
uint32_t d2
Dummy value.
Definition pvr.h:862
uint32_t argb1
Vertex color (inside volume)
Definition pvr.h:860
Generic PVR vertex type.
Definition pvr.h:833
float z
Z coordinate.
Definition pvr.h:838
float y
Y coordinate.
Definition pvr.h:837
float u
Texture U coordinate.
Definition pvr.h:839
uint32_t oargb
Vertex offset color.
Definition pvr.h:842
float x
X coordinate.
Definition pvr.h:836
float v
Texture V coordinate.
Definition pvr.h:840
uint32_t argb
Vertex color.
Definition pvr.h:841
PVR vertex type: Textured, packed color, affected by modifier volume.
Definition pvr.h:873
float z
Z coordinate.
Definition pvr.h:878
uint32_t oargb1
Vertex offset color (inside)
Definition pvr.h:886
uint32_t oargb0
Vertex offset color (outside)
Definition pvr.h:882
float x
X coordinate.
Definition pvr.h:876
float u0
Texture U coordinate (outside)
Definition pvr.h:879
uint32_t d2
Dummy value.
Definition pvr.h:888
float v0
Texture V coordinate (outside)
Definition pvr.h:880
uint32_t d4
Dummy value.
Definition pvr.h:890
float u1
Texture U coordinate (inside)
Definition pvr.h:883
float y
Y coordinate.
Definition pvr.h:877
float v1
Texture V coordinate (inside)
Definition pvr.h:884
uint32_t argb0
Vertex color (outside)
Definition pvr.h:881
uint32_t argb1
Vertex color (inside)
Definition pvr.h:885
uint32_t d1
Dummy value.
Definition pvr.h:887
uint32_t d3
Dummy value.
Definition pvr.h:889