Vif MFIFO: Logic fix for Chessmaster. Game still needs EE Timing Fix to solve later hang in video, but game is playable now. Thanks to Ssakash for looking in to this :)

This commit is contained in:
refractionpcsx2 2015-10-24 03:29:56 +01:00
parent e64bdbdb2c
commit 8d22006165
2 changed files with 11 additions and 4 deletions

View File

@ -270,7 +270,8 @@ __fi void vif1FBRST(u32 value) {
{ {
case MFD_VIF1: case MFD_VIF1:
//Console.WriteLn("MFIFO Stall"); //Console.WriteLn("MFIFO Stall");
if(vif1ch.chcr.STR == true) CPU_INT(DMAC_MFIFO_VIF, 0); //MFIFO active and not empty
if(vif1ch.chcr.STR == true && !(vif1.inprogress & 0x10)) CPU_INT(DMAC_MFIFO_VIF, 0);
break; break;
case NO_MFD: case NO_MFD:

View File

@ -183,7 +183,8 @@ void mfifoVIF1transfer(int qwc)
SPR_LOG("Added %x qw to mfifo,Vif CHCR %x Stalled %x done %x", qwc, vif1ch.chcr._u32, vif1.vifstalled.enabled, vif1.done); SPR_LOG("Added %x qw to mfifo,Vif CHCR %x Stalled %x done %x", qwc, vif1ch.chcr._u32, vif1.vifstalled.enabled, vif1.done);
if (vif1.inprogress & 0x10) if (vif1.inprogress & 0x10)
{ {
if(vif1ch.chcr.STR == true && !(cpuRegs.interrupt & (1<<DMAC_MFIFO_VIF))) //Don't resume if stalled or already looping
if(vif1ch.chcr.STR == true && !(cpuRegs.interrupt & (1<<DMAC_MFIFO_VIF)) && !vif1Regs.stat.INT)
{ {
SPR_LOG("Data Added, Resuming"); SPR_LOG("Data Added, Resuming");
CPU_INT(DMAC_MFIFO_VIF, 16); CPU_INT(DMAC_MFIFO_VIF, 16);
@ -328,12 +329,17 @@ void vifMFIFOInterrupt()
hwIntcIrq(INTC_VIF1); hwIntcIrq(INTC_VIF1);
--vif1.irq; --vif1.irq;
if (vif1.inprogress & 0x10) {
FireMFIFOEmpty();
//if (!(vif1.done && vif1ch.qwc == 0))return;
}
if (vif1Regs.stat.test(VIF1_STAT_VSS | VIF1_STAT_VIS | VIF1_STAT_VFS)) { if (vif1Regs.stat.test(VIF1_STAT_VSS | VIF1_STAT_VIS | VIF1_STAT_VFS)) {
//vif1Regs.stat.FQC = 0; // FQC=0 //vif1Regs.stat.FQC = 0; // FQC=0
//vif1ch.chcr.STR = false; //vif1ch.chcr.STR = false;
vif1Regs.stat.FQC = std::min((u16)0x10, vif1ch.qwc); vif1Regs.stat.FQC = std::min((u16)0x10, vif1ch.qwc);
if((vif1ch.qwc > 0 || !vif1.done) && !(vif1.inprogress & 0x10)) { VIF_LOG("VIF1 MFIFO Stalled qwc = %x done = %x inprogress = %x", vif1ch.qwc,vif1.done, vif1.inprogress & 0x10);
//Used to check if the MFIFO was empty, there's really no need if it's finished what it needed.
if((vif1ch.qwc > 0 || !vif1.done)) {
VIF_LOG("VIF1 MFIFO Stalled"); VIF_LOG("VIF1 MFIFO Stalled");
return; return;
} }