Search
lxdream.org :: lxdream/src/pvr2/pvr2mem.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/pvr2mem.c
changeset 1294:52be323fcab4
prev1067:d3c00ffccfcd
author nkeynes
date Wed Sep 19 08:42:18 2012 +1000 (8 years ago)
permissions -rw-r--r--
last change Invalidate render buffers when vram32 region is written from DMA / store
queue. Patch from Guinux, thanks!
file annotate diff log raw
1.1 --- a/src/pvr2/pvr2mem.c Sun Jul 05 13:54:48 2009 +1000
1.2 +++ b/src/pvr2/pvr2mem.c Wed Sep 19 08:42:18 2012 +1000
1.3 @@ -140,9 +140,7 @@
1.4 if( region == 0 ) {
1.5 pvr2_vram64_write( destaddr, src, 32 );
1.6 } else {
1.7 - destaddr &= PVR2_RAM_MASK;
1.8 - unsigned char *dest = pvr2_main_ram + destaddr;
1.9 - memcpy( dest, src, 32 );
1.10 + pvr2_vram32_write( destaddr, src, 32 );
1.11 }
1.12 }
1.13
1.14 @@ -152,9 +150,7 @@
1.15 if( region == 0 ) {
1.16 pvr2_vram64_write( destaddr, src, 32 );
1.17 } else {
1.18 - destaddr &= PVR2_RAM_MASK;
1.19 - unsigned char *dest = pvr2_main_ram + destaddr;
1.20 - memcpy( dest, src, 32 );
1.21 + pvr2_vram32_write( destaddr, src, 32 );
1.22 }
1.23 }
1.24
1.25 @@ -203,12 +199,7 @@
1.26 if( region == 0 ) {
1.27 pvr2_vram64_write( destaddr, src, count );
1.28 } else {
1.29 - destaddr &= PVR2_RAM_MASK;
1.30 - unsigned char *dest = pvr2_main_ram + destaddr;
1.31 - if( PVR2_RAM_SIZE - destaddr < count ) {
1.32 - count = PVR2_RAM_SIZE - destaddr;
1.33 - }
1.34 - memcpy( dest, src, count );
1.35 + pvr2_vram32_write( destaddr, src, count );
1.36 }
1.37 break;
1.38 case 0x10800000:
1.39 @@ -221,16 +212,22 @@
1.40 if( region == 0 ) {
1.41 pvr2_vram64_write( destaddr, src, count );
1.42 } else {
1.43 - destaddr &= PVR2_RAM_MASK;
1.44 - unsigned char *dest = pvr2_main_ram + destaddr;
1.45 - if( PVR2_RAM_SIZE - destaddr < count ) {
1.46 - count = PVR2_RAM_SIZE - destaddr;
1.47 - }
1.48 - memcpy( dest, src, count );
1.49 + pvr2_vram32_write( destaddr, src, count );
1.50 }
1.51 }
1.52 }
1.53
1.54 +void pvr2_vram32_write( sh4addr_t destaddr, unsigned char *src, uint32_t length )
1.55 +{
1.56 + destaddr &= PVR2_RAM_MASK;
1.57 + pvr2_render_buffer_invalidate( PVR2_RAM_BASE + destaddr, TRUE );
1.58 + unsigned char *dest = pvr2_main_ram + destaddr;
1.59 + if( PVR2_RAM_SIZE - destaddr < length ) {
1.60 + length = PVR2_RAM_SIZE - destaddr;
1.61 + }
1.62 + memcpy( dest, src, length );
1.63 +}
1.64 +
1.65 void pvr2_vram64_write( sh4addr_t destaddr, unsigned char *src, uint32_t length )
1.66 {
1.67 int bank_flag = (destaddr & 0x04) >> 2;
.