Search
lxdream.org :: lxdream/src/pvr2/pvr2.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/pvr2.h
changeset 221:cf5c6d326162
prev219:dfd3292143f2
next222:541d9d899aba
author nkeynes
date Tue Sep 12 08:38:38 2006 +0000 (14 years ago)
permissions -rw-r--r--
last change Bug #0010
Move polygon macros to pvr2.h
Implement background rendering more fully
file annotate diff log raw
1.1 --- a/src/pvr2/pvr2.h Tue Aug 29 08:12:13 2006 +0000
1.2 +++ b/src/pvr2/pvr2.h Tue Sep 12 08:38:38 2006 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: pvr2.h,v 1.16 2006-08-29 08:12:13 nkeynes Exp $
1.6 + * $Id: pvr2.h,v 1.17 2006-09-12 08:38:38 nkeynes Exp $
1.7 *
1.8 * PVR2 (video chip) functions and macros.
1.9 *
1.10 @@ -202,3 +202,31 @@
1.11 */
1.12 GLuint texcache_get_texture( uint32_t texture_addr, int width, int height,
1.13 int mode );
1.14 +
1.15 +/************************* Rendering support macros **************************/
1.16 +#define POLY1_DEPTH_MODE(poly1) ( pvr2_poly_depthmode[(poly1)>>29] )
1.17 +#define POLY1_DEPTH_ENABLE(poly1) (((poly1)&0x04000000) == 0 )
1.18 +#define POLY1_CULL_MODE(poly1) (((poly1)>>27)&0x03)
1.19 +#define POLY1_TEXTURED(poly1) (((poly1)&0x02000000))
1.20 +#define POLY1_SPECULAR(poly1) (((poly1)&0x01000000))
1.21 +#define POLY1_SHADE_MODEL(poly1) (((poly1)&0x00800000) ? GL_SMOOTH : GL_FLAT)
1.22 +#define POLY1_UV16(poly1) (((poly1)&0x00400000))
1.23 +#define POLY1_SINGLE_TILE(poly1) (((poly1)&0x00200000))
1.24 +
1.25 +#define POLY2_SRC_BLEND(poly2) ( pvr2_poly_srcblend[(poly2) >> 29] )
1.26 +#define POLY2_DEST_BLEND(poly2) ( pvr2_poly_dstblend[((poly2)>>26)&0x07] )
1.27 +#define POLY2_SRC_BLEND_ENABLE(poly2) ((poly2)&0x02000000)
1.28 +#define POLY2_DEST_BLEND_ENABLE(poly2) ((poly2)&0x01000000)
1.29 +#define POLY2_COLOUR_CLAMP_ENABLE(poly2) ((poly2)&0x00200000)
1.30 +#define POLY2_ALPHA_ENABLE(poly2) ((poly2)&0x001000000)
1.31 +#define POLY2_TEX_ALPHA_ENABLE(poly2) (((poly2)&0x00080000) == 0 )
1.32 +#define POLY2_TEX_WIDTH(poly2) ( 1<< ((((poly2) >> 3) & 0x07 ) + 3) )
1.33 +#define POLY2_TEX_HEIGHT(poly2) ( 1<< (((poly2) & 0x07 ) + 3) )
1.34 +#define POLY2_TEX_BLEND(poly2) ( pvr2_poly_texblend[((poly2) >> 6)&0x03] )
1.35 +extern int pvr2_poly_depthmode[8];
1.36 +extern int pvr2_poly_srcblend[8];
1.37 +extern int pvr2_poly_dstblend[8];
1.38 +extern int pvr2_poly_texblend[4];
1.39 +extern int pvr2_render_colour_format[8];
1.40 +
1.41 +float halftofloat(uint16_t half);
.