/[pcsx2_0.9.7]/trunk/pcsx2/Pcsx2Config.cpp
ViewVC logotype

Diff of /trunk/pcsx2/Pcsx2Config.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/pcsx2/Pcsx2Config.cpp	2010/09/07 03:24:11	31
+++ trunk/pcsx2/Pcsx2Config.cpp	2010/09/07 11:08:22	62
@@ -17,18 +17,17 @@
 
 #include <wx/fileconf.h>
 
-#include "IniInterface.h"
+#include "Utilities/IniInterface.h"
 #include "Config.h"
 #include "GS.h"
 
 void TraceLogFilters::LoadSave( IniInterface& ini )
 {
 	TraceLogFilters defaults;
-	IniScopedGroup path( ini, L"TraceLog" );
+	ScopedIniGroup path( ini, L"TraceLog" );
 
 	IniEntry( Enabled );
-	IniEntry( SIF );
-
+	
 	// Retaining backwards compat of the trace log enablers isn't really important, and
 	// doing each one by hand would be murder.  So let's cheat and just save it as an int:
 
@@ -44,43 +43,25 @@
 	VUCycleSteal	= 0;
 }
 
-ConsoleLogFilters::ConsoleLogFilters()
-{
-	ELF			= false;
-	StdoutEE	= true;
-	StdoutIOP	= true;
-	Deci2		= true;
-}
-
-void ConsoleLogFilters::LoadSave( IniInterface& ini )
-{
-	ConsoleLogFilters defaults;
-	IniScopedGroup path( ini, L"ConsoleLog" );
-
-	IniBitBool( ELF );
-	IniBitBool( StdoutEE );
-	IniBitBool( StdoutIOP );
-	IniBitBool( Deci2 );
-}
-
 void Pcsx2Config::SpeedhackOptions::LoadSave( IniInterface& ini )
 {
 	SpeedhackOptions defaults;
-	IniScopedGroup path( ini, L"Speedhacks" );
+	ScopedIniGroup path( ini, L"Speedhacks" );
 
 	IniBitfield( EECycleRate );
 	IniBitfield( VUCycleSteal );
-	IniBitBool( IopCycleRate_X2 );
+	IniBitBool( fastCDVD );
 	IniBitBool( IntcStat );
 	IniBitBool( WaitLoop );
 	IniBitBool( vuFlagHack );
+	IniBitBool( vuBlockHack );
 	IniBitBool( vuMinMax );
 }
 
 void Pcsx2Config::ProfilerOptions::LoadSave( IniInterface& ini )
 {
 	ProfilerOptions defaults;
-	IniScopedGroup path( ini, L"Profiler" );
+	ScopedIniGroup path( ini, L"Profiler" );
 
 	IniBitBool( Enabled );
 	IniBitBool( RecBlocks_EE );
@@ -93,7 +74,8 @@
 {
 	bitset		= 0;
 
-	StackFrameChecks = false;
+	//StackFrameChecks	= false;
+	//PreBlockCheckEE		= false;
 
 	// All recs are enabled by default.
 
@@ -152,7 +134,7 @@
 void Pcsx2Config::RecompilerOptions::LoadSave( IniInterface& ini )
 {
 	RecompilerOptions defaults;
-	IniScopedGroup path( ini, L"Recompiler" );
+	ScopedIniGroup path( ini, L"Recompiler" );
 
 	IniBitBool( EnableEE );
 	IniBitBool( EnableIOP );
@@ -172,6 +154,8 @@
 	IniBitBool( fpuFullMode );
 
 	IniBitBool( StackFrameChecks );
+	IniBitBool( PreBlockCheckEE );
+	IniBitBool( PreBlockCheckIOP );
 }
 
 Pcsx2Config::CpuOptions::CpuOptions()
@@ -191,7 +175,7 @@
 void Pcsx2Config::CpuOptions::LoadSave( IniInterface& ini )
 {
 	CpuOptions defaults;
-	IniScopedGroup path( ini, L"CPU" );
+	ScopedIniGroup path( ini, L"CPU" );
 
 	IniBitBoolEx( sseMXCSR.DenormalsAreZero,	"FPU.DenormalsAreZero" );
 	IniBitBoolEx( sseMXCSR.FlushToZero,			"FPU.FlushToZero" );
@@ -213,6 +197,7 @@
 
 	SynchronousMTGS			= false;
 	DisableOutput			= false;
+	VsyncQueueSize			= 2;
 
 	DefaultRegionMode		= Region_NTSC;
 	FramesToDraw			= 2;
@@ -226,10 +211,11 @@
 void Pcsx2Config::GSOptions::LoadSave( IniInterface& ini )
 {
 	GSOptions defaults;
-	IniScopedGroup path( ini, L"GS" );
+	ScopedIniGroup path( ini, L"GS" );
 
 	IniEntry( SynchronousMTGS );
 	IniEntry( DisableOutput );
+	IniEntry( VsyncQueueSize );
 
 	IniEntry( FrameLimitEnable );
 	IniEntry( FrameSkipEnable );
@@ -246,10 +232,92 @@
 	IniEntry( FramesToSkip );
 }
 
+const wxChar *const tbl_GamefixNames[] =
+{
+	L"VuAddSub",
+	L"VuClipFlag",
+	L"FpuCompare",
+	L"FpuMul",
+	L"FpuNegDiv",
+	L"XGKick",
+	L"IpuWait",
+	L"EETiming",
+	L"SkipMpeg",
+	L"OPHFlag"
+};
+
+const __fi wxChar* EnumToString( GamefixId id )
+{
+	return tbl_GamefixNames[id];
+}
+
+// Enables a full list of gamefixes.  The list can be either comma or pipe-delimited.
+//   Example:  "XGKick,IpuWait"  or  "EEtiming,FpuCompare"
+// If an unrecognized tag is encountered, a warning is printed to the console, but no error
+// is generated.  This allows the system to function in the event that future versions of
+// PCSX2 remove old hacks once they become obsolete.
+void Pcsx2Config::GamefixOptions::Set( const wxString& list, bool enabled )
+{
+	wxStringTokenizer izer( list, L",|", wxTOKEN_STRTOK );
+	
+	while( izer.HasMoreTokens() )
+	{
+		wxString token( izer.GetNextToken() );
+
+		GamefixId i;
+		for (i=GamefixId_FIRST; i < pxEnumEnd; ++i)
+		{
+			if( token.CmpNoCase( EnumToString(i) ) == 0 ) break;
+		}
+		if( i < pxEnumEnd ) Set( i );
+	}
+}
+
+void Pcsx2Config::GamefixOptions::Set( GamefixId id, bool enabled )
+{
+	EnumAssert( id );
+	switch(id)
+	{
+		case Fix_VuAddSub:		VuAddSubHack		= enabled;	break;
+		case Fix_VuClipFlag:	VuClipFlagHack		= enabled;	break;
+		case Fix_FpuCompare:	FpuCompareHack		= enabled;	break;
+		case Fix_FpuMultiply:	FpuMulHack			= enabled;	break;
+		case Fix_FpuNegDiv:		FpuNegDivHack		= enabled;	break;
+		case Fix_XGKick:		XgKickHack			= enabled;	break;
+		case Fix_IpuWait:		IPUWaitHack			= enabled;	break;
+		case Fix_EETiming:		EETimingHack		= enabled;	break;
+		case Fix_SkipMpeg:		SkipMPEGHack		= enabled;	break;
+		case Fix_OPHFlag:		OPHFlagHack			= enabled;  break;
+
+		jNO_DEFAULT;
+	}
+}
+
+bool Pcsx2Config::GamefixOptions::Get( GamefixId id ) const
+{
+	EnumAssert( id );
+	switch(id)
+	{
+		case Fix_VuAddSub:		return VuAddSubHack;
+		case Fix_VuClipFlag:	return VuClipFlagHack;
+		case Fix_FpuCompare:	return FpuCompareHack;
+		case Fix_FpuMultiply:	return FpuMulHack;
+		case Fix_FpuNegDiv:		return FpuNegDivHack;
+		case Fix_XGKick:		return XgKickHack;
+		case Fix_IpuWait:		return IPUWaitHack;
+		case Fix_EETiming:		return EETimingHack;
+		case Fix_SkipMpeg:		return SkipMPEGHack;
+		case Fix_OPHFlag:		return OPHFlagHack;
+		
+		jNO_DEFAULT
+	}
+	return false;		// unreachable, but we still need to suppress warnings >_<
+}
+
 void Pcsx2Config::GamefixOptions::LoadSave( IniInterface& ini )
 {
 	GamefixOptions defaults;
-	IniScopedGroup path( ini, L"Gamefixes" );
+	ScopedIniGroup path( ini, L"Gamefixes" );
 
 	IniBitBool( VuAddSubHack );
 	IniBitBool( VuClipFlagHack );
@@ -259,6 +327,8 @@
 	IniBitBool( XgKickHack );
 	IniBitBool( IPUWaitHack );
 	IniBitBool( EETimingHack );
+	IniBitBool( SkipMPEGHack );
+	IniBitBool( OPHFlagHack );
 }
 
 Pcsx2Config::Pcsx2Config()
@@ -270,7 +340,7 @@
 void Pcsx2Config::LoadSave( IniInterface& ini )
 {
 	Pcsx2Config defaults;
-	IniScopedGroup path( ini, L"EmuCore" );
+	ScopedIniGroup path( ini, L"EmuCore" );
 
 	IniBitBool( CdvdVerboseReads );
 	IniBitBool( CdvdDumpBlocks );
@@ -292,7 +362,6 @@
 	Profiler		.LoadSave( ini );
 
 	Trace			.LoadSave( ini );
-	Log				.LoadSave( ini );
 
 	ini.Flush();
 }

 

  ViewVC Help
Powered by ViewVC 1.1.22