Search
lxdream.org :: lxdream :: r429:e581b90c3fb3
lxdream 0.9.1
released Jun 29
Download Now
changeset429:e581b90c3fb3
parent428:338966c8aed0
child430:467519b050f4
authornkeynes
dateMon Oct 08 11:52:13 2007 +0000 (12 years ago)
Fix compilation warnings
src/cpu.h
src/display.h
src/dreamcast.h
src/drivers/gl_common.c
src/drivers/gl_common.h
src/drivers/gl_fbo.c
src/drivers/video_null.c
src/gui/debug_win.c
src/gui/gui.c
src/gui/gui.h
src/gui/mmio_win.c
src/maple/controller.c
src/pvr2/pvr2.h
src/pvr2/pvr2mem.c
src/pvr2/rendbkg.c
src/pvr2/rendcore.c
src/pvr2/render.c
src/pvr2/rendsave.c
src/pvr2/rendsort.c
src/pvr2/tacore.c
src/pvr2/texcache.c
src/pvr2/yuv.c
src/x86dasm/x86dasm.c
src/x86dasm/x86dasm.h
1.1 --- a/src/cpu.h Sun Oct 07 06:27:12 2007 +0000
1.2 +++ b/src/cpu.h Mon Oct 08 11:52:13 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: cpu.h,v 1.8 2007-01-17 21:28:43 nkeynes Exp $
1.6 + * $Id: cpu.h,v 1.9 2007-10-08 11:50:15 nkeynes Exp $
1.7 *
1.8 * Generic CPU definitions, primarily for providing information to the GUI.
1.9 *
1.10 @@ -66,7 +66,7 @@
1.11 size_t regs_size; /* Size of register structure in bytes */
1.12 const struct reg_desc_struct *regs_info; /* Description of all registers */
1.13 uint32_t *pc; /* Pointer to PC register */
1.14 -} *cpu_desc_t;
1.15 +} const *cpu_desc_t;
1.16
1.17 #ifdef __cplusplus
1.18 }
2.1 --- a/src/display.h Sun Oct 07 06:27:12 2007 +0000
2.2 +++ b/src/display.h Mon Oct 08 11:52:13 2007 +0000
2.3 @@ -1,5 +1,5 @@
2.4 /**
2.5 - * $Id: display.h,v 1.8 2007-10-07 05:42:24 nkeynes Exp $
2.6 + * $Id: display.h,v 1.9 2007-10-08 11:49:35 nkeynes Exp $
2.7 *
2.8 * The PC side of the video support (responsible for actually displaying /
2.9 * rendering frames)
2.10 @@ -145,7 +145,7 @@
2.11 * using the format etc from the buffer. This may force a glFinish()
2.12 * but does not invalidate the buffer.
2.13 */
2.14 - gboolean (*read_render_buffer)( render_buffer_t buffer, char *target );
2.15 + gboolean (*read_render_buffer)( render_buffer_t buffer, unsigned char *target );
2.16
2.17 } *display_driver_t;
2.18
3.1 --- a/src/dreamcast.h Sun Oct 07 06:27:12 2007 +0000
3.2 +++ b/src/dreamcast.h Mon Oct 08 11:52:13 2007 +0000
3.3 @@ -1,5 +1,5 @@
3.4 /**
3.5 - * $Id: dreamcast.h,v 1.15 2007-10-06 08:59:42 nkeynes Exp $
3.6 + * $Id: dreamcast.h,v 1.16 2007-10-08 11:50:15 nkeynes Exp $
3.7 *
3.8 * Public interface for dreamcast.c -
3.9 * Central switchboard for the system. This pulls all the individual modules
3.10 @@ -64,6 +64,7 @@
3.11 void dreamcast_run(void);
3.12 void dreamcast_run_for( unsigned int seconds, unsigned int nanosecs );
3.13 void dreamcast_stop(void);
3.14 +void dreamcast_shutdown(void);
3.15
3.16 gboolean dreamcast_load_config( const gchar *filename );
3.17 gboolean dreamcast_save_config( const gchar *filename );
4.1 --- a/src/drivers/gl_common.c Sun Oct 07 06:27:12 2007 +0000
4.2 +++ b/src/drivers/gl_common.c Mon Oct 08 11:52:13 2007 +0000
4.3 @@ -1,5 +1,5 @@
4.4 /**
4.5 - * $Id: gl_common.c,v 1.2 2007-10-07 05:42:25 nkeynes Exp $
4.6 + * $Id: gl_common.c,v 1.3 2007-10-08 11:49:35 nkeynes Exp $
4.7 *
4.8 * Common GL code that doesn't depend on a specific implementation
4.9 *
4.10 @@ -142,7 +142,7 @@
4.11 * has already set the appropriate glReadBuffer(); in other words, unless
4.12 * there's only one buffer this needs to be wrapped.
4.13 */
4.14 -gboolean gl_read_render_buffer( render_buffer_t buffer, char *target )
4.15 +gboolean gl_read_render_buffer( render_buffer_t buffer, unsigned char *target )
4.16 {
4.17 if( buffer->address == -1 )
4.18 return FALSE;
5.1 --- a/src/drivers/gl_common.h Sun Oct 07 06:27:12 2007 +0000
5.2 +++ b/src/drivers/gl_common.h Mon Oct 08 11:52:13 2007 +0000
5.3 @@ -1,5 +1,5 @@
5.4 /**
5.5 - * $Id: gl_common.h,v 1.2 2007-09-28 07:24:14 nkeynes Exp $
5.6 + * $Id: gl_common.h,v 1.3 2007-10-08 11:49:35 nkeynes Exp $
5.7 *
5.8 * Parent for all X11 display drivers.
5.9 *
5.10 @@ -46,7 +46,7 @@
5.11 * has already set the appropriate glReadBuffer(); in other words, unless
5.12 * there's only one buffer this needs to be wrapped.
5.13 */
5.14 -gboolean gl_read_render_buffer( render_buffer_t buffer, char *target );
5.15 +gboolean gl_read_render_buffer( render_buffer_t buffer, unsigned char *target );
5.16
5.17
5.18 /****** FBO handling (gl_fbo.c) ******/
6.1 --- a/src/drivers/gl_fbo.c Sun Oct 07 06:27:12 2007 +0000
6.2 +++ b/src/drivers/gl_fbo.c Mon Oct 08 11:52:13 2007 +0000
6.3 @@ -1,5 +1,5 @@
6.4 /**
6.5 - * $Id: gl_fbo.c,v 1.2 2007-10-07 05:42:25 nkeynes Exp $
6.6 + * $Id: gl_fbo.c,v 1.3 2007-10-08 11:49:35 nkeynes Exp $
6.7 *
6.8 * GL framebuffer-based driver shell. This requires the EXT_framebuffer_object
6.9 * extension, but is much nicer/faster/etc than pbuffers when it's available.
6.10 @@ -39,7 +39,7 @@
6.11 static gboolean gl_fbo_display_render_buffer( render_buffer_t buffer );
6.12 static gboolean gl_fbo_display_frame_buffer( frame_buffer_t buffer );
6.13 static gboolean gl_fbo_display_blank( uint32_t colour );
6.14 -static gboolean gl_fbo_read_render_buffer( render_buffer_t buffer, char *target );
6.15 +static gboolean gl_fbo_read_render_buffer( render_buffer_t buffer, unsigned char *target );
6.16
6.17 extern uint32_t video_width, video_height;
6.18
6.19 @@ -295,7 +295,7 @@
6.20 return gl_display_blank( colour );
6.21 }
6.22
6.23 -static gboolean gl_fbo_read_render_buffer( render_buffer_t buffer, char *target )
6.24 +static gboolean gl_fbo_read_render_buffer( render_buffer_t buffer, unsigned char *target )
6.25 {
6.26 int fb = gl_fbo_get_framebuffer( buffer->width, buffer->height );
6.27 gl_fbo_attach_texture( fb, buffer->buf_id );
7.1 --- a/src/drivers/video_null.c Sun Oct 07 06:27:12 2007 +0000
7.2 +++ b/src/drivers/video_null.c Mon Oct 08 11:52:13 2007 +0000
7.3 @@ -1,5 +1,5 @@
7.4 /**
7.5 - * $Id: video_null.c,v 1.4 2007-10-07 05:42:25 nkeynes Exp $
7.6 + * $Id: video_null.c,v 1.5 2007-10-08 11:49:35 nkeynes Exp $
7.7 *
7.8 * Null video output driver (ie no video output whatsoever)
7.9 *
7.10 @@ -37,7 +37,7 @@
7.11 return TRUE;
7.12 }
7.13
7.14 -gboolean video_null_read_render_buffer( render_buffer_t buffer, char *target )
7.15 +gboolean video_null_read_render_buffer( render_buffer_t buffer, unsigned char *target )
7.16 {
7.17 return TRUE;
7.18 }
8.1 --- a/src/gui/debug_win.c Sun Oct 07 06:27:12 2007 +0000
8.2 +++ b/src/gui/debug_win.c Mon Oct 08 11:52:13 2007 +0000
8.3 @@ -1,5 +1,5 @@
8.4 /**
8.5 - * $Id: debug_win.c,v 1.21 2007-10-03 09:32:09 nkeynes Exp $
8.6 + * $Id: debug_win.c,v 1.22 2007-10-08 11:48:56 nkeynes Exp $
8.7 * This file is responsible for the main debugger gui frame.
8.8 *
8.9 * Copyright (c) 2005 Nathan Keynes.
8.10 @@ -24,6 +24,7 @@
8.11 #include "mem.h"
8.12 #include "cpu.h"
8.13 #include "display.h"
8.14 +#include "pvr2/pvr2.h"
8.15
8.16 GdkColor *msg_colors[] = { &clrError, &clrError, &clrWarn, &clrNormal,
8.17 &clrDebug, &clrTrace };
8.18 @@ -36,7 +37,7 @@
8.19 int disasm_from;
8.20 int disasm_to;
8.21 int disasm_pc;
8.22 - struct cpu_desc_struct *cpu;
8.23 + const struct cpu_desc_struct *cpu;
8.24 const cpu_desc_t *cpu_list;
8.25 GtkCList *msgs_list;
8.26 GtkCList *regs_list;
8.27 @@ -287,7 +288,7 @@
8.28 void emit( void *ptr, int level, const gchar *source, const char *msg, ... )
8.29 {
8.30 char buf[20], addr[10] = "", *p;
8.31 - const char *arr[4] = {buf, source, addr};
8.32 + const gchar *arr[4] = {buf, source, addr};
8.33 int posn;
8.34 time_t tm = time(NULL);
8.35 va_list ap;
8.36 @@ -314,7 +315,7 @@
8.37 p = g_strdup_vprintf( msg, ap );
8.38 sprintf( addr, "%08X", *data->cpu->pc );
8.39 arr[3] = p;
8.40 - posn = gtk_clist_append(data->msgs_list, arr);
8.41 + posn = gtk_clist_append(data->msgs_list, (gchar **)arr);
8.42 free(p);
8.43 va_end(ap);
8.44
9.1 --- a/src/gui/gui.c Sun Oct 07 06:27:12 2007 +0000
9.2 +++ b/src/gui/gui.c Mon Oct 08 11:52:13 2007 +0000
9.3 @@ -1,5 +1,5 @@
9.4 /**
9.5 - * $Id: gui.c,v 1.14 2007-09-18 10:48:57 nkeynes Exp $
9.6 + * $Id: gui.c,v 1.15 2007-10-08 11:48:56 nkeynes Exp $
9.7 *
9.8 * Top-level GUI (GTK2) module.
9.9 *
9.10 @@ -203,7 +203,7 @@
9.11
9.12 uint32_t gtk_entry_get_hex_value( GtkEntry *entry, uint32_t defaultValue )
9.13 {
9.14 - gchar *text = gtk_entry_get_text(entry);
9.15 + const gchar *text = gtk_entry_get_text(entry);
9.16 if( text == NULL )
9.17 return defaultValue;
9.18 gchar *endptr;
10.1 --- a/src/gui/gui.h Sun Oct 07 06:27:12 2007 +0000
10.2 +++ b/src/gui/gui.h Mon Oct 08 11:52:13 2007 +0000
10.3 @@ -1,5 +1,5 @@
10.4 /**
10.5 - * $Id: gui.h,v 1.16 2007-09-18 10:48:57 nkeynes Exp $
10.6 + * $Id: gui.h,v 1.17 2007-10-08 11:48:56 nkeynes Exp $
10.7 *
10.8 * General GUI definitions
10.9 *
10.10 @@ -39,7 +39,7 @@
10.11 typedef struct debug_info_struct *debug_info_t;
10.12 extern debug_info_t main_debug;
10.13
10.14 -typedef int (*file_callback_t)( const gchar *filename );
10.15 +typedef gboolean (*file_callback_t)( const gchar *filename );
10.16 void open_file_dialog( char *title, file_callback_t file_handler, char *pattern, char *patname, const gchar *initial_dir );
10.17 void save_file_dialog( char *title, file_callback_t file_handler, char *pattern, char *patname, const gchar *initial_dir );
10.18
10.19 @@ -72,6 +72,8 @@
10.20 uint32_t gtk_entry_get_hex_value( GtkEntry *entry, uint32_t defaultValue );
10.21 void gtk_entry_set_hex_value( GtkEntry *entry, uint32_t value );
10.22
10.23 +void dump_window_new( void );
10.24 +
10.25 #ifdef __cplusplus
10.26 }
10.27 #endif
11.1 --- a/src/gui/mmio_win.c Sun Oct 07 06:27:12 2007 +0000
11.2 +++ b/src/gui/mmio_win.c Mon Oct 08 11:52:13 2007 +0000
11.3 @@ -1,5 +1,5 @@
11.4 /**
11.5 - * $Id: mmio_win.c,v 1.5 2006-12-15 10:17:08 nkeynes Exp $
11.6 + * $Id: mmio_win.c,v 1.6 2007-10-08 11:48:56 nkeynes Exp $
11.7 *
11.8 * Implements the MMIO register viewing window
11.9 *
11.10 @@ -90,16 +90,16 @@
11.11 gtk_widget_show( tab );
11.12 gtk_container_add( GTK_CONTAINER(scroll), GTK_WIDGET(list) );
11.13
11.14 - vbox = gtk_vbox_new( FALSE, 0 );
11.15 + vbox = GTK_VBOX(gtk_vbox_new( FALSE, 0 ));
11.16 gtk_widget_show( GTK_WIDGET(vbox) );
11.17 gtk_container_add( GTK_CONTAINER(vbox), GTK_WIDGET(scroll) );
11.18
11.19 - trace_button = gtk_check_button_new_with_label("Trace access");
11.20 + trace_button = GTK_CHECK_BUTTON(gtk_check_button_new_with_label("Trace access"));
11.21 gtk_widget_show( GTK_WIDGET(trace_button) );
11.22 gtk_container_add( GTK_CONTAINER(vbox), GTK_WIDGET(trace_button) );
11.23 gtk_box_set_child_packing( GTK_BOX(vbox), GTK_WIDGET(trace_button),
11.24 FALSE, FALSE, 0, GTK_PACK_START );
11.25 - gtk_notebook_append_page( mmr_book, vbox, tab );
11.26 + gtk_notebook_append_page( mmr_book, GTK_WIDGET(vbox), tab );
11.27 gtk_object_set_data( GTK_OBJECT(mmr_win), name, list );
11.28 g_signal_connect ((gpointer) trace_button, "toggled",
11.29 G_CALLBACK (on_trace_button_toggled),
12.1 --- a/src/maple/controller.c Sun Oct 07 06:27:12 2007 +0000
12.2 +++ b/src/maple/controller.c Mon Oct 08 11:52:13 2007 +0000
12.3 @@ -1,5 +1,5 @@
12.4 /**
12.5 - * $Id: controller.c,v 1.5 2007-09-30 21:19:43 nkeynes Exp $
12.6 + * $Id: controller.c,v 1.6 2007-10-08 11:49:35 nkeynes Exp $
12.7 *
12.8 * Implements the standard dreamcast controller
12.9 *
12.10 @@ -19,6 +19,7 @@
12.11 #include <stdlib.h>
12.12 #include "dream.h"
12.13 #include "dreamcast.h"
12.14 +#include "display.h"
12.15 #include "maple.h"
12.16 #include "maple/controller.h"
12.17
12.18 @@ -29,7 +30,7 @@
12.19 void controller_destroy( maple_device_t dev );
12.20 maple_device_t controller_new();
12.21 dreamcast_config_entry_t controller_get_config( maple_device_t dev );
12.22 -int controller_get_cond( maple_device_t dev, int function, char *outbuf,
12.23 +int controller_get_cond( maple_device_t dev, int function, unsigned char *outbuf,
12.24 int *outlen );
12.25
12.26 typedef struct controller_device {
12.27 @@ -159,7 +160,7 @@
12.28 }
12.29
12.30
12.31 -int controller_get_cond( maple_device_t mdev, int function, char *outbuf,
12.32 +int controller_get_cond( maple_device_t mdev, int function, unsigned char *outbuf,
12.33 int *outlen )
12.34 {
12.35 controller_device_t dev = (controller_device_t)mdev;
13.1 --- a/src/pvr2/pvr2.h Sun Oct 07 06:27:12 2007 +0000
13.2 +++ b/src/pvr2/pvr2.h Mon Oct 08 11:52:13 2007 +0000
13.3 @@ -1,5 +1,5 @@
13.4 /**
13.5 - * $Id: pvr2.h,v 1.35 2007-02-11 10:09:32 nkeynes Exp $
13.6 + * $Id: pvr2.h,v 1.36 2007-10-08 11:52:13 nkeynes Exp $
13.7 *
13.8 * PVR2 (video chip) functions and macros.
13.9 *
13.10 @@ -20,7 +20,6 @@
13.11 #include "mem.h"
13.12 #include "display.h"
13.13 #include "pvr2/pvr2mmio.h"
13.14 -#include <GL/gl.h>
13.15
13.16 typedef unsigned int pvraddr_t;
13.17 typedef unsigned int pvr64addr_t;
13.18 @@ -118,24 +117,24 @@
13.19 * Write a block of data to an address in the DMA range (0x10000000 -
13.20 * 0x13FFFFFF), ie TA, YUV, or texture ram.
13.21 */
13.22 -void pvr2_dma_write( sh4addr_t dest, char *src, uint32_t length );
13.23 +void pvr2_dma_write( sh4addr_t dest, unsigned char *src, uint32_t length );
13.24
13.25 /**
13.26 * Write to the interleaved memory address space (aka 64-bit address space).
13.27 */
13.28 -void pvr2_vram64_write( sh4addr_t dest, char *src, uint32_t length );
13.29 +void pvr2_vram64_write( sh4addr_t dest, unsigned char *src, uint32_t length );
13.30
13.31 /**
13.32 * Write to the interleaved memory address space (aka 64-bit address space),
13.33 * using a line length and stride.
13.34 */
13.35 -void pvr2_vram64_write_stride( sh4addr_t dest, char *src, uint32_t line_bytes,
13.36 +void pvr2_vram64_write_stride( sh4addr_t dest, unsigned char *src, uint32_t line_bytes,
13.37 uint32_t line_stride_bytes, uint32_t line_count );
13.38
13.39 /**
13.40 * Read from the interleaved memory address space (aka 64-bit address space)
13.41 */
13.42 -void pvr2_vram64_read( char *dest, sh4addr_t src, uint32_t length );
13.43 +void pvr2_vram64_read( unsigned char *dest, sh4addr_t src, uint32_t length );
13.44
13.45 /**
13.46 * Read a twiddled image from interleaved memory address space (aka 64-bit address
13.47 @@ -143,7 +142,7 @@
13.48 * Width and height must be powers of 2
13.49 * This version reads 4-bit pixels.
13.50 */
13.51 -void pvr2_vram64_read_twiddled_4( char *dest, sh4addr_t src, uint32_t width, uint32_t height );
13.52 +void pvr2_vram64_read_twiddled_4( unsigned char *dest, sh4addr_t src, uint32_t width, uint32_t height );
13.53
13.54
13.55 /**
13.56 @@ -152,7 +151,7 @@
13.57 * Width and height must be powers of 2
13.58 * This version reads 8-bit pixels.
13.59 */
13.60 -void pvr2_vram64_read_twiddled_8( char *dest, sh4addr_t src, uint32_t width, uint32_t height );
13.61 +void pvr2_vram64_read_twiddled_8( unsigned char *dest, sh4addr_t src, uint32_t width, uint32_t height );
13.62
13.63 /**
13.64 * Read a twiddled image from interleaved memory address space (aka 64-bit address
13.65 @@ -160,14 +159,14 @@
13.66 * Width and height must be powers of 2, and src must be 16-bit aligned.
13.67 * This version reads 16-bit pixels.
13.68 */
13.69 -void pvr2_vram64_read_twiddled_16( char *dest, sh4addr_t src, uint32_t width, uint32_t height );
13.70 +void pvr2_vram64_read_twiddled_16( unsigned char *dest, sh4addr_t src, uint32_t width, uint32_t height );
13.71
13.72 /**
13.73 * Read an image from the interleaved memory address space (aka 64-bit address space)
13.74 * where the source and destination line sizes may differ. Note that both byte
13.75 * counts must be a multiple of 4, and the src address must be 32-bit aligned.
13.76 */
13.77 -void pvr2_vram64_read_stride( char *dest, uint32_t dest_line_bytes, sh4addr_t srcaddr,
13.78 +void pvr2_vram64_read_stride( unsigned char *dest, uint32_t dest_line_bytes, sh4addr_t srcaddr,
13.79 uint32_t src_line_bytes, uint32_t line_count );
13.80 /**
13.81 * Dump a portion of vram to a stream from the interleaved memory address
13.82 @@ -197,7 +196,7 @@
13.83 * Process the data in the supplied buffer as an array of TA command lists.
13.84 * Any excess bytes are held pending until a complete list is sent
13.85 */
13.86 -void pvr2_ta_write( char *buf, uint32_t length );
13.87 +void pvr2_ta_write( unsigned char *buf, uint32_t length );
13.88
13.89
13.90 /**
13.91 @@ -206,13 +205,18 @@
13.92 */
13.93 void pvr2_ta_init( void );
13.94
13.95 +void pvr2_ta_reset( void );
13.96 +
13.97 +void pvr2_ta_save_state( FILE *f );
13.98 +
13.99 +int pvr2_ta_load_state( FILE *f );
13.100
13.101 /****************************** YUV Converter ****************************/
13.102
13.103 /**
13.104 * Process a block of YUV data.
13.105 */
13.106 -void pvr2_yuv_write( char *buf, uint32_t length );
13.107 +void pvr2_yuv_write( unsigned char *buf, uint32_t length );
13.108
13.109 /**
13.110 * Initialize the YUV converter.
13.111 @@ -221,6 +225,10 @@
13.112
13.113 void pvr2_yuv_set_config( uint32_t config );
13.114
13.115 +void pvr2_yuv_save_state( FILE *f );
13.116 +
13.117 +int pvr2_yuv_load_state( FILE *f );
13.118 +
13.119 /********************************* Renderer ******************************/
13.120
13.121 /**
13.122 @@ -244,6 +252,9 @@
13.123 int clipx2, int clipy2 );
13.124
13.125 float pvr2_render_find_maximum_z();
13.126 +
13.127 +void pvr2_render_getsize( int *x, int *y );
13.128 +
13.129 /**
13.130 * Structure to hold a complete unpacked vertex (excluding modifier
13.131 * volume parameters - generate separate vertexes in that case).
13.132 @@ -255,12 +266,25 @@
13.133 float offset_rgba[4]; /* Offset color (RGBA order) */
13.134 };
13.135
13.136 +void render_unpack_quad( struct vertex_unpacked *unpacked, uint32_t poly1,
13.137 + uint32_t *vertexes, int vertex_size,
13.138 + int render_mode );
13.139 +
13.140 +void render_unpack_vertexes( struct vertex_unpacked *out, uint32_t poly1,
13.141 + uint32_t *vertexes, int num_vertexes,
13.142 + int vertex_size, int render_mode );
13.143 +
13.144 void render_unpacked_vertex_array( uint32_t poly1, struct vertex_unpacked *vertexes[],
13.145 int num_vertexes );
13.146
13.147 void render_vertex_array( uint32_t poly1, uint32_t *vertexes[], int num_vertexes,
13.148 int vertex_size, int render_mode );
13.149
13.150 +void render_tile( pvraddr_t tile_entry, int render_mode, gboolean cheap_modifier_mode );
13.151 +
13.152 +void render_autosort_tile( pvraddr_t tile_entry, int render_mode, gboolean cheap_modifier_mode );
13.153 +
13.154 +
13.155 /****************************** Texture Cache ****************************/
13.156
13.157 /**
13.158 @@ -298,6 +322,8 @@
13.159 GLuint texcache_get_texture( uint32_t texture_addr, int width, int height,
13.160 int mode );
13.161
13.162 +void pvr2_check_palette_changed(void);
13.163 +
13.164 /************************* Rendering support macros **************************/
13.165 #define POLY1_DEPTH_MODE(poly1) ( pvr2_poly_depthmode[(poly1)>>29] )
13.166 #define POLY1_DEPTH_ENABLE(poly1) (((poly1)&0x04000000) == 0 )
14.1 --- a/src/pvr2/pvr2mem.c Sun Oct 07 06:27:12 2007 +0000
14.2 +++ b/src/pvr2/pvr2mem.c Mon Oct 08 11:52:13 2007 +0000
14.3 @@ -1,5 +1,5 @@
14.4 /**
14.5 - * $Id: pvr2mem.c,v 1.9 2007-02-11 10:09:32 nkeynes Exp $
14.6 + * $Id: pvr2mem.c,v 1.10 2007-10-08 11:52:13 nkeynes Exp $
14.7 *
14.8 * PVR2 (Video) VRAM handling routines (mainly for the 64-bit region)
14.9 *
14.10 @@ -20,9 +20,9 @@
14.11 #include <stdio.h>
14.12 #include <errno.h>
14.13
14.14 -extern char *video_base;
14.15 +extern unsigned char *video_base;
14.16
14.17 -void pvr2_dma_write( sh4addr_t destaddr, char *src, uint32_t count )
14.18 +void pvr2_dma_write( sh4addr_t destaddr, unsigned char *src, uint32_t count )
14.19 {
14.20 int region;
14.21
14.22 @@ -57,7 +57,7 @@
14.23 }
14.24 }
14.25
14.26 -void pvr2_vram64_write( sh4addr_t destaddr, char *src, uint32_t length )
14.27 +void pvr2_vram64_write( sh4addr_t destaddr, unsigned char *src, uint32_t length )
14.28 {
14.29 int bank_flag = (destaddr & 0x04) >> 2;
14.30 uint32_t *banks[2];
14.31 @@ -80,7 +80,7 @@
14.32
14.33 /* Handle non-aligned start of source */
14.34 if( destaddr & 0x03 ) {
14.35 - char *dest = ((char *)banks[bank_flag]) + (destaddr & 0x03);
14.36 + unsigned char *dest = ((unsigned char *)banks[bank_flag]) + (destaddr & 0x03);
14.37 for( i= destaddr & 0x03; i < 4 && length > 0; i++, length-- ) {
14.38 *dest++ = *src++;
14.39 }
14.40 @@ -96,8 +96,8 @@
14.41
14.42 /* Handle non-aligned end of source */
14.43 if( length ) {
14.44 - src = (char *)dwsrc;
14.45 - char *dest = (char *)banks[bank_flag];
14.46 + src = (unsigned char *)dwsrc;
14.47 + unsigned char *dest = (unsigned char *)banks[bank_flag];
14.48 while( length-- > 0 ) {
14.49 *dest++ = *src++;
14.50 }
14.51 @@ -109,7 +109,7 @@
14.52 * The destaddr must be 32-bit aligned, and both line_bytes and line_stride_bytes
14.53 * must be multiples of 4.
14.54 */
14.55 -void pvr2_vram64_write_stride( sh4addr_t destaddr, char *src, uint32_t line_bytes,
14.56 +void pvr2_vram64_write_stride( sh4addr_t destaddr, unsigned char *src, uint32_t line_bytes,
14.57 uint32_t line_stride_bytes, uint32_t line_count )
14.58 {
14.59 int bank_flag = (destaddr & 0x04) >> 2;
14.60 @@ -155,14 +155,14 @@
14.61 * must be multiples of 4. line_stride_bytes must be >= line_bytes.
14.62 * This method is used to extract a "stride" texture from vram.
14.63 */
14.64 -void pvr2_vram64_read_stride( char *dest, uint32_t dest_line_bytes, sh4addr_t srcaddr,
14.65 +void pvr2_vram64_read_stride( unsigned char *dest, uint32_t dest_line_bytes, sh4addr_t srcaddr,
14.66 uint32_t src_line_bytes, uint32_t line_count )
14.67 {
14.68 int bank_flag = (srcaddr & 0x04) >> 2;
14.69 uint32_t *banks[2];
14.70 uint32_t *dwdest;
14.71 - uint32_t dest_line_gap;
14.72 - uint32_t src_line_gap;
14.73 + uint32_t dest_line_gap = 0;
14.74 + uint32_t src_line_gap = 0;
14.75 uint32_t line_bytes;
14.76 int src_line_gap_flag;
14.77 int i,j;
14.78 @@ -301,13 +301,13 @@
14.79 * @param width image width (must be a power of 2)
14.80 * @param height image height (must be a power of 2)
14.81 */
14.82 -void pvr2_vram64_read_twiddled_4( char *dest, sh4addr_t srcaddr, uint32_t width, uint32_t height )
14.83 +void pvr2_vram64_read_twiddled_4( unsigned char *dest, sh4addr_t srcaddr, uint32_t width, uint32_t height )
14.84 {
14.85 int offset_flag = (srcaddr & 0x07);
14.86 uint8_t *banks[2];
14.87 uint8_t *wdest = (uint8_t*)dest;
14.88 uint32_t stride = width >> 1;
14.89 - int i,j;
14.90 + int i;
14.91
14.92 srcaddr = srcaddr & 0x7FFFF8;
14.93
14.94 @@ -344,12 +344,12 @@
14.95 * @param width image width (must be a power of 2)
14.96 * @param height image height (must be a power of 2)
14.97 */
14.98 -void pvr2_vram64_read_twiddled_8( char *dest, sh4addr_t srcaddr, uint32_t width, uint32_t height )
14.99 +void pvr2_vram64_read_twiddled_8( unsigned char *dest, sh4addr_t srcaddr, uint32_t width, uint32_t height )
14.100 {
14.101 int offset_flag = (srcaddr & 0x07);
14.102 uint8_t *banks[2];
14.103 uint8_t *wdest = (uint8_t*)dest;
14.104 - int i,j;
14.105 + int i;
14.106
14.107 srcaddr = srcaddr & 0x7FFFF8;
14.108
14.109 @@ -386,11 +386,11 @@
14.110 * @param width image width (must be a power of 2)
14.111 * @param height image height (must be a power of 2)
14.112 */
14.113 -void pvr2_vram64_read_twiddled_16( char *dest, sh4addr_t srcaddr, uint32_t width, uint32_t height ) {
14.114 +void pvr2_vram64_read_twiddled_16( unsigned char *dest, sh4addr_t srcaddr, uint32_t width, uint32_t height ) {
14.115 int offset_flag = (srcaddr & 0x06) >> 1;
14.116 uint16_t *banks[2];
14.117 uint16_t *wdest = (uint16_t*)dest;
14.118 - int i,j;
14.119 + int i;
14.120
14.121 srcaddr = srcaddr & 0x7FFFF8;
14.122
14.123 @@ -420,11 +420,11 @@
14.124 }
14.125 }
14.126
14.127 -void pvr2_vram_write_invert( sh4addr_t destaddr, char *src, uint32_t length, uint32_t line_length,
14.128 +void pvr2_vram_write_invert( sh4addr_t destaddr, unsigned char *src, uint32_t length, uint32_t line_length,
14.129 uint32_t src_stride )
14.130 {
14.131 - char *dest = video_base + (destaddr & 0x007FFFFF);
14.132 - char *p = src + length - src_stride;
14.133 + unsigned char *dest = video_base + (destaddr & 0x007FFFFF);
14.134 + unsigned char *p = src + length - src_stride;
14.135 while( p >= src ) {
14.136 memcpy( dest, p, line_length );
14.137 p -= src_stride;
14.138 @@ -432,7 +432,7 @@
14.139 }
14.140 }
14.141
14.142 -void pvr2_vram64_read( char *dest, sh4addr_t srcaddr, uint32_t length )
14.143 +void pvr2_vram64_read( unsigned char *dest, sh4addr_t srcaddr, uint32_t length )
14.144 {
14.145 int bank_flag = (srcaddr & 0x04) >> 2;
14.146 uint32_t *banks[2];
14.147 @@ -466,8 +466,8 @@
14.148
14.149 /* Handle non-aligned end of source */
14.150 if( length ) {
14.151 - dest = (char *)dwdest;
14.152 - char *src = (char *)banks[bank_flag];
14.153 + dest = (unsigned char *)dwdest;
14.154 + unsigned char *src = (unsigned char *)banks[bank_flag];
14.155 while( length-- > 0 ) {
14.156 *dest++ = *src++;
14.157 }
14.158 @@ -484,7 +484,7 @@
14.159 ERROR( "Unable to write to dump file '%s' (%s)", filename, strerror(errno) );
14.160 return;
14.161 }
14.162 - pvr2_vram64_read( (char *)tmp, addr, length );
14.163 + pvr2_vram64_read( (unsigned char *)tmp, addr, length );
14.164 fprintf( f, "%08X\n", addr );
14.165 for( i =0; i<length>>2; i+=8 ) {
14.166 for( j=i; j<i+8; j++ ) {
14.167 @@ -500,7 +500,7 @@
14.168
14.169 void pvr2_vram64_dump( sh4addr_t addr, uint32_t length, FILE *f )
14.170 {
14.171 - char tmp[length];
14.172 + unsigned char tmp[length];
14.173 pvr2_vram64_read( tmp, addr, length );
14.174 fwrite_dump( tmp, length, f );
14.175 }
14.176 @@ -518,14 +518,14 @@
14.177 */
14.178 void pvr2_render_buffer_copy_to_sh4( render_buffer_t buffer )
14.179 {
14.180 - if( buffer->address & 0xFF000000 == 0x04000000 ) {
14.181 + if( (buffer->address & 0xFF000000) == 0x04000000 ) {
14.182 /* Interlaced buffer. Go the double copy... :( */
14.183 - char target[buffer->size];
14.184 + unsigned char target[buffer->size];
14.185 display_driver->read_render_buffer( buffer, target );
14.186 pvr2_vram64_write( buffer->address, target, buffer->size );
14.187 } else {
14.188 /* Regular buffer */
14.189 - char target[buffer->size];
14.190 + unsigned char target[buffer->size];
14.191 int line_size = buffer->width * colour_formats[buffer->colour_format].bpp;
14.192 display_driver->read_render_buffer( buffer, target );
14.193 if( (buffer->scale & 0xFFFF) == 0x0800 ) {
15.1 --- a/src/pvr2/rendbkg.c Sun Oct 07 06:27:12 2007 +0000
15.2 +++ b/src/pvr2/rendbkg.c Mon Oct 08 11:52:13 2007 +0000
15.3 @@ -1,5 +1,5 @@
15.4 /**
15.5 - * $Id: rendbkg.c,v 1.6 2007-01-29 11:25:40 nkeynes Exp $
15.6 + * $Id: rendbkg.c,v 1.7 2007-10-08 11:52:13 nkeynes Exp $
15.7 *
15.8 * PVR2 background renderer.
15.9 *
15.10 @@ -427,6 +427,8 @@
15.11 center.x = base[1].x;
15.12 center.y = base[1].y;
15.13 center.z = (1/base[1].z);
15.14 + center.u = base[1].u;
15.15 + center.v = base[1].v;
15.16 diff0.x = base[0].x - center.x;
15.17 diff0.y = base[0].y - center.y;
15.18 diff0.z = (1/base[0].z) - center.z;
15.19 @@ -586,7 +588,6 @@
15.20 struct vertex_unpacked vertex[3];
15.21 int screen_vertexes[4] = {0,1,2,3};
15.22 struct bkg_scene scene;
15.23 - int i,j,k, num_vertexes;
15.24 int vertex_length = (mode >> 24) & 0x07;
15.25 int cheap_shadow = MMIO_READ( PVR2, RENDER_SHADOW ) & 0x100;
15.26 int is_modified = mode & 0x08000000;
16.1 --- a/src/pvr2/rendcore.c Sun Oct 07 06:27:12 2007 +0000
16.2 +++ b/src/pvr2/rendcore.c Mon Oct 08 11:52:13 2007 +0000
16.3 @@ -1,5 +1,5 @@
16.4 /**
16.5 - * $Id: rendcore.c,v 1.19 2007-02-11 10:09:32 nkeynes Exp $
16.6 + * $Id: rendcore.c,v 1.20 2007-10-08 11:52:13 nkeynes Exp $
16.7 *
16.8 * PVR2 renderer core.
16.9 *
16.10 @@ -19,6 +19,10 @@
16.11 #include "pvr2/pvr2.h"
16.12 #include "asic.h"
16.13
16.14 +#define GL_GLEXT_PROTOTYPES 1
16.15 +#include <GL/gl.h>
16.16 +#include <GL/glext.h>
16.17 +
16.18 int pvr2_poly_depthmode[8] = { GL_NEVER, GL_LESS, GL_EQUAL, GL_LEQUAL,
16.19 GL_GREATER, GL_NOTEQUAL, GL_GEQUAL,
16.20 GL_ALWAYS };
16.21 @@ -228,10 +232,10 @@
16.22 out[i].rgba[3] = FARGB_A(argb);
16.23 if( POLY1_SPECULAR(poly1) ) {
16.24 uint32_t offset = vertexes[k++];
16.25 - out[i].offset_rgba[0] = FARGB_R(argb);
16.26 - out[i].offset_rgba[1] = FARGB_G(argb);
16.27 - out[i].offset_rgba[2] = FARGB_B(argb);
16.28 - out[i].offset_rgba[3] = FARGB_A(argb);
16.29 + out[i].offset_rgba[0] = FARGB_R(offset);
16.30 + out[i].offset_rgba[1] = FARGB_G(offset);
16.31 + out[i].offset_rgba[2] = FARGB_B(offset);
16.32 + out[i].offset_rgba[3] = FARGB_A(offset);
16.33 }
16.34 vertexes += vertex_size;
16.35 }
16.36 @@ -564,7 +568,6 @@
16.37 tile_list = (uint32_t *)(video_base + (entry&0x007FFFFF));
16.38 } else {
16.39 uint32_t *polygon = (uint32_t *)(video_base + poly_bank + ((entry & 0x000FFFFF) << 2));
16.40 - int is_modified = entry & 0x01000000;
16.41 int vertex_length = (entry >> 21) & 0x07;
16.42 int context_length = 3;
16.43 if( (entry & 0x01000000) && (shadow_cfg==0) ) {
16.44 @@ -588,7 +591,6 @@
16.45 } else if( (entry & 0xE0000000) == 0xA0000000 ) {
16.46 /* Sprite(s) */
16.47 int strip_count = ((entry >> 25) & 0x0F)+1;
16.48 - int polygon_length = 4 * vertex_length + context_length;
16.49 int i;
16.50 float *vertexz = (float *)(polygon+context_length+2);
16.51 for( i=0; i<strip_count; i++ ) {
16.52 @@ -602,7 +604,7 @@
16.53 }
16.54 } else {
16.55 /* Polygon */
16.56 - int i, first=-1, last = -1;
16.57 + int i;
16.58 float *vertexz = (float *)polygon+context_length+2;
16.59 for( i=0; i<6; i++ ) {
16.60 if( (entry & (0x40000000>>i)) && *vertexz > z ) {
16.61 @@ -679,7 +681,7 @@
16.62 int num_vertexes, int vertex_size )
16.63 {
16.64 char buf[256], *p;
16.65 - int i,j, k;
16.66 + int i, k;
16.67 for( i=0; i<num_vertexes; i++ ) {
16.68 p = buf;
16.69 float *vertf = (float *)vert_array[i];
16.70 @@ -711,7 +713,7 @@
16.71 {
16.72 uint32_t poly_bank = MMIO_READ(PVR2,RENDER_POLYBASE);
16.73 int shadow_cfg = MMIO_READ( PVR2, RENDER_SHADOW ) & 0x100;
16.74 - int i, j;
16.75 + int i;
16.76
16.77 if( entry >> 28 == 0x0F ) {
16.78 fprintf( f, "EOT\n" );
16.79 @@ -719,7 +721,6 @@
16.80 fprintf( f, "LINK %08X\n", entry &0x7FFFFF );
16.81 } else {
16.82 uint32_t *polygon = (uint32_t *)(video_base + poly_bank + ((entry & 0x000FFFFF) << 2));
16.83 - int is_modified = entry & 0x01000000;
16.84 int vertex_length = (entry >> 21) & 0x07;
16.85 int context_length = 3;
16.86 if( (entry & 0x01000000) && (shadow_cfg==0) ) {
16.87 @@ -755,7 +756,6 @@
16.88 } else {
16.89 /* Polygon */
16.90 int last = -1;
16.91 - float *vertexz = (float *)polygon+context_length+2;
16.92 uint32_t *array[8];
16.93 for( i=0; i<6; i++ ) {
16.94 if( entry & (0x40000000>>i) ) {
17.1 --- a/src/pvr2/render.c Sun Oct 07 06:27:12 2007 +0000
17.2 +++ b/src/pvr2/render.c Mon Oct 08 11:52:13 2007 +0000
17.3 @@ -1,5 +1,5 @@
17.4 /**
17.5 - * $Id: render.c,v 1.24 2007-02-11 10:09:32 nkeynes Exp $
17.6 + * $Id: render.c,v 1.25 2007-10-08 11:52:13 nkeynes Exp $
17.7 *
17.8 * PVR2 Renderer support. This part is primarily
17.9 *
17.10 @@ -16,20 +16,23 @@
17.11 * GNU General Public License for more details.
17.12 */
17.13
17.14 +#include <sys/time.h>
17.15 +#include <time.h>
17.16 #include "pvr2/pvr2.h"
17.17 #include "asic.h"
17.18
17.19
17.20 -int pvr2_render_font_list = -1;
17.21 int pvr2_render_trace = 0;
17.22
17.23 +#if 0
17.24 +int pvr2_render_font_list = -1;
17.25 int glPrintf( int x, int y, const char *fmt, ... )
17.26 {
17.27 va_list ap; /* our argument pointer */
17.28 char buf[256];
17.29 int len;
17.30 if (fmt == NULL) /* if there is no string to draw do nothing */
17.31 - return;
17.32 + return 0;
17.33 va_start(ap, fmt);
17.34 len = vsnprintf(buf, sizeof(buf), fmt, ap);
17.35 va_end(ap);
17.36 @@ -49,6 +52,7 @@
17.37
17.38 return len;
17.39 }
17.40 +#endif
17.41
17.42 void glDrawGrid( int width, int height )
17.43 {
17.44 @@ -79,11 +83,11 @@
17.45 {
17.46 /* Select and initialize the render context */
17.47 display_driver->set_render_target(buffer);
17.48 -
17.49 +#if 0
17.50 if( pvr2_render_font_list == -1 ) {
17.51 pvr2_render_font_list = video_glx_load_font( "-*-helvetica-*-r-normal--16-*-*-*-p-*-iso8859-1");
17.52 }
17.53 -
17.54 +#endif
17.55 pvr2_check_palette_changed();
17.56
17.57 /* Setup the display model */
17.58 @@ -111,8 +115,9 @@
17.59 */
17.60 void pvr2_render_scene( render_buffer_t buffer )
17.61 {
17.62 - struct tile_descriptor *tile_desc =
17.63 - (struct tile_descriptor *)mem_get_region(PVR2_RAM_BASE + MMIO_READ( PVR2, RENDER_TILEBASE ));
17.64 + struct timeval tva, tvb;
17.65 +
17.66 + gettimeofday(&tva, NULL);
17.67
17.68 float bgplanez = 1/MMIO_READF( PVR2, RENDER_FARCLIP );
17.69 pvr2_render_prepare_context( buffer, bgplanez, 0 );
17.70 @@ -135,6 +140,9 @@
17.71
17.72 pvr2_render_tilebuffer( buffer->width, buffer->height, clip_x, clip_y,
17.73 clip_x + clip_width, clip_y + clip_height );
17.74 -
17.75 - DEBUG( "Rendered frame %d to %08X", pvr2_get_frame_count(), buffer->address );
17.76 +
17.77 + gettimeofday( &tvb, NULL );
17.78 + uint32_t ms = (tvb.tv_sec - tva.tv_sec) * 1000 +
17.79 + (tvb.tv_usec - tva.tv_usec)/1000;
17.80 + DEBUG( "Rendered frame %d to %08X in %dms", pvr2_get_frame_count(), buffer->address, ms );
17.81 }
18.1 --- a/src/pvr2/rendsave.c Sun Oct 07 06:27:12 2007 +0000
18.2 +++ b/src/pvr2/rendsave.c Mon Oct 08 11:52:13 2007 +0000
18.3 @@ -1,5 +1,5 @@
18.4 /**
18.5 - * $Id: rendsave.c,v 1.1 2007-01-16 10:34:46 nkeynes Exp $
18.6 + * $Id: rendsave.c,v 1.2 2007-10-08 11:52:13 nkeynes Exp $
18.7 *
18.8 * Scene-save support. This is mainly for test/debug purposes.
18.9 *
18.10 @@ -94,4 +94,5 @@
18.11 uint32_t eof = 0xFFFFFFFF;
18.12 fwrite( &eof, sizeof(uint32_t), 1, f );
18.13 fclose( f );
18.14 + return 0;
18.15 }
19.1 --- a/src/pvr2/rendsort.c Sun Oct 07 06:27:12 2007 +0000
19.2 +++ b/src/pvr2/rendsort.c Mon Oct 08 11:52:13 2007 +0000
19.3 @@ -1,5 +1,5 @@
19.4 /**
19.5 - * $Id: rendsort.c,v 1.5 2007-01-26 01:37:39 nkeynes Exp $
19.6 + * $Id: rendsort.c,v 1.6 2007-10-08 11:52:13 nkeynes Exp $
19.7 *
19.8 * PVR2 renderer routines for depth sorted polygons
19.9 *
19.10 @@ -148,7 +148,7 @@
19.11 }
19.12 } else {
19.13 /* Polygon */
19.14 - int i, first=-1, last = -1;
19.15 + int i;
19.16 float *vertex = (float *)polygon+context_length;
19.17 for( i=0; i<6; i++ ) {
19.18 if( entry & (0x40000000>>i) ) {
19.19 @@ -178,7 +178,7 @@
19.20 void render_triangles( struct render_triangle *triangles, int num_triangles,
19.21 int render_mode )
19.22 {
19.23 - int i,j, k, m = 0;
19.24 + int i;
19.25 for( i=0; i<num_triangles; i++ ) {
19.26 render_set_context( triangles[i].polygon, render_mode );
19.27 glEnable(GL_DEPTH_TEST);
19.28 @@ -194,10 +194,10 @@
19.29
19.30 }
19.31
19.32 -int compare_triangles( void *a, void *b )
19.33 +int compare_triangles( const void *a, const void *b )
19.34 {
19.35 - struct render_triangle *tri1 = a;
19.36 - struct render_triangle *tri2 = b;
19.37 + const struct render_triangle *tri1 = a;
19.38 + const struct render_triangle *tri2 = b;
19.39 if( tri1->minz < tri2->minz ) {
19.40 return 1; // No these _aren't_ back to front...
19.41 } else if( tri1->minz > tri2->minz ) {
20.1 --- a/src/pvr2/tacore.c Sun Oct 07 06:27:12 2007 +0000
20.2 +++ b/src/pvr2/tacore.c Mon Oct 08 11:52:13 2007 +0000
20.3 @@ -1,5 +1,5 @@
20.4 /**
20.5 - * $Id: tacore.c,v 1.11 2007-01-31 10:31:53 nkeynes Exp $
20.6 + * $Id: tacore.c,v 1.12 2007-10-08 11:52:13 nkeynes Exp $
20.7 *
20.8 * PVR2 Tile Accelerator implementation
20.9 *
20.10 @@ -261,7 +261,7 @@
20.11 (((((base & 0xFF) * i) & 0xFF00) |
20.12 (((base & 0xFF00) * i) & 0xFF0000) |
20.13 (((base & 0xFF0000) * i) & 0xFF000000)) >> 8) |
20.14 - base & 0xFF000000;
20.15 + (base & 0xFF000000);
20.16 }
20.17
20.18 /**
20.19 @@ -369,7 +369,6 @@
20.20 uint32_t posn = MMIO_READ( PVR2, TA_LISTPOS );
20.21 uint32_t limit = MMIO_READ( PVR2, TA_LISTEND ) >> 2;
20.22 uint32_t newposn;
20.23 - uint32_t result;
20.24 if( ta_status.tilelist_dir == TA_GROW_DOWN ) {
20.25 newposn = posn - ta_status.tilelist_size;
20.26 if( posn == limit ) {
20.27 @@ -412,18 +411,18 @@
20.28 /**
20.29 * Write a tile entry out to the matrix.
20.30 */
20.31 -static int ta_write_tile_entry( int x, int y, uint32_t tile_entry ) {
20.32 +static void ta_write_tile_entry( int x, int y, uint32_t tile_entry ) {
20.33 uint32_t tile = TILESLOT(x,y);
20.34 uint32_t tilestart = tile;
20.35 uint32_t value;
20.36 uint32_t lasttri = 0;
20.37 - int i,l;
20.38 + int i;
20.39
20.40 if( ta_status.clip_mode == TA_POLYCMD_CLIP_OUTSIDE &&
20.41 x >= ta_status.clip.x1 && x <= ta_status.clip.x2 &&
20.42 y >= ta_status.clip.y1 && y <= ta_status.clip.y2 ) {
20.43 /* Tile clipped out */
20.44 - return 0;
20.45 + return;
20.46 }
20.47
20.48 if( (tile_entry & 0x80000000) &&
20.49 @@ -475,11 +474,11 @@
20.50 } else if( (value & 0xFF000000) == 0xE0000000 ) {
20.51 value &= 0x00FFFFFF;
20.52 if( value == tilestart )
20.53 - return 0; /* Loop */
20.54 + return; /* Loop */
20.55 tilestart = tile = value;
20.56 } else {
20.57 /* This should never happen */
20.58 - return 0;
20.59 + return;
20.60 }
20.61 }
20.62 }
20.63 @@ -1035,7 +1034,7 @@
20.64 /**
20.65 * Process 1 32-byte block of ta data
20.66 */
20.67 -void pvr2_ta_process_block( char *input ) {
20.68 +void pvr2_ta_process_block( unsigned char *input ) {
20.69 union ta_data *data = (union ta_data *)input;
20.70
20.71 switch( ta_status.state ) {
20.72 @@ -1169,7 +1168,7 @@
20.73 * far enough to generate the correct end-of-list events. Tile buffer is
20.74 * entirely ignored.
20.75 */
20.76 -void pvr2_ta_write( char *buf, uint32_t length )
20.77 +void pvr2_ta_write( unsigned char *buf, uint32_t length )
20.78 {
20.79 if( ta_status.debug_output ) {
20.80 fwrite_dump32( (uint32_t *)buf, length, stderr );
21.1 --- a/src/pvr2/texcache.c Sun Oct 07 06:27:12 2007 +0000
21.2 +++ b/src/pvr2/texcache.c Mon Oct 08 11:52:13 2007 +0000
21.3 @@ -1,5 +1,5 @@
21.4 /**
21.5 - * $Id: texcache.c,v 1.26 2007-02-11 10:09:32 nkeynes Exp $
21.6 + * $Id: texcache.c,v 1.27 2007-10-08 11:52:13 nkeynes Exp $
21.7 *
21.8 * Texture cache. Responsible for maintaining a working set of OpenGL
21.9 * textures.
21.10 @@ -261,7 +261,7 @@
21.11 }
21.12 }
21.13
21.14 -static void vq_decode( uint16_t *output, char *input, int width, int height,
21.15 +static void vq_decode( uint16_t *output, unsigned char *input, int width, int height,
21.16 struct vq_codebook *codebook ) {
21.17 int i,j;
21.18
21.19 @@ -318,7 +318,7 @@
21.20 * Load texture data from the given address and parameters into the currently
21.21 * bound OpenGL texture.
21.22 */
21.23 -static texcache_load_texture( uint32_t texture_addr, int width, int height,
21.24 +static void texcache_load_texture( uint32_t texture_addr, int width, int height,
21.25 int mode ) {
21.26 int bpp_shift = 1; /* bytes per (output) pixel as a power of 2 */
21.27 GLint intFormat = GL_RGBA, format, type;
21.28 @@ -353,6 +353,8 @@
21.29 type = GL_UNSIGNED_INT_8_8_8_8_REV;
21.30 bpp_shift = 2;
21.31 break;
21.32 + default:
21.33 + return; /* Can't happen, but it makes gcc stop complaining */
21.34 }
21.35 break;
21.36
21.37 @@ -379,16 +381,19 @@
21.38 break;
21.39 case PVR2_TEX_FORMAT_BUMPMAP:
21.40 ERROR( "Bumpmap not supported" );
21.41 - break;
21.42 + return;
21.43 + default:
21.44 + ERROR( "Undefined texture format" );
21.45 + return;
21.46 }
21.47
21.48 if( PVR2_TEX_IS_STRIDE(mode) && tex_format != PVR2_TEX_FORMAT_IDX4 &&
21.49 tex_format != PVR2_TEX_FORMAT_IDX8 ) {
21.50 /* Stride textures cannot be mip-mapped, compressed, indexed or twiddled */
21.51 uint32_t stride = (MMIO_READ( PVR2, RENDER_TEXSIZE ) & 0x003F) << 5;
21.52 - char data[(width*height) << bpp_shift];
21.53 + unsigned char data[(width*height) << bpp_shift];
21.54 if( tex_format == PVR2_TEX_FORMAT_YUV422 ) {
21.55 - char tmp[(width*height)<<1];
21.56 + unsigned char tmp[(width*height)<<1];
21.57 pvr2_vram64_read_stride( tmp, width<<1, texture_addr, stride<<1, height );
21.58 yuv_decode( (uint32_t *)data, (uint32_t *)tmp, width, height );
21.59 } else {
21.60 @@ -414,19 +419,19 @@
21.61
21.62 if( PVR2_TEX_IS_COMPRESSED(mode) ) {
21.63 uint16_t tmp[VQ_CODEBOOK_SIZE];
21.64 - pvr2_vram64_read( (char *)tmp, texture_addr, VQ_CODEBOOK_SIZE );
21.65 + pvr2_vram64_read( (unsigned char *)tmp, texture_addr, VQ_CODEBOOK_SIZE );
21.66 texture_addr += VQ_CODEBOOK_SIZE;
21.67 vq_get_codebook( &codebook, tmp );
21.68 }
21.69
21.70 for( level=last_level; level>= 0; level-- ) {
21.71 - char data[dest_bytes];
21.72 + unsigned char data[dest_bytes];
21.73 /* load data from image, detwiddling/uncompressing as required */
21.74 if( tex_format == PVR2_TEX_FORMAT_IDX8 ) {
21.75 src_bytes = (mip_width * mip_height);
21.76 int bank = (mode >> 25) &0x03;
21.77 uint32_t *palette = ((uint32_t *)mmio_region_PVR2PAL.mem) + (bank<<8);
21.78 - char tmp[src_bytes];
21.79 + unsigned char tmp[src_bytes];
21.80 pvr2_vram64_read_twiddled_8( tmp, texture_addr, mip_width, mip_height );
21.81 if( bpp_shift == 2 ) {
21.82 decode_pal8_to_32( (uint32_t *)data, tmp, src_bytes, palette );
21.83 @@ -437,7 +442,7 @@
21.84 src_bytes = (mip_width * mip_height) >> 1;
21.85 int bank = (mode >>21 ) & 0x3F;
21.86 uint32_t *palette = ((uint32_t *)mmio_region_PVR2PAL.mem) + (bank<<4);
21.87 - char tmp[src_bytes];
21.88 + unsigned char tmp[src_bytes];
21.89 pvr2_vram64_read_twiddled_4( tmp, texture_addr, mip_width, mip_height );
21.90 if( bpp_shift == 2 ) {
21.91 decode_pal4_to_32( (uint32_t *)data, tmp, src_bytes, palette );
21.92 @@ -446,7 +451,7 @@
21.93 }
21.94 } else if( tex_format == PVR2_TEX_FORMAT_YUV422 ) {
21.95 src_bytes = ((mip_width*mip_height)<<1);
21.96 - char tmp[src_bytes];
21.97 + unsigned char tmp[src_bytes];
21.98 if( PVR2_TEX_IS_TWIDDLED(mode) ) {
21.99 pvr2_vram64_read_twiddled_16( tmp, texture_addr, mip_width, mip_height );
21.100 } else {
21.101 @@ -455,7 +460,7 @@
21.102 yuv_decode( (uint32_t *)data, (uint32_t *)tmp, mip_width, mip_height );
21.103 } else if( PVR2_TEX_IS_COMPRESSED(mode) ) {
21.104 src_bytes = ((mip_width*mip_height) >> 2);
21.105 - char tmp[src_bytes];
21.106 + unsigned char tmp[src_bytes];
21.107 if( PVR2_TEX_IS_TWIDDLED(mode) ) {
21.108 pvr2_vram64_read_twiddled_8( tmp, texture_addr, mip_width>>1, mip_height>>1 );
21.109 } else {
22.1 --- a/src/pvr2/yuv.c Sun Oct 07 06:27:12 2007 +0000
22.2 +++ b/src/pvr2/yuv.c Mon Oct 08 11:52:13 2007 +0000
22.3 @@ -1,5 +1,5 @@
22.4 /**
22.5 - * $Id: yuv.c,v 1.4 2007-01-16 09:17:22 nkeynes Exp $
22.6 + * $Id: yuv.c,v 1.5 2007-10-08 11:52:13 nkeynes Exp $
22.7 *
22.8 * YUV420 and YUV422 decoding
22.9 *
22.10 @@ -33,7 +33,7 @@
22.11 int width;
22.12 int height;
22.13 int input_format;
22.14 - char data[512];
22.15 + unsigned char data[512];
22.16 int data_length;
22.17 int x, y;
22.18 } pvr2_yuv_state;
22.19 @@ -83,7 +83,7 @@
22.20 * for a total of 384 bytes.
22.21 * Output is UVYV = 32 bits = 2 horizontal pixels, 8x16 = 512 bytes
22.22 */
22.23 -void pvr2_decode_yuv420( char *dest, char *src )
22.24 +void pvr2_decode_yuv420( unsigned char *dest, unsigned char *src )
22.25 {
22.26 int i;
22.27 for( i=0; i<512; i++ ) {
22.28 @@ -91,7 +91,7 @@
22.29 }
22.30 }
22.31
22.32 -void pvr2_decode_yuv422( char *dest, char *src )
22.33 +void pvr2_decode_yuv422( unsigned char *dest, unsigned char *src )
22.34 {
22.35 int i;
22.36 for( i=0; i<512; i++ ) {
22.37 @@ -103,9 +103,9 @@
22.38 * Process a single macroblock of YUV data and write it out to
22.39 * texture vram.
22.40 */
22.41 -void pvr2_yuv_process_block( char *data )
22.42 +void pvr2_yuv_process_block( unsigned char *data )
22.43 {
22.44 - char output[512];
22.45 + unsigned char output[512];
22.46
22.47 if( pvr2_yuv_state.input_format == FORMAT_YUV420 ) {
22.48 pvr2_decode_yuv420( output, data );
22.49 @@ -135,7 +135,7 @@
22.50 * for buffering the data into macroblock chunks and then passing it on to the
22.51 * real processing
22.52 */
22.53 -void pvr2_yuv_write( char *data, uint32_t length )
22.54 +void pvr2_yuv_write( unsigned char *data, uint32_t length )
22.55 {
22.56 int block_size = yuv_block_size[pvr2_yuv_state.input_format];
22.57
23.1 --- a/src/x86dasm/x86dasm.c Sun Oct 07 06:27:12 2007 +0000
23.2 +++ b/src/x86dasm/x86dasm.c Mon Oct 08 11:52:13 2007 +0000
23.3 @@ -1,5 +1,5 @@
23.4 /**
23.5 - * $Id: x86dasm.c,v 1.3 2007-09-12 09:16:47 nkeynes Exp $
23.6 + * $Id: x86dasm.c,v 1.4 2007-10-08 11:48:10 nkeynes Exp $
23.7 *
23.8 * Wrapper around i386-dis to supply the same behaviour as the other
23.9 * disassembly functions.
23.10 @@ -31,9 +31,7 @@
23.11 &sh4r.pc };
23.12
23.13 static int x86_disasm_output( void *data, const char *format, ... );
23.14 -static int x86_read_memory( bfd_vma memaddr, bfd_byte *buffer, unsigned int length,
23.15 - struct disassemble_info *info );
23.16 -static int x86_print_address( bfd_vma memaddr, struct disassemble_info *info );
23.17 +static void x86_print_address( bfd_vma memaddr, struct disassemble_info *info );
23.18
23.19 static struct disassemble_info x86_disasm_info;
23.20
23.21 @@ -54,7 +52,7 @@
23.22 }
23.23 }
23.24
23.25 -void x86_disasm_init(char *buf, uint32_t vma, int buflen)
23.26 +void x86_disasm_init(unsigned char *buf, uint32_t vma, int buflen)
23.27 {
23.28 init_disassemble_info( &x86_disasm_info, NULL, x86_disasm_output );
23.29 x86_disasm_info.arch = bfd_arch_i386;
23.30 @@ -76,21 +74,20 @@
23.31 {
23.32 int i;
23.33 for( i=0; i<x86_num_symbols; i++ ) {
23.34 - if( x86_symtab[i].ptr == (void *)memaddr ) {
23.35 + if( x86_symtab[i].ptr == (void *)(uint32_t)memaddr ) {
23.36 return x86_symtab[i].name;
23.37 }
23.38 }
23.39 return NULL;
23.40 }
23.41
23.42 -static int x86_print_address( bfd_vma memaddr, struct disassemble_info *info )
23.43 +static void x86_print_address( bfd_vma memaddr, struct disassemble_info *info )
23.44 {
23.45 const char *sym = x86_find_symbol(memaddr, info);
23.46 info->fprintf_func( info->stream, "%08X", memaddr );
23.47 if( sym != NULL ) {
23.48 info->fprintf_func( info->stream, " <%s>", sym );
23.49 }
23.50 - return 0;
23.51 }
23.52
23.53 uint32_t x86_disasm_instruction( uint32_t pc, char *buf, int len, char *opcode )
23.54 @@ -101,7 +98,7 @@
23.55 buf[0] = 0;
23.56 count = print_insn_i386_att( pc, &x86_disasm_info );
23.57 if( count != 0 ) {
23.58 - char tmp[count];
23.59 + unsigned char tmp[count];
23.60 x86_disasm_info.read_memory_func( pc, tmp, count, &x86_disasm_info );
23.61 for( i=0; i<count; i++ ) {
23.62 sprintf( opcode, "%02X ", ((unsigned int)tmp[i])&0xFF );
24.1 --- a/src/x86dasm/x86dasm.h Sun Oct 07 06:27:12 2007 +0000
24.2 +++ b/src/x86dasm/x86dasm.h Mon Oct 08 11:52:13 2007 +0000
24.3 @@ -1,5 +1,5 @@
24.4 /**
24.5 - * $Id: x86dasm.h,v 1.3 2007-09-12 09:16:47 nkeynes Exp $
24.6 + * $Id: x86dasm.h,v 1.4 2007-10-08 11:48:10 nkeynes Exp $
24.7 *
24.8 * Wrapper around i386-dis to supply the same behaviour as the other
24.9 * disassembly functions.
24.10 @@ -28,5 +28,5 @@
24.11
24.12 void x86_disasm_block( FILE *out, void *block, uint32_t len );
24.13 void x86_set_symtab( x86_symbol *symtab, int num_symbols );
24.14 -void x86_disasm_init(char *buf, uint32_t vma, int buflen);
24.15 +void x86_disasm_init(unsigned char *buf, uint32_t vma, int buflen);
24.16 uint32_t x86_disasm_instruction( uint32_t pc, char *buf, int len, char *opcode );
.