mirror of https://github.com/PCSX2/pcsx2.git
* Disable Ok/Apply/Cancel buttons on dialogs while settings are being applied, prevents potential deadlock when accidentally double-clicking the buttons.
* Add preliminary code for selectively disabling spam-heavy hardware registers git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3853 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
c48ae28247
commit
7ad0ef4fb4
|
@ -36,6 +36,9 @@ __ri void cpuUpdateOperationMode() {
|
|||
}
|
||||
|
||||
void __fastcall WriteCP0Status(u32 value) {
|
||||
|
||||
DMA_LOG("COP0 Status write = 0x%08x", value);
|
||||
|
||||
cpuRegs.CP0.n.Status.val = value;
|
||||
cpuUpdateOperationMode();
|
||||
cpuSetNextEventDelta(4);
|
||||
|
|
|
@ -108,8 +108,11 @@ __fi uint dmacInterrupt()
|
|||
//DevCon.Warning("DMAC Suspended or Disabled on interrupt");
|
||||
return 0;
|
||||
}
|
||||
HW_LOG("dmacInterrupt %x", (psHu16(DMAC_STAT + 2) & psHu16(DMAC_STAT) |
|
||||
psHu16(DMAC_STAT) & 0x8000));
|
||||
|
||||
DMA_LOG("dmacInterrupt %x",
|
||||
((psHu16(DMAC_STAT + 2) & psHu16(DMAC_STAT)) |
|
||||
(psHu16(DMAC_STAT) & 0x8000))
|
||||
);
|
||||
|
||||
//cpuException(0x800, cpuRegs.branch);
|
||||
return 0x800;
|
||||
|
|
|
@ -189,7 +189,7 @@ void cpuTlbMiss(u32 addr, u32 bd, u32 excode)
|
|||
cpuRegs.CP0.n.EPC = cpuRegs.pc - 4;
|
||||
}
|
||||
|
||||
if ((cpuRegs.CP0.n.Status.val & 0x1) == 0) {
|
||||
if (!cpuRegs.CP0.n.Status.b.IE) {
|
||||
cpuRegs.pc = 0x80000000;
|
||||
} else {
|
||||
cpuRegs.pc = 0x80000180;
|
||||
|
|
|
@ -109,6 +109,9 @@ public:
|
|||
virtual ApplyStateStruct& GetApplyState() { return m_ApplyState; }
|
||||
};
|
||||
|
||||
// --------------------------------------------------------------------------------------
|
||||
// BaseApplicableDialog
|
||||
// --------------------------------------------------------------------------------------
|
||||
class BaseApplicableDialog
|
||||
: public wxDialogWithHelpers
|
||||
, public IApplyState
|
||||
|
|
|
@ -180,33 +180,75 @@ void Dialogs::BaseConfigurationDialog::OnCloseWindow( wxCloseEvent& evt )
|
|||
evt.Skip();
|
||||
}
|
||||
|
||||
class ScopedOkButtonDisabler
|
||||
{
|
||||
protected:
|
||||
wxWindow* m_apply;
|
||||
wxWindow* m_ok;
|
||||
wxWindow* m_cancel;
|
||||
|
||||
public:
|
||||
ScopedOkButtonDisabler( wxWindow* parent )
|
||||
{
|
||||
m_apply = parent->FindWindow( wxID_APPLY );
|
||||
m_ok = parent->FindWindow( wxID_OK );
|
||||
m_cancel = parent->FindWindow( wxID_CANCEL );
|
||||
|
||||
if (m_apply) m_apply ->Disable();
|
||||
if (m_ok) m_ok ->Disable();
|
||||
if (m_cancel) m_cancel->Disable();
|
||||
}
|
||||
|
||||
// Use this to prevent the Apply buton from being re-enabled.
|
||||
void DetachApply()
|
||||
{
|
||||
m_apply = NULL;
|
||||
}
|
||||
|
||||
void DetachAll()
|
||||
{
|
||||
m_apply = m_ok = m_cancel = NULL;
|
||||
}
|
||||
|
||||
virtual ~ScopedOkButtonDisabler() throw()
|
||||
{
|
||||
if (m_apply) m_apply ->Enable();
|
||||
if (m_ok) m_ok ->Enable();
|
||||
if (m_cancel) m_cancel->Enable();
|
||||
}
|
||||
};
|
||||
|
||||
void Dialogs::BaseConfigurationDialog::OnOk_Click( wxCommandEvent& evt )
|
||||
{
|
||||
ScopedOkButtonDisabler disabler(this);
|
||||
|
||||
if( m_ApplyState.ApplyAll() )
|
||||
{
|
||||
if( wxWindow* apply = FindWindow( wxID_APPLY ) ) apply->Disable();
|
||||
if( m_listbook ) GetConfSettingsTabName() = m_labels[m_listbook->GetSelection()];
|
||||
AppSaveSettings();
|
||||
disabler.DetachAll();
|
||||
evt.Skip();
|
||||
}
|
||||
}
|
||||
|
||||
void Dialogs::BaseConfigurationDialog::OnApply_Click( wxCommandEvent& evt )
|
||||
{
|
||||
ScopedOkButtonDisabler disabler(this);
|
||||
|
||||
if( m_ApplyState.ApplyAll() )
|
||||
disabler.DetachApply();
|
||||
|
||||
if( m_listbook ) GetConfSettingsTabName() = m_labels[m_listbook->GetSelection()];
|
||||
AppSaveSettings();
|
||||
}
|
||||
|
||||
void Dialogs::BaseConfigurationDialog::OnCancel_Click( wxCommandEvent& evt )
|
||||
{
|
||||
evt.Skip();
|
||||
if( m_listbook ) GetConfSettingsTabName() = m_labels[m_listbook->GetSelection()];
|
||||
}
|
||||
|
||||
void Dialogs::BaseConfigurationDialog::OnApply_Click( wxCommandEvent& evt )
|
||||
{
|
||||
if( m_ApplyState.ApplyAll() )
|
||||
FindWindow( wxID_APPLY )->Disable();
|
||||
|
||||
if( m_listbook ) GetConfSettingsTabName() = m_labels[m_listbook->GetSelection()];
|
||||
AppSaveSettings();
|
||||
}
|
||||
|
||||
|
||||
void Dialogs::BaseConfigurationDialog::OnScreenshot_Click( wxCommandEvent& evt )
|
||||
{
|
||||
wxBitmap memBmp;
|
||||
|
|
|
@ -57,6 +57,7 @@ int Dialogs::BiosSelectorDialog::ShowModal()
|
|||
|
||||
void Dialogs::BiosSelectorDialog::OnOk_Click( wxCommandEvent& evt )
|
||||
{
|
||||
wxWindowDisabler disableOk( FindWindow( wxID_OK ) );
|
||||
if( m_ApplyState.ApplyAll() )
|
||||
{
|
||||
Close();
|
||||
|
|
|
@ -24,33 +24,8 @@ using namespace pxSizerFlags;
|
|||
|
||||
|
||||
Dialogs::LogOptionsDialog::LogOptionsDialog( wxWindow* parent )
|
||||
: BaseApplicableDialog( parent, _("Trace Logging"), pxDialogFlags().Resize() )
|
||||
: BaseConfigurationDialog( parent, _("Trace Logging"), 720 )
|
||||
{
|
||||
*this += new LogOptionsPanel( this ) | StdExpand();
|
||||
|
||||
AddOkCancel( *GetSizer(), true );
|
||||
FindWindow( wxID_APPLY )->Disable();
|
||||
|
||||
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( m_ApplyState.ApplyAll() )
|
||||
{
|
||||
FindWindow( wxID_APPLY )->Disable();
|
||||
AppSaveSettings();
|
||||
|
||||
Close();
|
||||
evt.Skip();
|
||||
}
|
||||
}
|
||||
|
||||
void Dialogs::LogOptionsDialog::OnApply_Click( wxCommandEvent& evt )
|
||||
{
|
||||
if( m_ApplyState.ApplyAll() )
|
||||
FindWindow( wxID_APPLY )->Disable();
|
||||
|
||||
AppSaveSettings();
|
||||
AddOkCancel();
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
namespace Dialogs {
|
||||
|
||||
class LogOptionsDialog : public BaseApplicableDialog
|
||||
class LogOptionsDialog : public BaseConfigurationDialog
|
||||
{
|
||||
public:
|
||||
LogOptionsDialog( wxWindow* parent=NULL );
|
||||
|
@ -35,6 +35,13 @@ public:
|
|||
protected:
|
||||
void OnOk_Click( wxCommandEvent& evt );
|
||||
void OnApply_Click( wxCommandEvent& evt );
|
||||
|
||||
wxString& GetConfSettingsTabName() const
|
||||
{
|
||||
static wxString bleh = L"TraceLogs";
|
||||
pxFailDev("No tabs yet!");
|
||||
return bleh;
|
||||
}
|
||||
};
|
||||
|
||||
} // end namespace Dialogs
|
||||
|
|
|
@ -15,6 +15,25 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#define eeAddrInRange(name, addr) \
|
||||
(addr >= EEMemoryMap::name##_Start && addr < EEMemoryMap::name##_End)
|
||||
|
||||
static __ri bool _eelog_enabled( u32 addr )
|
||||
{
|
||||
// Selective enable/disable ability for specific register maps
|
||||
if (eeAddrInRange(RCNT0, addr)) return false;
|
||||
if (eeAddrInRange(RCNT1, addr)) return true;
|
||||
if (eeAddrInRange(RCNT2, addr)) return true;
|
||||
if (eeAddrInRange(RCNT3, addr)) return true;
|
||||
|
||||
if (eeAddrInRange(SBUS, addr)) return false;
|
||||
|
||||
// INTC!
|
||||
if (addr == INTC_STAT || addr == INTC_MASK) return true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
template< typename T>
|
||||
static __ri const char* _eelog_GetHwName( u32 addr, T val )
|
||||
{
|
||||
|
@ -244,6 +263,7 @@ static __ri void eeHwTraceLog( u32 addr, T val, bool mode )
|
|||
{
|
||||
if (!IsDevBuild) return;
|
||||
if (!EmuConfig.Trace.Enabled || !EmuConfig.Trace.EE.m_EnableAll || !EmuConfig.Trace.EE.m_EnableRegisters) return;
|
||||
if (!_eelog_enabled(addr)) return;
|
||||
|
||||
FastFormatAscii valStr;
|
||||
FastFormatAscii labelStr;
|
||||
|
|
Loading…
Reference in New Issue