Search
lxdream.org :: lxdream/src/pvr2/pvr2.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/pvr2.h
changeset 429:e581b90c3fb3
prev352:f0df7a6d4703
next432:0b761ef2dbfd
author nkeynes
date Mon Oct 08 11:52:13 2007 +0000 (14 years ago)
permissions -rw-r--r--
last change Fix compilation warnings
file annotate diff log raw
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.3 @@ -1,5 +1,5 @@
1.4 /**
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.7 *
1.8 * PVR2 (video chip) functions and macros.
1.9 *
1.10 @@ -20,7 +20,6 @@
1.11 #include "mem.h"
1.12 #include "display.h"
1.13 #include "pvr2/pvr2mmio.h"
1.14 -#include <GL/gl.h>
1.15
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.21 */
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.24
1.25 /**
1.26 * Write to the interleaved memory address space (aka 64-bit address space).
1.27 */
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.30
1.31 /**
1.32 * Write to the interleaved memory address space (aka 64-bit address space),
1.33 * using a line length and stride.
1.34 */
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.38
1.39 /**
1.40 * Read from the interleaved memory address space (aka 64-bit address space)
1.41 */
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.44
1.45 /**
1.46 * Read a twiddled image from interleaved memory address space (aka 64-bit address
1.47 @@ -143,7 +142,7 @@
1.48 * Width and height must be powers of 2
1.49 * This version reads 4-bit pixels.
1.50 */
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.53
1.54
1.55 /**
1.56 @@ -152,7 +151,7 @@
1.57 * Width and height must be powers of 2
1.58 * This version reads 8-bit pixels.
1.59 */
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.62
1.63 /**
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.68 */
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.71
1.72 /**
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.76 */
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.80 /**
1.81 * Dump a portion of vram to a stream from the interleaved memory address
1.82 @@ -197,7 +196,7 @@
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.85 */
1.86 -void pvr2_ta_write( char *buf, uint32_t length );
1.87 +void pvr2_ta_write( unsigned char *buf, uint32_t length );
1.88
1.89
1.90 /**
1.91 @@ -206,13 +205,18 @@
1.92 */
1.93 void pvr2_ta_init( void );
1.94
1.95 +void pvr2_ta_reset( void );
1.96 +
1.97 +void pvr2_ta_save_state( FILE *f );
1.98 +
1.99 +int pvr2_ta_load_state( FILE *f );
1.100
1.101 /****************************** YUV Converter ****************************/
1.102
1.103 /**
1.104 * Process a block of YUV data.
1.105 */
1.106 -void pvr2_yuv_write( char *buf, uint32_t length );
1.107 +void pvr2_yuv_write( unsigned char *buf, uint32_t length );
1.108
1.109 /**
1.110 * Initialize the YUV converter.
1.111 @@ -221,6 +225,10 @@
1.112
1.113 void pvr2_yuv_set_config( uint32_t config );
1.114
1.115 +void pvr2_yuv_save_state( FILE *f );
1.116 +
1.117 +int pvr2_yuv_load_state( FILE *f );
1.118 +
1.119 /********************************* Renderer ******************************/
1.120
1.121 /**
1.122 @@ -244,6 +252,9 @@
1.123 int clipx2, int clipy2 );
1.124
1.125 float pvr2_render_find_maximum_z();
1.126 +
1.127 +void pvr2_render_getsize( int *x, int *y );
1.128 +
1.129 /**
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.134 };
1.135
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.139 +
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.143 +
1.144 void render_unpacked_vertex_array( uint32_t poly1, struct vertex_unpacked *vertexes[],
1.145 int num_vertexes );
1.146
1.147 void render_vertex_array( uint32_t poly1, uint32_t *vertexes[], int num_vertexes,
1.148 int vertex_size, int render_mode );
1.149
1.150 +void render_tile( pvraddr_t tile_entry, int render_mode, gboolean cheap_modifier_mode );
1.151 +
1.152 +void render_autosort_tile( pvraddr_t tile_entry, int render_mode, gboolean cheap_modifier_mode );
1.153 +
1.154 +
1.155 /****************************** Texture Cache ****************************/
1.156
1.157 /**
1.158 @@ -298,6 +322,8 @@
1.159 GLuint texcache_get_texture( uint32_t texture_addr, int width, int height,
1.160 int mode );
1.161
1.162 +void pvr2_check_palette_changed(void);
1.163 +
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 )
.