Finished the new logging options dialog (loads and saves settings (!))

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2187 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2009-11-11 11:36:13 +00:00
parent bcba091cf3
commit b755069217
8 changed files with 372 additions and 129 deletions

View File

@ -127,8 +127,6 @@ struct TraceFiltersEE
bitset = 0; bitset = 0;
} }
void LoadSave( IniInterface& conf );
bool operator ==( const TraceFiltersEE& right ) const bool operator ==( const TraceFiltersEE& right ) const
{ {
return OpEqu( bitset ); return OpEqu( bitset );
@ -200,8 +198,6 @@ struct TraceFiltersIOP
bitset = 0; bitset = 0;
} }
void LoadSave( IniInterface& conf );
bool operator ==( const TraceFiltersIOP& right ) const bool operator ==( const TraceFiltersIOP& right ) const
{ {
return OpEqu( bitset ); return OpEqu( bitset );
@ -237,7 +233,7 @@ struct TraceLogFilters
SIF = false; SIF = false;
} }
void LoadSave( IniInterface& conf ); void LoadSave( IniInterface& ini );
bool operator ==( const TraceLogFilters& right ) const bool operator ==( const TraceLogFilters& right ) const
{ {

View File

@ -20,6 +20,21 @@
#include <wx/fileconf.h> #include <wx/fileconf.h>
void TraceLogFilters::LoadSave( IniInterface& ini )
{
TraceLogFilters defaults;
IniScopedGroup 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:
IniEntry( EE.bitset );
IniEntry( IOP.bitset );
}
// all speedhacks are disabled by default // all speedhacks are disabled by default
Pcsx2Config::SpeedhackOptions::SpeedhackOptions() : Pcsx2Config::SpeedhackOptions::SpeedhackOptions() :
bitset( 0 ) bitset( 0 )
@ -236,6 +251,8 @@ void Pcsx2Config::LoadSave( IniInterface& ini )
Gamefixes.LoadSave( ini ); Gamefixes.LoadSave( ini );
Profiler.LoadSave( ini ); Profiler.LoadSave( ini );
Trace.LoadSave( ini );
ini.Flush(); ini.Flush();
} }

View File

@ -20,14 +20,40 @@
#include <wx/statline.h> #include <wx/statline.h>
using namespace wxHelpers; using namespace wxHelpers;
using namespace Panels;
Dialogs::LogOptionsDialog::LogOptionsDialog( wxWindow* parent, int id ) Dialogs::LogOptionsDialog::LogOptionsDialog( wxWindow* parent, int id )
: wxDialogWithHelpers( parent, id, _("High Volume Logging"), true ) : wxDialogWithHelpers( parent, id, _("High Volume Logging"), true )
{ {
wxBoxSizer& mainsizer = *new wxBoxSizer( wxVERTICAL ); wxBoxSizer& mainsizer = *new wxBoxSizer( wxVERTICAL );
mainsizer.Add( new Panels::LogOptionsPanel( this, 480 ) ); mainsizer.Add( new LogOptionsPanel( this, 480 ) );
AddOkCancel( mainsizer, true );
FindWindow( wxID_APPLY )->Disable();
AddOkCancel( mainsizer );
SetSizerAndFit( &mainsizer, true ); SetSizerAndFit( &mainsizer, true );
Connect( wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( LogOptionsDialog::OnOk_Click ) );
Connect( wxID_APPLY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( LogOptionsDialog::OnApply_Click ) );
}
void Dialogs::LogOptionsDialog::OnOk_Click( wxCommandEvent& evt )
{
if( g_ApplyState.ApplyAll( false ) )
{
FindWindow( wxID_APPLY )->Disable();
AppSaveSettings();
Close();
evt.Skip();
}
}
void Dialogs::LogOptionsDialog::OnApply_Click( wxCommandEvent& evt )
{
if( g_ApplyState.ApplyAll( false ) )
FindWindow( wxID_APPLY )->Disable();
AppSaveSettings();
} }

View File

@ -30,6 +30,10 @@ class LogOptionsDialog: public wxDialogWithHelpers
{ {
public: public:
LogOptionsDialog( wxWindow* parent=NULL, int id=DialogId_LogOptions ); LogOptionsDialog( wxWindow* parent=NULL, int id=DialogId_LogOptions );
protected:
void OnOk_Click( wxCommandEvent& evt );
void OnApply_Click( wxCommandEvent& evt );
}; };
} // end namespace Dialogs } // end namespace Dialogs

View File

@ -17,66 +17,55 @@
#include "LogOptionsPanels.h" #include "LogOptionsPanels.h"
#include "DebugTools/Debug.h" #include "DebugTools/Debug.h"
#include <wx/statline.h>
using namespace wxHelpers; using namespace wxHelpers;
#define newCheckBox( name, label ) \
(wxCheckBox*) s_##name.Add( new pxCheckBox( name##Panel, wxT(label) ) )->GetWindow()
Panels::eeLogOptionsPanel::eeLogOptionsPanel( LogOptionsPanel* parent ) Panels::eeLogOptionsPanel::eeLogOptionsPanel( LogOptionsPanel* parent )
: CheckedStaticBox( parent, wxVERTICAL, L"EE Logs" ) : CheckedStaticBox( parent, wxVERTICAL, L"EE Logs" )
{ {
CheckBoxDict& chks( parent->CheckBoxes ); m_disasmPanel = new CheckedStaticBox( this, wxVERTICAL, L"Disasm" );
m_hwPanel = new CheckedStaticBox( this, wxVERTICAL, L"Hardware" );
m_evtPanel = new CheckedStaticBox( this, wxVERTICAL, L"Events" );
wxSizer& s_disasm ( m_disasmPanel->ThisSizer );
wxSizer& s_hw ( m_hwPanel->ThisSizer );
wxSizer& s_evt ( m_evtPanel->ThisSizer );
wxStaticBoxSizer& s_misc = *new wxStaticBoxSizer( wxVERTICAL, this, L"General" ); wxStaticBoxSizer& s_misc = *new wxStaticBoxSizer( wxVERTICAL, this, L"General" );
wxPanelWithHelpers* miscPanel = this; // helper for our newCheckBox macro. wxPanelWithHelpers* m_miscPanel = this; // helper for our newCheckBox macro.
chks["EE:Memory"] = newCheckBox( misc, "Memory" ); s_misc.Add( m_Bios = new pxCheckBox( m_miscPanel, L"Bios" ) );
chks["EE:Bios"] = newCheckBox( misc, "Bios" ); s_misc.Add( m_Memory = new pxCheckBox( m_miscPanel, L"Memory" ) );
chks["EE:MMU"] = newCheckBox( misc, "MMU" ); s_misc.Add( m_Cache = new pxCheckBox( m_miscPanel, L"Cache" ));
s_misc.Add( m_SysCtrl = new pxCheckBox( m_miscPanel, L"SysCtrl / MMU" ) );
// ---------------------------------------------------------------------------- s_disasm.Add( m_R5900 = new pxCheckBox( m_disasmPanel, L"R5900" ));
CheckedStaticBox* disasmPanel = new CheckedStaticBox( this, wxVERTICAL, L"Disasm" ); s_disasm.Add( m_COP0 = new pxCheckBox( m_disasmPanel, L"COP0 (MMU/SysCtrl)" ));
wxSizer& s_disasm( disasmPanel->ThisSizer ); s_disasm.Add( m_COP1 = new pxCheckBox( m_disasmPanel, L"COP1 (FPU)" ));
s_disasm.Add( m_COP2 = new pxCheckBox( m_disasmPanel, L"COP2 (VU0 macro)" ));
s_disasm.Add( m_VU0micro = new pxCheckBox( m_disasmPanel, L"VU0 micro" ));
s_disasm.Add( m_VU1micro = new pxCheckBox( m_disasmPanel, L"VU1 micro" ));
chks["EE:R5900"] = newCheckBox( disasm, "R5900" ); s_hw.Add( m_KnownHw = new pxCheckBox( m_hwPanel, L"Registers" ));
chks["EE:COP0"] = newCheckBox( disasm, "COP0 (MMU/SysCtrl)" ); s_hw.Add( m_UnknownHw = new pxCheckBox( m_hwPanel, L"Unknown Regs" ));
chks["EE:COP1"] = newCheckBox( disasm, "COP1 (FPU)" ); s_hw.Add( m_DMA = new pxCheckBox( m_hwPanel, L"DMA" ));
chks["EE:COP2"] = newCheckBox( disasm, "COP2 (VU0 macro)" );
chks["EE:VU0micro"] = newCheckBox( disasm, "VU0 micro" ); s_evt.Add( m_Counters = new pxCheckBox( m_evtPanel, L"Counters" ));
chks["EE:VU1micro"] = newCheckBox( disasm, "VU1 micro" ); s_evt.Add( m_VIF = new pxCheckBox( m_evtPanel, L"VIF" ));
s_evt.Add( m_GIF = new pxCheckBox( m_evtPanel, L"GIF" ));
s_evt.Add( m_IPU = new pxCheckBox( m_evtPanel, L"IPU" ));
s_evt.Add( m_SPR = new pxCheckBox( m_evtPanel, L"SPR" ));
disasmPanel->SetValue( false ); m_Cache->SetToolTip(_("(not implemented yet)"));
// ----------------------------------------------------------------------------
CheckedStaticBox* hwPanel = new CheckedStaticBox( this, wxVERTICAL, L"Hardware" );
wxSizer& s_hw( hwPanel->ThisSizer );
chks["EE:KnownHw"] = newCheckBox( hw, "Registers" );
chks["EE:UnkownHw"] = newCheckBox( hw, "Unknown Regs" );
chks["EE:DMA"] = newCheckBox( hw, "DMA" );
hwPanel->SetValue( false );
// ----------------------------------------------------------------------------
CheckedStaticBox* evtPanel = new CheckedStaticBox( this, wxVERTICAL, L"Events" );
wxSizer& s_evt( evtPanel->ThisSizer );
chks["EE:Counters"] = newCheckBox( evt, "Counters" );
chks["EE:Memcards"] = newCheckBox( evt, "Memcards" );
chks["EE:VIF"] = newCheckBox( evt, "VIF" );
chks["EE:GIF"] = newCheckBox( evt, "GIF" );
chks["EE:IPU"] = newCheckBox( evt, "IPU" );
chks["EE:SPR"] = newCheckBox( evt, "SPR" );
evtPanel->SetValue( false );
// ----------------------------------------------------------------------------
wxFlexGridSizer& eeTable( *new wxFlexGridSizer( 2, 5 ) ); wxFlexGridSizer& eeTable( *new wxFlexGridSizer( 2, 5 ) );
eeTable.Add( &s_misc, SizerFlags::SubGroup() ); eeTable.Add( &s_misc, SizerFlags::SubGroup() );
eeTable.Add( hwPanel, SizerFlags::SubGroup() ); eeTable.Add( m_hwPanel, SizerFlags::SubGroup() );
eeTable.Add( evtPanel, SizerFlags::SubGroup() ); eeTable.Add( m_evtPanel, SizerFlags::SubGroup() );
eeTable.Add( disasmPanel, SizerFlags::SubGroup() ); eeTable.Add( m_disasmPanel, SizerFlags::SubGroup() );
ThisSizer.AddSpacer( 4 ); ThisSizer.AddSpacer( 4 );
ThisSizer.Add( &eeTable ); ThisSizer.Add( &eeTable );
@ -85,52 +74,44 @@ Panels::eeLogOptionsPanel::eeLogOptionsPanel( LogOptionsPanel* parent )
} }
Panels::iopLogOptionsPanel::iopLogOptionsPanel( LogOptionsPanel* parent ) Panels::iopLogOptionsPanel::iopLogOptionsPanel( LogOptionsPanel* parent )
: CheckedStaticBox( parent, wxHORIZONTAL, L"IOP Logs" ) : CheckedStaticBox( parent, wxVERTICAL, L"IOP Logs" )
{ {
CheckBoxDict& chks( parent->CheckBoxes ); m_disasmPanel = new CheckedStaticBox( this, wxVERTICAL, L"Disasm" );
m_hwPanel = new CheckedStaticBox( this, wxVERTICAL, L"Hardware" );
m_evtPanel = new CheckedStaticBox( this, wxVERTICAL, L"Events" );
wxSizer& s_disasm ( m_disasmPanel->ThisSizer );
wxSizer& s_hw ( m_hwPanel->ThisSizer );
wxSizer& s_evt ( m_evtPanel->ThisSizer );
wxStaticBoxSizer& s_misc = *new wxStaticBoxSizer( wxVERTICAL, this, L"General" ); wxStaticBoxSizer& s_misc = *new wxStaticBoxSizer( wxVERTICAL, this, L"General" );
wxPanelWithHelpers* miscPanel = this; // helper for our newCheckBox macro. wxPanelWithHelpers* m_miscPanel = this; // helper for our newCheckBox macro.
chks["IOP:Memory"] = newCheckBox( misc, "Memory" ); s_misc.Add( m_Bios = new pxCheckBox( m_miscPanel, L"Bios" ));
chks["IOP:Bios"] = newCheckBox( misc, "Bios" ); s_misc.Add( m_Memory = new pxCheckBox( m_miscPanel, L"Memory" ));
chks["IOP:GPU"] = newCheckBox( misc, "GPU (PS1 only)" ); s_misc.Add( m_GPU = new pxCheckBox( m_miscPanel, L"GPU (PS1 only)", L"(Not implemented yet)" ));
// ---------------------------------------------------------------------------- s_disasm.Add( m_R3000A = new pxCheckBox( m_disasmPanel, L"R3000A" ));
CheckedStaticBox* disasmPanel = new CheckedStaticBox( this, wxVERTICAL, L"Disasm" ); s_disasm.Add( m_COP2 = new pxCheckBox( m_disasmPanel, L"COP2 (Geometry)" ));
wxSizer& s_disasm( disasmPanel->ThisSizer );
chks["IOP:R3000A"] = newCheckBox( disasm, "R3000A" ); s_hw.Add( m_KnownHw = new pxCheckBox( m_hwPanel, L"Registers" ));
chks["IOP:COP2"] = newCheckBox( disasm, "COP2 (Geometry)" ); s_hw.Add( m_UnknownHw = new pxCheckBox( m_hwPanel, L"UnknownRegs" ));
s_hw.Add( m_DMA = new pxCheckBox( m_hwPanel, L"DMA" ));
disasmPanel->SetValue( false ); s_evt.Add( m_Counters = new pxCheckBox( m_evtPanel, L"Counters" ));
// ---------------------------------------------------------------------------- s_evt.Add( m_Memcards = new pxCheckBox( m_evtPanel, L"Memcards" ));
CheckedStaticBox* hwPanel = new CheckedStaticBox( this, wxVERTICAL, L"Hardware" ); s_evt.Add( m_PAD = new pxCheckBox( m_evtPanel, L"Pad" ));
wxSizer& s_hw( hwPanel->ThisSizer ); s_evt.Add( m_SPU2 = new pxCheckBox( m_evtPanel, L"SPU2" ));
s_evt.Add( m_CDVD = new pxCheckBox( m_evtPanel, L"CDVD" ));
chks["IOP:KnownHw"] = newCheckBox( hw, "Registers" ); s_evt.Add( m_USB = new pxCheckBox( m_evtPanel, L"USB" ));
chks["IOP:UnknownHw"] = newCheckBox( hw, "UnknownRegs" ); s_evt.Add( m_FW = new pxCheckBox( m_evtPanel, L"FW" ));
chks["IOP:DMA"] = newCheckBox( hw, "DMA" );
hwPanel->SetValue( false );
// ----------------------------------------------------------------------------
CheckedStaticBox* evtPanel = new CheckedStaticBox( this, wxVERTICAL, L"Events" );
wxSizer& s_evt( evtPanel->ThisSizer );
chks["IOP:PAD"] = newCheckBox( evt, "Pad" );
chks["IOP:SPU2"] = newCheckBox( evt, "SPU2" );
chks["IOP:CDVD"] = newCheckBox( evt, "CDVD" );
chks["IOP:USB"] = newCheckBox( evt, "USB" );
chks["IOP:FW"] = newCheckBox( evt, "FW" );
// ----------------------------------------------------------------------------
wxFlexGridSizer& iopTable( *new wxFlexGridSizer( 2, 5 ) ); wxFlexGridSizer& iopTable( *new wxFlexGridSizer( 2, 5 ) );
iopTable.Add( &s_misc, SizerFlags::SubGroup() ); iopTable.Add( &s_misc, SizerFlags::SubGroup() );
iopTable.Add( hwPanel, SizerFlags::SubGroup() ); iopTable.Add( m_hwPanel, SizerFlags::SubGroup() );
iopTable.Add( evtPanel, SizerFlags::SubGroup() ); iopTable.Add( m_evtPanel, SizerFlags::SubGroup() );
iopTable.Add( disasmPanel, SizerFlags::SubGroup() ); iopTable.Add( m_disasmPanel, SizerFlags::SubGroup() );
ThisSizer.AddSpacer( 4 ); ThisSizer.AddSpacer( 4 );
ThisSizer.Add( &iopTable ); ThisSizer.Add( &iopTable );
@ -138,6 +119,70 @@ Panels::iopLogOptionsPanel::iopLogOptionsPanel( LogOptionsPanel* parent )
SetValue( true ); SetValue( true );
} }
#define SetCheckValue( cpu, key ) \
if( m_##key != NULL ) m_##key->SetValue( conf.cpu.m_##key );
void Panels::eeLogOptionsPanel::OnSettingsChanged()
{
const TraceLogFilters& conf( g_Conf->EmuOptions.Trace );
this->SetValue( conf.EE.m_EnableAll );
m_disasmPanel->SetValue( conf.EE.m_EnableDisasm );
m_evtPanel->SetValue( conf.EE.m_EnableEvents );
m_hwPanel->SetValue( conf.EE.m_EnableHardware );
SetCheckValue( EE, Memory );
SetCheckValue( EE, Bios );
SetCheckValue( EE, Cache );
SetCheckValue( EE, SysCtrl );
SetCheckValue( EE, R5900 );
SetCheckValue( EE, COP0 );
SetCheckValue( EE, COP1 );
SetCheckValue( EE, COP2 );
SetCheckValue(EE, VU0micro);
SetCheckValue(EE, VU1micro);
SetCheckValue(EE, KnownHw);
SetCheckValue(EE, UnknownHw);
SetCheckValue(EE, DMA);
SetCheckValue(EE, Counters);
SetCheckValue(EE, VIF);
SetCheckValue(EE, GIF);
SetCheckValue(EE, SPR);
SetCheckValue(EE, IPU);
}
void Panels::iopLogOptionsPanel::OnSettingsChanged()
{
const TraceLogFilters& conf( g_Conf->EmuOptions.Trace );
SetValue( conf.IOP.m_EnableAll );
m_disasmPanel->SetValue( conf.IOP.m_EnableDisasm );
m_evtPanel->SetValue( conf.IOP.m_EnableEvents );
m_hwPanel->SetValue( conf.IOP.m_EnableHardware );
SetCheckValue(IOP, Bios);
SetCheckValue(IOP, Memory);
SetCheckValue(IOP, R3000A);
SetCheckValue(IOP, COP2);
SetCheckValue(IOP, KnownHw);
SetCheckValue(IOP, UnknownHw);
SetCheckValue(IOP, DMA);
SetCheckValue(IOP, Counters);
SetCheckValue(IOP, Memcards);
SetCheckValue(IOP, PAD);
SetCheckValue(IOP, SPU2);
SetCheckValue(IOP, USB);
SetCheckValue(IOP, FW);
SetCheckValue(IOP, CDVD);
}
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
// LogOptionsPanel Implementations // LogOptionsPanel Implementations
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
@ -150,62 +195,147 @@ Panels::LogOptionsPanel::LogOptionsPanel(wxWindow* parent, int idealWidth )
wxBoxSizer& topSizer = *new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer& topSizer = *new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer& s_misc = *new wxStaticBoxSizer( wxHORIZONTAL, this, L"Misc" ); wxStaticBoxSizer& s_misc = *new wxStaticBoxSizer( wxHORIZONTAL, this, L"Misc" );
wxPanelWithHelpers* miscPanel = this; // helper for our newCheckBox macro.
CheckBoxes["SYMs"] = newCheckBox( misc, "SYMs Log" ); m_masterEnabler = new pxCheckBox( this, _("Enable Trace Logging"),
_("Trace logs are all written to emulog.txt. Warning: Enabling trace logs is typically very slow, and is a leading cause of 'What happened to my FPS?' problems. :)") );
m_masterEnabler->SetToolTip( _("On-the-fly hotkey support: Toggle trace logging at any time using F10.") );
//miscSizer.Add( ("ELF") ); s_misc.Add( m_SIF = new pxCheckBox( this, L"SIF (EE<->IOP)" ));
m_SIF->SetToolTip(_("Enables logging of both SIF DMAs and SIF Register activity.") );
s_misc.Add( m_VIFunpack = new pxCheckBox( this, L"VIFunpack" ));
m_VIFunpack->SetToolTip(_("Special detailed logs of VIF packed data handling (does not include VIF control, status, or hwRegs)"));
s_misc.Add( m_GIFtag = new pxCheckBox( this, L"GIFtag" ));
m_GIFtag->SetToolTip(_("(not implemented yet)"));
//s_head.Add( &s_misc, SizerFlags::SubGroup() );
topSizer.Add( &m_eeSection, SizerFlags::StdSpace() ); topSizer.Add( &m_eeSection, SizerFlags::StdSpace() );
topSizer.Add( &m_iopSection, SizerFlags::StdSpace() ); topSizer.Add( &m_iopSection, SizerFlags::StdSpace() );
mainsizer.Add( m_masterEnabler, SizerFlags::StdSpace() );
mainsizer.Add( new wxStaticLine( this, wxID_ANY ), SizerFlags::StdExpand().Border(wxLEFT | wxRIGHT, 20) );
mainsizer.AddSpacer( 5 );
mainsizer.Add( &topSizer ); mainsizer.Add( &topSizer );
mainsizer.Add( &s_misc, SizerFlags::StdSpace() ); mainsizer.Add( &s_misc, SizerFlags::StdSpace().Centre() );
SetSizer( &mainsizer ); SetSizer( &mainsizer );
Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(LogOptionsPanel::OnCheckBoxClicked) ); Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(LogOptionsPanel::OnCheckBoxClicked) );
OnSettingsChanged();
} }
void Panels::LogOptionsPanel::OnSettingsChanged()
{
TraceLogFilters& conf( g_Conf->EmuOptions.Trace );
m_masterEnabler->SetValue( conf.Enabled );
m_SIF->SetValue( conf.SIF );
SetCheckValue( EE, VIFunpack );
SetCheckValue( EE, GIFtag );
m_eeSection.OnSettingsChanged();
m_iopSection.OnSettingsChanged();
OnUpdateEnableAll();
}
void Panels::LogOptionsPanel::OnUpdateEnableAll()
{
bool enabled( m_masterEnabler->GetValue() );
m_SIF->Enable( enabled );
m_VIFunpack->Enable( enabled );
m_GIFtag->Enable( enabled );
m_eeSection.Enable( enabled );
m_iopSection.Enable( enabled );
}
void Panels::LogOptionsPanel::OnCheckBoxClicked(wxCommandEvent &evt) void Panels::LogOptionsPanel::OnCheckBoxClicked(wxCommandEvent &evt)
{ {
m_IsDirty = true; m_IsDirty = true;
if( evt.GetId() == m_masterEnabler->GetWxPtr()->GetId() )
OnUpdateEnableAll();
} }
void Panels::LogOptionsPanel::Apply() void Panels::LogOptionsPanel::Apply()
{ {
CheckBoxDict& chks( CheckBoxes ); if( !m_IsDirty ) return;
#define SetEE( name ) \ g_Conf->EmuOptions.Trace.Enabled = m_masterEnabler->GetValue();
g_Conf->EmuOptions.Trace.EE.m_##name = chks["EE:"#name]->GetValue() g_Conf->EmuOptions.Trace.SIF = m_SIF->GetValue();
SetEE(EnableAll); g_Conf->EmuOptions.Trace.EE.m_VIFunpack = m_VIFunpack->GetValue();
SetEE(Bios); g_Conf->EmuOptions.Trace.EE.m_GIFtag = m_GIFtag->GetValue();
SetEE(Memory);
SetEE(SysCtrl);
SetEE(VIFunpack);
SetEE(GIFtag);
SetEE(EnableDisasm); m_eeSection.Apply();
SetEE(R5900); m_iopSection.Apply();
SetEE(COP0);
SetEE(COP1);
SetEE(COP2);
SetEE(VU0micro);
SetEE(VU1micro);
SetEE(EnableHardware); m_IsDirty = false;
SetEE(KnownHw); }
SetEE(UnknownHw);
SetEE(DMA); #define GetSet( name ) conf.name = name->GetValue()
SetEE(EnableEvents); void Panels::eeLogOptionsPanel::Apply()
SetEE(Counters); {
SetEE(VIF); TraceFiltersEE& conf( g_Conf->EmuOptions.Trace.EE );
SetEE(GIF);
SetEE(SPR); conf.m_EnableAll = GetValue();
SetEE(IPU); conf.m_EnableDisasm = m_disasmPanel->GetValue();
conf.m_EnableHardware = m_hwPanel->GetValue();
// TODO -- IOP Section! conf.m_EnableEvents = m_evtPanel->GetValue();
GetSet(m_Bios);
GetSet(m_Memory);
GetSet(m_Cache);
GetSet(m_SysCtrl);
GetSet(m_R5900);
GetSet(m_COP0);
GetSet(m_COP1);
GetSet(m_COP2);
GetSet(m_VU0micro);
GetSet(m_VU1micro);
GetSet(m_KnownHw);
GetSet(m_UnknownHw);
GetSet(m_DMA);
GetSet(m_Counters);
GetSet(m_VIF);
GetSet(m_GIF);
GetSet(m_SPR);
GetSet(m_IPU);
}
void Panels::iopLogOptionsPanel::Apply()
{
TraceFiltersIOP& conf( g_Conf->EmuOptions.Trace.IOP );
conf.m_EnableAll = GetValue();
conf.m_EnableDisasm = m_disasmPanel->GetValue();
conf.m_EnableHardware = m_hwPanel->GetValue();
conf.m_EnableEvents = m_evtPanel->GetValue();
GetSet(m_Bios);
GetSet(m_Memory);
GetSet(m_R3000A);
GetSet(m_COP2);
GetSet(m_KnownHw);
GetSet(m_UnknownHw);
GetSet(m_DMA);
GetSet(m_Counters);
GetSet(m_Memcards);
GetSet(m_PAD);
GetSet(m_SPU2);
GetSet(m_USB);
GetSet(m_FW);
GetSet(m_CDVD);
} }

View File

@ -19,43 +19,100 @@
#include "BaseConfigPanel.h" #include "BaseConfigPanel.h"
#include "CheckedStaticBox.h" #include "CheckedStaticBox.h"
#include "Utilities/HashMap.h"
namespace Panels namespace Panels
{ {
typedef HashTools::Dictionary< wxCheckBox* > CheckBoxDict;
class LogOptionsPanel; class LogOptionsPanel;
class eeLogOptionsPanel : public CheckedStaticBox class eeLogOptionsPanel : public CheckedStaticBox
{ {
public:
CheckedStaticBox* m_disasmPanel;
CheckedStaticBox* m_hwPanel;
CheckedStaticBox* m_evtPanel;
pxCheckBox* m_Memory;
pxCheckBox* m_Bios;
pxCheckBox* m_Cache;
pxCheckBox* m_SysCtrl;
pxCheckBox* m_R5900;
pxCheckBox* m_COP0;
pxCheckBox* m_COP1;
pxCheckBox* m_COP2;
pxCheckBox* m_VU0micro;
pxCheckBox* m_VU1micro;
pxCheckBox* m_KnownHw;
pxCheckBox* m_UnknownHw;
pxCheckBox* m_DMA;
pxCheckBox* m_Counters;
pxCheckBox* m_VIF;
pxCheckBox* m_GIF;
pxCheckBox* m_SPR;
pxCheckBox* m_IPU;
public: public:
eeLogOptionsPanel( LogOptionsPanel* parent ); eeLogOptionsPanel( LogOptionsPanel* parent );
virtual ~eeLogOptionsPanel() throw() {} virtual ~eeLogOptionsPanel() throw() {}
void OnSettingsChanged();
void Apply();
}; };
class iopLogOptionsPanel : public CheckedStaticBox class iopLogOptionsPanel : public CheckedStaticBox
{ {
public:
CheckedStaticBox* m_disasmPanel;
CheckedStaticBox* m_hwPanel;
CheckedStaticBox* m_evtPanel;
pxCheckBox* m_Bios;
pxCheckBox* m_Memory;
pxCheckBox* m_GPU;
pxCheckBox* m_R3000A;
pxCheckBox* m_COP2;
pxCheckBox* m_KnownHw;
pxCheckBox* m_UnknownHw;
pxCheckBox* m_DMA;
pxCheckBox* m_Counters;
pxCheckBox* m_Memcards;
pxCheckBox* m_PAD;
pxCheckBox* m_SPU2;
pxCheckBox* m_USB;
pxCheckBox* m_FW;
pxCheckBox* m_CDVD;
public: public:
iopLogOptionsPanel( LogOptionsPanel* parent ); iopLogOptionsPanel( LogOptionsPanel* parent );
virtual ~iopLogOptionsPanel() throw() {} virtual ~iopLogOptionsPanel() throw() {}
void OnSettingsChanged();
void Apply();
}; };
class LogOptionsPanel : public BaseApplicableConfigPanel class LogOptionsPanel : public BaseApplicableConfigPanel
{ {
public:
CheckBoxDict CheckBoxes;
protected: protected:
eeLogOptionsPanel& m_eeSection; eeLogOptionsPanel& m_eeSection;
iopLogOptionsPanel& m_iopSection; iopLogOptionsPanel& m_iopSection;
bool m_IsDirty; // any settings modified since last apply will flag this "true" bool m_IsDirty; // any settings modified since last apply will flag this "true"
pxCheckBox* m_masterEnabler;
pxCheckBox* m_SIF;
pxCheckBox* m_VIFunpack;
pxCheckBox* m_GIFtag;
public: public:
LogOptionsPanel( wxWindow* parent, int idealWidth ); LogOptionsPanel( wxWindow* parent, int idealWidth );
virtual ~LogOptionsPanel() throw() {} virtual ~LogOptionsPanel() throw() {}
void OnSettingsChanged();
void OnUpdateEnableAll();
void OnCheckBoxClicked(wxCommandEvent &event); void OnCheckBoxClicked(wxCommandEvent &event);
void Apply(); void Apply();
}; };

View File

@ -136,6 +136,17 @@ pxCheckBox& pxCheckBox::SetToolTip( const wxString& tip )
return *this; return *this;
} }
pxCheckBox& pxCheckBox::SetValue( bool val )
{
m_checkbox->SetValue( val );
return *this;
}
bool pxCheckBox::GetValue() const
{
return m_checkbox->GetValue();
}
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// Creates a new Radio button and adds it to the specified sizer/parent combo, with optional tooltip. // Creates a new Radio button and adds it to the specified sizer/parent combo, with optional tooltip.
// Uses the default spacer setting for adding checkboxes, and the tooltip (if specified) is applied // Uses the default spacer setting for adding checkboxes, and the tooltip (if specified) is applied

View File

@ -112,12 +112,14 @@ public:
const wxStaticText* GetSubText() const { return m_subtext; } const wxStaticText* GetSubText() const { return m_subtext; }
pxCheckBox& SetToolTip( const wxString& tip ); pxCheckBox& SetToolTip( const wxString& tip );
pxCheckBox& SetValue( bool val );
operator wxCheckBox*() { return m_checkbox; } bool GetValue() const;
operator const wxCheckBox*() const { return m_checkbox; }
operator wxCheckBox&() { pxAssert( m_checkbox != NULL ); return *m_checkbox; } operator wxCheckBox&() { pxAssert( m_checkbox != NULL ); return *m_checkbox; }
operator const wxCheckBox&() const { pxAssert( m_checkbox != NULL ); return *m_checkbox; } operator const wxCheckBox&() const { pxAssert( m_checkbox != NULL ); return *m_checkbox; }
wxCheckBox* GetWxPtr() { return m_checkbox; }
const wxCheckBox* GetWxPtr() const { return m_checkbox; }
}; };