# HG changeset patch # User nkeynes # Date 1169378957 0 # Node ID e2750808d02c0f100f1943beaa40a94c5c0e4fe9 # Parent 10a5b5475fb0587c8f82ed6634b6cdb599f48a31 Add method to dump vram to file in a form directly usable by testdata --- a/src/pvr2/pvr2mem.c Sun Jan 21 11:28:43 2007 +0000 +++ b/src/pvr2/pvr2mem.c Sun Jan 21 11:29:17 2007 +0000 @@ -1,5 +1,5 @@ /** - * $Id: pvr2mem.c,v 1.2 2007-01-15 10:10:51 nkeynes Exp $ + * $Id: pvr2mem.c,v 1.3 2007-01-21 11:29:17 nkeynes Exp $ * * PVR2 (Video) VRAM handling routines (mainly for the 64-bit region) * @@ -16,6 +16,8 @@ * GNU General Public License for more details. */ #include "pvr2.h" +#include +#include extern char *video_base; @@ -217,6 +219,30 @@ } } +void pvr2_vram64_dump_file( sh4addr_t addr, uint32_t length, gchar *filename ) +{ + uint32_t tmp[length>>2]; + FILE *f = fopen(filename, "wo"); + unsigned int i, j; + + if( f == NULL ) { + ERROR( "Unable to write to dump file '%s' (%s)", filename, strerror(errno) ); + return; + } + pvr2_vram64_read( tmp, addr, length ); + fprintf( f, "%08X\n", addr ); + for( i =0; i>2; i+=8 ) { + for( j=i; j