apply the new wxw method to dsp hle, wiimote, and padsimple.

wiimote config now loads way faster :)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3649 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman
2009-07-02 19:00:27 +00:00
parent 12efada734
commit 99a33ccba9
24 changed files with 618 additions and 689 deletions

View File

@ -19,17 +19,17 @@
#include "Config.h"
#include "ConfigDlg.h"
BEGIN_EVENT_TABLE(ConfigDialog, wxDialog)
EVT_BUTTON(wxID_OK, ConfigDialog::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_HLE_AUDIO, ConfigDialog::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_DTK_MUSIC, ConfigDialog::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_THROTTLE, ConfigDialog::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_RE0_FIX, ConfigDialog::SettingsChanged)
EVT_CHECKBOX(ID_DISABLE_STREAMING, ConfigDialog::SettingsChanged)
EVT_COMMAND_SCROLL(ID_VOLUME, ConfigDialog::VolumeChanged)
BEGIN_EVENT_TABLE(DSPConfigDialogHLE, wxDialog)
EVT_BUTTON(wxID_OK, DSPConfigDialogHLE::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_HLE_AUDIO, DSPConfigDialogHLE::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_DTK_MUSIC, DSPConfigDialogHLE::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_THROTTLE, DSPConfigDialogHLE::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_RE0_FIX, DSPConfigDialogHLE::SettingsChanged)
EVT_CHECKBOX(ID_DISABLE_STREAMING, DSPConfigDialogHLE::SettingsChanged)
EVT_COMMAND_SCROLL(ID_VOLUME, DSPConfigDialogHLE::VolumeChanged)
END_EVENT_TABLE()
ConfigDialog::ConfigDialog(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
DSPConfigDialogHLE::DSPConfigDialogHLE(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
: wxDialog(parent, id, title, position, size, style)
{
// Load config settings
@ -107,7 +107,7 @@ ConfigDialog::ConfigDialog(wxWindow *parent, wxWindowID id, const wxString &titl
}
// Add audio output options
void ConfigDialog::AddBackend(const char* backend)
void DSPConfigDialogHLE::AddBackend(const char* backend)
{
// Update values
m_BackendSelection->Append(wxString::FromAscii(backend));
@ -124,11 +124,11 @@ void ConfigDialog::AddBackend(const char* backend)
#endif
}
ConfigDialog::~ConfigDialog()
DSPConfigDialogHLE::~DSPConfigDialogHLE()
{
}
void ConfigDialog::VolumeChanged(wxScrollEvent& WXUNUSED(event))
void DSPConfigDialogHLE::VolumeChanged(wxScrollEvent& WXUNUSED(event))
{
ac_Config.m_Volume = m_volumeSlider->GetValue();
ac_Config.Update();
@ -136,7 +136,7 @@ void ConfigDialog::VolumeChanged(wxScrollEvent& WXUNUSED(event))
m_volumeText->SetLabel(wxString::Format(wxT("%d %%"), m_volumeSlider->GetValue()));
}
void ConfigDialog::SettingsChanged(wxCommandEvent& event)
void DSPConfigDialogHLE::SettingsChanged(wxCommandEvent& event)
{
g_Config.m_EnableHLEAudio = m_buttonEnableHLEAudio->GetValue();
g_Config.m_EnableRE0Fix = m_buttonEnableRE0Fix->GetValue();

View File

@ -24,16 +24,16 @@
#include <wx/statbox.h>
#include "AudioCommon.h"
class ConfigDialog : public wxDialog
class DSPConfigDialogHLE : public wxDialog
{
public:
ConfigDialog(wxWindow *parent,
DSPConfigDialogHLE(wxWindow *parent,
wxWindowID id = 1,
const wxString &title = wxT("Dolphin DSP-HLE Plugin Settings"),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE);
virtual ~ConfigDialog();
virtual ~DSPConfigDialogHLE();
void AddBackend(const char *backend);
private:

View File

@ -42,7 +42,7 @@
// Make the wxTextCtrls scroll with each other
void CDebugger::DoScrollBlocks()
void DSPDebuggerHLE::DoScrollBlocks()
{
// ShowPosition = in letters
// GetScrollPos = number of lines from the top
@ -75,13 +75,13 @@ void CDebugger::DoScrollBlocks()
}*/
}
void CDebugger::ScrollBlocksMouse(wxMouseEvent& event)
void DSPDebuggerHLE::ScrollBlocksMouse(wxMouseEvent& event)
{
DoScrollBlocks();
event.Skip(); // otherwise we remove the regular behavior, for example scrolling
}
void CDebugger::ScrollBlocksCursor(wxScrollWinEvent& event)
void DSPDebuggerHLE::ScrollBlocksCursor(wxScrollWinEvent& event)
{
DoScrollBlocks();
event.Skip(); // otherwise we remove the regular behavior, for example scrolling

View File

@ -42,38 +42,38 @@
// =======================================================================================
// Event table and class
BEGIN_EVENT_TABLE(CDebugger,wxDialog)
EVT_CLOSE(CDebugger::OnClose) // on close event
BEGIN_EVENT_TABLE(DSPDebuggerHLE,wxDialog)
EVT_CLOSE(DSPDebuggerHLE::OnClose) // on close event
EVT_BUTTON(ID_UPD,CDebugger::OnUpdate) // buttons
EVT_BUTTON(ID_UPD,DSPDebuggerHLE::OnUpdate) // buttons
// left cotrols
EVT_CHECKLISTBOX(IDC_CHECKLIST5, CDebugger::OnOptions) // options
EVT_CHECKLISTBOX(IDC_CHECKLIST6, CDebugger::OnShowAll)
EVT_RADIOBOX(IDC_RADIO0,CDebugger::ShowBase) // update frequency
EVT_CHECKLISTBOX(IDC_CHECKLIST5, DSPDebuggerHLE::OnOptions) // options
EVT_CHECKLISTBOX(IDC_CHECKLIST6, DSPDebuggerHLE::OnShowAll)
EVT_RADIOBOX(IDC_RADIO0,DSPDebuggerHLE::ShowBase) // update frequency
// right cotrols
EVT_RADIOBOX(IDC_RADIO0,CDebugger::ShowBase)
EVT_RADIOBOX(IDC_RADIO1,CDebugger::ChangeFrequency) // update frequency
EVT_RADIOBOX(IDC_RADIO2,CDebugger::ChangePreset) // presets
EVT_CHECKLISTBOX(IDC_CHECKLIST1, CDebugger::OnSettingsCheck) // settings
EVT_RADIOBOX(IDC_RADIO0,DSPDebuggerHLE::ShowBase)
EVT_RADIOBOX(IDC_RADIO1,DSPDebuggerHLE::ChangeFrequency) // update frequency
EVT_RADIOBOX(IDC_RADIO2,DSPDebuggerHLE::ChangePreset) // presets
EVT_CHECKLISTBOX(IDC_CHECKLIST1, DSPDebuggerHLE::OnSettingsCheck) // settings
EVT_NOTEBOOK_PAGE_CHANGED(ID_NOTEBOOK, CDebugger::UpdateMail) // mails
EVT_RADIOBOX(IDC_RADIO3,CDebugger::ChangeMail)
EVT_CHECKLISTBOX(IDC_CHECKLIST2, CDebugger::OnGameChange) // gc
EVT_CHECKLISTBOX(IDC_CHECKLIST3, CDebugger::OnGameChange) // wii
EVT_CHECKLISTBOX(IDC_CHECKLIST4, CDebugger::MailSettings) // settings
EVT_NOTEBOOK_PAGE_CHANGED(ID_NOTEBOOK, DSPDebuggerHLE::UpdateMail) // mails
EVT_RADIOBOX(IDC_RADIO3,DSPDebuggerHLE::ChangeMail)
EVT_CHECKLISTBOX(IDC_CHECKLIST2, DSPDebuggerHLE::OnGameChange) // gc
EVT_CHECKLISTBOX(IDC_CHECKLIST3, DSPDebuggerHLE::OnGameChange) // wii
EVT_CHECKLISTBOX(IDC_CHECKLIST4, DSPDebuggerHLE::MailSettings) // settings
//EVT_RIGHT_DOWN(CDebugger::ScrollBlocks)
//EVT_LEFT_DOWN(CDebugger::ScrollBlocks)
//EVT_MOUSE_EVENTS(CDebugger::ScrollBlocks)
//EVT_MOTION(CDebugger::ScrollBlocks)
//EVT_RIGHT_DOWN(DSPDebuggerHLE::ScrollBlocks)
//EVT_LEFT_DOWN(DSPDebuggerHLE::ScrollBlocks)
//EVT_MOUSE_EVENTS(DSPDebuggerHLE::ScrollBlocks)
//EVT_MOTION(DSPDebuggerHLE::ScrollBlocks)
//EVT_SCROLL(CDebugger::ScrollBlocks)
//EVT_SCROLLWIN(CDebugger::ScrollBlocks)
//EVT_SCROLL(DSPDebuggerHLE::ScrollBlocks)
//EVT_SCROLLWIN(DSPDebuggerHLE::ScrollBlocks)
END_EVENT_TABLE()
CDebugger::CDebugger(wxWindow *parent, wxWindowID id, const wxString &title,
DSPDebuggerHLE::DSPDebuggerHLE(wxWindow *parent, wxWindowID id, const wxString &title,
const wxPoint &position, const wxSize& size, long style)
: wxDialog(parent, id, title, position, size, style)
, m_GPRListView(NULL)
@ -131,16 +131,16 @@ CDebugger::CDebugger(wxWindow *parent, wxWindowID id, const wxString &title,
//m_bl95, m_PageBlock, sBlock
m_bl95->Connect(wxID_ANY, wxEVT_SCROLLWIN_THUMBTRACK,
wxScrollWinEventHandler(CDebugger::ScrollBlocksCursor), (wxObject*)NULL, this);
wxScrollWinEventHandler(DSPDebuggerHLE::ScrollBlocksCursor), (wxObject*)NULL, this);
m_bl95->Connect(wxID_ANY, wxEVT_SCROLLWIN_THUMBRELEASE,
wxScrollWinEventHandler(CDebugger::ScrollBlocksCursor), (wxObject*)NULL, this);
wxScrollWinEventHandler(DSPDebuggerHLE::ScrollBlocksCursor), (wxObject*)NULL, this);
m_bl95->Connect(wxID_ANY, wxEVT_MOTION,
wxMouseEventHandler(CDebugger::ScrollBlocksMouse), (wxObject*)NULL, this);
wxMouseEventHandler(DSPDebuggerHLE::ScrollBlocksMouse), (wxObject*)NULL, this);
m_bl95->Connect(wxID_ANY, wxEVT_MOUSEWHEEL,
wxMouseEventHandler(CDebugger::ScrollBlocksMouse), (wxObject*)NULL, this);
wxMouseEventHandler(DSPDebuggerHLE::ScrollBlocksMouse), (wxObject*)NULL, this);
}
CDebugger::~CDebugger()
DSPDebuggerHLE::~DSPDebuggerHLE()
{
// empty
IniFile file;
@ -154,7 +154,7 @@ CDebugger::~CDebugger()
// ========================================================================
// System functions
// --------------
void CDebugger::OnClose(wxCloseEvent& /*event*/)
void DSPDebuggerHLE::OnClose(wxCloseEvent& /*event*/)
{
// Save the window position when we hide the window to
IniFile file;
@ -165,18 +165,7 @@ void CDebugger::OnClose(wxCloseEvent& /*event*/)
EndModal(0);
}
void CDebugger::DoHide()
{
Hide();
}
void CDebugger::DoShow()
{
Show();
DoShowConsole(); // The console goes with the wx window
}
void CDebugger::OnUpdate(wxCommandEvent& /*event*/)
void DSPDebuggerHLE::OnUpdate(wxCommandEvent& /*event*/)
{
this->NotifyUpdate();
}
@ -186,19 +175,18 @@ void CDebugger::OnUpdate(wxCommandEvent& /*event*/)
// ==========================================================================
// Save and load settings
// --------------
void CDebugger::Save(IniFile& _IniFile) const
void DSPDebuggerHLE::Save(IniFile& _IniFile) const
{
// TODO2: get the screen resolution and make limits from that
if(GetPosition().x < 1000 && GetPosition().y < 1000
&& GetSize().GetWidth() < 1000 && GetSize().GetHeight() < 1000
)
&& GetSize().GetWidth() < 1000 && GetSize().GetHeight() < 1000)
{
_IniFile.Set("SoundWindow", "x", GetPosition().x);
_IniFile.Set("SoundWindow", "y", GetPosition().y);
_IniFile.Set("SoundWindow", "w", GetSize().GetWidth());
_IniFile.Set("SoundWindow", "h", GetSize().GetHeight());
}
_IniFile.Set("SoundWindow", "Console", m_options->IsChecked(3)); // save settings
// save settings
_IniFile.Set("SoundWindow", "UpdateFrequency", m_RadioBox[1]->GetSelection());
_IniFile.Set("SoundWindow", "ScanMails", m_gcwiiset->IsChecked(0));
_IniFile.Set("SoundWindow", "StoreMails", m_gcwiiset->IsChecked(1));
@ -206,7 +194,7 @@ void CDebugger::Save(IniFile& _IniFile) const
}
void CDebugger::Load(IniFile& _IniFile)
void DSPDebuggerHLE::Load(IniFile& _IniFile)
{
int x,y,w,h;
_IniFile.Get("SoundWindow", "x", &x, GetPosition().x);
@ -215,12 +203,6 @@ void CDebugger::Load(IniFile& _IniFile)
_IniFile.Get("SoundWindow", "h", &h, GetSize().GetHeight());
SetSize(x, y, w, h);
// Show console or not
bool Console;
_IniFile.Get("SoundWindow", "Console", &Console, m_options->IsChecked(3));
m_options->Check(3, Console);
DoShowConsole();
// Show number base
_IniFile.Get("SoundWindow", "ShowBase", &bShowBase, !m_RadioBox[0]->GetSelection());
m_RadioBox[0]->SetSelection(!bShowBase);
@ -241,7 +223,7 @@ void CDebugger::Load(IniFile& _IniFile)
//////////////////////////////////////////////////////////////////////////////////////////
// Create GUI controls
// -------------
void CDebugger::CreateGUIControls()
void DSPDebuggerHLE::CreateGUIControls()
{
SetTitle(wxT("Sound Debugging"));
@ -350,12 +332,10 @@ SetTitle(wxT("Sound Debugging"));
m_options->Append(wxT("Save to file"));
m_options->Append(wxT("Only looping"));
m_options->Append(wxT("Show all"));
m_options->Append(wxT("Show console"));
m_options->Check(0, gSaveFile);
m_options->Check(1, gOnlyLooping);
m_options->Check(2, gShowAll);
m_options->Check(3, gSaveFile);
m_options->SetMinSize(wxSize(m_options->GetSize().GetWidth() - 40,
m_options->GetCount() * 15));
@ -563,7 +543,7 @@ SetTitle(wxT("Sound Debugging"));
// =======================================================================================
// Settings
void CDebugger::OnSettingsCheck(wxCommandEvent& event)
void DSPDebuggerHLE::OnSettingsCheck(wxCommandEvent& event)
{
gSSBM = m_settings->IsChecked(0);
gSSBMremedy1 = m_settings->IsChecked(1);
@ -576,12 +556,12 @@ void CDebugger::OnSettingsCheck(wxCommandEvent& event)
// =======================================================================================
// Change preset
void CDebugger::ChangePreset(wxCommandEvent& event)
void DSPDebuggerHLE::ChangePreset(wxCommandEvent& event)
{
DoChangePreset();
}
void CDebugger::DoChangePreset()
void DSPDebuggerHLE::DoChangePreset()
{
if(m_RadioBox[2]->GetSelection() == 0)
gPreset = 0;
@ -595,7 +575,7 @@ void CDebugger::DoChangePreset()
// =======================================================================================
// Show base
void CDebugger::ShowBase(wxCommandEvent& event)
void DSPDebuggerHLE::ShowBase(wxCommandEvent& event)
{
if(m_RadioBox[0]->GetSelection() == 0)
bShowBase = true;
@ -605,12 +585,12 @@ void CDebugger::ShowBase(wxCommandEvent& event)
// =======================================================================================
// Change update frequency
void CDebugger::ChangeFrequency(wxCommandEvent& event)
void DSPDebuggerHLE::ChangeFrequency(wxCommandEvent& event)
{
DoChangeFrequency();
}
void CDebugger::DoChangeFrequency()
void DSPDebuggerHLE::DoChangeFrequency()
{
if(m_RadioBox[1]->GetSelection() == 0)
gUpdFreq = 0;
@ -624,17 +604,14 @@ void CDebugger::DoChangeFrequency()
// =======================================================================================
// Options
void CDebugger::OnOptions(wxCommandEvent& event)
void DSPDebuggerHLE::OnOptions(wxCommandEvent& event)
{
gSaveFile = m_options->IsChecked(0);
gOnlyLooping = m_options->IsChecked(1);
gShowAll = m_options->IsChecked(2);
gSaveFile = m_options->IsChecked(3);
if(event.GetInt() == 3) DoShowConsole();
}
void CDebugger::OnShowAll(wxCommandEvent& event)
void DSPDebuggerHLE::OnShowAll(wxCommandEvent& event)
{
/// Only allow one selection at a time
for (u32 i = 0; i < m_opt_showall->GetCount(); ++i)
@ -647,24 +624,7 @@ void CDebugger::OnShowAll(wxCommandEvent& event)
else giShowAll = -1;
}
// --------------
// =======================================================================================
// Show or hide console window
void CDebugger::ShowHideConsole(wxCommandEvent& event)
{
DoShowConsole();
}
void CDebugger::DoShowConsole()
{
ConsoleListener* console = LogManager::GetInstance()->getConsoleListener();
if(m_options->IsChecked(3) && !console->IsOpen())
console->Open();
}
void CDebugger::NotifyUpdate()
void DSPDebuggerHLE::NotifyUpdate()
{
if (m_GPRListView != NULL)
{

View File

@ -19,8 +19,8 @@
//
//////////////////////////////////////////////////////////////////////////////////////////
#ifndef __CDebugger_h__
#define __CDebugger_h__
#ifndef __DSPDebuggerHLE_h__
#define __DSPDebuggerHLE_h__
// general things
#include <iostream>
@ -51,42 +51,41 @@
class CPBView;
class IniFile;
// Window settings
#undef CDebugger_STYLE
#define CDebugger_STYLE wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN | wxNO_FULL_REPAINT_ON_RESIZE
class CDebugger : public wxDialog
class DSPDebuggerHLE : public wxDialog
{
private:
DECLARE_EVENT_TABLE();
public:
CDebugger(wxWindow *parent, wxWindowID id = 1, const wxString &title = _("Sound Debugger"),
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = CDebugger_STYLE);
DSPDebuggerHLE(wxWindow *parent,
wxWindowID id = 1,
const wxString &title = wxT("Sound Debugger"),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE);
virtual ~CDebugger();
virtual ~DSPDebuggerHLE();
void Save(IniFile& _IniFile) const;
void Load(IniFile& _IniFile);
void DoHide(); void DoShow();
void NotifyUpdate();
void OnUpdate(wxCommandEvent& event);
void ShowHideConsole(wxCommandEvent& event); // options
// options
void ShowBase(wxCommandEvent& event);
void DoShowConsole();
//void OnlyLooping(wxCommandEvent& event);
void OnOptions(wxCommandEvent& event);
void OnShowAll(wxCommandEvent& event);
void ChangeFrequency(wxCommandEvent& event); // update frequency
// update frequency
void ChangeFrequency(wxCommandEvent& event);
void DoChangeFrequency();
void ChangePreset(wxCommandEvent& event);
void DoChangePreset();
void OnSettingsCheck(wxCommandEvent& event); // settings
// settings
void OnSettingsCheck(wxCommandEvent& event);
// ============== Mail
void DoUpdateMail();
@ -161,8 +160,6 @@ class CDebugger : public wxDialog
ID_NOTEBOOK, ID_PAGEMAIN, ID_PAGEMAIL, ID_PAGEBLOCK, // notebook
ID_LOG, ID_LOG1, // mails
ID_BL0, ID_BL95, ID_BL94, ID_BL93, ID_BL92,
ID_DUMMY_VALUE_ //don't remove this value unless you have other enum values
};
void OnClose(wxCloseEvent& event);

View File

@ -27,7 +27,7 @@
#if defined(HAVE_WX) && HAVE_WX
#include "../Debugger/Debugger.h"
extern CDebugger* m_frame;
extern DSPDebuggerHLE* m_DebuggerFrame;
#endif
#include "../Debugger/File.h"
@ -88,7 +88,7 @@ int PrintFile(int a, char *fmt, ...)
{
#if defined(DEBUG_HLE) && defined(_WIN32)
if(m_frame->gSaveFile)
if(m_DebuggerFrame->gSaveFile)
{
char s[StringSize];
va_list argptr;

View File

@ -51,7 +51,7 @@
// -------------
// Externals
extern CDebugger* m_frame;
extern DSPDebuggerHLE* m_DebuggerFrame;
//int PBSize = 128;
// Parameter blocks
@ -148,7 +148,7 @@ std::vector<int> numberRunning(NUMBER_OF_PBS);
// Classes
extern CDebugger* m_frame;
extern DSPDebuggerHLE* m_DebuggerFrame;
//////////////////////////
@ -160,7 +160,7 @@ std::string writeTitle(int a, bool Wii)
std::string b;
if(a == 0)
{
if(m_frame->bShowBase) // show base 10
if(m_DebuggerFrame->bShowBase) // show base 10
{
b = " adpcm adpcm_loop\n";
b = b + " Nr m pos / end lpos | voll volr | isl iss | pre yn1 yn2 pre yn1 yn2 | frac ratio[hi lo]\n";
@ -173,7 +173,7 @@ std::string writeTitle(int a, bool Wii)
}
else if(a == 1)
{
if(m_frame->bShowBase) // show base 10
if(m_DebuggerFrame->bShowBase) // show base 10
{
b = " Nr pos / end lpos | voll volr | src form coef | 1 2 3 4 5 addr value\n";
}
@ -184,7 +184,7 @@ std::string writeTitle(int a, bool Wii)
}
else if(a == 2)
{
if(m_frame->bShowBase) // show base 10
if(m_DebuggerFrame->bShowBase) // show base 10
{
b = " Nr pos / end lpos | voll volr | isl iss | e-l e-s\n";
}
@ -195,7 +195,7 @@ std::string writeTitle(int a, bool Wii)
}
else if(a == 3)
{
if(m_frame->bShowBase) // show base 10
if(m_DebuggerFrame->bShowBase) // show base 10
{
if(Wii)
b = " Nr voll volr dl dr curv delt mixc r | v1 v2 v3 v4 v5 v6 v7 | d1 d2 d3 d4 d5 d6 d7\n";
@ -244,7 +244,7 @@ std::string writeMessage(int a, int i, bool Wii)
*/
if(a == 0)
{
if(m_frame->bShowBase) // base 10 (decimal)
if(m_DebuggerFrame->bShowBase) // base 10 (decimal)
{
if(Wii) // Wii
{
@ -280,7 +280,7 @@ std::string writeMessage(int a, int i, bool Wii)
}
else if(a == 1)
{
if(m_frame->bShowBase) // base 10 (decimal)
if(m_DebuggerFrame->bShowBase) // base 10 (decimal)
{
sprintf(buf,"%c%02i %10s/%10s %10s | %6s %6s | %u %u %u | %u %u %u %u %u %08x %08x %08x %08x %08x %08x",
223, i, ThS(gsamplePos[i]).c_str(), ThS(gsampleEnd[i]).c_str(), ThS(gloopPos[i]).c_str(),
@ -316,7 +316,7 @@ std::string writeMessage(int a, int i, bool Wii)
}
else if(a == 2)
{
if(m_frame->bShowBase)
if(m_DebuggerFrame->bShowBase)
{
sprintf(buf,"%c%02i %10s/%10s %10s | %05i %05i | %i %i | %10s %10s",
223, i, ThS(gsamplePos[i]).c_str(), ThS(gsampleEnd[i]).c_str(), ThS(gloopPos[i]).c_str(),
@ -342,7 +342,7 @@ std::string writeMessage(int a, int i, bool Wii)
*/
else if(a == 3)
{
if(m_frame->bShowBase)
if(m_DebuggerFrame->bShowBase)
{
if(Wii) // Wii
{
@ -532,23 +532,23 @@ bool PrepareConditions(bool Wii, int i, ParamBlockType &PBs)
{
bool Conditions;
if (m_frame->gOnlyLooping) // show only looping blocks
if (m_DebuggerFrame->gOnlyLooping) // show only looping blocks
{
Conditions = PBs[i].audio_addr.looping ? true : false;
}
else if (m_frame->gShowAll) // show all blocks
else if (m_DebuggerFrame->gShowAll) // show all blocks
{
Conditions = true;
}
else if (m_frame->giShowAll > -1) // show all blocks
else if (m_DebuggerFrame->giShowAll > -1) // show all blocks
{
if (m_frame->giShowAll == 0)
if (m_DebuggerFrame->giShowAll == 0)
Conditions = (i < 31);
else if(m_frame->giShowAll == 1)
else if(m_DebuggerFrame->giShowAll == 1)
Conditions = (i > 30 && i < 61);
else if(m_frame->giShowAll == 2)
else if(m_DebuggerFrame->giShowAll == 2)
Conditions = (i > 60 && i < 91);
else if(m_frame->giShowAll == 3)
else if(m_DebuggerFrame->giShowAll == 3)
Conditions = (i > 90 && i < 121);
}
else // show only the ones that have recently been running
@ -640,7 +640,7 @@ void Logging_(short* _pBuffer, int _iSize, int a, bool Wii, ParamBlockType &PBs,
// Control how often the screen is updated, and then update the screen
// --------------
if(a == 0) count1++; // a == 0 when Logging is called before the blocks are updated
if (m_frame->gUpdFreq > 0 && count1 > (200/m_frame->gUpdFreq))
if (m_DebuggerFrame->gUpdFreq > 0 && count1 > (200/m_DebuggerFrame->gUpdFreq))
{
// =======================================================================================
@ -712,7 +712,7 @@ void Logging_(short* _pBuffer, int _iSize, int a, bool Wii, ParamBlockType &PBs,
// --------------
char buffer [1000] = "";
std::string sbuff;
sbuff = writeTitle(m_frame->gPreset, Wii);
sbuff = writeTitle(m_DebuggerFrame->gPreset, Wii);
// ==============
@ -733,7 +733,7 @@ void Logging_(short* _pBuffer, int _iSize, int a, bool Wii, ParamBlockType &PBs,
// --------------------------------------
// Save playback history text string for the console and GUI debugger
// ------------------
if(m_frame)
if(m_DebuggerFrame)
{
std::string guipr; // gui progress
@ -750,7 +750,7 @@ void Logging_(short* _pBuffer, int _iSize, int a, bool Wii, ParamBlockType &PBs,
}
u32 run = atoi( guipr.c_str());
m_frame->m_GPRListView->m_CachedRegs[1][i] = run;
m_DebuggerFrame->m_GPRListView->m_CachedRegs[1][i] = run;
guipr.clear();
}
@ -771,41 +771,41 @@ void Logging_(short* _pBuffer, int _iSize, int a, bool Wii, ParamBlockType &PBs,
// Hopefully this is false if we don't have a debugging window and so it doesn't cause a crash
if(m_frame)
if(m_DebuggerFrame)
{
m_frame->m_GPRListView->m_CachedRegs[2][i] = gsamplePos[i];
m_frame->m_GPRListView->m_CachedRegs[3][i] = gsampleEnd[i];
m_frame->m_GPRListView->m_CachedRegs[4][i] = gloopPos[i];
m_DebuggerFrame->m_GPRListView->m_CachedRegs[2][i] = gsamplePos[i];
m_DebuggerFrame->m_GPRListView->m_CachedRegs[3][i] = gsampleEnd[i];
m_DebuggerFrame->m_GPRListView->m_CachedRegs[4][i] = gloopPos[i];
m_frame->m_GPRListView->m_CachedRegs[5][i] = gvolume_left[i];
m_frame->m_GPRListView->m_CachedRegs[6][i] = gvolume_right[i];
m_DebuggerFrame->m_GPRListView->m_CachedRegs[5][i] = gvolume_left[i];
m_DebuggerFrame->m_GPRListView->m_CachedRegs[6][i] = gvolume_right[i];
m_frame->m_GPRListView->m_CachedRegs[7][i] = glooping[i];
m_frame->m_GPRListView->m_CachedRegs[8][i] = gloop1[i];
m_frame->m_GPRListView->m_CachedRegs[9][i] = gloop2[i];
m_frame->m_GPRListView->m_CachedRegs[10][i] = gloop3[i];
m_DebuggerFrame->m_GPRListView->m_CachedRegs[7][i] = glooping[i];
m_DebuggerFrame->m_GPRListView->m_CachedRegs[8][i] = gloop1[i];
m_DebuggerFrame->m_GPRListView->m_CachedRegs[9][i] = gloop2[i];
m_DebuggerFrame->m_GPRListView->m_CachedRegs[10][i] = gloop3[i];
m_frame->m_GPRListView->m_CachedRegs[11][i] = gis_stream[i];
m_DebuggerFrame->m_GPRListView->m_CachedRegs[11][i] = gis_stream[i];
m_frame->m_GPRListView->m_CachedRegs[12][i] = gaudioFormat[i];
m_frame->m_GPRListView->m_CachedRegs[13][i] = gsrc_type[i];
m_frame->m_GPRListView->m_CachedRegs[14][i] = gcoef[i];
m_DebuggerFrame->m_GPRListView->m_CachedRegs[12][i] = gaudioFormat[i];
m_DebuggerFrame->m_GPRListView->m_CachedRegs[13][i] = gsrc_type[i];
m_DebuggerFrame->m_GPRListView->m_CachedRegs[14][i] = gcoef[i];
m_frame->m_GPRListView->m_CachedRegs[15][i] = gfrac[i];
m_DebuggerFrame->m_GPRListView->m_CachedRegs[15][i] = gfrac[i];
m_frame->m_GPRListView->m_CachedRegs[16][i] = gratio[i];
m_frame->m_GPRListView->m_CachedRegs[17][i] = gratiohi[i];
m_frame->m_GPRListView->m_CachedRegs[18][i] = gratiolo[i];
m_DebuggerFrame->m_GPRListView->m_CachedRegs[16][i] = gratio[i];
m_DebuggerFrame->m_GPRListView->m_CachedRegs[17][i] = gratiohi[i];
m_DebuggerFrame->m_GPRListView->m_CachedRegs[18][i] = gratiolo[i];
m_frame->m_GPRListView->m_CachedRegs[19][i] = gupdates1[i];
m_frame->m_GPRListView->m_CachedRegs[20][i] = gupdates2[i];
m_frame->m_GPRListView->m_CachedRegs[21][i] = gupdates3[i];
m_frame->m_GPRListView->m_CachedRegs[22][i] = gupdates4[i];
m_frame->m_GPRListView->m_CachedRegs[23][i] = gupdates5[i];
m_DebuggerFrame->m_GPRListView->m_CachedRegs[19][i] = gupdates1[i];
m_DebuggerFrame->m_GPRListView->m_CachedRegs[20][i] = gupdates2[i];
m_DebuggerFrame->m_GPRListView->m_CachedRegs[21][i] = gupdates3[i];
m_DebuggerFrame->m_GPRListView->m_CachedRegs[22][i] = gupdates4[i];
m_DebuggerFrame->m_GPRListView->m_CachedRegs[23][i] = gupdates5[i];
}
// add new line
sbuff = sbuff + writeMessage(m_frame->gPreset, i, Wii); strcpy(buffer, "");
sbuff = sbuff + writeMessage(m_DebuggerFrame->gPreset, i, Wii); strcpy(buffer, "");
sbuff = sbuff + "\n";
} // end of if(Conditions)
@ -818,13 +818,13 @@ void Logging_(short* _pBuffer, int _iSize, int a, bool Wii, ParamBlockType &PBs,
// Write global values
// ---------------
int nOfBlocks;
int span = m_frame->gLastBlock - m_addressPBs;
int span = m_DebuggerFrame->gLastBlock - m_addressPBs;
if(Wii)
nOfBlocks = (m_frame->gLastBlock-m_addressPBs) / 256;
nOfBlocks = (m_DebuggerFrame->gLastBlock-m_addressPBs) / 256;
else
nOfBlocks = (m_frame->gLastBlock-m_addressPBs) / 192;
nOfBlocks = (m_DebuggerFrame->gLastBlock-m_addressPBs) / 192;
sprintf(buffer, "\nThe parameter blocks span from %08x to %08x (%s bytes) impl. %i blocks | numberOfPBs %i | _iSize %i\n",
m_addressPBs, m_frame->gLastBlock, ThS(span).c_str(), nOfBlocks, numberOfPBs, _iSize);
m_addressPBs, m_DebuggerFrame->gLastBlock, ThS(span).c_str(), nOfBlocks, numberOfPBs, _iSize);
sbuff = sbuff + buffer; strcpy(buffer, "");
// ===============
@ -834,7 +834,7 @@ void Logging_(short* _pBuffer, int _iSize, int a, bool Wii, ParamBlockType &PBs,
// ---------------
sprintf(buffer, "\nSettings: SSBM fix %i | SSBM rem1 %i | SSBM rem2 %i\nSequenced %i | Volume %i | Reset %i | Only looping %i | Save file %i\n",
gSSBM, gSSBMremedy1, gSSBMremedy2, gSequenced,
gVolume, gReset, m_frame->gOnlyLooping, m_frame->gSaveFile);
gVolume, gReset, m_DebuggerFrame->gOnlyLooping, m_DebuggerFrame->gSaveFile);
sbuff = sbuff + buffer; strcpy(buffer, "");
// ===============
@ -895,9 +895,9 @@ void Logging_(short* _pBuffer, int _iSize, int a, bool Wii, ParamBlockType &PBs,
// New values are written so update - DISABLED - It flickered a lot, even worse than a
// console window. So for now only the console windows is updated.
/*
if(m_frame)
if(m_DebuggerFrame)
{
m_frame->NotifyUpdate();
m_DebuggerFrame->NotifyUpdate();
}
*/
@ -914,7 +914,7 @@ void CUCode_AX::Logging(short* _pBuffer, int _iSize, int a, bool Wii)
{
/* Doing all this may have a noticable CPU effect, so we can disable it completely
this way. But remember that "Save to file" will not write anything then either. */
if (m_frame->gUpdFreq > 0)
if (m_DebuggerFrame->gUpdFreq > 0)
{
int version; // AX version
int numberOfPBs;

View File

@ -46,14 +46,14 @@
// Declarations and definitions
// -------------
extern std::vector<std::string> sMailLog, sMailTime;
extern CDebugger* m_frame;
extern DSPDebuggerHLE* m_DebuggerFrame;
///////////////////////////////
// =======================================================================================
// Update mail window
// --------------
void CDebugger::DoUpdateMail()
void DSPDebuggerHLE::DoUpdateMail()
{
//Console::Print("i %i %i\n", sFullMail.size(), sMailLog.size());
@ -68,17 +68,17 @@ void CDebugger::DoUpdateMail()
}
void CDebugger::UpdateMail(wxNotebookEvent& event)
void DSPDebuggerHLE::UpdateMail(wxNotebookEvent& event)
{
DoUpdateMail();
/* This may be called before m_frame is fully created through the
/* This may be called before m_DebuggerFrame is fully created through the
EVT_NOTEBOOK_PAGE_CHANGED, in that case it will crash because this
is accessing members of it */
if(StoreMails && m_frame) ReadDir();
if(StoreMails && m_DebuggerFrame) ReadDir();
}
// Change mail from radio button change
void CDebugger::ChangeMail(wxCommandEvent& event)
void DSPDebuggerHLE::ChangeMail(wxCommandEvent& event)
{
//Console::Print("abc");
DoUpdateMail();
@ -91,7 +91,7 @@ void CDebugger::ChangeMail(wxCommandEvent& event)
// =======================================================================================
// Read out mails from dir
// --------------
void CDebugger::ReadDir()
void DSPDebuggerHLE::ReadDir()
{
CFileSearch::XStringVector Directories;
//Directories.push_back("Logs/Mail");
@ -157,7 +157,7 @@ void CDebugger::ReadDir()
// =======================================================================================
// Check for duplicates and count files from all_all_files
// --------------
bool CDebugger::NoDuplicate(std::string FileName)
bool DSPDebuggerHLE::NoDuplicate(std::string FileName)
{
for (u32 i = 0; i < all_files.size(); i++)
{
@ -168,7 +168,7 @@ bool CDebugger::NoDuplicate(std::string FileName)
}
// Count the number of files for each game
u32 CDebugger::CountFiles(std::string FileName)
u32 DSPDebuggerHLE::CountFiles(std::string FileName)
{
int match = 0;
@ -187,7 +187,7 @@ u32 CDebugger::CountFiles(std::string FileName)
// =======================================================================================
// Read file from harddrive
// --------------
std::string CDebugger::Readfile_(std::string FileName)
std::string DSPDebuggerHLE::Readfile_(std::string FileName)
{
char c; // declare a char variable
FILE *file; // declare a FILE pointer
@ -220,7 +220,7 @@ std::string CDebugger::Readfile_(std::string FileName)
}
// Read file
void CDebugger::Readfile(std::string FileName, bool GC)
void DSPDebuggerHLE::Readfile(std::string FileName, bool GC)
{
u32 n = CountFiles(FileName); // count how many mails we have
u32 curr_n = 0;
@ -264,7 +264,7 @@ void CDebugger::Readfile(std::string FileName, bool GC)
// =======================================================================================
// Read the file to the text window
// ---------------
void CDebugger::OnGameChange(wxCommandEvent& event)
void DSPDebuggerHLE::OnGameChange(wxCommandEvent& event)
{
if(event.GetId() == 2006)
{
@ -286,7 +286,7 @@ void CDebugger::OnGameChange(wxCommandEvent& event)
}
// Settings
void CDebugger::MailSettings(wxCommandEvent& event)
void DSPDebuggerHLE::MailSettings(wxCommandEvent& event)
{
//for (int i = 0; i < all_all_files.size(); ++i)
//Console::Print("s: %s \n", all_all_files.at(i).c_str());

View File

@ -20,7 +20,7 @@
#if defined(HAVE_WX) && HAVE_WX
#include "../Debugger/Debugger.h"
//#include "../Logging/File.h" // For PrintFile()
extern CDebugger* m_frame;
extern DSPDebuggerHLE* m_DebuggerFrame;
#endif
#include <sstream>
#include "../Config.h"
@ -98,7 +98,7 @@ void CUCode_AX::SaveLog_(bool Wii, const char* _fmt, va_list ap)
vsprintf(Msg, _fmt, ap);
#if defined(HAVE_WX) && HAVE_WX
if(m_frame->ScanMails)
if(m_DebuggerFrame->ScanMails)
{
if(strcmp(Msg, "Begin") == 0)
@ -128,12 +128,12 @@ if(m_frame->ScanMails)
sMailLog.push_back(TmpMailLog);
// Save file to disc
if(m_frame->StoreMails)
if(m_DebuggerFrame->StoreMails)
{
SaveLogFile(TmpMailLog, saveNext, 1, Wii);
}
m_frame->DoUpdateMail(); // update the view
m_DebuggerFrame->DoUpdateMail(); // update the view
saveNext = 0;
}
}
@ -157,7 +157,7 @@ if(m_frame->ScanMails)
void CUCode_AX::SaveMail(bool Wii, u32 _uMail)
{
#if defined(HAVE_WX) && HAVE_WX
if(m_frame->ScanMails)
if(m_DebuggerFrame->ScanMails)
{
int i = 0;
std::string sTemp;
@ -192,11 +192,11 @@ if(m_frame->ScanMails)
// Compare this mail to old mails
u32 addnew = 0;
for (u32 j = 0; j < m_frame->sMail.size(); j++)
for (u32 j = 0; j < m_DebuggerFrame->sMail.size(); j++)
{
if(m_frame->sMail.at(j).length() != sTemp.length())
if(m_DebuggerFrame->sMail.at(j).length() != sTemp.length())
{
//wxMessageBox( wxString::Format("%s \n\n%s", m_frame->sMail.at(i).c_str(),
//wxMessageBox( wxString::Format("%s \n\n%s", m_DebuggerFrame->sMail.at(i).c_str(),
// sTemp.c_str()) );
addnew++;
}
@ -204,10 +204,10 @@ if(m_frame->ScanMails)
// In case the mail didn't match any saved mail, save it
if(addnew == m_frame->sMail.size())
if(addnew == m_DebuggerFrame->sMail.size())
{
//Console::Print("%i | %i\n", addnew, m_frame->sMail.size());
u32 resizeTo = (u32)(m_frame->sMail.size() + 1);
//Console::Print("%i | %i\n", addnew, m_DebuggerFrame->sMail.size());
u32 resizeTo = (u32)(m_DebuggerFrame->sMail.size() + 1);
// ------------------------------------
// get timestamp
@ -219,15 +219,15 @@ if(m_frame->ScanMails)
sMailTime.push_back(Msg);
// ------------------------------------
m_frame->sMail.push_back(sTemp); // save the main comparison mail
m_DebuggerFrame->sMail.push_back(sTemp); // save the main comparison mail
std::string lMail = sTemp + "------------------\n" + sTempEnd;
m_frame->sFullMail.push_back(lMail);
m_DebuggerFrame->sFullMail.push_back(lMail);
// enable the radio button and update view
if(resizeTo <= m_frame->m_RadioBox[3]->GetCount())
if(resizeTo <= m_DebuggerFrame->m_RadioBox[3]->GetCount())
{
m_frame->m_RadioBox[3]->Enable(resizeTo - 1, true);
m_frame->m_RadioBox[3]->Select(resizeTo - 1);
m_DebuggerFrame->m_RadioBox[3]->Enable(resizeTo - 1, true);
m_DebuggerFrame->m_RadioBox[3]->Select(resizeTo - 1);
}
addnew = 0;
@ -235,9 +235,9 @@ if(m_frame->ScanMails)
// ------------------------------------
// Save as file
if(m_frame->StoreMails)
if(m_DebuggerFrame->StoreMails)
{
//Console::Print("m_frame->sMail.size(): %i | resizeTo:%i\n", m_frame->sMail.size(), resizeTo);
//Console::Print("m_DebuggerFrame->sMail.size(): %i | resizeTo:%i\n", m_DebuggerFrame->sMail.size(), resizeTo);
SaveLogFile(lMail, resizeTo, 0, Wii);
}
@ -268,7 +268,7 @@ int ReadOutPBs(u32 pbs_address, AXParamBlock* _pPBs, int _num)
#if defined(HAVE_WX) && HAVE_WX
#if defined(_DEBUG) || defined(DEBUGFAST)
if(m_frame) m_frame->gLastBlock = blockAddr + p*2 + 2; // save last block location
if(m_DebuggerFrame) m_DebuggerFrame->gLastBlock = blockAddr + p*2 + 2; // save last block location
#endif
#endif
}
@ -321,7 +321,7 @@ void CUCode_AX::MixAdd(short* _pBuffer, int _iSize)
#if defined(HAVE_WX) && HAVE_WX
// write logging data to debugger
if (m_frame && _pBuffer)
if (m_DebuggerFrame && _pBuffer)
{
CUCode_AX::Logging(_pBuffer, _iSize, 0, false);
}
@ -408,7 +408,7 @@ void CUCode_AX::MixAdd(short* _pBuffer, int _iSize)
}
#if defined(HAVE_WX) && HAVE_WX
// write logging data to debugger again after the update
if (m_frame && _pBuffer)
if (m_DebuggerFrame && _pBuffer)
{
CUCode_AX::Logging(_pBuffer, _iSize, 1, false);
}
@ -453,7 +453,7 @@ void CUCode_AX::SaveLog(const char* _fmt, ...)
{
#if defined(HAVE_WX) && HAVE_WX
va_list ap; va_start(ap, _fmt);
if(m_frame) SaveLog_(false, _fmt, ap);
if(m_DebuggerFrame) SaveLog_(false, _fmt, ap);
va_end(ap);
#endif
}
@ -488,7 +488,7 @@ bool CUCode_AX::AXTask(u32& _uMail)
bool bExecuteList = true;
#if defined(HAVE_WX) && HAVE_WX
if(m_frame) SaveMail(false, _uMail); // Save mail for debugging
if(m_DebuggerFrame) SaveMail(false, _uMail); // Save mail for debugging
#endif
while (bExecuteList)
{

View File

@ -20,7 +20,7 @@
#if defined(HAVE_WX) && HAVE_WX
#include "../Debugger/Debugger.h"
//#include "../Logging/File.h" // For PrintFile
extern CDebugger * m_frame;
extern DSPDebuggerHLE * m_DebuggerFrame;
#endif
#include "../MailHandler.h"
@ -110,7 +110,7 @@ void CUCode_AXWii::MixAdd_(short* _pBuffer, int _iSize, ParamBlockType &PBs)
// -------------------------------------------
// write logging data to debugger
#if defined(HAVE_WX) && HAVE_WX
if (m_frame && _pBuffer)
if (m_DebuggerFrame && _pBuffer)
{
lCUCode_AX->Logging(_pBuffer, _iSize, 0, true);
@ -119,7 +119,7 @@ void CUCode_AXWii::MixAdd_(short* _pBuffer, int _iSize, ParamBlockType &PBs)
int p = numberOfPBs - 1;
if(numberOfPBs > p)
{
if(PBs[p].running && !m_frame->upd95)
if(PBs[p].running && !m_DebuggerFrame->upd95)
{
const u32 blockAddr = (u32)(PBs[p].this_pb_hi<< 16) | PBs[p].this_pb_lo;
const short *pSrc = (const short *)g_dspInitialize.pGetMemoryPointer(blockAddr);
@ -127,24 +127,24 @@ void CUCode_AXWii::MixAdd_(short* _pBuffer, int _iSize, ParamBlockType &PBs)
{
if(i == 10 || i == 34 || i == 41 || i == 46 || i == 46 || i == 58 || i == 60
|| i == 68 || i == 88 || i == 95)
{m_frame->str0 += "\n"; m_frame->str95 += "\n";}
{m_DebuggerFrame->str0 += "\n"; m_DebuggerFrame->str95 += "\n";}
std::string line = StringFromFormat("%02i|%02i : %s : %s",
i/2, i,
m_frame->PBn[i].c_str(), m_frame->PBp[i].c_str()
m_DebuggerFrame->PBn[i].c_str(), m_DebuggerFrame->PBp[i].c_str()
);
for (u32 j = 0; j < 50 - line.length(); ++j)
line += " ";
m_frame->str0 += line;
m_DebuggerFrame->str0 += line;
m_frame->str0 += "\n";
m_frame->str95 += StringFromFormat(" : %02i|%02i : %04x%04x\n",
m_DebuggerFrame->str0 += "\n";
m_DebuggerFrame->str95 += StringFromFormat(" : %02i|%02i : %04x%04x\n",
i/2, i,
Common::swap16(pSrc[i]), Common::swap16(pSrc[i+1]));
}
m_frame->m_bl95->AppendText(wxString::FromAscii(m_frame->str95.c_str()));
m_frame->m_bl0->AppendText(wxString::FromAscii(m_frame->str0.c_str()));
m_frame->upd95 = true;
m_DebuggerFrame->m_bl95->AppendText(wxString::FromAscii(m_DebuggerFrame->str95.c_str()));
m_DebuggerFrame->m_bl0->AppendText(wxString::FromAscii(m_DebuggerFrame->str0.c_str()));
m_DebuggerFrame->upd95 = true;
}
}
}
@ -217,7 +217,7 @@ void CUCode_AXWii::MixAdd_(short* _pBuffer, int _iSize, ParamBlockType &PBs)
#if defined(HAVE_WX) && HAVE_WX
// write logging data to debugger again after the update
if (m_frame && _pBuffer)
if (m_DebuggerFrame && _pBuffer)
{
lCUCode_AX->Logging(_pBuffer, _iSize, 1, true);
}
@ -241,7 +241,7 @@ void CUCode_AXWii::SaveLog(const char* _fmt, ...)
#if defined(HAVE_WX) && HAVE_WX
va_list ap;
va_start(ap, _fmt);
if(m_frame)
if(m_DebuggerFrame)
lCUCode_AX->SaveLog_(true, _fmt, ap);
va_end(ap);
#endif
@ -271,7 +271,7 @@ bool CUCode_AXWii::AXTask(u32& _uMail)
bool bExecuteList = true;
#if defined(HAVE_WX) && HAVE_WX
if(m_frame) lCUCode_AX->SaveMail(true, uAddress); // Save mail for debugging
if(m_DebuggerFrame) lCUCode_AX->SaveMail(true, uAddress); // Save mail for debugging
#endif
if (false)
{

View File

@ -60,7 +60,7 @@ inline int ReadOutPBsWii(u32 pbs_address, ParamBlockType& _pPBs, int _num)
#if defined(HAVE_WX) && HAVE_WX
#if defined(_DEBUG) || defined(DEBUGFAST)
if(m_frame) m_frame->gLastBlock = blockAddr + p*2 + 2; // save last block location
if(m_DebuggerFrame) m_DebuggerFrame->gLastBlock = blockAddr + p*2 + 2; // save last block location
#endif
#endif
}

View File

@ -21,9 +21,10 @@
#if defined(HAVE_WX) && HAVE_WX
#include "ConfigDlg.h"
DSPConfigDialogHLE* m_ConfigFrame = NULL;
#include "Debugger/File.h" // For file logging
#include "Debugger/Debugger.h" // For the CDebugger class
CDebugger* m_frame = NULL;
#include "Debugger/Debugger.h"
DSPDebuggerHLE* m_DebuggerFrame = NULL;
#endif
#include "ChunkFile.h"
@ -65,7 +66,10 @@ struct DSPState
};
DSPState g_dspState;
// wxWidgets: Create the wxApp
// Standard crap to make wxWidgets happy
#ifdef _WIN32
HINSTANCE g_hInstance;
#if defined(HAVE_WX) && HAVE_WX
class wxDLLApp : public wxApp
{
@ -74,72 +78,69 @@ class wxDLLApp : public wxApp
return true;
}
};
IMPLEMENT_APP_NO_MAIN(wxDLLApp)
IMPLEMENT_APP_NO_MAIN(wxDLLApp)
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
#endif
// DllMain
#ifdef _WIN32
HINSTANCE g_hInstance = NULL;
BOOL APIENTRY DllMain(HINSTANCE hinstDLL, // DLL module handle
DWORD dwReason, // reason called
LPVOID lpvReserved) // reserved
BOOL APIENTRY DllMain(HINSTANCE hinstDLL, // DLL module handle
DWORD dwReason, // reason called
LPVOID lpvReserved) // reserved
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
{
// more stuff wx needs
#if defined(HAVE_WX) && HAVE_WX
wxSetInstance((HINSTANCE)hinstDLL);
int argc = 0;
char **argv = NULL;
wxEntryStart(argc, argv);
// This is for ?
if ( !wxTheApp || !wxTheApp->CallOnInit() )
if (!wxTheApp || !wxTheApp->CallOnInit())
return FALSE;
#endif
}
break;
break;
case DLL_PROCESS_DETACH:
wxEntryCleanup(); // use this or get a crash
#if defined(HAVE_WX) && HAVE_WX
wxEntryCleanup();
#endif
break;
default:
break;
}
g_hInstance = hinstDLL;
return(TRUE);
return TRUE;
}
#endif
#if defined(HAVE_WX) && HAVE_WX
wxWindow* GetParentedWxWindow(HWND Parent)
{
#ifdef _WIN32
wxSetInstance((HINSTANCE)g_hInstance);
#endif
wxWindow *win = new wxWindow();
#ifdef _WIN32
win->SetHWND((WXHWND)Parent);
win->AdoptAttributesFromHWND();
#endif
return win;
}
#endif
// Exported fuctions
// Create debugging window - We could use use wxWindow win; new CDebugger(win)
// like nJoy but I don't know why it would be better. - There's a lockup
// problem with ShowModal(), but Show() doesn't work because then
// DLL_PROCESS_DETACH is called immediately after DLL_PROCESS_ATTACH.
void DllDebugger(HWND _hParent, bool Show)
{
#if defined(HAVE_WX) && HAVE_WX
if (m_frame && Show) // if we have created it, let us show it again
{
m_frame->DoShow();
}
else if (!m_frame && Show)
{
m_frame = new CDebugger(NULL);
m_frame->Show();
}
else if (m_frame && !Show)
{
m_frame->DoHide();
}
if (!m_DebuggerFrame)
m_DebuggerFrame = new DSPDebuggerHLE(GetParentedWxWindow(_hParent));
if (Show)
m_DebuggerFrame->Show();
else
m_DebuggerFrame->Hide();
#endif
}
@ -169,18 +170,23 @@ void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals)
void DllConfig(HWND _hParent)
{
#if defined(HAVE_WX) && HAVE_WX
// (shuffle2) TODO: reparent dlg with DolphinApp
ConfigDialog dlg(NULL);
if (!m_ConfigFrame)
m_ConfigFrame = new DSPConfigDialogHLE(GetParentedWxWindow(_hParent));
// add backends
std::vector<std::string> backends = AudioCommon::GetSoundBackends();
for (std::vector<std::string>::const_iterator iter = backends.begin();
iter != backends.end(); ++iter) {
dlg.AddBackend((*iter).c_str());
iter != backends.end(); ++iter)
{
m_ConfigFrame->AddBackend((*iter).c_str());
}
// Show the window
dlg.ShowModal();
// Only allow one open at a time
if (!m_ConfigFrame->IsShown())
m_ConfigFrame->ShowModal();
else
m_ConfigFrame->Hide();
#endif
}
@ -211,12 +217,12 @@ void Shutdown()
#if defined(HAVE_WX) && HAVE_WX
// Reset mails
if (m_frame)
if (m_DebuggerFrame)
{
sMailLog.clear();
sMailTime.clear();
m_frame->sMail.clear();
m_frame->sMailEnd.clear();
m_DebuggerFrame->sMail.clear();
m_DebuggerFrame->sMailEnd.clear();
}
#endif

View File

@ -23,7 +23,7 @@
#if defined(HAVE_WX) && HAVE_WX
#include "Debugger/Debugger.h"
extern CDebugger* m_frame;
extern DSPDebuggerHLE* m_DebuggerFrame;
#endif
extern SoundStream *soundStream;