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
This commit is contained in:
tmkkmac 2009-03-02 18:45:19 +00:00
parent 79cde4c09e
commit 699cdbba1e
1 changed files with 23 additions and 3 deletions

View File

@ -3007,9 +3007,29 @@ void VuInstruction::Recompile(list<VuInstruction>::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
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");