2009-09-12 02:58:22 +00:00
|
|
|
/* PCSX2 - PS2 Emulator for PCs
|
|
|
|
* Copyright (C) 2002-2009 PCSX2 Dev Team
|
|
|
|
*
|
|
|
|
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU Lesser General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with PCSX2.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "PrecompiledHeader.h"
|
|
|
|
#include "IniInterface.h"
|
|
|
|
#include "Config.h"
|
|
|
|
#include "GS.h"
|
|
|
|
|
|
|
|
#include <wx/fileconf.h>
|
|
|
|
|
|
|
|
// all speedhacks are disabled by default
|
|
|
|
Pcsx2Config::SpeedhackOptions::SpeedhackOptions() :
|
|
|
|
bitset( 0 )
|
|
|
|
, EECycleRate( 0 )
|
|
|
|
, VUCycleSteal( 0 )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Pcsx2Config::SpeedhackOptions::LoadSave( IniInterface& ini )
|
|
|
|
{
|
|
|
|
SpeedhackOptions defaults;
|
|
|
|
IniScopedGroup path( ini, L"Speedhacks" );
|
|
|
|
|
|
|
|
IniBitfield( EECycleRate );
|
|
|
|
IniBitfield( VUCycleSteal );
|
|
|
|
IniBitBool( IopCycleRate_X2 );
|
|
|
|
IniBitBool( IntcStat );
|
|
|
|
IniBitBool( BIFC0 );
|
|
|
|
IniBitBool( vuFlagHack );
|
|
|
|
IniBitBool( vuMinMax );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Pcsx2Config::ProfilerOptions::LoadSave( IniInterface& ini )
|
|
|
|
{
|
|
|
|
ProfilerOptions defaults;
|
|
|
|
IniScopedGroup path( ini, L"Profiler" );
|
|
|
|
|
|
|
|
IniBitBool( Enabled );
|
|
|
|
IniBitBool( RecBlocks_EE );
|
|
|
|
IniBitBool( RecBlocks_IOP );
|
|
|
|
IniBitBool( RecBlocks_VU0 );
|
|
|
|
IniBitBool( RecBlocks_VU1 );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Pcsx2Config::RecompilerOptions::LoadSave( IniInterface& ini )
|
|
|
|
{
|
|
|
|
RecompilerOptions defaults;
|
|
|
|
IniScopedGroup path( ini, L"Recompiler" );
|
|
|
|
|
|
|
|
IniBitBool( EnableEE );
|
|
|
|
IniBitBool( EnableIOP );
|
|
|
|
IniBitBool( EnableVU0 );
|
|
|
|
IniBitBool( EnableVU1 );
|
2009-09-18 14:40:24 +00:00
|
|
|
|
|
|
|
IniBitBool( UseMicroVU0 );
|
|
|
|
IniBitBool( UseMicroVU1 );
|
2009-09-12 02:58:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Pcsx2Config::CpuOptions::CpuOptions() :
|
|
|
|
bitset( 0 )
|
|
|
|
, sseMXCSR( DEFAULT_sseMXCSR )
|
|
|
|
, sseVUMXCSR( DEFAULT_sseVUMXCSR )
|
|
|
|
{
|
|
|
|
vuOverflow = true;
|
|
|
|
fpuOverflow = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Pcsx2Config::CpuOptions::LoadSave( IniInterface& ini )
|
|
|
|
{
|
|
|
|
CpuOptions defaults;
|
|
|
|
IniScopedGroup path( ini, L"CPU" );
|
|
|
|
|
|
|
|
IniEntry( sseMXCSR );
|
|
|
|
IniEntry( sseVUMXCSR );
|
|
|
|
|
|
|
|
IniBitBool( vuOverflow );
|
|
|
|
IniBitBool( vuExtraOverflow );
|
|
|
|
IniBitBool( vuSignOverflow );
|
|
|
|
IniBitBool( vuUnderflow );
|
|
|
|
|
|
|
|
IniBitBool( fpuOverflow );
|
|
|
|
IniBitBool( fpuExtraOverflow );
|
|
|
|
IniBitBool( fpuFullMode );
|
|
|
|
|
|
|
|
Recompiler.LoadSave( ini );
|
|
|
|
}
|
|
|
|
|
|
|
|
Pcsx2Config::VideoOptions::VideoOptions() :
|
|
|
|
EnableFrameLimiting( false )
|
|
|
|
, EnableFrameSkipping( false )
|
|
|
|
, DefaultRegionMode( Region_NTSC )
|
|
|
|
, FpsTurbo( 60*4 )
|
|
|
|
, FpsLimit( 60 )
|
|
|
|
, FpsSkip( 55 )
|
|
|
|
, ConsecutiveFrames( 2 )
|
|
|
|
, ConsecutiveSkip( 1 )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Pcsx2Config::VideoOptions::LoadSave( IniInterface& ini )
|
|
|
|
{
|
|
|
|
VideoOptions defaults;
|
|
|
|
IniScopedGroup path( ini, L"Video" );
|
|
|
|
|
|
|
|
IniEntry( EnableFrameLimiting );
|
|
|
|
IniEntry( EnableFrameSkipping );
|
|
|
|
|
|
|
|
static const wxChar * const ntsc_pal_str[2] = { L"ntsc", L"pal" };
|
|
|
|
ini.EnumEntry( L"DefaultRegionMode", DefaultRegionMode, ntsc_pal_str, defaults.DefaultRegionMode );
|
|
|
|
|
|
|
|
IniEntry( FpsTurbo );
|
|
|
|
IniEntry( FpsLimit );
|
|
|
|
IniEntry( FpsSkip );
|
|
|
|
IniEntry( ConsecutiveFrames );
|
|
|
|
IniEntry( ConsecutiveSkip );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Pcsx2Config::GamefixOptions::LoadSave( IniInterface& ini )
|
|
|
|
{
|
|
|
|
GamefixOptions defaults;
|
|
|
|
IniScopedGroup path( ini, L"Gamefixes" );
|
|
|
|
|
|
|
|
IniBitBool( VuAddSubHack );
|
|
|
|
IniBitBool( VuClipFlagHack );
|
|
|
|
IniBitBool( FpuCompareHack );
|
|
|
|
IniBitBool( FpuMulHack );
|
|
|
|
IniBitBool( DMAExeHack );
|
|
|
|
IniBitBool( XgKickHack );
|
|
|
|
IniBitBool( MpegHack );
|
|
|
|
}
|
|
|
|
|
|
|
|
Pcsx2Config::Pcsx2Config() :
|
|
|
|
bitset( 0 )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Pcsx2Config::LoadSave( IniInterface& ini )
|
|
|
|
{
|
|
|
|
Pcsx2Config defaults;
|
|
|
|
IniScopedGroup path( ini, L"EmuCore" );
|
|
|
|
|
|
|
|
IniBitBool( CdvdVerboseReads );
|
|
|
|
IniBitBool( CdvdDumpBlocks );
|
|
|
|
IniBitBool( EnablePatches );
|
2009-09-16 19:03:14 +00:00
|
|
|
|
|
|
|
IniBitBool( SkipBiosSplash );
|
2009-09-12 02:58:22 +00:00
|
|
|
|
|
|
|
IniBitBool( McdEnableEjection );
|
2009-09-13 17:11:35 +00:00
|
|
|
IniBitBool( MultitapPort0_Enabled );
|
|
|
|
IniBitBool( MultitapPort1_Enabled );
|
2009-09-12 02:58:22 +00:00
|
|
|
|
|
|
|
// Process various sub-components:
|
|
|
|
|
|
|
|
Speedhacks.LoadSave( ini );
|
|
|
|
Cpu.LoadSave( ini );
|
|
|
|
Video.LoadSave( ini );
|
|
|
|
Gamefixes.LoadSave( ini );
|
|
|
|
Profiler.LoadSave( ini );
|
|
|
|
|
|
|
|
ini.Flush();
|
|
|
|
}
|
|
|
|
|
Lots of new code maintenance stuffs:
* Completely new assertion macros: pxAssert, pxAssertMsg, and pxFail, pxAssertDev (both which default to using a message). These replace *all* wxASSERT, DevAssert, and jASSUME varieties of macros. New macros borrow the best of all assertion worlds: MSVCRT, wxASSERT, and AtlAssume. :)
* Rewrote the Console namespace as a structure called IConsoleWriter, and created several varieties of ConsoleWriters for handling different states of log and console availability (should help reduce overhead of console logging nicely).
* More improvements to the PersistentThread model, using safely interlocked "Do*" style callbacks for starting and cleaning up threads.
* Fixed console logs so that they're readable in Win32 notepad again (the log writer adds CRs to naked LFs).
* Added AppInit.cpp -- contains constructor, destructor, OnInit, and command line parsing mess.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1950 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-04 08:27:27 +00:00
|
|
|
bool Pcsx2Config::MultitapEnabled( uint port ) const
|
|
|
|
{
|
|
|
|
pxAssert( port < 2 );
|
|
|
|
return (port==0) ? MultitapPort0_Enabled : MultitapPort1_Enabled;
|
|
|
|
}
|
|
|
|
|
2009-09-12 02:58:22 +00:00
|
|
|
void Pcsx2Config::Load( const wxString& srcfile )
|
|
|
|
{
|
|
|
|
//m_IsLoaded = true;
|
|
|
|
|
|
|
|
// Note: Extra parenthesis resolves "I think this is a function" issues with C++.
|
|
|
|
wxFileConfig cfg( srcfile );
|
|
|
|
IniLoader loader( (IniLoader( cfg )) );
|
|
|
|
LoadSave( loader );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Pcsx2Config::Save( const wxString& dstfile )
|
|
|
|
{
|
|
|
|
//if( !m_IsLoaded ) return;
|
|
|
|
|
|
|
|
wxFileConfig cfg( dstfile );
|
|
|
|
IniSaver saver( (IniSaver( cfg )) );
|
|
|
|
LoadSave( saver );
|
|
|
|
}
|