New optional gamefix detects when a full motion video runs and temporarily switches GSdx to software rendering mode.

This is a workaround for the many FMV issues that occur in hardware rendering and that will take a while longer to get a proper fix.
It doesn't have any checks for the current video mode, so don't put GSdx in software mode and expect this to adapt, okay? :p
Note: It's possible to get crashes from switching renderers so please report those if you get them.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5391 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
ramapcsx2 2012-08-21 19:11:53 +00:00
parent fb851cfdfc
commit f44e697743
5 changed files with 56 additions and 2 deletions

View File

@ -55,6 +55,7 @@ enum GamefixId
Fix_VIFFIFO,
Fix_VIF1Stall,
Fix_GIFReverse,
Fix_FMVinSoftware,
GamefixId_COUNT
};
@ -347,7 +348,8 @@ struct Pcsx2Config
DMABusyHack :1, // Denies writes to the DMAC when it's busy. This is correct behaviour but bad timing can cause problems.
VIFFIFOHack :1, // Pretends to fill the non-existant VIF FIFO Buffer.
VIF1StallHack :1, // Like above, processes FIFO data before the stall is allowed (to make sure data goes over).
GIFReverseHack :1; // Allows PATH3 to continue even if the FIFO is reversed.
GIFReverseHack :1, // Allows PATH3 to continue even if the FIFO is reversed.
FMVinSoftwareHack:1; // Toggle in and out of software rendering when an FMV runs.
BITFIELD_END
GamefixOptions();
@ -497,6 +499,7 @@ TraceLogFilters& SetTraceConfig();
#define CHECK_VIFFIFOHACK (EmuConfig.Gamefixes.VIFFIFOHack) // Pretends to fill the non-existant VIF FIFO Buffer.
#define CHECK_VIF1STALLHACK (EmuConfig.Gamefixes.VIF1StallHack) // Like above, processes FIFO data before the stall is allowed (to make sure data goes over).
#define CHECK_GIFREVERSEHACK (EmuConfig.Gamefixes.GIFReverseHack) // Allows PATH3 to continue even if the FIFO is reversed.
#define CHECK_FMVINSOFTWAREHACK (EmuConfig.Gamefixes.FMVinSoftwareHack) // Toggle in and out of software rendering when an FMV runs.
//------------ Advanced Options!!! ---------------
#define CHECK_VU_OVERFLOW (EmuConfig.Cpu.Recompiler.vuOverflow)
#define CHECK_VU_EXTRA_OVERFLOW (EmuConfig.Cpu.Recompiler.vuExtraOverflow) // If enabled, Operands are clamped before being used in the VU recs

View File

@ -49,6 +49,9 @@ int coded_block_pattern = 0;
u8 indx4[16*16/2];
uint eecount_on_last_vdec = 0;
bool FMVstarted = 0;
bool EnableFMV = 0;
void tIPU_cmd::clear()
{
@ -403,6 +406,17 @@ static __ri void ipuBDEC(tIPU_CMD_BDEC bdec)
static __fi bool ipuVDEC(u32 val)
{
if (EmuConfig.Gamefixes.FMVinSoftwareHack) {
static int count = 0;
if (count++ > 5) {
if (FMVstarted == 0) {
EnableFMV = 1;
FMVstarted = 1;
}
count = 0;
}
eecount_on_last_vdec = cpuRegs.cycle;
}
switch (ipu_cmd.pos[0])
{
case 0:

View File

@ -255,7 +255,8 @@ const wxChar *const tbl_GamefixNames[] =
L"DMABusy",
L"VIFFIFO",
L"VIF1Stall",
L"GIFReverse"
L"GIFReverse",
L"FMVinSoftware",
};
const __fi wxChar* EnumToString( GamefixId id )
@ -316,6 +317,7 @@ void Pcsx2Config::GamefixOptions::Set( GamefixId id, bool enabled )
case Fix_VIFFIFO: VIFFIFOHack = enabled; break;
case Fix_VIF1Stall: VIF1StallHack = enabled; break;
case Fix_GIFReverse: GIFReverseHack = enabled; break;
case Fix_FMVinSoftware: FMVinSoftwareHack = enabled; break;
jNO_DEFAULT;
}
@ -340,6 +342,7 @@ bool Pcsx2Config::GamefixOptions::Get( GamefixId id ) const
case Fix_VIFFIFO: return VIFFIFOHack;
case Fix_VIF1Stall: return VIF1StallHack;
case Fix_GIFReverse: return GIFReverseHack;
case Fix_FMVinSoftware: return FMVinSoftwareHack;
jNO_DEFAULT;
}
@ -364,6 +367,7 @@ void Pcsx2Config::GamefixOptions::LoadSave( IniInterface& ini )
IniBitBool( VIFFIFOHack );
IniBitBool( VIF1StallHack );
IniBitBool( GIFReverseHack );
IniBitBool( FMVinSoftwareHack );
}
Pcsx2Config::Pcsx2Config()

View File

@ -435,6 +435,18 @@ double FramerateManager::GetFramerate() const
// LogicalVsync - Event received from the AppCoreThread (EEcore) for each vsync,
// roughly 50/60 times a second when frame limiting is enabled, and up to 10,000
// times a second if not (ok, not quite, but you get the idea... I hope.)
extern uint eecount_on_last_vdec;
extern bool FMVstarted;
extern bool renderswitch;
extern bool EnableFMV;
void DoFmvSwitch()
{
ScopedCoreThreadPause paused_core( new SysExecEvent_SaveSinglePlugin(PluginId_GS) );
renderswitch = !renderswitch;
paused_core.AllowResume();
}
void Pcsx2App::LogicalVsync()
{
if( AppRpc_TryInvokeAsync( &Pcsx2App::LogicalVsync ) ) return;
@ -445,6 +457,23 @@ void Pcsx2App::LogicalVsync()
FpsManager.DoFrame();
if (EmuConfig.Gamefixes.FMVinSoftwareHack) {
if (EnableFMV == 1) {
Console.Warning("FMV on");
DoFmvSwitch();
EnableFMV = 0;
}
if (FMVstarted){
int diff = cpuRegs.cycle - eecount_on_last_vdec;
if (diff > 60000000 ) {
Console.Warning("FMV off");
DoFmvSwitch();
FMVstarted = 0;
}
}
}
if (EmuConfig.GS.ManagedVsync && EmuConfig.GS.VsyncEnable)
{
static bool last_enabled = true; // Avoids locking it in some scenarios

View File

@ -93,6 +93,10 @@ Panels::GameFixesPanel::GameFixesPanel( wxWindow* parent )
{
_("Ignore Bus Direction on Path3 Transfer - Used for Hotwheels"),
wxEmptyString
},
{
_("Switch to GSdx software rendering when a FMV plays"),
wxEmptyString
}
};