From 2cc719d5b0030b7f9214029133d7023894446a5f Mon Sep 17 00:00:00 2001 From: refraction Date: Fri, 13 Feb 2009 23:57:39 +0000 Subject: [PATCH] Slight modification to the MFIFO's to prevent potential situations which could cause bad data to be copied. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@490 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Gif.cpp | 1 + pcsx2/Vif.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pcsx2/Gif.cpp b/pcsx2/Gif.cpp index 3401b3c8b3..f8be88c25f 100644 --- a/pcsx2/Gif.cpp +++ b/pcsx2/Gif.cpp @@ -421,6 +421,7 @@ void mfifoGIFtransfer(int qwc) { if(qwc > 0 ) { gifqwc += qwc; if(!(gif->chcr & 0x100))return; + if(gifdone == 1) return; } SPR_LOG("mfifoGIFtransfer %x madr %x, tadr %x\n", gif->chcr, gif->madr, gif->tadr); diff --git a/pcsx2/Vif.cpp b/pcsx2/Vif.cpp index 0eec873685..b070b3cc31 100644 --- a/pcsx2/Vif.cpp +++ b/pcsx2/Vif.cpp @@ -486,9 +486,10 @@ void mfifoVIF1transfer(int qwc) { if(qwc > 0){ vifqwc += qwc; - vif1.done &= ~1; + SPR_LOG("Added %x qw to mfifo, total now %x\n", qwc, vifqwc); - if((vif1ch->chcr & 0x100) == 0 || vif1.vifstalled == 1) return; + + if((vif1ch->chcr & 0x100) == 0 || vif1.vifstalled == 1 || vif1.done == 1) return; } if(vif1ch->qwc == 0){ @@ -590,7 +591,6 @@ void vifMFIFOInterrupt() if(vif1.done != 1) { if(vifqwc <= 0){ //SysPrintf("Empty\n"); - vif1.done |= 1; hwDmacIrq(14); return; }