Preliminary addition of Advanced Options (roundmode/clamping). They don't do anything yet -- implementation of functionality is pending on review of the layout. :)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2110 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2009-11-01 11:27:50 +00:00
parent 376a2c94b1
commit 4adb0d1e8d
5 changed files with 235 additions and 66 deletions

View File

@ -107,10 +107,21 @@ public:
bool
UseMicroVU0:1,
UseMicroVU1:1;
bool
vuOverflow:1,
vuExtraOverflow:1,
vuSignOverflow:1,
vuUnderflow:1;
bool
fpuOverflow:1,
fpuExtraOverflow:1,
fpuFullMode:1;
BITFIELD_END
// All recs are enabled by default.
RecompilerOptions() : bitset( 0xffffffff ) { }
RecompilerOptions();
void LoadSave( IniInterface& conf );
bool operator ==( const RecompilerOptions& right ) const
@ -133,27 +144,12 @@ public:
u32 sseMXCSR;
u32 sseVUMXCSR;
BITFIELD32()
bool
vuOverflow:1,
vuExtraOverflow:1,
vuSignOverflow:1,
vuUnderflow:1;
bool
fpuOverflow:1,
fpuExtraOverflow:1,
fpuFullMode:1;
BITFIELD_END
CpuOptions();
void LoadSave( IniInterface& conf );
bool operator ==( const CpuOptions& right ) const
{
return
OpEqu( sseMXCSR ) && OpEqu( sseVUMXCSR ) &&
OpEqu( bitset ) && OpEqu( Recompiler );
return OpEqu( sseMXCSR ) && OpEqu( sseVUMXCSR ) && OpEqu( Recompiler );
}
bool operator !=( const CpuOptions& right ) const
@ -361,16 +357,16 @@ extern SessionOverrideFlags g_Session;
#define CHECK_MPEGHACK (EmuConfig.Gamefixes.MpegHack) // Special Fix for Mana Khemia 1; breaks Digital Devil Saga.
//------------ Advanced Options!!! ---------------
#define CHECK_VU_OVERFLOW (EmuConfig.Cpu.vuOverflow)
#define CHECK_VU_EXTRA_OVERFLOW (EmuConfig.Cpu.vuExtraOverflow) // If enabled, Operands are clamped before being used in the VU recs
#define CHECK_VU_SIGN_OVERFLOW (EmuConfig.Cpu.vuSignOverflow)
#define CHECK_VU_UNDERFLOW (EmuConfig.Cpu.vuUnderflow)
#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
#define CHECK_VU_SIGN_OVERFLOW (EmuConfig.Cpu.Recompiler.vuSignOverflow)
#define CHECK_VU_UNDERFLOW (EmuConfig.Cpu.Recompiler.vuUnderflow)
#define CHECK_VU_EXTRA_FLAGS 0 // Always disabled now // Sets correct flags in the sVU recs
#define CHECK_FPU_OVERFLOW (EmuConfig.Cpu.fpuOverflow)
#define CHECK_FPU_EXTRA_OVERFLOW (EmuConfig.Cpu.fpuExtraOverflow) // If enabled, Operands are checked for infinities before being used in the FPU recs
#define CHECK_FPU_OVERFLOW (EmuConfig.Cpu.Recompiler.fpuOverflow)
#define CHECK_FPU_EXTRA_OVERFLOW (EmuConfig.Cpu.Recompiler.fpuExtraOverflow) // If enabled, Operands are checked for infinities before being used in the FPU recs
#define CHECK_FPU_EXTRA_FLAGS 1 // Always enabled now // Sets D/I flags on FPU instructions
#define CHECK_FPU_FULL (EmuConfig.Cpu.fpuFullMode)
#define CHECK_FPU_FULL (EmuConfig.Cpu.Recompiler.fpuFullMode)
//------------ EE Recompiler defines - Comment to disable a recompiler ---------------

View File

@ -54,6 +54,29 @@ void Pcsx2Config::ProfilerOptions::LoadSave( IniInterface& ini )
IniBitBool( RecBlocks_VU1 );
}
Pcsx2Config::RecompilerOptions::RecompilerOptions() : bitset(0)
{
// All recs are enabled by default.
EnableEE = true;
EnableIOP = true;
EnableVU0 = true;
EnableVU1 = true;
UseMicroVU0 = true;
UseMicroVU1 = true;
// vu and fpu clamping default to standard overflow.
vuOverflow = true;
//vuExtraOverflow = false;
//vuSignOverflow = false;
//vuUnderflow = false;
fpuOverflow = true;
//fpuExtraOverflow = false;
//fpuFullMode = false;
}
void Pcsx2Config::RecompilerOptions::LoadSave( IniInterface& ini )
{
RecompilerOptions defaults;
@ -66,24 +89,6 @@ void Pcsx2Config::RecompilerOptions::LoadSave( IniInterface& ini )
IniBitBool( UseMicroVU0 );
IniBitBool( UseMicroVU1 );
}
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 );
@ -93,6 +98,21 @@ void Pcsx2Config::CpuOptions::LoadSave( IniInterface& ini )
IniBitBool( fpuOverflow );
IniBitBool( fpuExtraOverflow );
IniBitBool( fpuFullMode );
}
Pcsx2Config::CpuOptions::CpuOptions() :
sseMXCSR( DEFAULT_sseMXCSR )
, sseVUMXCSR( DEFAULT_sseVUMXCSR )
{
}
void Pcsx2Config::CpuOptions::LoadSave( IniInterface& ini )
{
CpuOptions defaults;
IniScopedGroup path( ini, L"CPU" );
IniEntry( sseMXCSR );
IniEntry( sseVUMXCSR );
Recompiler.LoadSave( ini );
}

View File

@ -63,7 +63,8 @@ Dialogs::ConfigurationDialog::ConfigurationDialog( wxWindow* parent, int id ) :
g_ApplyState.StartBook( &m_listbook );
AddPage<CpuPanel> ( wxLt("CPU"), cfgid.Cpu );
AddPage<CpuPanelEE> ( wxLt("EE/IOP"), cfgid.Cpu );
AddPage<CpuPanelVU> ( wxLt("VUs"), cfgid.Cpu );
AddPage<VideoPanel> ( wxLt("GS/Video"), cfgid.Video );
AddPage<SpeedHacksPanel> ( wxLt("Speedhacks"), cfgid.Speedhacks );
AddPage<GameFixesPanel> ( wxLt("Game Fixes"), cfgid.Gamefixes );

View File

@ -205,22 +205,47 @@ namespace Panels
//////////////////////////////////////////////////////////////////////////////////////////
//
class CpuPanel : public BaseApplicableConfigPanel
class CpuPanelEE : public BaseApplicableConfigPanel
{
protected:
wxRadioButton* m_Option_RecEE;
wxRadioButton* m_Option_RecIOP;
public:
CpuPanelEE( wxWindow& parent, int idealWidth );
void Apply();
};
class CpuPanelVU : public BaseApplicableConfigPanel
{
protected:
wxRadioButton* m_Option_mVU0;
wxRadioButton* m_Option_mVU1;
wxRadioButton* m_Option_sVU0;
wxRadioButton* m_Option_sVU1;
public:
CpuPanel( wxWindow& parent, int idealWidth );
CpuPanelVU( wxWindow& parent, int idealWidth );
void Apply();
};
class AdvancedOptionsFPU : public BaseApplicableConfigPanel
{
public:
AdvancedOptionsFPU( wxWindow& parent, int idealWidth );
virtual ~AdvancedOptionsFPU() throw() { }
void Apply();
};
class AdvancedOptionsVU : public BaseApplicableConfigPanel
{
public:
AdvancedOptionsVU( wxWindow& parent, int idealWidth );
virtual ~AdvancedOptionsVU() throw() { }
void Apply();
};
//////////////////////////////////////////////////////////////////////////////////////////
//
class VideoPanel : public BaseApplicableConfigPanel

View File

@ -18,19 +18,115 @@
using namespace wxHelpers;
Panels::CpuPanel::CpuPanel( wxWindow& parent, int idealWidth ) :
Panels::AdvancedOptionsFPU::AdvancedOptionsFPU( wxWindow& parent, int idealWidth ) :
BaseApplicableConfigPanel( &parent, idealWidth )
{
wxFlexGridSizer& s_main = *new wxFlexGridSizer( 2 );
wxStaticBoxSizer& s_adv = *new wxStaticBoxSizer( wxVERTICAL, this, _("EE/FPU Advanced Recompiler Options") );
wxStaticBoxSizer& s_round = *new wxStaticBoxSizer( wxVERTICAL, this, _("Round Mode") );
wxStaticBoxSizer& s_clamp = *new wxStaticBoxSizer( wxVERTICAL, this, _("Clamping Mode") );
wxFlexGridSizer& grid = *new wxFlexGridSizer( 4 );
// Clever proportions selected for a fairly nice spacing, with the third
// colum serving as a buffer between static box and a pair of checkboxes.
grid.AddGrowableCol( 0, 8 );
grid.AddGrowableCol( 1, 10 );
grid.AddGrowableCol( 2, 1 );
grid.AddGrowableCol( 3, 7 );
AddRadioButton( s_round, _("Nearest") );
AddRadioButton( s_round, _("Negative") );
AddRadioButton( s_round, _("Positive") );
AddRadioButton( s_round, _("Chop / Zero") );
m_StartNewRadioGroup = true;
AddRadioButton( s_clamp, _("None") );
AddRadioButton( s_clamp, _("Normal") );
AddRadioButton( s_clamp, _("Extra + Preserve Sign") );
AddRadioButton( s_clamp, _("Full") );
wxBoxSizer& s_daz( *new wxBoxSizer( wxVERTICAL ) );
s_daz.AddSpacer( 16 );
AddCheckBox( s_daz, _("Flush to Zero") );
s_daz.AddSpacer( 6 );
AddCheckBox( s_daz, _("Denormals are Zero") );
grid.Add( &s_round, SizerFlags::SubGroup() );
grid.Add( &s_clamp, SizerFlags::SubGroup() );
grid.Add( new wxBoxSizer( wxVERTICAL ) ); // spacer column!
grid.Add( &s_daz, wxSizerFlags().Expand() );
s_adv.Add( &grid, SizerFlags::StdExpand() );
s_main.AddGrowableCol( 0, 1 );
s_main.AddGrowableCol( 1, 1 );
SetSizer( &s_adv );
}
Panels::AdvancedOptionsVU::AdvancedOptionsVU( wxWindow& parent, int idealWidth ) :
BaseApplicableConfigPanel( &parent, idealWidth )
{
wxStaticBoxSizer& s_adv = *new wxStaticBoxSizer( wxVERTICAL, this, _("VU0 / VU1 Advanced Recompiler Options") );
wxStaticBoxSizer& s_round = *new wxStaticBoxSizer( wxVERTICAL, this, _("Round Mode") );
wxStaticBoxSizer& s_clamp = *new wxStaticBoxSizer( wxVERTICAL, this, _("Clamping Mode") );
wxFlexGridSizer& grid = *new wxFlexGridSizer( 4 );
// Clever proportions selected for a fairly nice spacing, with the third
// colum serving as a buffer between static box and a pair of checkboxes.
grid.AddGrowableCol( 0, 8 );
grid.AddGrowableCol( 1, 10 );
grid.AddGrowableCol( 2, 1 );
grid.AddGrowableCol( 3, 7 );
AddRadioButton( s_round, _("Nearest") );
AddRadioButton( s_round, _("Negative") );
AddRadioButton( s_round, _("Positive") );
AddRadioButton( s_round, _("Chop / Zero") );
m_StartNewRadioGroup = true;
AddRadioButton( s_clamp, _("None") );
AddRadioButton( s_clamp, _("Normal") );
AddRadioButton( s_clamp, _("Extra") );
AddRadioButton( s_clamp, _("Extra + Preserve Sign") );
wxBoxSizer& s_daz( *new wxBoxSizer( wxVERTICAL ) );
s_daz.AddSpacer( 16 );
AddCheckBox( s_daz, _("Flush to Zero") );
s_daz.AddSpacer( 6 );
AddCheckBox( s_daz, _("Denormals are Zero") );
grid.Add( &s_round, SizerFlags::SubGroup() );
grid.Add( &s_clamp, SizerFlags::SubGroup() );
grid.Add( new wxBoxSizer( wxVERTICAL ) ); // spacer column!
grid.Add( &s_daz, wxSizerFlags().Expand() );
s_adv.Add( &grid, SizerFlags::StdExpand() );
SetSizer( &s_adv );
}
void Panels::AdvancedOptionsFPU::Apply()
{
}
void Panels::AdvancedOptionsVU::Apply()
{
}
Panels::CpuPanelEE::CpuPanelEE( wxWindow& parent, int idealWidth ) :
BaseApplicableConfigPanel( &parent, idealWidth )
{
wxBoxSizer& s_main = *new wxBoxSizer( wxVERTICAL );
wxFlexGridSizer& s_recs = *new wxFlexGridSizer( 2 );
s_recs.AddGrowableCol( 0, 1 );
s_recs.AddGrowableCol( 1, 1 );
// i18n: No point in translating PS2 CPU names :)
wxStaticBoxSizer& s_ee = *new wxStaticBoxSizer( wxVERTICAL, this, L"EmotionEngine" );
wxStaticBoxSizer& s_iop = *new wxStaticBoxSizer( wxVERTICAL, this, L"IOP" );
wxStaticBoxSizer& s_vu0 = *new wxStaticBoxSizer( wxVERTICAL, this, L"VU0" );
wxStaticBoxSizer& s_vu1 = *new wxStaticBoxSizer( wxVERTICAL, this, L"VU1" );
m_StartNewRadioGroup = true;
AddRadioButton( s_ee, _("Interpreter"), wxEmptyString, _("Quite possibly the slowest thing in the universe.") );
@ -40,6 +136,36 @@ Panels::CpuPanel::CpuPanel( wxWindow& parent, int idealWidth ) :
AddRadioButton( s_iop, _("Interpreter") );
m_Option_RecIOP = &AddRadioButton( s_iop, _("Recompiler [Preferred]") );
s_recs.Add( &s_ee, SizerFlags::SubGroup() );
s_recs.Add( &s_iop, SizerFlags::SubGroup() );
s_main.Add( &s_recs, SizerFlags::StdExpand() );
s_main.Add( new wxStaticLine( this ), wxSizerFlags().Border(wxALL, 24).Expand() );
s_main.Add( new AdvancedOptionsFPU( *this, idealWidth ), SizerFlags::StdExpand() );
SetSizer( &s_main );
// ----------------------------------------------------------------------------
// Apply current configuration options...
Pcsx2Config::RecompilerOptions& recOps( g_Conf->EmuOptions.Cpu.Recompiler );
m_Option_RecEE->SetValue( recOps.EnableEE );
m_Option_RecIOP->SetValue( recOps.EnableIOP );
}
Panels::CpuPanelVU::CpuPanelVU( wxWindow& parent, int idealWidth ) :
BaseApplicableConfigPanel( &parent, idealWidth )
{
wxBoxSizer& s_main = *new wxBoxSizer( wxVERTICAL );
wxFlexGridSizer& s_recs = *new wxFlexGridSizer( 2 );
s_recs.AddGrowableCol( 0, 1 );
s_recs.AddGrowableCol( 1, 1 );
wxStaticBoxSizer& s_vu0 = *new wxStaticBoxSizer( wxVERTICAL, this, L"VU0" );
wxStaticBoxSizer& s_vu1 = *new wxStaticBoxSizer( wxVERTICAL, this, L"VU1" );
m_StartNewRadioGroup = true;
AddRadioButton( s_vu0, _("Interpreter"), wxEmptyString, _("Vector Unit Interpreter. Slow and not very compatible. Only use for testing.") ).SetValue( true );
m_Option_mVU0 = &AddRadioButton( s_vu0, _("microVU Recompiler [Preferred]"), wxEmptyString, _("New Vector Unit recompiler.") );
@ -49,24 +175,20 @@ Panels::CpuPanel::CpuPanel( wxWindow& parent, int idealWidth ) :
AddRadioButton( s_vu1, _("Interpreter"), wxEmptyString, _("Vector Unit Interpreter. Slow and not very compatible. Only use for testing.") ).SetValue( true );
m_Option_mVU1 = &AddRadioButton( s_vu1, _("microVU Recompiler [Preferred]"), wxEmptyString, _("New Vector Unit recompiler.") );
m_Option_sVU1 = &AddRadioButton( s_vu1, _("superVU Recompiler [legacy]"), wxEmptyString, _("Useful for diagnosing possible bugs in the new mVU recompiler.") );
s_main.Add( &s_ee, SizerFlags::StdExpand() );
s_main.Add( &s_iop, SizerFlags::StdExpand() );
s_main.Add( &s_vu0, SizerFlags::StdExpand() );
s_main.Add( &s_vu1, SizerFlags::StdExpand() );
// [TODO] : Add advanced CPU settings -- FPU/VU rounding, clamping, etc.
s_recs.Add( &s_vu0, SizerFlags::SubGroup() );
s_recs.Add( &s_vu1, SizerFlags::SubGroup() );
s_main.Add( &s_recs, SizerFlags::StdExpand() );
s_main.Add( new wxStaticLine( this ), wxSizerFlags().Border(wxALL, 24).Expand() );
s_main.Add( new AdvancedOptionsVU( *this, idealWidth ), SizerFlags::StdExpand() );
SetSizer( &s_main );
// ----------------------------------------------------------------------------
// Apply current configuration options...
Pcsx2Config::RecompilerOptions& recOps( g_Conf->EmuOptions.Cpu.Recompiler );
m_Option_RecEE->SetValue( recOps.EnableEE );
m_Option_RecIOP->SetValue( recOps.EnableIOP );
Pcsx2Config::RecompilerOptions& recOps( g_Conf->EmuOptions.Cpu.Recompiler );
if( recOps.UseMicroVU0 )
m_Option_mVU0->SetValue( recOps.EnableVU0 );
else
@ -78,11 +200,16 @@ Panels::CpuPanel::CpuPanel( wxWindow& parent, int idealWidth ) :
m_Option_sVU1->SetValue( recOps.EnableVU1 );
}
void Panels::CpuPanel::Apply()
void Panels::CpuPanelEE::Apply()
{
Pcsx2Config::RecompilerOptions& recOps( g_Conf->EmuOptions.Cpu.Recompiler );
recOps.EnableEE = m_Option_RecEE->GetValue();
recOps.EnableIOP = m_Option_RecIOP->GetValue();
}
void Panels::CpuPanelVU::Apply()
{
Pcsx2Config::RecompilerOptions& recOps( g_Conf->EmuOptions.Cpu.Recompiler );
recOps.EnableVU0 = m_Option_mVU0->GetValue() || m_Option_sVU0->GetValue();
recOps.EnableVU1 = m_Option_mVU1->GetValue() || m_Option_sVU1->GetValue();