Search
lxdream.org :: lxdream/src/pvr2/pvr2mem.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/pvr2mem.c
changeset 333:e29561c998f5
prev327:00d55a462af3
next352:f0df7a6d4703
author nkeynes
date Sat Jan 27 06:21:35 2007 +0000 (12 years ago)
permissions -rw-r--r--
last change Start working towards scaler implementation - fixes overrun issue
file annotate diff log raw
1.1 --- a/src/pvr2/pvr2mem.c Thu Jan 25 11:46:35 2007 +0000
1.2 +++ b/src/pvr2/pvr2mem.c Sat Jan 27 06:21:35 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: pvr2mem.c,v 1.7 2007-01-25 11:46:35 nkeynes Exp $
1.6 + * $Id: pvr2mem.c,v 1.8 2007-01-27 06:21:35 nkeynes Exp $
1.7 *
1.8 * PVR2 (Video) VRAM handling routines (mainly for the 64-bit region)
1.9 *
1.10 @@ -420,13 +420,14 @@
1.11 }
1.12 }
1.13
1.14 -void pvr2_vram_write_invert( sh4addr_t destaddr, char *src, uint32_t length, uint32_t line_length )
1.15 +void pvr2_vram_write_invert( sh4addr_t destaddr, char *src, uint32_t length, uint32_t line_length,
1.16 + uint32_t src_stride )
1.17 {
1.18 char *dest = video_base + (destaddr & 0x007FFFFF);
1.19 - char *p = src + length - line_length;
1.20 + char *p = src + length - src_stride;
1.21 while( p >= src ) {
1.22 memcpy( dest, p, line_length );
1.23 - p -= line_length;
1.24 + p -= src_stride;
1.25 dest += line_length;
1.26 }
1.27 }
1.28 @@ -541,7 +542,11 @@
1.29 /* Regular buffer */
1.30 char target[size];
1.31 glReadPixels( 0, 0, buffer->width, buffer->height, format, type, target );
1.32 - pvr2_vram_write_invert( buffer->render_addr, target, size, line_size );
1.33 + if( (buffer->scale & 0xFFFF) == 0x0800 ) {
1.34 + pvr2_vram_write_invert( buffer->render_addr, target, size, line_size, line_size << 1 );
1.35 + } else {
1.36 + pvr2_vram_write_invert( buffer->render_addr, target, size, line_size, line_size );
1.37 + }
1.38 }
1.39 }
1.40
.