1.1 --- a/src/pvr2/pvr2.h Sun Feb 11 10:09:32 2007 +0000
1.2 +++ b/src/pvr2/pvr2.h Mon Oct 08 11:52:13 2007 +0000
1.5 - * $Id: pvr2.h,v 1.35 2007-02-11 10:09:32 nkeynes Exp $
1.6 + * $Id: pvr2.h,v 1.36 2007-10-08 11:52:13 nkeynes Exp $
1.8 * PVR2 (video chip) functions and macros.
1.12 #include "display.h"
1.13 #include "pvr2/pvr2mmio.h"
1.16 typedef unsigned int pvraddr_t;
1.17 typedef unsigned int pvr64addr_t;
1.18 @@ -118,24 +117,24 @@
1.19 * Write a block of data to an address in the DMA range (0x10000000 -
1.20 * 0x13FFFFFF), ie TA, YUV, or texture ram.
1.22 -void pvr2_dma_write( sh4addr_t dest, char *src, uint32_t length );
1.23 +void pvr2_dma_write( sh4addr_t dest, unsigned char *src, uint32_t length );
1.26 * Write to the interleaved memory address space (aka 64-bit address space).
1.28 -void pvr2_vram64_write( sh4addr_t dest, char *src, uint32_t length );
1.29 +void pvr2_vram64_write( sh4addr_t dest, unsigned char *src, uint32_t length );
1.32 * Write to the interleaved memory address space (aka 64-bit address space),
1.33 * using a line length and stride.
1.35 -void pvr2_vram64_write_stride( sh4addr_t dest, char *src, uint32_t line_bytes,
1.36 +void pvr2_vram64_write_stride( sh4addr_t dest, unsigned char *src, uint32_t line_bytes,
1.37 uint32_t line_stride_bytes, uint32_t line_count );
1.40 * Read from the interleaved memory address space (aka 64-bit address space)
1.42 -void pvr2_vram64_read( char *dest, sh4addr_t src, uint32_t length );
1.43 +void pvr2_vram64_read( unsigned char *dest, sh4addr_t src, uint32_t length );
1.46 * Read a twiddled image from interleaved memory address space (aka 64-bit address
1.48 * Width and height must be powers of 2
1.49 * This version reads 4-bit pixels.
1.51 -void pvr2_vram64_read_twiddled_4( char *dest, sh4addr_t src, uint32_t width, uint32_t height );
1.52 +void pvr2_vram64_read_twiddled_4( unsigned char *dest, sh4addr_t src, uint32_t width, uint32_t height );
1.57 * Width and height must be powers of 2
1.58 * This version reads 8-bit pixels.
1.60 -void pvr2_vram64_read_twiddled_8( char *dest, sh4addr_t src, uint32_t width, uint32_t height );
1.61 +void pvr2_vram64_read_twiddled_8( unsigned char *dest, sh4addr_t src, uint32_t width, uint32_t height );
1.64 * Read a twiddled image from interleaved memory address space (aka 64-bit address
1.65 @@ -160,14 +159,14 @@
1.66 * Width and height must be powers of 2, and src must be 16-bit aligned.
1.67 * This version reads 16-bit pixels.
1.69 -void pvr2_vram64_read_twiddled_16( char *dest, sh4addr_t src, uint32_t width, uint32_t height );
1.70 +void pvr2_vram64_read_twiddled_16( unsigned char *dest, sh4addr_t src, uint32_t width, uint32_t height );
1.73 * Read an image from the interleaved memory address space (aka 64-bit address space)
1.74 * where the source and destination line sizes may differ. Note that both byte
1.75 * counts must be a multiple of 4, and the src address must be 32-bit aligned.
1.77 -void pvr2_vram64_read_stride( char *dest, uint32_t dest_line_bytes, sh4addr_t srcaddr,
1.78 +void pvr2_vram64_read_stride( unsigned char *dest, uint32_t dest_line_bytes, sh4addr_t srcaddr,
1.79 uint32_t src_line_bytes, uint32_t line_count );
1.81 * Dump a portion of vram to a stream from the interleaved memory address
1.83 * Process the data in the supplied buffer as an array of TA command lists.
1.84 * Any excess bytes are held pending until a complete list is sent
1.86 -void pvr2_ta_write( char *buf, uint32_t length );
1.87 +void pvr2_ta_write( unsigned char *buf, uint32_t length );
1.91 @@ -206,13 +205,18 @@
1.93 void pvr2_ta_init( void );
1.95 +void pvr2_ta_reset( void );
1.97 +void pvr2_ta_save_state( FILE *f );
1.99 +int pvr2_ta_load_state( FILE *f );
1.101 /****************************** YUV Converter ****************************/
1.104 * Process a block of YUV data.
1.106 -void pvr2_yuv_write( char *buf, uint32_t length );
1.107 +void pvr2_yuv_write( unsigned char *buf, uint32_t length );
1.110 * Initialize the YUV converter.
1.111 @@ -221,6 +225,10 @@
1.113 void pvr2_yuv_set_config( uint32_t config );
1.115 +void pvr2_yuv_save_state( FILE *f );
1.117 +int pvr2_yuv_load_state( FILE *f );
1.119 /********************************* Renderer ******************************/
1.122 @@ -244,6 +252,9 @@
1.123 int clipx2, int clipy2 );
1.125 float pvr2_render_find_maximum_z();
1.127 +void pvr2_render_getsize( int *x, int *y );
1.130 * Structure to hold a complete unpacked vertex (excluding modifier
1.131 * volume parameters - generate separate vertexes in that case).
1.132 @@ -255,12 +266,25 @@
1.133 float offset_rgba[4]; /* Offset color (RGBA order) */
1.136 +void render_unpack_quad( struct vertex_unpacked *unpacked, uint32_t poly1,
1.137 + uint32_t *vertexes, int vertex_size,
1.138 + int render_mode );
1.140 +void render_unpack_vertexes( struct vertex_unpacked *out, uint32_t poly1,
1.141 + uint32_t *vertexes, int num_vertexes,
1.142 + int vertex_size, int render_mode );
1.144 void render_unpacked_vertex_array( uint32_t poly1, struct vertex_unpacked *vertexes[],
1.145 int num_vertexes );
1.147 void render_vertex_array( uint32_t poly1, uint32_t *vertexes[], int num_vertexes,
1.148 int vertex_size, int render_mode );
1.150 +void render_tile( pvraddr_t tile_entry, int render_mode, gboolean cheap_modifier_mode );
1.152 +void render_autosort_tile( pvraddr_t tile_entry, int render_mode, gboolean cheap_modifier_mode );
1.155 /****************************** Texture Cache ****************************/
1.158 @@ -298,6 +322,8 @@
1.159 GLuint texcache_get_texture( uint32_t texture_addr, int width, int height,
1.162 +void pvr2_check_palette_changed(void);
1.164 /************************* Rendering support macros **************************/
1.165 #define POLY1_DEPTH_MODE(poly1) ( pvr2_poly_depthmode[(poly1)>>29] )
1.166 #define POLY1_DEPTH_ENABLE(poly1) (((poly1)&0x04000000) == 0 )