Search
lxdream.org :: lxdream/test/pvr.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename test/pvr.h
changeset 185:6755a04c447f
next190:f7653df5e832
author nkeynes
date Tue Jul 11 01:35:27 2006 +0000 (15 years ago)
permissions -rw-r--r--
last change First commit of system test framework. 3 initial test cases (incomplete):
testide, testmath, and testta
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/pvr.h Tue Jul 11 01:35:27 2006 +0000
1.3 @@ -0,0 +1,143 @@
1.4 +/**
1.5 + * $Id: pvr.h,v 1.1 2006-07-11 01:35:23 nkeynes Exp $
1.6 + *
1.7 + * PVR support code
1.8 + *
1.9 + * Copyright (c) 2006 Nathan Keynes.
1.10 + *
1.11 + * This program is free software; you can redistribute it and/or modify
1.12 + * it under the terms of the GNU General Public License as published by
1.13 + * the Free Software Foundation; either version 2 of the License, or
1.14 + * (at your option) any later version.
1.15 + *
1.16 + * This program is distributed in the hope that it will be useful,
1.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.19 + * GNU General Public License for more details.
1.20 + */
1.21 +
1.22 +#define PVR_VRAM_BASE 0xA5000000
1.23 +#define PVR_VRAM64_BASE 0xA4000000
1.24 +
1.25 +
1.26 +#define TA_PIXFMT_RGB555 0
1.27 +#define TA_PIXFMT_RGB565 1
1.28 +#define TA_PIXFMT_ARGB4444 2
1.29 +#define TA_PIXFMT_ARGB1555 3
1.30 +#define TA_PIXFMT_RGB888 5
1.31 +#define TA_PIXFMT_ARGB8888 6
1.32 +#define TA_PIXFMT_DITHER 8
1.33 +
1.34 +#define TA_CMD_POLYGON 0x80000000
1.35 +#define TA_CMD_MODIFIER 0x80000000
1.36 +#define TA_CMD_POLYGON_TYPE_OPAQUE (0<<24)
1.37 +#define TA_CMD_MODIFIER_TYPE_OPAQUE (1<<24)
1.38 +#define TA_CMD_POLYGON_TYPE_TRANSPARENT (2<<24)
1.39 +#define TA_CMD_MODIFIER_TYPE_TRANSPARENT (3<<24)
1.40 +#define TA_CMD_POLYGON_TYPE_PUNCHTHRU (4<<24)
1.41 +#define TA_CMD_POLYGON_SUBLIST 0x00800000
1.42 +#define TA_CMD_POLYGON_STRIPLENGTH_1 (0<<18)
1.43 +#define TA_CMD_POLYGON_STRIPLENGTH_2 (1<<18)
1.44 +#define TA_CMD_POLYGON_STRIPLENGTH_4 (2<<18)
1.45 +#define TA_CMD_POLYGON_STRIPLENGTH_6 (3<<18)
1.46 +#define TA_CMD_POLYGON_USER_CLIP_INSIDE 0x00020000
1.47 +#define TA_CMD_POLYGON_USER_CLIP_OUTSIDE 0x00030000
1.48 +#define TA_CMD_POLYGON_AFFECTED_BY_MODIFIER 0x00000080
1.49 +#define TA_CMD_POLYGON_CHEAP_SHADOW_MODIFIER 0x00000000
1.50 +#define TA_CMD_POLYGON_NORMAL_MODIFIER 0x00000040
1.51 +#define TA_CMD_POLYGON_PACKED_COLOUR (0<<4)
1.52 +#define TA_CMD_POLYGON_FLOAT_COLOUR (1<<4)
1.53 +#define TA_CMD_POLYGON_INTENSITY (2<<4)
1.54 +#define TA_CMD_POLYGON_PREVFACE_INTENSITY (3<<4)
1.55 +#define TA_CMD_POLYGON_TEXTURED 0x00000008
1.56 +#define TA_CMD_POLYGON_SPECULAR_HIGHLIGHT 0x00000004
1.57 +#define TA_CMD_POLYGON_GOURAUD_SHADING 0x00000002
1.58 +#define TA_CMD_POLYGON_16BIT_UV 0x00000001
1.59 +
1.60 +#define TA_POLYMODE1_Z_NEVER (0<<29)
1.61 +#define TA_POLYMODE1_Z_LESS (1<<29)
1.62 +#define TA_POLYMODE1_Z_EQUAL (2<<29)
1.63 +#define TA_POLYMODE1_Z_LESSEQUAL (3<<29)
1.64 +#define TA_POLYMODE1_Z_GREATER (4<<29)
1.65 +#define TA_POLYMODE1_Z_NOTEQUAL (5<<29)
1.66 +#define TA_POLYMODE1_Z_GREATEREQUAL (6<<29)
1.67 +#define TA_POLYMODE1_Z_ALWAYS (7<<29)
1.68 +#define TA_POLYMODE1_CULL_SMALL (1<<27)
1.69 +#define TA_POLYMODE1_CULL_CCW (2<<27)
1.70 +#define TA_POLYMODE1_CULL_CW (3<<27)
1.71 +#define TA_POLYMODE1_NO_Z_UPDATE 0x04000000
1.72 +
1.73 +#define TA_POLYMODE2_BLEND_DEFAULT (0x20<<24)
1.74 +#define TA_POLYMODE2_FOG_TABLE (0<<22)
1.75 +#define TA_POLYMODE2_FOG_VERTEX (1<<22)
1.76 +#define TA_POLYMODE2_FOG_DISABLED (2<<22)
1.77 +#define TA_POLYMODE2_FOG_TABLE2 (3<<22)
1.78 +#define TA_POLYMODE2_CLAMP_COLOURS 0x00200000
1.79 +#define TA_POLYMODE2_ENABLE_ALPHA 0x00100000
1.80 +#define TA_POLYMODE2_DISABLE_TEXTURE_TRANSPARENCY 0x00080000
1.81 +#define TA_POLYMODE2_TEXTURE_FLIP_U 0x00080000
1.82 +#define TA_POLYMODE2_TEXTURE_FLIP_V 0x00040000
1.83 +#define TA_POLYMODE2_TEXTURE_CLAMP_U 0x00020000
1.84 +#define TA_POLYMODE2_TEXTURE_CLAMP_V 0x00010000
1.85 +#define TA_POLYMODE2_TRILINEAR_FILTER 0x00004000
1.86 +#define TA_POLYMODE2_BILINEAR_FILTER 0x00002000
1.87 +
1.88 +#define TA_POLYMODE2_MIPMAP_D_0_25 (1<<8)
1.89 +#define TA_POLYMODE2_MIPMAP_D_0_50 (2<<8)
1.90 +#define TA_POLYMODE2_MIPMAP_D_0_75 (3<<8)
1.91 +#define TA_POLYMODE2_MIPMAP_D_1_00 (4<<8)
1.92 +#define TA_POLYMODE2_MIPMAP_D_1_25 (5<<8)
1.93 +#define TA_POLYMODE2_MIPMAP_D_1_50 (6<<8)
1.94 +#define TA_POLYMODE2_MIPMAP_D_1_75 (7<<8)
1.95 +#define TA_POLYMODE2_MIPMAP_D_2_00 (8<<8)
1.96 +#define TA_POLYMODE2_MIPMAP_D_2_25 (9<<8)
1.97 +#define TA_POLYMODE2_MIPMAP_D_2_50 (10<<8)
1.98 +#define TA_POLYMODE2_MIPMAP_D_2_75 (11<<8)
1.99 +#define TA_POLYMODE2_MIPMAP_D_3_00 (12<<8)
1.100 +#define TA_POLYMODE2_MIPMAP_D_3_25 (13<<8)
1.101 +#define TA_POLYMODE2_MIPMAP_D_3_50 (14<<8)
1.102 +#define TA_POLYMODE2_MIPMAP_D_3_75 (15<<8)
1.103 +#define TA_POLYMODE2_TEXTURE_REPLACE (0<<6)
1.104 +#define TA_POLYMODE2_TEXTURE_MODULATE (1<<6)
1.105 +#define TA_POLYMODE2_TEXTURE_DECAL (2<<6)
1.106 +#define TA_POLYMODE2_U_SIZE_8 (0<<3)
1.107 +#define TA_POLYMODE2_U_SIZE_16 (1<<3)
1.108 +#define TA_POLYMODE2_U_SIZE_32 (2<<3)
1.109 +#define TA_POLYMODE2_U_SIZE_64 (3<<3)
1.110 +#define TA_POLYMODE2_U_SIZE_128 (4<<3)
1.111 +#define TA_POLYMODE2_U_SIZE_256 (5<<3)
1.112 +#define TA_POLYMODE2_U_SIZE_512 (6<<3)
1.113 +#define TA_POLYMODE2_U_SIZE_1024 (7<<3)
1.114 +#define TA_POLYMODE2_V_SIZE_8 (0<<0)
1.115 +#define TA_POLYMODE2_V_SIZE_16 (1<<0)
1.116 +#define TA_POLYMODE2_V_SIZE_32 (2<<0)
1.117 +#define TA_POLYMODE2_V_SIZE_64 (3<<0)
1.118 +#define TA_POLYMODE2_V_SIZE_128 (4<<0)
1.119 +#define TA_POLYMODE2_V_SIZE_256 (5<<0)
1.120 +#define TA_POLYMODE2_V_SIZE_512 (6<<0)
1.121 +#define TA_POLYMODE2_V_SIZE_1024 (7<<0)
1.122 +#define TA_TEXTUREMODE_MIPMAP 0x80000000
1.123 +#define TA_TEXTUREMODE_VQ_COMPRESSION 0x40000000
1.124 +#define TA_TEXTUREMODE_ARGB1555 (0<<27)
1.125 +#define TA_TEXTUREMODE_RGB565 (1<<27)
1.126 +#define TA_TEXTUREMODE_ARGB4444 (2<<27)
1.127 +#define TA_TEXTUREMODE_YUV422 (3<<27)
1.128 +#define TA_TEXTUREMODE_BUMPMAP (4<<27)
1.129 +#define TA_TEXTUREMODE_CLUT4 (5<<27)
1.130 +#define TA_TEXTUREMODE_CLUT8 (6<<27)
1.131 +#define TA_TEXTUREMODE_CLUTBANK8(n) ((n)<<25) /* 0-3 */
1.132 +#define TA_TEXTUREMODE_CLUTBANK4(n) ((n)<<21) /* 0-63 */
1.133 +#define TA_TEXTUREMODE_TWIDDLED 0x00000000
1.134 +#define TA_TEXTUREMODE_NON_TWIDDLED 0x04000000
1.135 +#define TA_TEXTUREMODE_ADDRESS(a) ((((unsigned long)(void*)(a))&0x7fffff)>>3)
1.136 +#define TA_CMD_VERTEX 0xe0000000
1.137 +#define TA_CMD_VERTEX_LAST 0xF0000000 /* end of strip */
1.138 +
1.139 +
1.140 +void ta_init( unsigned int hres, unsigned int vres,
1.141 + unsigned int polybuf, unsigned int polybuflen,
1.142 + unsigned int tilebuf, unsigned int tilebuflen );
1.143 +
1.144 +void pvr_dump_objbuf( FILE *f );
1.145 +void pvr_dump_tilebuf( FILE *f );
1.146 +int pvr_get_objbuf_size();
.