From 699cdbba1e83adc951bcb89b0df0dbd2985bfde9 Mon Sep 17 00:00:00 2001 From: tmkkmac Date: Mon, 2 Mar 2009 18:45:19 +0000 Subject: [PATCH] Fixed a problem that VU clip flag wasn't propagated correctly between recompiled blocks in some cases. SPS in Rule of Rose will be fixed by this. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@659 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/iVUzerorec.cpp | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/pcsx2/x86/iVUzerorec.cpp b/pcsx2/x86/iVUzerorec.cpp index fcca31ef3b..6e7bce2e8e 100644 --- a/pcsx2/x86/iVUzerorec.cpp +++ b/pcsx2/x86/iVUzerorec.cpp @@ -3007,9 +3007,29 @@ void VuInstruction::Recompile(list::iterator& itinst, u32 vuxyz) #endif if( type & INST_CLIP_WRITE ) { - if( nParentPc < s_pCurBlock->startpc || nParentPc >= (int)pc ) - // reading from out of this block, so already flushed to mem - s_ClipRead = (uptr)&VU->VI[REG_CLIP_FLAG]; + if( nParentPc < s_pCurBlock->startpc || nParentPc >= (int)pc ) { + + if( pparentinst != NULL ) { + + if( pparentinst->pClipWrite == 0 ) { + pparentinst->pClipWrite = (uptr)SuperVUStaticAlloc(4); + } + + if( nParentCheckForExecution >= 0 ) { + if( s_ClipRead == 0 ) + s_ClipRead = (uptr)&VU->VI[REG_CLIP_FLAG]; + + CMP32ItoM((uptr)&g_nLastBlockExecuted, nParentCheckForExecution); + u8* jptr = JNE8(0); + MOV32MtoR(EAX, pparentinst->pClipWrite); + MOV32ItoM(pparentinst->pClipWrite, 0); + MOV32RtoM(s_ClipRead, EAX); + x86SetJ8(jptr); + } + else s_ClipRead = (uptr)&VU->VI[REG_CLIP_FLAG]; + } + else s_ClipRead = (uptr)&VU->VI[REG_CLIP_FLAG]; + } else { s_ClipRead = s_pCurBlock->GetInstIterAtPc(nParentPc)->pClipWrite; if (s_ClipRead == 0) SysPrintf("super ClipRead allocation error! \n");