# HG changeset patch # User nkeynes # Date 1150632066 0 # Node ID 126794f2ea6db952fbeee42bbfe5f145e1a0f9fe # Parent 84f6b203cfe1d6d7ca4b349fc67a6e7338fc7023 Invalidate render buffers on writes to vram --- a/src/sh4/sh4mem.c Sun Jun 18 12:00:27 2006 +0000 +++ b/src/sh4/sh4mem.c Sun Jun 18 12:01:06 2006 +0000 @@ -1,5 +1,5 @@ /** - * $Id: sh4mem.c,v 1.12 2006-06-15 10:25:45 nkeynes Exp $ + * $Id: sh4mem.c,v 1.13 2006-06-18 12:01:06 nkeynes Exp $ * sh4mem.c is responsible for the SH4's access to memory (including memory * mapped I/O), using the page maps created in mem.c * @@ -230,6 +230,9 @@ (addr&0x1F800000) == 0x11000000 ) { texcache_invalidate_page(addr& 0x7FFFFF); addr = TRANSLATE_VIDEO_64BIT_ADDRESS(addr); + pvr2_render_invalidate(addr); + } else if( (addr&0x1F800000) == 0x05000000 ) { + pvr2_render_invalidate(addr); } if( IS_MMU_ENABLED() ) { @@ -275,6 +278,9 @@ (addr&0x1F800000) == 0x11000000 ) { texcache_invalidate_page(addr& 0x7FFFFF); addr = TRANSLATE_VIDEO_64BIT_ADDRESS(addr); + pvr2_render_invalidate(addr); + } else if( (addr&0x1F800000) == 0x05000000 ) { + pvr2_render_invalidate(addr); } if( IS_MMU_ENABLED() ) { ERROR( "user-mode & mmu translation not implemented, aborting", NULL ); @@ -308,6 +314,9 @@ (addr&0x1F800000) == 0x11000000 ) { texcache_invalidate_page(addr& 0x7FFFFF); addr = TRANSLATE_VIDEO_64BIT_ADDRESS(addr); + pvr2_render_invalidate(addr); + } else if( (addr&0x1F800000) == 0x05000000 ) { + pvr2_render_invalidate(addr); } if( IS_MMU_ENABLED() ) { @@ -353,6 +362,8 @@ destaddr >= 0x11000000 && destaddr < 0x12000000 ) { pvr2_vram64_write( destaddr, src, count ); } else { + if( (destaddr & 0x1F800000) == 0x05000000 ) + pvr2_render_invalidate( destaddr ); char *dest = mem_get_region(destaddr); if( dest == NULL ) ERROR( "Attempted block write to unknown address %08X", destaddr );