From c4cc49cda6d5ba4f767894b0340978286035cad6 Mon Sep 17 00:00:00 2001 From: refraction Date: Sat, 14 Feb 2009 16:47:31 +0000 Subject: [PATCH] Fixed an issue which caused savestates (or escaping) to freeze up the emu if MFIFO was in use git-svn-id: http://pcsx2.googlecode.com/svn/trunk@493 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/GS.cpp | 3 +++ pcsx2/Gif.cpp | 2 +- pcsx2/VifDma.cpp | 7 +++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pcsx2/GS.cpp b/pcsx2/GS.cpp index e99410d93e..980e36c07d 100644 --- a/pcsx2/GS.cpp +++ b/pcsx2/GS.cpp @@ -813,10 +813,13 @@ void gsDynamicSkipEnable() frameLimitReset(); } +extern unsigned int gifdone; void SaveState::gsFreeze() { FreezeMem(PS2MEM_GS, 0x2000); Freeze(CSRw); + if(((DMACh*)&PS2MEM_HW[0xA000])->chcr & 0x100)gifdone = 0; + else gifdone = 0; mtgsFreeze(); } diff --git a/pcsx2/Gif.cpp b/pcsx2/Gif.cpp index f8be88c25f..e28a8aa7d1 100644 --- a/pcsx2/Gif.cpp +++ b/pcsx2/Gif.cpp @@ -343,7 +343,7 @@ void dmaGIF() { static unsigned int mfifocycles; static unsigned int gifqwc = 0; -static unsigned int gifdone = 0; +unsigned int gifdone = 0; // called from only one location, so forceinline it: static __forceinline int mfifoGIFrbTransfer() { diff --git a/pcsx2/VifDma.cpp b/pcsx2/VifDma.cpp index 78ba2372e5..d22f17db28 100644 --- a/pcsx2/VifDma.cpp +++ b/pcsx2/VifDma.cpp @@ -1993,7 +1993,7 @@ __forceinline void vif1Interrupt() { return; } #ifdef PCSX2_DEVBUILD - if(vif1ch->qwc > 0) SysPrintf("VIF1 Ending with QWC left\n"); + if(vif1ch->qwc > 0) SysPrintf("VIF1 Ending with %x QWC left\n"); if(vif1.cmd != 0) SysPrintf("vif1.cmd still set %x\n", vif1.cmd); #endif @@ -2238,6 +2238,9 @@ void vif1Reset() { void SaveState::vif1Freeze() { Freeze(vif1); - if( IsLoading() ) + if( IsLoading() ){ SetNewMask(g_vif1Masks, g_vif1HasMask3, vif1Regs->mask, ~vif1Regs->mask); + if(vif1ch->chcr & 0x100)vif1.done = 0; + else vif1.done = 0; + } }