Search
lxdream.org :: lxdream/src/pvr2/pvr2.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/pvr2.h
changeset 653:3202ff01d48e
prev561:533f6b478071
next655:31a4b664d489
author nkeynes
date Fri Mar 28 12:32:25 2008 +0000 (12 years ago)
permissions -rw-r--r--
last change Merge lxdream-render branch (643:670) to trunk
file annotate diff log raw
1.1 --- a/src/pvr2/pvr2.h Tue Jan 01 05:08:38 2008 +0000
1.2 +++ b/src/pvr2/pvr2.h Fri Mar 28 12:32:25 2008 +0000
1.3 @@ -16,7 +16,11 @@
1.4 * GNU General Public License for more details.
1.5 */
1.6
1.7 -#include "dream.h"
1.8 +#ifndef lxdream_pvr2_H
1.9 +#define lxdream_pvr2_H 1
1.10 +
1.11 +#include <stdio.h>
1.12 +#include "lxdream.h"
1.13 #include "mem.h"
1.14 #include "display.h"
1.15 #include "pvr2/pvr2mmio.h"
1.16 @@ -240,6 +244,8 @@
1.17
1.18 /********************************* Renderer ******************************/
1.19
1.20 +void pvr2_read_scene( void );
1.21 +
1.22 /**
1.23 * Render the current scene stored in PVR ram to the GL back buffer.
1.24 */
1.25 @@ -260,7 +266,7 @@
1.26 void pvr2_render_tilebuffer( int width, int height, int clipx1, int clipy1,
1.27 int clipx2, int clipy2 );
1.28
1.29 -float pvr2_render_find_maximum_z();
1.30 +void pvr2_render_find_z_range( float *min, float *max );
1.31
1.32 void pvr2_render_getsize( int *x, int *y );
1.33
1.34 @@ -275,25 +281,6 @@
1.35 float offset_rgba[4]; /* Offset color (RGBA order) */
1.36 };
1.37
1.38 -void render_unpack_quad( struct vertex_unpacked *unpacked, uint32_t poly1,
1.39 - uint32_t *vertexes, int vertex_size,
1.40 - int render_mode );
1.41 -
1.42 -void render_unpack_vertexes( struct vertex_unpacked *out, uint32_t poly1,
1.43 - uint32_t *vertexes, int num_vertexes,
1.44 - int vertex_size, int render_mode );
1.45 -
1.46 -void render_unpacked_vertex_array( uint32_t poly1, struct vertex_unpacked *vertexes[],
1.47 - int num_vertexes );
1.48 -
1.49 -void render_vertex_array( uint32_t poly1, uint32_t *vertexes[], int num_vertexes,
1.50 - int vertex_size, int render_mode );
1.51 -
1.52 -void render_tile( pvraddr_t tile_entry, int render_mode, gboolean cheap_modifier_mode );
1.53 -
1.54 -void render_autosort_tile( pvraddr_t tile_entry, int render_mode, gboolean cheap_modifier_mode );
1.55 -
1.56 -
1.57 /****************************** Texture Cache ****************************/
1.58
1.59 /**
1.60 @@ -338,8 +325,7 @@
1.61 * If the texture has already been bound, return the ID to which it was
1.62 * bound. Otherwise obtain an unused texture ID and set it up appropriately.
1.63 */
1.64 -GLuint texcache_get_texture( uint32_t texture_addr, int width, int height,
1.65 - int mode );
1.66 +GLuint texcache_get_texture( uint32_t texture_word, int width, int height );
1.67
1.68 void pvr2_check_palette_changed(void);
1.69
1.70 @@ -348,8 +334,9 @@
1.71
1.72 /************************* Rendering support macros **************************/
1.73 #define POLY1_DEPTH_MODE(poly1) ( pvr2_poly_depthmode[(poly1)>>29] )
1.74 -#define POLY1_DEPTH_ENABLE(poly1) (((poly1)&0x04000000) == 0 )
1.75 +#define POLY1_DEPTH_WRITE(poly1) (((poly1)&0x04000000) == 0 )
1.76 #define POLY1_CULL_MODE(poly1) (((poly1)>>27)&0x03)
1.77 +#define POLY1_CULL_ENABLE(poly1) (((poly1)>>28)&0x01)
1.78 #define POLY1_TEXTURED(poly1) (((poly1)&0x02000000))
1.79 #define POLY1_SPECULAR(poly1) (((poly1)&0x01000000))
1.80 #define POLY1_GOURAUD_SHADED(poly1) ((poly1)&0x00800000)
1.81 @@ -376,4 +363,28 @@
1.82 extern int pvr2_poly_texblend[4];
1.83 extern int pvr2_render_colour_format[8];
1.84
1.85 -float halftofloat(uint16_t half);
1.86 +#define CULL_NONE 0
1.87 +#define CULL_SMALL 1
1.88 +#define CULL_CCW 2
1.89 +#define CULL_CW 3
1.90 +
1.91 +#define SEGMENT_END 0x80000000
1.92 +#define SEGMENT_ZCLEAR 0x40000000
1.93 +#define SEGMENT_SORT_TRANS 0x20000000
1.94 +#define SEGMENT_START 0x10000000
1.95 +#define SEGMENT_X(c) (((c) >> 2) & 0x3F)
1.96 +#define SEGMENT_Y(c) (((c) >> 8) & 0x3F)
1.97 +#define NO_POINTER 0x80000000
1.98 +#define IS_TILE_PTR(p) ( ((p)&NO_POINTER) == 0 )
1.99 +#define IS_LAST_SEGMENT(s) (((s)->control) & SEGMENT_END)
1.100 +
1.101 +struct tile_segment {
1.102 + uint32_t control;
1.103 + pvraddr_t opaque_ptr;
1.104 + pvraddr_t opaquemod_ptr;
1.105 + pvraddr_t trans_ptr;
1.106 + pvraddr_t transmod_ptr;
1.107 + pvraddr_t punchout_ptr;
1.108 +};
1.109 +
1.110 +#endif /* !lxdream_pvr2_H */
.