mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
More FrameAui work. Some more segmentation faults resolved. And a little more code clean up.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5959 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@@ -473,7 +473,7 @@ void CCodeWindow::ToggleCodeWindow(bool bShow)
|
||||
if (bShow)
|
||||
Parent->DoAddPage(this, iCodeWindow,
|
||||
Parent->bFloatWindow[IDM_CODEWINDOW - IDM_LOGWINDOW]);
|
||||
else // hide
|
||||
else // Hide
|
||||
Parent->DoRemovePage(this);
|
||||
}
|
||||
|
||||
@@ -487,8 +487,8 @@ void CCodeWindow::ToggleRegisterWindow(bool bShow)
|
||||
Parent->DoAddPage(m_RegisterWindow, iRegisterWindow,
|
||||
Parent->bFloatWindow[IDM_REGISTERWINDOW - IDM_LOGWINDOW]);
|
||||
}
|
||||
else // hide
|
||||
Parent->DoRemovePage(m_RegisterWindow);
|
||||
else // Close
|
||||
Parent->DoRemovePage(m_RegisterWindow, false);
|
||||
}
|
||||
|
||||
void CCodeWindow::ToggleBreakPointWindow(bool bShow)
|
||||
@@ -501,8 +501,8 @@ void CCodeWindow::ToggleBreakPointWindow(bool bShow)
|
||||
Parent->DoAddPage(m_BreakpointWindow, iBreakpointWindow,
|
||||
Parent->bFloatWindow[IDM_BREAKPOINTWINDOW - IDM_LOGWINDOW]);
|
||||
}
|
||||
else // hide
|
||||
Parent->DoRemovePage(m_BreakpointWindow);
|
||||
else // Close
|
||||
Parent->DoRemovePage(m_BreakpointWindow, false);
|
||||
}
|
||||
|
||||
void CCodeWindow::ToggleMemoryWindow(bool bShow)
|
||||
@@ -515,8 +515,8 @@ void CCodeWindow::ToggleMemoryWindow(bool bShow)
|
||||
Parent->DoAddPage(m_MemoryWindow, iMemoryWindow,
|
||||
Parent->bFloatWindow[IDM_MEMORYWINDOW - IDM_LOGWINDOW]);
|
||||
}
|
||||
else // hide
|
||||
Parent->DoRemovePage(m_MemoryWindow);
|
||||
else // Close
|
||||
Parent->DoRemovePage(m_MemoryWindow, false);
|
||||
}
|
||||
|
||||
void CCodeWindow::ToggleJitWindow(bool bShow)
|
||||
@@ -529,8 +529,8 @@ void CCodeWindow::ToggleJitWindow(bool bShow)
|
||||
Parent->DoAddPage(m_JitWindow, iJitWindow,
|
||||
Parent->bFloatWindow[IDM_JITWINDOW - IDM_LOGWINDOW]);
|
||||
}
|
||||
else // hide
|
||||
Parent->DoRemovePage(m_JitWindow);
|
||||
else // Close
|
||||
Parent->DoRemovePage(m_JitWindow, false);
|
||||
}
|
||||
|
||||
// Notice: This windows docking will produce several wx debugging messages for plugin
|
||||
@@ -582,7 +582,7 @@ void CCodeWindow::ToggleDLLWindow(int Id, bool bShow)
|
||||
Win = (wxPanel *)FindWindowById(Id);
|
||||
if (Win)
|
||||
{
|
||||
Parent->DoRemovePageId(Id, false, false);
|
||||
Parent->DoRemovePage(Win, false);
|
||||
Win->Close();
|
||||
Win->Destroy();
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
#include "Debugger.h"
|
||||
|
||||
|
||||
#include <wx/button.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/listctrl.h>
|
||||
@@ -38,7 +37,6 @@
|
||||
#include "HW/Memmap.h"
|
||||
#include "HW/DSP.h"
|
||||
|
||||
// ugly that this lib included code from the main
|
||||
#include "../../DolphinWX/Src/Globals.h"
|
||||
|
||||
enum
|
||||
@@ -48,7 +46,7 @@ enum
|
||||
IDM_SETVALBUTTON,
|
||||
IDM_DUMP_MEMORY,
|
||||
IDM_VALBOX,
|
||||
IDM_U8,//Feel free to rename these
|
||||
IDM_U8,
|
||||
IDM_U16,
|
||||
IDM_U32,
|
||||
IDM_SEARCH,
|
||||
@@ -57,33 +55,35 @@ enum
|
||||
};
|
||||
|
||||
BEGIN_EVENT_TABLE(CMemoryWindow, wxPanel)
|
||||
EVT_TEXT(IDM_MEM_ADDRBOX, CMemoryWindow::OnAddrBoxChange)
|
||||
EVT_LISTBOX(IDM_SYMBOLLIST, CMemoryWindow::OnSymbolListChange)
|
||||
EVT_HOST_COMMAND(wxID_ANY, CMemoryWindow::OnHostMessage)
|
||||
EVT_BUTTON(IDM_SETVALBUTTON, CMemoryWindow::SetMemoryValue)
|
||||
EVT_BUTTON(IDM_DUMP_MEMORY, CMemoryWindow::OnDumpMemory)
|
||||
EVT_CHECKBOX(IDM_U8 , CMemoryWindow::U8)
|
||||
EVT_CHECKBOX(IDM_U16 , CMemoryWindow::U16)
|
||||
EVT_CHECKBOX(IDM_U32 , CMemoryWindow::U32)
|
||||
EVT_BUTTON(IDM_SEARCH , CMemoryWindow::onSearch)
|
||||
EVT_CHECKBOX(IDM_ASCII , CMemoryWindow::onAscii)
|
||||
EVT_CHECKBOX(IDM_HEX , CMemoryWindow::onHex)
|
||||
EVT_TEXT(IDM_MEM_ADDRBOX, CMemoryWindow::OnAddrBoxChange)
|
||||
EVT_LISTBOX(IDM_SYMBOLLIST, CMemoryWindow::OnSymbolListChange)
|
||||
EVT_HOST_COMMAND(wxID_ANY, CMemoryWindow::OnHostMessage)
|
||||
EVT_BUTTON(IDM_SETVALBUTTON, CMemoryWindow::SetMemoryValue)
|
||||
EVT_BUTTON(IDM_DUMP_MEMORY, CMemoryWindow::OnDumpMemory)
|
||||
EVT_CHECKBOX(IDM_U8, CMemoryWindow::U8)
|
||||
EVT_CHECKBOX(IDM_U16, CMemoryWindow::U16)
|
||||
EVT_CHECKBOX(IDM_U32, CMemoryWindow::U32)
|
||||
EVT_BUTTON(IDM_SEARCH, CMemoryWindow::onSearch)
|
||||
EVT_CHECKBOX(IDM_ASCII, CMemoryWindow::onAscii)
|
||||
EVT_CHECKBOX(IDM_HEX, CMemoryWindow::onHex)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
CMemoryWindow::CMemoryWindow(wxWindow* parent, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size, long style, const wxString& name)
|
||||
: wxPanel(parent, id, pos, size, style, name)
|
||||
{
|
||||
{
|
||||
wxBoxSizer* sizerBig = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer* sizerRight = new wxBoxSizer(wxVERTICAL);
|
||||
// didn't see anything usefull in the left part
|
||||
// Didn't see anything usefull in the left part
|
||||
//wxBoxSizer* sizerLeft = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
DebugInterface* di = &PowerPC::debug_interface;
|
||||
|
||||
//sizerLeft->Add(symbols = new wxListBox(this, IDM_SYMBOLLIST, wxDefaultPosition, wxSize(20, 100), 0, NULL, wxLB_SORT), 1, wxEXPAND);
|
||||
//symbols = new wxListBox(this, IDM_SYMBOLLIST, wxDefaultPosition,
|
||||
// wxSize(20, 100), 0, NULL, wxLB_SORT);
|
||||
//sizerLeft->Add(symbols, 1, wxEXPAND);
|
||||
memview = new CMemoryView(di, this, wxID_ANY);
|
||||
memview->dataType=0;
|
||||
memview->dataType = 0;
|
||||
//sizerBig->Add(sizerLeft, 1, wxEXPAND);
|
||||
sizerBig->Add(memview, 20, wxEXPAND);
|
||||
sizerBig->Add(sizerRight, 0, wxEXPAND | wxALL, 3);
|
||||
@@ -96,18 +96,19 @@ CMemoryWindow::CMemoryWindow(wxWindow* parent, wxWindowID id,
|
||||
|
||||
wxStaticBoxSizer* sizerSearchType = new wxStaticBoxSizer(wxVERTICAL, this, wxT("Search"));
|
||||
|
||||
sizerSearchType->Add(btnSearch=new wxButton(this,IDM_SEARCH,_T("Search")));
|
||||
sizerSearchType->Add(chkAscii=new wxCheckBox(this,IDM_ASCII,_T("&Ascii ")));
|
||||
sizerSearchType->Add(chkHex=new wxCheckBox(this,IDM_HEX,_T("&Hex")));
|
||||
sizerSearchType->Add(btnSearch = new wxButton(this, IDM_SEARCH, _T("Search")));
|
||||
sizerSearchType->Add(chkAscii = new wxCheckBox(this, IDM_ASCII, _T("&Ascii ")));
|
||||
sizerSearchType->Add(chkHex = new wxCheckBox(this, IDM_HEX, _T("&Hex")));
|
||||
sizerRight->Add(sizerSearchType);
|
||||
wxStaticBoxSizer* sizerDataTypes = new wxStaticBoxSizer(wxVERTICAL, this, wxT("Data Type"));
|
||||
|
||||
sizerDataTypes->Add(chk8=new wxCheckBox(this,IDM_U8,_T("&U8 ")));//Excesss spaces are to get the DataType to show properly
|
||||
sizerDataTypes->Add(chk16=new wxCheckBox(this,IDM_U16,_T("&U16 ")));
|
||||
sizerDataTypes->Add(chk32=new wxCheckBox(this,IDM_U32,_T("&U32 ")));
|
||||
sizerDataTypes->SetMinSize(74, 40);
|
||||
sizerDataTypes->Add(chk8 = new wxCheckBox(this, IDM_U8, _T("&U8")));
|
||||
sizerDataTypes->Add(chk16 = new wxCheckBox(this, IDM_U16, _T("&U16")));
|
||||
sizerDataTypes->Add(chk32 = new wxCheckBox(this, IDM_U32, _T("&U32")));
|
||||
sizerRight->Add(sizerDataTypes);
|
||||
SetSizer(sizerBig);
|
||||
chkHex->SetValue(1);//Set defaults
|
||||
chkHex->SetValue(1); //Set defaults
|
||||
chk8->SetValue(1);
|
||||
|
||||
//sizerLeft->SetSizeHints(this);
|
||||
@@ -118,12 +119,10 @@ CMemoryWindow::CMemoryWindow(wxWindow* parent, wxWindowID id,
|
||||
sizerBig->Fit(this);
|
||||
}
|
||||
|
||||
|
||||
CMemoryWindow::~CMemoryWindow()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void CMemoryWindow::Save(IniFile& _IniFile) const
|
||||
{
|
||||
// Prevent these bad values that can happen after a crash or hanging
|
||||
@@ -136,10 +135,9 @@ void CMemoryWindow::Save(IniFile& _IniFile) const
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CMemoryWindow::Load(IniFile& _IniFile)
|
||||
{
|
||||
int x,y,w,h;
|
||||
int x, y, w, h;
|
||||
_IniFile.Get("MemoryWindow", "x", &x, GetPosition().x);
|
||||
_IniFile.Get("MemoryWindow", "y", &y, GetPosition().y);
|
||||
_IniFile.Get("MemoryWindow", "w", &w, GetSize().GetWidth());
|
||||
@@ -147,13 +145,11 @@ void CMemoryWindow::Load(IniFile& _IniFile)
|
||||
SetSize(x, y, w, h);
|
||||
}
|
||||
|
||||
|
||||
void CMemoryWindow::JumpToAddress(u32 _Address)
|
||||
{
|
||||
memview->Center(_Address);
|
||||
}
|
||||
|
||||
|
||||
void CMemoryWindow::SetMemoryValue(wxCommandEvent& event)
|
||||
{
|
||||
std::string str_addr = std::string(addrbox->GetValue().mb_str());
|
||||
@@ -161,12 +157,14 @@ void CMemoryWindow::SetMemoryValue(wxCommandEvent& event)
|
||||
u32 addr;
|
||||
u32 val;
|
||||
|
||||
if (!TryParseUInt(std::string("0x") + str_addr, &addr)) {
|
||||
if (!TryParseUInt(std::string("0x") + str_addr, &addr))
|
||||
{
|
||||
PanicAlert("Invalid Address: %s", str_addr.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!TryParseUInt(std::string("0x") + str_val, &val)) {
|
||||
if (!TryParseUInt(std::string("0x") + str_val, &val))
|
||||
{
|
||||
PanicAlert("Invalid Value: %s", str_val.c_str());
|
||||
return;
|
||||
}
|
||||
@@ -198,7 +196,7 @@ void CMemoryWindow::NotifyMapLoaded()
|
||||
{
|
||||
symbols->Show(false); // hide it for faster filling
|
||||
symbols->Clear();
|
||||
/*
|
||||
#if 0
|
||||
#ifdef _WIN32
|
||||
const FunctionDB::XFuncMap &syms = g_symbolDB.Symbols();
|
||||
for (FuntionDB::XFuncMap::iterator iter = syms.begin(); iter != syms.end(); ++iter)
|
||||
@@ -206,10 +204,8 @@ void CMemoryWindow::NotifyMapLoaded()
|
||||
int idx = symbols->Append(iter->second.name.c_str());
|
||||
symbols->SetClientData(idx, (void*)&iter->second);
|
||||
}
|
||||
|
||||
//
|
||||
#endif
|
||||
*/
|
||||
#endif
|
||||
symbols->Show(true);
|
||||
Update();
|
||||
}
|
||||
@@ -217,7 +213,8 @@ void CMemoryWindow::NotifyMapLoaded()
|
||||
void CMemoryWindow::OnSymbolListChange(wxCommandEvent& event)
|
||||
{
|
||||
int index = symbols->GetSelection();
|
||||
if (index >= 0) {
|
||||
if (index >= 0)
|
||||
{
|
||||
Symbol* pSymbol = static_cast<Symbol *>(symbols->GetClientData(index));
|
||||
if (pSymbol != NULL)
|
||||
{
|
||||
@@ -230,13 +227,13 @@ void CMemoryWindow::OnHostMessage(wxCommandEvent& event)
|
||||
{
|
||||
switch (event.GetId())
|
||||
{
|
||||
case IDM_NOTIFYMAPLOADED:
|
||||
NotifyMapLoaded();
|
||||
break;
|
||||
case IDM_NOTIFYMAPLOADED:
|
||||
NotifyMapLoaded();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// so we can view memory in a tile/hex viewer for data analysis
|
||||
// So we can view memory in a tile/hex viewer for data analysis
|
||||
void CMemoryWindow::OnDumpMemory( wxCommandEvent& event )
|
||||
{
|
||||
switch (memview->GetMemoryType())
|
||||
@@ -270,40 +267,45 @@ void CMemoryWindow::OnDumpMemory( wxCommandEvent& event )
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CMemoryWindow::U8(wxCommandEvent& event) {
|
||||
void CMemoryWindow::U8(wxCommandEvent& event)
|
||||
{
|
||||
chk16->SetValue(0);
|
||||
chk32->SetValue(0);
|
||||
memview->dataType = 0;
|
||||
memview->Refresh();
|
||||
}
|
||||
void CMemoryWindow::U16(wxCommandEvent& event) {
|
||||
|
||||
void CMemoryWindow::U16(wxCommandEvent& event)
|
||||
{
|
||||
chk8->SetValue(0);
|
||||
chk32->SetValue(0);
|
||||
memview->dataType = 1;
|
||||
memview->Refresh();
|
||||
memview->Refresh();
|
||||
}
|
||||
void CMemoryWindow::U32(wxCommandEvent& event) {
|
||||
|
||||
void CMemoryWindow::U32(wxCommandEvent& event)
|
||||
{
|
||||
chk16->SetValue(0);
|
||||
chk8->SetValue(0);
|
||||
memview->dataType = 2;
|
||||
memview->Refresh();
|
||||
}
|
||||
|
||||
void CMemoryWindow::onSearch(wxCommandEvent& event) {
|
||||
u8* TheRAM=0;
|
||||
u32 szRAM=0;
|
||||
void CMemoryWindow::onSearch(wxCommandEvent& event)
|
||||
{
|
||||
u8* TheRAM = 0;
|
||||
u32 szRAM = 0;
|
||||
switch (memview->GetMemoryType())
|
||||
{
|
||||
case 0:
|
||||
default:
|
||||
if (Memory::m_pRAM)
|
||||
{
|
||||
TheRAM=Memory::m_pRAM;
|
||||
szRAM=Memory::REALRAM_SIZE;
|
||||
TheRAM = Memory::m_pRAM;
|
||||
szRAM = Memory::REALRAM_SIZE;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
@@ -311,8 +313,8 @@ void CMemoryWindow::onSearch(wxCommandEvent& event) {
|
||||
u8* aram = DSP::GetARAMPtr();
|
||||
if (aram)
|
||||
{
|
||||
TheRAM=aram;
|
||||
szRAM=DSP::ARAM_SIZE;
|
||||
TheRAM = aram;
|
||||
szRAM = DSP::ARAM_SIZE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -320,91 +322,103 @@ void CMemoryWindow::onSearch(wxCommandEvent& event) {
|
||||
//Now we have memory to look in
|
||||
//Are we looking for ASCII string, or hex?
|
||||
//memview->cu
|
||||
wxString rawData=valbox->GetValue();
|
||||
std::vector<u8> Dest;//May need a better name
|
||||
u32 size=0;
|
||||
int pad=rawData.size()%2;//If it's uneven
|
||||
unsigned int i=0;
|
||||
long count=0;
|
||||
char copy[3]={0};
|
||||
long newsize=0;
|
||||
unsigned char *tmp2=0;
|
||||
char* tmpstr=0;
|
||||
switch (chkHex->GetValue()){
|
||||
wxString rawData = valbox->GetValue();
|
||||
std::vector<u8> Dest; //May need a better name
|
||||
u32 size = 0;
|
||||
int pad = rawData.size()%2; //If it's uneven
|
||||
unsigned int i = 0;
|
||||
long count = 0;
|
||||
char copy[3] = {0};
|
||||
long newsize = 0;
|
||||
unsigned char *tmp2 = 0;
|
||||
char* tmpstr = 0;
|
||||
switch (chkHex->GetValue())
|
||||
{
|
||||
case 1://We are looking for hex
|
||||
//If it's uneven
|
||||
size=(rawData.size()/2) + pad;
|
||||
size = (rawData.size()/2) + pad;
|
||||
Dest.resize(size+32);
|
||||
newsize=rawData.size();
|
||||
newsize = rawData.size();
|
||||
|
||||
if (pad) {
|
||||
if (pad)
|
||||
{
|
||||
tmpstr = new char[newsize + 2];
|
||||
memset(tmpstr, 0, newsize + 2);
|
||||
tmpstr[0]='0';
|
||||
} else {
|
||||
tmpstr[0] = '0';
|
||||
}
|
||||
else
|
||||
{
|
||||
tmpstr = new char[newsize + 1];
|
||||
memset(tmpstr, 0, newsize + 1);
|
||||
}
|
||||
//sprintf(tmpstr,"%s%s",tmpstr,rawData.c_str());
|
||||
//strcpy(&tmpstr[1],rawData.ToAscii());
|
||||
//memcpy(&tmpstr[1],&rawData.c_str()[0],rawData.size());
|
||||
sprintf(tmpstr,"%s%s",tmpstr,(const char *)rawData.mb_str());
|
||||
tmp2=&Dest.front();
|
||||
count=0;
|
||||
for(i=0;i<strlen(tmpstr);i++){
|
||||
copy[0]=tmpstr[i];
|
||||
copy[1]=tmpstr[i+1];
|
||||
copy[2]=0;
|
||||
//sprintf(tmpstr, "%s%s", tmpstr, rawData.c_str());
|
||||
//strcpy(&tmpstr[1], rawData.ToAscii());
|
||||
//memcpy(&tmpstr[1], &rawData.c_str()[0], rawData.size());
|
||||
sprintf(tmpstr, "%s%s", tmpstr, (const char *)rawData.mb_str());
|
||||
tmp2 = &Dest.front();
|
||||
count = 0;
|
||||
for(i = 0; i < strlen(tmpstr); i++)
|
||||
{
|
||||
copy[0] = tmpstr[i];
|
||||
copy[1] = tmpstr[i+1];
|
||||
copy[2] = 0;
|
||||
int tmpint;
|
||||
sscanf(copy, "%02x", &tmpint);
|
||||
tmp2[count++] = tmpint;
|
||||
//sscanf(copy,"%02x",&tmp2[count++]);//Dest[count] should now be the hex of what the two chars were! Also should add a check to make sure it's A-F only
|
||||
i+=1;//
|
||||
// Dest[count] should now be the hex of what the two chars were!
|
||||
// Also should add a check to make sure it's A-F only
|
||||
//sscanf(copy, "%02x", &tmp2[count++]);
|
||||
i += 1;
|
||||
}
|
||||
delete[] tmpstr;
|
||||
break;
|
||||
case 0://Looking for an ascii string
|
||||
size=rawData.size();
|
||||
size = rawData.size();
|
||||
Dest.resize(size+1);
|
||||
tmpstr=new char[size+1];
|
||||
tmpstr = new char[size+1];
|
||||
|
||||
tmp2 = &Dest.front();
|
||||
sprintf(tmpstr, "%s", (const char *)rawData.mb_str());
|
||||
|
||||
for(i = 0; i < size; i++)
|
||||
tmp2[i] = tmpstr[i];
|
||||
|
||||
tmp2=&Dest.front();
|
||||
sprintf(tmpstr,"%s",(const char *)rawData.mb_str());
|
||||
for(i=0;i<size;i++){
|
||||
tmp2[i]=tmpstr[i];
|
||||
}
|
||||
delete[] tmpstr;
|
||||
break;
|
||||
}
|
||||
if(size){
|
||||
unsigned char* pnt=&Dest.front();
|
||||
unsigned int k=0;
|
||||
//grab
|
||||
if(size)
|
||||
{
|
||||
unsigned char* pnt = &Dest.front();
|
||||
unsigned int k = 0;
|
||||
//grab
|
||||
wxString txt = addrbox->GetValue();
|
||||
u32 addr=0;
|
||||
u32 addr = 0;
|
||||
if (txt.size())
|
||||
{
|
||||
sscanf(txt.mb_str(), "%08x", &addr);
|
||||
}
|
||||
i=addr+4;
|
||||
for(;i<szRAM;i++){
|
||||
for(k=0;k<size;k++){
|
||||
if(i+k>szRAM) break;
|
||||
if(k>size) break;
|
||||
if(pnt[k]!=TheRAM[i+k]){
|
||||
k=0;
|
||||
i = addr+4;
|
||||
for( ; i < szRAM; i++)
|
||||
{
|
||||
for(k = 0; k < size; k++)
|
||||
{
|
||||
if(i + k > szRAM) break;
|
||||
if(k > size) break;
|
||||
if(pnt[k] != TheRAM[i+k])
|
||||
{
|
||||
k = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(k==size){
|
||||
if(k == size)
|
||||
{
|
||||
//Match was found
|
||||
wxMessageBox(_T("A match was found. Placing viewer at the offset."));
|
||||
wxChar tmpwxstr[128]={0};
|
||||
wxSprintf(tmpwxstr,_T("%08x"),i);
|
||||
wxChar tmpwxstr[128] = {0};
|
||||
wxSprintf(tmpwxstr, _T("%08x"), i);
|
||||
wxString tmpwx(tmpwxstr);
|
||||
addrbox->SetValue(tmpwx);
|
||||
//memview->curAddress=i;
|
||||
//memview->curAddress = i;
|
||||
//memview->Refresh();
|
||||
OnAddrBoxChange(event);
|
||||
return;
|
||||
@@ -414,10 +428,12 @@ void CMemoryWindow::onSearch(wxCommandEvent& event) {
|
||||
}
|
||||
}
|
||||
|
||||
void CMemoryWindow::onAscii(wxCommandEvent& event) {
|
||||
void CMemoryWindow::onAscii(wxCommandEvent& event)
|
||||
{
|
||||
chkHex->SetValue(0);
|
||||
}
|
||||
|
||||
void CMemoryWindow::onHex(wxCommandEvent& event) {
|
||||
void CMemoryWindow::onHex(wxCommandEvent& event)
|
||||
{
|
||||
chkAscii->SetValue(0);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ class CMemoryWindow
|
||||
long style = wxNO_BORDER,
|
||||
const wxString& name = _T("Memory"));
|
||||
|
||||
~CMemoryWindow();
|
||||
~CMemoryWindow();
|
||||
wxCheckBox* chk8;
|
||||
wxCheckBox* chk16;
|
||||
wxCheckBox* chk32;
|
||||
@@ -56,7 +56,7 @@ class CMemoryWindow
|
||||
void Update();
|
||||
void NotifyMapLoaded();
|
||||
|
||||
void JumpToAddress(u32 _Address);
|
||||
void JumpToAddress(u32 _Address);
|
||||
|
||||
private:
|
||||
CMemoryView* memview;
|
||||
|
||||
@@ -132,12 +132,12 @@ CPanel::CPanel(
|
||||
case WM_USER_PAUSE:
|
||||
main_frame->DoPause();
|
||||
break;
|
||||
|
||||
|
||||
// Stop
|
||||
case WM_USER_STOP:
|
||||
main_frame->DoStop();
|
||||
break;
|
||||
|
||||
|
||||
case WM_USER_CREATE:
|
||||
break;
|
||||
|
||||
@@ -336,8 +336,7 @@ CFrame::CFrame(wxFrame* parent,
|
||||
bool ShowLogWindow,
|
||||
long style)
|
||||
: CRenderFrame(parent, id, title, pos, size, style)
|
||||
, g_pCodeWindow(NULL)
|
||||
, m_MenuBar(NULL)
|
||||
, g_pCodeWindow(NULL)
|
||||
, bRenderToMain(false), bNoWiimoteMsg(false)
|
||||
, m_ToolBar(NULL), m_ToolBarDebug(NULL), m_ToolBarAui(NULL)
|
||||
, m_pStatusBar(NULL), m_GameListCtrl(NULL), m_Panel(NULL)
|
||||
@@ -369,7 +368,7 @@ CFrame::CFrame(wxFrame* parent,
|
||||
g_pCodeWindow = new CCodeWindow(SConfig::GetInstance().m_LocalCoreStartupParameter, this, IDM_CODEWINDOW);
|
||||
g_pCodeWindow->Hide();
|
||||
g_pCodeWindow->Load();
|
||||
}
|
||||
}
|
||||
|
||||
// Create timer
|
||||
#if wxUSE_TIMER
|
||||
@@ -377,7 +376,7 @@ CFrame::CFrame(wxFrame* parent,
|
||||
m_timer.Start( floor((double)(1000 / TimesPerSecond)) );
|
||||
#endif
|
||||
|
||||
// Create toolbar bitmaps
|
||||
// Create toolbar bitmaps
|
||||
InitBitmaps();
|
||||
|
||||
// Give it an icon
|
||||
@@ -402,7 +401,7 @@ CFrame::CFrame(wxFrame* parent,
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxLC_REPORT | wxSUNKEN_BORDER | wxLC_ALIGN_LEFT);
|
||||
|
||||
sizerPanel = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer *sizerPanel = new wxBoxSizer(wxHORIZONTAL);
|
||||
sizerPanel->Add(m_GameListCtrl, 1, wxEXPAND | wxALL);
|
||||
m_Panel->SetSizer(sizerPanel);
|
||||
// ---------------
|
||||
@@ -411,9 +410,6 @@ CFrame::CFrame(wxFrame* parent,
|
||||
// wxAUI_MGR_LIVE_RESIZE does not exist in the wxWidgets 2.8.9 that comes with Ubuntu 9.04
|
||||
// Could just check for wxWidgets version if it becomes a problem.
|
||||
m_Mgr = new wxAuiManager(this, wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE);
|
||||
NOTEBOOK_STYLE = wxAUI_NB_TOP | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_EXTERNAL_MOVE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_WINDOWLIST_BUTTON | wxNO_BORDER;
|
||||
TOOLBAR_STYLE = wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT /*wxAUI_TB_OVERFLOW overflow visible*/;
|
||||
aNormalFile = wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16));
|
||||
|
||||
if (g_pCodeWindow)
|
||||
{
|
||||
@@ -427,7 +423,7 @@ CFrame::CFrame(wxFrame* parent,
|
||||
|
||||
// Setup perspectives
|
||||
if (g_pCodeWindow)
|
||||
{
|
||||
{
|
||||
m_Mgr->GetPane(wxT("Pane 0")).CenterPane().PaneBorder(false);
|
||||
AuiFullscreen = m_Mgr->SavePerspective();
|
||||
m_Mgr->GetPane(wxT("Pane 0")).CenterPane().PaneBorder(true);
|
||||
@@ -453,7 +449,7 @@ CFrame::CFrame(wxFrame* parent,
|
||||
|
||||
// Setup perspectives
|
||||
if (g_pCodeWindow)
|
||||
{
|
||||
{
|
||||
// Load perspective
|
||||
SaveLocal();
|
||||
DoLoadPerspective();
|
||||
@@ -470,7 +466,7 @@ CFrame::CFrame(wxFrame* parent,
|
||||
// Show window
|
||||
Show();
|
||||
|
||||
// Commit
|
||||
// Commit
|
||||
m_Mgr->Update();
|
||||
|
||||
// Create cursors
|
||||
@@ -518,6 +514,9 @@ CFrame::~CFrame()
|
||||
delete m_XRRConfig;
|
||||
#endif
|
||||
|
||||
// Close the log window now so that its settings are saved
|
||||
m_LogWindow->Close();
|
||||
|
||||
ClosePages();
|
||||
|
||||
delete m_Mgr;
|
||||
@@ -742,7 +741,7 @@ void CFrame::OnGameListCtrl_ItemActivated(wxListEvent& WXUNUSED (event))
|
||||
SConfig::GetInstance().m_ListWad = SConfig::GetInstance().m_ListJap =
|
||||
SConfig::GetInstance().m_ListUsa = SConfig::GetInstance().m_ListPal =
|
||||
SConfig::GetInstance().m_ListFrance = SConfig::GetInstance().m_ListItaly =
|
||||
SConfig::GetInstance().m_ListKorea = SConfig::GetInstance().m_ListTaiwan =
|
||||
SConfig::GetInstance().m_ListKorea = SConfig::GetInstance().m_ListTaiwan =
|
||||
SConfig::GetInstance().m_ListUnknown= true;
|
||||
|
||||
GetMenuBar()->FindItem(IDM_LISTGC)->Check(true);
|
||||
@@ -758,7 +757,7 @@ void CFrame::OnGameListCtrl_ItemActivated(wxListEvent& WXUNUSED (event))
|
||||
GetMenuBar()->FindItem(IDM_LIST_UNK)->Check(true);
|
||||
|
||||
m_GameListCtrl->Update();
|
||||
}
|
||||
}
|
||||
else
|
||||
// Game started by double click
|
||||
BootGame(std::string(""));
|
||||
@@ -811,7 +810,7 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
|
||||
if (event.GetModifiers() == wxMOD_NONE)
|
||||
State_UndoSaveState();
|
||||
else if (event.GetModifiers() == wxMOD_SHIFT)
|
||||
State_UndoLoadState();
|
||||
State_UndoLoadState();
|
||||
else
|
||||
event.Skip();
|
||||
}
|
||||
@@ -864,42 +863,6 @@ void CFrame::OnKeyUp(wxKeyEvent& event)
|
||||
}
|
||||
}
|
||||
|
||||
wxFrame * CFrame::CreateParentFrame(wxWindowID Id, const wxString& Title, wxWindow * Child)
|
||||
{
|
||||
wxFrame * Frame = new wxFrame(this, Id, Title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE);
|
||||
|
||||
Child->Reparent(Frame);
|
||||
Child->Show();
|
||||
|
||||
wxBoxSizer * m_MainSizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
m_MainSizer->Add(Child, 1, wxEXPAND);
|
||||
|
||||
Frame->Connect(wxID_ANY, wxEVT_CLOSE_WINDOW,
|
||||
wxCloseEventHandler(CFrame::OnFloatingPageClosed),
|
||||
(wxObject*)0, this);
|
||||
|
||||
if (Id == IDM_CONSOLEWINDOW_PARENT)
|
||||
{
|
||||
Frame->Connect(wxID_ANY, wxEVT_SIZE,
|
||||
wxSizeEventHandler(CFrame::OnFloatingPageSize),
|
||||
(wxObject*)0, this);
|
||||
}
|
||||
|
||||
// Main sizer
|
||||
Frame->SetSizer( m_MainSizer );
|
||||
// Minimum frame size
|
||||
Frame->SetMinSize(wxSize(200, -1));
|
||||
Frame->Show();
|
||||
return Frame;
|
||||
}
|
||||
|
||||
wxAuiNotebook* CFrame::CreateEmptyNotebook()
|
||||
{
|
||||
wxAuiNotebook* NB = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, NOTEBOOK_STYLE);
|
||||
return NB;
|
||||
}
|
||||
|
||||
void CFrame::DoFullscreen(bool bF)
|
||||
{
|
||||
ToggleDisplayMode(bF);
|
||||
|
||||
@@ -114,8 +114,6 @@ class CFrame : public CRenderFrame
|
||||
|
||||
// These have to be public
|
||||
CCodeWindow* g_pCodeWindow;
|
||||
wxMenuBar* m_MenuBar;
|
||||
wxBitmap aNormalFile;
|
||||
void InitBitmaps();
|
||||
void DoPause();
|
||||
void DoStop();
|
||||
@@ -143,8 +141,6 @@ class CFrame : public CRenderFrame
|
||||
// AUI
|
||||
wxAuiManager *m_Mgr;
|
||||
wxAuiToolBar *m_ToolBar, *m_ToolBarDebug, *m_ToolBarAui;
|
||||
long NOTEBOOK_STYLE, TOOLBAR_STYLE;
|
||||
int iLeftWidth[2], iMidWidth[2];
|
||||
bool bFloatWindow[IDM_VIDEOWINDOW - IDM_LOGWINDOW + 1];
|
||||
|
||||
// Utility
|
||||
@@ -169,9 +165,8 @@ class CFrame : public CRenderFrame
|
||||
void ShowAllNotebooks(bool Window = false);
|
||||
void HideAllNotebooks(bool Window = false);
|
||||
void CloseAllNotebooks();
|
||||
void DoAddPage(wxWindow *, int, bool);
|
||||
void DoRemovePage(wxWindow *, bool Hide = true);
|
||||
void DoRemovePageId(wxWindowID Id, bool bHide, bool bDestroy);
|
||||
void DoAddPage(wxWindow *Win, int i, bool Float);
|
||||
void DoRemovePage(wxWindow *, bool bHide = true);
|
||||
void TogglePane();
|
||||
void SetSimplePaneSize();
|
||||
void SetPaneSize();
|
||||
@@ -210,7 +205,6 @@ class CFrame : public CRenderFrame
|
||||
|
||||
private:
|
||||
wxStatusBar* m_pStatusBar;
|
||||
wxBoxSizer* sizerPanel;
|
||||
wxBoxSizer* sizerFrame;
|
||||
CGameListCtrl* m_GameListCtrl;
|
||||
wxPanel* m_Panel;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -100,7 +100,7 @@ void CFrame::CreateMenu()
|
||||
{
|
||||
if (GetMenuBar()) GetMenuBar()->Destroy();
|
||||
|
||||
m_MenuBar = new wxMenuBar(wxMB_DOCKABLE);
|
||||
wxMenuBar *m_MenuBar = new wxMenuBar();
|
||||
|
||||
// file menu
|
||||
wxMenu* fileMenu = new wxMenu;
|
||||
@@ -367,6 +367,7 @@ void CFrame::RecreateToolbar()
|
||||
m_ToolBar->Destroy();
|
||||
}
|
||||
|
||||
long TOOLBAR_STYLE = wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT /*wxAUI_TB_OVERFLOW overflow visible*/;
|
||||
m_ToolBar = new wxAuiToolBar(this, ID_TOOLBAR, wxDefaultPosition, wxDefaultSize, TOOLBAR_STYLE);
|
||||
|
||||
PopulateToolbar(m_ToolBar);
|
||||
@@ -495,8 +496,6 @@ void CFrame::InitBitmaps()
|
||||
|
||||
// Update in case the bitmap has been updated
|
||||
if (m_ToolBar != NULL) RecreateToolbar();
|
||||
|
||||
aNormalFile = wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16));
|
||||
}
|
||||
|
||||
// Menu items
|
||||
@@ -1325,10 +1324,8 @@ void CFrame::UpdateGUI()
|
||||
// Game has not started, show game list
|
||||
if (!m_GameListCtrl->IsShown())
|
||||
{
|
||||
m_GameListCtrl->Reparent(m_Panel);
|
||||
m_GameListCtrl->Enable();
|
||||
m_GameListCtrl->Show();
|
||||
sizerPanel->FitInside(m_Panel);
|
||||
}
|
||||
// Game has been selected but not started, enable play button
|
||||
if (m_GameListCtrl->GetSelectedISO() != NULL && m_GameListCtrl->IsEnabled() && !m_bGameLoading)
|
||||
|
||||
@@ -165,7 +165,6 @@ CLogWindow::~CLogWindow()
|
||||
void CLogWindow::OnClose(wxCloseEvent& event)
|
||||
{
|
||||
SaveSettings();
|
||||
wxGetApp().GetCFrame()->ToggleLogWindow(false);
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user