From 31ee576d6a0f015199d91948602a79bcc64c2d22 Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Thu, 8 Oct 2015 20:02:15 +0100 Subject: [PATCH] Sif: Limit/Mask transfer size to 1mb-16, thanks to jpd002 (Play!) for the fix! Fixes #643 Gregory Horror Show, which seems to be playable (from nothing!) --- pcsx2/Sif0.cpp | 4 +++- pcsx2/Sif1.cpp | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pcsx2/Sif0.cpp b/pcsx2/Sif0.cpp index 266c326d57..38ce1a40dd 100644 --- a/pcsx2/Sif0.cpp +++ b/pcsx2/Sif0.cpp @@ -134,7 +134,9 @@ static __fi bool ProcessIOPTag() // We're only copying the first 24 bits. Bits 30 and 31 (checked below) are Stop/IRQ bits. hw_dma9.madr = sif0data & 0xFFFFFF; - sif0.iop.counter = sif0words; + if (sif0words > 0xFFFFC) DevCon.Warning("SIF0 Overrun %x", sif0words); + //Maximum transfer amount 1mb-16 also masking out top part which is a "Mode" cache stuff, we don't care :) + sif0.iop.counter = sif0words & 0xFFFFC; // IOP tags have an IRQ bit and an End of Transfer bit: if (sif0tag.IRQ || (sif0tag.ID & 4)) sif0.iop.end = true; diff --git a/pcsx2/Sif1.cpp b/pcsx2/Sif1.cpp index 729e888429..3c69da7862 100644 --- a/pcsx2/Sif1.cpp +++ b/pcsx2/Sif1.cpp @@ -125,7 +125,11 @@ static __fi bool SIFIOPReadTag() // Only use the first 24 bits. hw_dma10.madr = sif1data & 0xffffff; - sif1.iop.counter = sif1words; + + if (sif1words > 0xFFFFC) DevCon.Warning("SIF1 Overrun %x", sif1words); + //Maximum transfer amount 1mb-16 also masking out top part which is a "Mode" cache stuff, we don't care :) + sif1.iop.counter = sif1words & 0xFFFFC; + if (sif1tag.IRQ || (sif1tag.ID & 4)) sif1.iop.end = true; return true;