2009-07-28 21:32:10 +00:00
|
|
|
// Copyright (C) 2003 Dolphin Project.
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0.
|
|
|
|
|
|
|
|
// This program 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 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official SVN repository and contact information can be found at
|
|
|
|
// http://code.google.com/p/dolphin-emu/
|
|
|
|
|
2009-08-27 16:08:43 +00:00
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Include
|
2009-08-27 16:08:43 +00:00
|
|
|
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
2009-02-23 06:15:48 +00:00
|
|
|
#include "Common.h"
|
|
|
|
|
|
|
|
#include <wx/button.h>
|
|
|
|
#include <wx/textctrl.h>
|
|
|
|
#include <wx/textdlg.h>
|
|
|
|
#include <wx/listctrl.h>
|
|
|
|
#include <wx/thread.h>
|
|
|
|
#include <wx/mstream.h>
|
|
|
|
#include <wx/tipwin.h>
|
|
|
|
#include <wx/fontdlg.h>
|
|
|
|
|
|
|
|
// ugly that this lib included code from the main
|
2009-02-24 19:31:32 +00:00
|
|
|
#include "../../DolphinWX/Src/WxUtils.h"
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
#include "Host.h"
|
|
|
|
|
|
|
|
#include "Debugger.h"
|
2009-06-21 08:39:21 +00:00
|
|
|
#include "DebuggerUIUtil.h"
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
#include "RegisterWindow.h"
|
|
|
|
#include "BreakpointWindow.h"
|
|
|
|
#include "MemoryWindow.h"
|
|
|
|
#include "JitWindow.h"
|
2009-02-24 19:31:32 +00:00
|
|
|
#include "FileUtil.h"
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
#include "CodeWindow.h"
|
|
|
|
#include "CodeView.h"
|
|
|
|
|
|
|
|
#include "Core.h"
|
|
|
|
#include "HLE/HLE.h"
|
|
|
|
#include "Boot/Boot.h"
|
|
|
|
#include "LogManager.h"
|
|
|
|
#include "HW/CPU.h"
|
|
|
|
#include "PowerPC/PowerPC.h"
|
|
|
|
#include "Debugger/PPCDebugInterface.h"
|
|
|
|
#include "Debugger/Debugger_SymbolMap.h"
|
|
|
|
#include "PowerPC/PPCAnalyst.h"
|
|
|
|
#include "PowerPC/Profiler.h"
|
2009-06-21 08:39:21 +00:00
|
|
|
#include "PowerPC/PPCSymbolDB.h"
|
2009-02-23 06:15:48 +00:00
|
|
|
#include "PowerPC/SignatureDB.h"
|
|
|
|
#include "PowerPC/PPCTables.h"
|
|
|
|
#include "PowerPC/Jit64/Jit.h"
|
2009-02-23 20:29:55 +00:00
|
|
|
#include "PowerPC/JitCommon/JitCache.h" // for ClearCache()
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
#include "PluginManager.h"
|
|
|
|
#include "ConfigManager.h"
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" // Bitmaps
|
|
|
|
{
|
|
|
|
#include "../resources/toolbar_play.c"
|
|
|
|
#include "../resources/toolbar_pause.c"
|
|
|
|
#include "../resources/toolbar_add_memorycheck.c"
|
|
|
|
#include "../resources/toolbar_delete.c"
|
|
|
|
#include "../resources/toolbar_add_breakpoint.c"
|
|
|
|
}
|
2009-08-27 16:08:43 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
|
2009-08-27 16:08:43 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Symbols, JIT, Profiler
|
|
|
|
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
2009-02-23 06:15:48 +00:00
|
|
|
void CCodeWindow::CreateSymbolsMenu()
|
|
|
|
{
|
|
|
|
wxMenu *pSymbolsMenu = new wxMenu;
|
|
|
|
pSymbolsMenu->Append(IDM_CLEARSYMBOLS, _T("&Clear symbols"));
|
|
|
|
// pSymbolsMenu->Append(IDM_CLEANSYMBOLS, _T("&Clean symbols (zz)"));
|
|
|
|
pSymbolsMenu->Append(IDM_SCANFUNCTIONS, _T("&Generate symbol map"));
|
|
|
|
pSymbolsMenu->AppendSeparator();
|
|
|
|
pSymbolsMenu->Append(IDM_LOADMAPFILE, _T("&Load symbol map"));
|
|
|
|
pSymbolsMenu->Append(IDM_SAVEMAPFILE, _T("&Save symbol map"));
|
|
|
|
pSymbolsMenu->AppendSeparator();
|
|
|
|
pSymbolsMenu->Append(IDM_SAVEMAPFILEWITHCODES, _T("Save code"),
|
|
|
|
wxString::FromAscii("Save the entire disassembled code. This may take a several seconds"
|
|
|
|
" and may require between 50 and 100 MB of hard drive space. It will only save code"
|
|
|
|
" that are in the first 4 MB of memory, if you are debugging a game that load .rel"
|
|
|
|
" files with code to memory you may want to increase that to perhaps 8 MB, you can do"
|
|
|
|
" that from SymbolDB::SaveMap().")
|
|
|
|
);
|
|
|
|
|
|
|
|
pSymbolsMenu->AppendSeparator();
|
|
|
|
pSymbolsMenu->Append(IDM_CREATESIGNATUREFILE, _T("&Create signature file..."));
|
|
|
|
pSymbolsMenu->Append(IDM_USESIGNATUREFILE, _T("&Use signature file..."));
|
|
|
|
pSymbolsMenu->AppendSeparator();
|
|
|
|
pSymbolsMenu->Append(IDM_PATCHHLEFUNCTIONS, _T("&Patch HLE functions"));
|
2009-03-02 21:10:46 +00:00
|
|
|
pSymbolsMenu->Append(IDM_RENAME_SYMBOLS, _T("&Rename symbols from file..."));
|
2009-02-23 06:15:48 +00:00
|
|
|
pMenuBar->Append(pSymbolsMenu, _T("&Symbols"));
|
|
|
|
|
|
|
|
wxMenu *pJitMenu = new wxMenu;
|
|
|
|
pJitMenu->Append(IDM_CLEARCODECACHE, _T("&Clear code cache"));
|
|
|
|
pJitMenu->Append(IDM_LOGINSTRUCTIONS, _T("&Log JIT instruction coverage"));
|
2009-06-17 19:50:59 +00:00
|
|
|
pJitMenu->Append(IDM_SEARCHINSTRUCTION, _T("&Search for an op"));
|
2009-02-23 06:15:48 +00:00
|
|
|
pMenuBar->Append(pJitMenu, _T("&JIT"));
|
|
|
|
|
|
|
|
wxMenu *pProfilerMenu = new wxMenu;
|
|
|
|
pProfilerMenu->Append(IDM_PROFILEBLOCKS, _T("&Profile blocks"), wxEmptyString, wxITEM_CHECK);
|
|
|
|
pProfilerMenu->AppendSeparator();
|
|
|
|
pProfilerMenu->Append(IDM_WRITEPROFILE, _T("&Write to profile.txt, show"));
|
|
|
|
pMenuBar->Append(pProfilerMenu, _T("&Profiler"));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CCodeWindow::OnProfilerMenu(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
if (Core::GetState() == Core::CORE_RUN) {
|
|
|
|
event.Skip();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
switch (event.GetId())
|
|
|
|
{
|
|
|
|
case IDM_PROFILEBLOCKS:
|
2009-07-15 20:15:34 +00:00
|
|
|
jit.ClearCache();
|
2009-02-23 06:15:48 +00:00
|
|
|
Profiler::g_ProfileBlocks = GetMenuBar()->IsChecked(IDM_PROFILEBLOCKS);
|
|
|
|
break;
|
|
|
|
case IDM_WRITEPROFILE:
|
|
|
|
Profiler::WriteProfileResults("profiler.txt");
|
2009-02-24 19:31:32 +00:00
|
|
|
WxUtils::Launch("profiler.txt");
|
2009-02-23 06:15:48 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
if (Core::GetState() == Core::CORE_UNINITIALIZED)
|
|
|
|
{
|
|
|
|
// TODO: disable menu items instead :P
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
std::string mapfile = CBoot::GenerateMapFilename();
|
|
|
|
switch (event.GetId())
|
|
|
|
{
|
|
|
|
case IDM_CLEARSYMBOLS:
|
|
|
|
g_symbolDB.Clear();
|
|
|
|
Host_NotifyMapLoaded();
|
|
|
|
break;
|
|
|
|
case IDM_CLEANSYMBOLS:
|
|
|
|
g_symbolDB.Clear("zz");
|
|
|
|
Host_NotifyMapLoaded();
|
|
|
|
break;
|
|
|
|
case IDM_SCANFUNCTIONS:
|
|
|
|
{
|
2009-06-08 18:34:24 +00:00
|
|
|
PPCAnalyst::FindFunctions(0x80000000, 0x80400000, &g_symbolDB);
|
2009-02-23 06:15:48 +00:00
|
|
|
SignatureDB db;
|
2009-05-07 21:19:55 +00:00
|
|
|
if (db.Load((File::GetSysDirectory() + TOTALDB).c_str()))
|
2009-02-23 06:15:48 +00:00
|
|
|
db.Apply(&g_symbolDB);
|
|
|
|
|
|
|
|
// HLE::PatchFunctions();
|
|
|
|
NotifyMapLoaded();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case IDM_LOADMAPFILE:
|
|
|
|
if (!File::Exists(mapfile.c_str()))
|
|
|
|
{
|
|
|
|
g_symbolDB.Clear();
|
2009-03-02 21:10:46 +00:00
|
|
|
PPCAnalyst::FindFunctions(0x81300000, 0x81800000, &g_symbolDB);
|
2009-02-23 06:15:48 +00:00
|
|
|
SignatureDB db;
|
2009-05-07 21:19:55 +00:00
|
|
|
if (db.Load((File::GetSysDirectory() + TOTALDB).c_str()))
|
2009-02-23 06:15:48 +00:00
|
|
|
db.Apply(&g_symbolDB);
|
|
|
|
} else {
|
|
|
|
g_symbolDB.LoadMap(mapfile.c_str());
|
|
|
|
}
|
2009-03-02 21:10:46 +00:00
|
|
|
HLE::PatchFunctions();
|
2009-02-23 06:15:48 +00:00
|
|
|
NotifyMapLoaded();
|
|
|
|
break;
|
|
|
|
case IDM_SAVEMAPFILE:
|
|
|
|
g_symbolDB.SaveMap(mapfile.c_str());
|
|
|
|
break;
|
|
|
|
case IDM_SAVEMAPFILEWITHCODES:
|
|
|
|
g_symbolDB.SaveMap(mapfile.c_str(), true);
|
|
|
|
break;
|
2009-03-02 21:10:46 +00:00
|
|
|
|
|
|
|
case IDM_RENAME_SYMBOLS:
|
|
|
|
{
|
|
|
|
wxString path = wxFileSelector(
|
|
|
|
_T("Apply signature file"), wxEmptyString, wxEmptyString, wxEmptyString,
|
|
|
|
_T("Dolphin Symbole Rename File (*.sym)|*.sym;"), wxFD_OPEN | wxFD_FILE_MUST_EXIST,
|
|
|
|
this);
|
|
|
|
if (path)
|
|
|
|
{
|
2009-03-02 21:39:06 +00:00
|
|
|
FILE *f = fopen(path.mb_str(), "r");
|
2009-03-02 21:10:46 +00:00
|
|
|
if (!f)
|
|
|
|
return;
|
|
|
|
|
|
|
|
bool started = false;
|
|
|
|
while (!feof(f))
|
|
|
|
{
|
2009-03-05 22:35:06 +00:00
|
|
|
char line[512];
|
2009-03-02 21:10:46 +00:00
|
|
|
fgets(line, 511, f);
|
|
|
|
if (strlen(line) < 4)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
u32 address, type;
|
|
|
|
char name[512];
|
|
|
|
sscanf(line, "%08x %02i %s", &address, &type, name);
|
|
|
|
|
|
|
|
Symbol *symbol = g_symbolDB.GetSymbolFromAddr(address);
|
|
|
|
if (symbol) {
|
|
|
|
symbol->name = line+12;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fclose(f);
|
|
|
|
Host_NotifyMapLoaded();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
case IDM_CREATESIGNATUREFILE:
|
|
|
|
{
|
|
|
|
wxTextEntryDialog input_prefix(this, wxString::FromAscii("Only export symbols with prefix:"), wxGetTextFromUserPromptStr, _T("."));
|
|
|
|
if (input_prefix.ShowModal() == wxID_OK) {
|
|
|
|
std::string prefix(input_prefix.GetValue().mb_str());
|
|
|
|
|
|
|
|
wxString path = wxFileSelector(
|
|
|
|
_T("Save signature as"), wxEmptyString, wxEmptyString, wxEmptyString,
|
|
|
|
_T("Dolphin Signature File (*.dsy)|*.dsy;"), wxFD_SAVE,
|
|
|
|
this);
|
|
|
|
if (path) {
|
|
|
|
SignatureDB db;
|
|
|
|
db.Initialize(&g_symbolDB, prefix.c_str());
|
2009-08-02 05:59:55 +00:00
|
|
|
std::string filename(path.mb_str()); // PPCAnalyst::SaveSignatureDB(
|
|
|
|
db.Save(path.mb_str());
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case IDM_USESIGNATUREFILE:
|
|
|
|
{
|
|
|
|
wxString path = wxFileSelector(
|
|
|
|
_T("Apply signature file"), wxEmptyString, wxEmptyString, wxEmptyString,
|
|
|
|
_T("Dolphin Signature File (*.dsy)|*.dsy;"), wxFD_OPEN | wxFD_FILE_MUST_EXIST,
|
|
|
|
this);
|
|
|
|
if (path) {
|
|
|
|
SignatureDB db;
|
2009-08-02 05:59:55 +00:00
|
|
|
db.Load(path.mb_str());
|
2009-02-23 06:15:48 +00:00
|
|
|
db.Apply(&g_symbolDB);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
NotifyMapLoaded();
|
|
|
|
break;
|
|
|
|
case IDM_PATCHHLEFUNCTIONS:
|
|
|
|
HLE::PatchFunctions();
|
|
|
|
Update();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CCodeWindow::NotifyMapLoaded()
|
|
|
|
{
|
|
|
|
g_symbolDB.FillInCallers();
|
|
|
|
//symbols->Show(false); // hide it for faster filling
|
|
|
|
symbols->Freeze(); // HyperIris: wx style fast filling
|
|
|
|
symbols->Clear();
|
2009-06-21 08:39:21 +00:00
|
|
|
for (PPCSymbolDB::XFuncMap::iterator iter = g_symbolDB.GetIterator(); iter != g_symbolDB.End(); iter++)
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
|
|
|
int idx = symbols->Append(wxString::FromAscii(iter->second.name.c_str()));
|
|
|
|
symbols->SetClientData(idx, (void*)&iter->second);
|
|
|
|
}
|
|
|
|
symbols->Thaw();
|
|
|
|
//symbols->Show(true);
|
|
|
|
Update();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CCodeWindow::OnSymbolListChange(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
int index = symbols->GetSelection();
|
|
|
|
if (index >= 0) {
|
|
|
|
Symbol* pSymbol = static_cast<Symbol *>(symbols->GetClientData(index));
|
|
|
|
if (pSymbol != NULL)
|
|
|
|
{
|
|
|
|
if(pSymbol->type == Symbol::SYMBOL_DATA)
|
|
|
|
{
|
|
|
|
if(m_MemoryWindow && m_MemoryWindow->IsVisible())
|
|
|
|
m_MemoryWindow->JumpToAddress(pSymbol->address);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
JumpToAddress(pSymbol->address);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CCodeWindow::OnSymbolListContextMenu(wxContextMenuEvent& event)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-08-26 09:19:15 +00:00
|
|
|
|
|
|
|
// Change the global DebuggerFont
|
|
|
|
void CCodeWindow::OnChangeFont(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
wxFontData data;
|
|
|
|
data.SetInitialFont(GetFont());
|
|
|
|
|
|
|
|
wxFontDialog dialog(this, data);
|
|
|
|
if ( dialog.ShowModal() == wxID_OK )
|
|
|
|
DebuggerFont = dialog.GetFontData().GetChosenFont();
|
|
|
|
}
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Toogle windows
|
|
|
|
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
2009-08-27 15:53:19 +00:00
|
|
|
int CCodeWindow::Limit(int i, int Low, int High)
|
|
|
|
{
|
|
|
|
if (i < Low) return Low;
|
|
|
|
if (i > High) return High;
|
|
|
|
return i;
|
|
|
|
}
|
2009-08-27 01:30:08 +00:00
|
|
|
void CCodeWindow::OpenPages()
|
|
|
|
{
|
2009-08-29 06:08:14 +00:00
|
|
|
if (bRegisterWindow) Parent->DoToggleWindow(IDM_REGISTERWINDOW, true);
|
|
|
|
if (bBreakpointWindow) Parent->DoToggleWindow(IDM_BREAKPOINTWINDOW, true);
|
|
|
|
if (bMemoryWindow) Parent->DoToggleWindow(IDM_MEMORYWINDOW, true);
|
|
|
|
if (bJitWindow) Parent->DoToggleWindow(IDM_JITWINDOW, true);
|
|
|
|
if (bSoundWindow) Parent->DoToggleWindow(IDM_SOUNDWINDOW, true);
|
|
|
|
if (bVideoWindow) Parent->DoToggleWindow(IDM_VIDEOWINDOW, true);
|
2009-08-27 01:30:08 +00:00
|
|
|
}
|
2009-08-26 23:28:30 +00:00
|
|
|
void CCodeWindow::OnToggleWindow(wxCommandEvent& event)
|
|
|
|
{
|
2009-08-27 10:10:07 +00:00
|
|
|
Parent->DoToggleWindow(event.GetId(), GetMenuBar()->IsChecked(event.GetId()));
|
2009-08-26 09:19:15 +00:00
|
|
|
}
|
2009-08-27 15:53:19 +00:00
|
|
|
void CCodeWindow::OnToggleRegisterWindow(bool Show, int i)
|
2009-08-26 09:19:15 +00:00
|
|
|
{
|
2009-08-25 01:50:27 +00:00
|
|
|
if (Show)
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2009-08-27 15:53:19 +00:00
|
|
|
if (i < 0 || i > Parent->m_NB.size()-1) return;
|
|
|
|
if (m_RegisterWindow && Parent->m_NB[i]->GetPageIndex(m_RegisterWindow) != wxNOT_FOUND) return;
|
2009-08-27 10:10:07 +00:00
|
|
|
if (!m_RegisterWindow) m_RegisterWindow = new CRegisterWindow(Parent);
|
2009-08-27 15:53:19 +00:00
|
|
|
Parent->m_NB[i]->AddPage(m_RegisterWindow, wxT("Registers"), true, Parent->aNormalFile );
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
|
|
|
else // hide
|
2009-08-27 10:10:07 +00:00
|
|
|
Parent->DoRemovePage (m_RegisterWindow);
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
|
|
|
|
2009-08-27 15:53:19 +00:00
|
|
|
void CCodeWindow::OnToggleBreakPointWindow(bool Show, int i)
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2009-08-26 09:19:15 +00:00
|
|
|
if (Show)
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2009-08-27 15:53:19 +00:00
|
|
|
if (i < 0 || i > Parent->m_NB.size()-1) return;
|
|
|
|
if (m_BreakpointWindow && Parent->m_NB[i]->GetPageIndex(m_BreakpointWindow) != wxNOT_FOUND) return;
|
2009-08-27 10:10:07 +00:00
|
|
|
if (!m_BreakpointWindow) m_BreakpointWindow = new CBreakPointWindow(this, Parent);
|
2009-08-27 15:53:19 +00:00
|
|
|
Parent->m_NB[i]->AddPage(m_BreakpointWindow, wxT("Breakpoints"), true, Parent->aNormalFile );
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
|
|
|
else // hide
|
2009-08-27 10:10:07 +00:00
|
|
|
Parent->DoRemovePage(m_BreakpointWindow);
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
|
|
|
|
2009-08-27 15:53:19 +00:00
|
|
|
void CCodeWindow::OnToggleJitWindow(bool Show, int i)
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2009-08-26 09:19:15 +00:00
|
|
|
if (Show)
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2009-08-27 15:53:19 +00:00
|
|
|
if (i < 0 || i > Parent->m_NB.size()-1) return;
|
|
|
|
if (m_JitWindow && Parent->m_NB[i]->GetPageIndex(m_JitWindow) != wxNOT_FOUND) return;
|
2009-08-27 10:10:07 +00:00
|
|
|
if (!m_JitWindow) m_JitWindow = new CJitWindow(Parent);
|
2009-08-27 15:53:19 +00:00
|
|
|
Parent->m_NB[i]->AddPage(m_JitWindow, wxT("JIT"), true, Parent->aNormalFile );
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
|
|
|
else // hide
|
2009-08-27 10:10:07 +00:00
|
|
|
Parent->DoRemovePage(m_JitWindow);
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-08-27 15:53:19 +00:00
|
|
|
void CCodeWindow::OnToggleMemoryWindow(bool Show, int i)
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2009-08-26 09:19:15 +00:00
|
|
|
if (Show)
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2009-08-27 15:53:19 +00:00
|
|
|
if (i < 0 || i > Parent->m_NB.size()-1) return;
|
|
|
|
if (m_MemoryWindow && Parent->m_NB[i]->GetPageIndex(m_MemoryWindow) != wxNOT_FOUND) return;
|
2009-08-27 10:10:07 +00:00
|
|
|
if (!m_MemoryWindow) m_MemoryWindow = new CMemoryWindow(Parent);
|
2009-08-27 15:53:19 +00:00
|
|
|
Parent->m_NB[i]->AddPage(m_MemoryWindow, wxT("Memory"), true, Parent->aNormalFile );
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
|
|
|
else // hide
|
2009-08-27 10:10:07 +00:00
|
|
|
Parent->DoRemovePage(m_MemoryWindow);
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
|
|
|
|
2009-08-26 09:19:15 +00:00
|
|
|
//Toggle Sound Debugging Window
|
2009-08-27 15:53:19 +00:00
|
|
|
void CCodeWindow::OnToggleSoundWindow(bool Show, int i)
|
2009-08-26 09:19:15 +00:00
|
|
|
{
|
2009-08-26 23:28:30 +00:00
|
|
|
//ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener();
|
|
|
|
|
2009-08-26 09:19:15 +00:00
|
|
|
if (Show)
|
|
|
|
{
|
2009-08-27 15:53:19 +00:00
|
|
|
if (i < 0 || i > Parent->m_NB.size()-1) return;
|
2009-08-26 23:28:30 +00:00
|
|
|
#ifdef _WIN32
|
2009-08-27 19:38:35 +00:00
|
|
|
wxWindow *Win = Parent->GetWxWindow(wxT("Sound"));
|
2009-08-27 15:53:19 +00:00
|
|
|
if (Win && Parent->m_NB[i]->GetPageIndex(Win) != wxNOT_FOUND) return;
|
2009-08-26 23:28:30 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
//Console->Log(LogTypes::LNOTICE, StringFromFormat("OpenDebug\n").c_str());
|
|
|
|
CPluginManager::GetInstance().OpenDebug(
|
2009-08-27 10:10:07 +00:00
|
|
|
Parent->GetHandle(),
|
2009-08-26 23:28:30 +00:00
|
|
|
//GetHandle(),
|
|
|
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(),
|
|
|
|
PLUGIN_TYPE_DSP, true // DSP, show
|
|
|
|
);
|
|
|
|
#ifdef _WIN32
|
|
|
|
}
|
|
|
|
|
2009-08-27 19:38:35 +00:00
|
|
|
Win = Parent->GetWxWindow(wxT("Sound"));
|
2009-08-26 23:28:30 +00:00
|
|
|
if (Win)
|
|
|
|
{
|
|
|
|
//Console->Log(LogTypes::LNOTICE, StringFromFormat("AddPage\n").c_str());
|
2009-08-27 15:53:19 +00:00
|
|
|
Parent->m_NB[i]->AddPage(Win, wxT("Sound"), true, Parent->aNormalFile );
|
2009-08-26 23:28:30 +00:00
|
|
|
}
|
|
|
|
#endif
|
2009-08-26 09:19:15 +00:00
|
|
|
}
|
|
|
|
else // hide
|
|
|
|
{
|
2009-08-26 23:28:30 +00:00
|
|
|
#ifdef _WIN32
|
2009-08-27 19:38:35 +00:00
|
|
|
wxWindow *Win = Parent->GetWxWindow(wxT("Sound"));
|
2009-08-27 10:10:07 +00:00
|
|
|
Parent->DoRemovePage (Win, false);
|
2009-08-26 23:28:30 +00:00
|
|
|
#endif
|
2009-08-26 09:19:15 +00:00
|
|
|
// Close the sound dll that has an open debugger
|
|
|
|
CPluginManager::GetInstance().OpenDebug(
|
|
|
|
GetHandle(),
|
|
|
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(),
|
|
|
|
PLUGIN_TYPE_DSP, false // DSP, hide
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Toggle Video Debugging Window
|
2009-08-27 15:53:19 +00:00
|
|
|
void CCodeWindow::OnToggleVideoWindow(bool Show, int i)
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2009-08-26 09:19:15 +00:00
|
|
|
//GetMenuBar()->Check(event.GetId(), false); // Turn off
|
2009-02-23 06:15:48 +00:00
|
|
|
|
2009-08-26 09:19:15 +00:00
|
|
|
if (Show)
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2009-08-27 15:53:19 +00:00
|
|
|
if (i < 0 || i > Parent->m_NB.size()-1) return;
|
2009-08-26 23:28:30 +00:00
|
|
|
#ifdef _WIN32
|
2009-08-27 19:38:35 +00:00
|
|
|
wxWindow *Win = Parent->GetWxWindow(wxT("Video"));
|
2009-08-27 15:53:19 +00:00
|
|
|
if (Win && Parent->m_NB[i]->GetPageIndex(Win) != wxNOT_FOUND) return;
|
2009-08-26 23:28:30 +00:00
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
{
|
2009-08-26 23:28:30 +00:00
|
|
|
#endif
|
|
|
|
// Show and/or create the window
|
|
|
|
CPluginManager::GetInstance().OpenDebug(
|
2009-08-27 10:10:07 +00:00
|
|
|
Parent->GetHandle(),
|
2009-08-26 23:28:30 +00:00
|
|
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str(),
|
|
|
|
PLUGIN_TYPE_VIDEO, true // Video, show
|
|
|
|
);
|
|
|
|
#ifdef _WIN32
|
|
|
|
}
|
2009-02-23 06:15:48 +00:00
|
|
|
|
2009-08-27 19:38:35 +00:00
|
|
|
Win = Parent->GetWxWindow(wxT("Video"));
|
2009-08-27 15:53:19 +00:00
|
|
|
if (Win) Parent->m_NB[i]->AddPage(Win, wxT("Video"), true, Parent->aNormalFile );
|
2009-08-26 23:28:30 +00:00
|
|
|
#endif
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
|
|
|
else // hide
|
|
|
|
{
|
2009-08-26 23:28:30 +00:00
|
|
|
#ifdef _WIN32
|
2009-08-27 19:38:35 +00:00
|
|
|
wxWindow *Win = Parent->GetWxWindow(wxT("Video"));
|
2009-08-27 10:10:07 +00:00
|
|
|
Parent->DoRemovePage (Win, false);
|
2009-08-26 23:28:30 +00:00
|
|
|
#endif
|
2009-08-26 09:19:15 +00:00
|
|
|
// Close the video dll that has an open debugger
|
|
|
|
CPluginManager::GetInstance().OpenDebug(
|
|
|
|
GetHandle(),
|
|
|
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str(),
|
|
|
|
PLUGIN_TYPE_VIDEO, false // Video, hide
|
|
|
|
);
|
2009-02-23 06:15:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-08-26 09:19:15 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|