From 31221a29bd3bf87cf838529ebd2f0f8371bdb567 Mon Sep 17 00:00:00 2001 From: "refraction@gmail.com" Date: Wed, 13 Mar 2013 11:26:42 +0000 Subject: [PATCH] microVU: Save PC when processing T/D bits on branches, this is to ensure the rest of the block gets compiled correctly. Could have been the reason VP2 was freaking out after loading a save. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5593 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/microVU_Compile.inl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pcsx2/x86/microVU_Compile.inl b/pcsx2/x86/microVU_Compile.inl index 4d0e64dddd..371f5f867c 100644 --- a/pcsx2/x86/microVU_Compile.inl +++ b/pcsx2/x86/microVU_Compile.inl @@ -482,8 +482,10 @@ void mVUDoDBit(microVU& mVU, microFlagCycles* mFC) { bool isBranch = false; JccComparisonType Jcc; + u32 savedPC = 0; incPC(2); //Check next slot for branch delay, if not, that's where the VU will resume anyway. + savedPC = iPC; //Save PC as it's about to get modified if it's a branch! if(mVUinfo.isBdelay) isBranch = true; @@ -531,14 +533,17 @@ void mVUDoDBit(microVU& mVU, microFlagCycles* mFC) else mVUDTendProgram(mVU, mFC, 1); eJMP.SetTarget(); + iPC = savedPC; } void mVUDoTBit(microVU& mVU, microFlagCycles* mFC) { bool isBranch = false; JccComparisonType Jcc; + u32 savedPC = 0; incPC(2); //Check next slot for branch delay, if not, that's where the VU will resume anyway. + savedPC = iPC; //Save PC as it's about to get modified if it's a branch! if(mVUinfo.isBdelay) isBranch = true; @@ -584,6 +589,7 @@ void mVUDoTBit(microVU& mVU, microFlagCycles* mFC) else mVUDTendProgram(mVU, mFC, 1); eJMP.SetTarget(); + iPC = savedPC; } void mVUSaveFlags(microVU& mVU,microFlagCycles &mFC, microFlagCycles &mFCBackup)