From 6669b7d6ef558af798691863cce46a9f8b3586b1 Mon Sep 17 00:00:00 2001 From: "sudonim1@gmail.com" Date: Tue, 14 Aug 2012 22:30:04 +0000 Subject: [PATCH] Game fixes: Extended the OPH hack a bit to set APATH to each path in turn in addition. Should make the hack fix some Eurocom games (Sphinx and the Cursed Mummy, some Buffy thing, others?) VIF: changed a memcpy_aligned on 64-bit aligned data to memcpy_fast. Doesn't matter with the current memcpy set we use but could have caused a crash in the future. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5373 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Vif_Codes.cpp | 2 +- pcsx2/ps2/LegacyDmac.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pcsx2/Vif_Codes.cpp b/pcsx2/Vif_Codes.cpp index 721e6d51ca..f43a902391 100644 --- a/pcsx2/Vif_Codes.cpp +++ b/pcsx2/Vif_Codes.cpp @@ -263,7 +263,7 @@ static __fi void _vifCode_MPG(int idx, u32 addr, const u32 *data, int size) { // Clear VU memory before writing! if (!idx) CpuVU0->Clear(addr, size*4); else CpuVU1->Clear(addr, size*4); - memcpy_aligned(VUx.Micro + addr, data, size*4); //from tests, memcpy is 1fps faster on Grandia 3 than memcpy_fast + memcpy_fast(VUx.Micro + addr, data, size*4); //from tests, memcpy is 1fps faster on Grandia 3 than memcpy_fast //} } diff --git a/pcsx2/ps2/LegacyDmac.cpp b/pcsx2/ps2/LegacyDmac.cpp index a8473971fb..a6eb16e661 100644 --- a/pcsx2/ps2/LegacyDmac.cpp +++ b/pcsx2/ps2/LegacyDmac.cpp @@ -282,10 +282,14 @@ static __ri void DmaExec( void (*func)(), u32 mem, u32 value ) template< uint page > __fi u32 dmacRead32( u32 mem ) { - // Fixme: OPH hack. Toggle the flag on each GIF_STAT access. (rama) + // Fixme: OPH hack. Toggle the flag on GIF_STAT access. (rama) if (IsPageFor(mem) && (mem == GIF_STAT) && CHECK_OPHFLAGHACK) { - gifRegs.stat.OPH = !gifRegs.stat.OPH; + static unsigned counter = 1; + if (++counter == 8) + counter = 2; + // Set OPH and APATH from counter, cycling paths and alternating OPH + return gifRegs.stat._u32 & ~(7 << 9) | (counter & 1 ? counter << 9 : 0); } return psHu32(mem);