Added a new gamefix to make ignoring of DMAC writes when it's busy optional.

This should be mandatory but (most probably) timing issues make this break more games than it fixes.
Notable exception: Mana Khemia 1 (going "off campus"), so I added it to the auto gamefix database (Only NTSC so far, anyone got the PAL CRCs?).

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4512 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
ramapcsx2 2011-03-30 10:54:43 +00:00
parent fc9bc494ad
commit 6dcccff206
7 changed files with 24 additions and 7 deletions

View File

@ -9269,6 +9269,7 @@ Serial = SLUS-21735
Name = Mana Khemia - Alchemists of Al-Revis
Region = NTSC-U
Compat = 5
DMABusyHack = 1
---------------------------------------------
Serial = SLUS-21736
Name = Wall-E

View File

@ -51,6 +51,7 @@ enum GamefixId
Fix_EETiming,
Fix_SkipMpeg,
Fix_OPHFlag,
Fix_DMABusy,
GamefixId_COUNT
};
@ -339,7 +340,8 @@ struct Pcsx2Config
IPUWaitHack :1, // FFX FMV, makes GIF flush before doing IPU work. Fixes bad graphics overlay.
EETimingHack :1, // General purpose timing hack.
SkipMPEGHack :1, // Skips MPEG videos (Katamari and other games need this)
OPHFlagHack :1; // Skips MPEG videos (Katamari and other games need this)
OPHFlagHack :1, // Bleach Blade Battlers
DMABusyHack :1; // Denies writes to the DMAC when it's busy. This is correct behaviour but bad timing can cause problems.
BITFIELD_END
GamefixOptions();
@ -483,7 +485,8 @@ TraceLogFilters& SetTraceConfig();
#define CHECK_IPUWAITHACK (EmuConfig.Gamefixes.IPUWaitHack) // Special Fix For FFX
#define CHECK_EETIMINGHACK (EmuConfig.Gamefixes.EETimingHack) // Fix all scheduled events to happen in 1 cycle.
#define CHECK_SKIPMPEGHACK (EmuConfig.Gamefixes.SkipMPEGHack) // Finds sceMpegIsEnd pattern to tell the game the mpeg is finished (Katamari and a lot of games need this)
#define CHECK_OPHFLAGHACK (EmuConfig.Gamefixes.OPHFlagHack)
#define CHECK_OPHFLAGHACK (EmuConfig.Gamefixes.OPHFlagHack) // Bleach Blade Battlers
#define CHECK_DMABUSYHACK (EmuConfig.Gamefixes.DMABusyHack) // Denies writes to the DMAC when it's busy. This is correct behaviour but bad timing can cause problems.
//------------ Advanced Options!!! ---------------
#define CHECK_VU_OVERFLOW (EmuConfig.Cpu.Recompiler.vuOverflow)

View File

@ -251,7 +251,8 @@ const wxChar *const tbl_GamefixNames[] =
L"IpuWait",
L"EETiming",
L"SkipMpeg",
L"OPHFlag"
L"OPHFlag",
L"DMABusy"
};
const __fi wxChar* EnumToString( GamefixId id )
@ -308,6 +309,7 @@ void Pcsx2Config::GamefixOptions::Set( GamefixId id, bool enabled )
case Fix_EETiming: EETimingHack = enabled; break;
case Fix_SkipMpeg: SkipMPEGHack = enabled; break;
case Fix_OPHFlag: OPHFlagHack = enabled; break;
case Fix_DMABusy: DMABusyHack = enabled; break;
jNO_DEFAULT;
}
@ -328,6 +330,7 @@ bool Pcsx2Config::GamefixOptions::Get( GamefixId id ) const
case Fix_EETiming: return EETimingHack;
case Fix_SkipMpeg: return SkipMPEGHack;
case Fix_OPHFlag: return OPHFlagHack;
case Fix_DMABusy: return DMABusyHack;
jNO_DEFAULT
}
@ -348,6 +351,7 @@ void Pcsx2Config::GamefixOptions::LoadSave( IniInterface& ini )
IniBitBool( EETimingHack );
IniBitBool( SkipMPEGHack );
IniBitBool( OPHFlagHack );
IniBitBool( DMABusyHack );
}
Pcsx2Config::Pcsx2Config()

View File

@ -246,7 +246,7 @@ void SysCoreThread::DoCpuExecute()
void SysCoreThread::ExecuteTaskInThread()
{
Threading::EnableHiresScheduler();
Threading::EnableHiresScheduler(); // Note that *something* in SPU2-X and GSdx also set the timer resolution to 1ms.
m_sem_event.WaitWithoutYield();
m_mxcsr_saved.bitmask = _mm_getcsr();

View File

@ -83,6 +83,13 @@ Panels::GameFixesPanel::GameFixesPanel( wxWindow* parent )
L" * Growlanser II and III\n"
L" * Wizardry"
)
},
{
_("Ignore DMAC writes when it is busy."),
pxEt( "!ContextTip:Gamefixes:DMA Busy hack",
L"Known to affect following games:\n"
L" * Mana Khemia 1 (Going \"off campus\")\n"
)
}
};

View File

@ -429,12 +429,13 @@ __fi bool dmacWrite32( u32 mem, mem32_t& value )
}
}
//DMA Writes are invalid to everything except the STR on CHCR when it is busy
if((mem & 0xf0))
// DMA Writes are invalid to everything except the STR on CHCR when it is busy
// There's timing problems with many games. Gamefix time!
if( CHECK_DMABUSYHACK && (mem & 0xf0) )
{
if((psHu32(mem & ~0xff) & 0x100) && dmacRegs.ctrl.DMAE && !psHu8(DMAC_ENABLER+2))
{
//DevCon.Warning("Write to DMA addr %x while STR is busy! Ignoring", mem);
DevCon.Warning("Gamefix: Write to DMA addr %x while STR is busy! Ignoring", mem);
return false;
}
}

View File

@ -44,6 +44,7 @@ void pxDwm_Load()
{
Console.WriteLn( "[Dwm] Desktop Window Manager detected." );
// Seems to set the Windows timer resolution to 10ms
if(FAILED(pDwmEnableMMCSS(TRUE)))
Console.WriteLn("[Dwm] DwmEnableMMCSS returned a failure code.");
}