2009-07-28 21:32:10 +00:00
|
|
|
// Copyright (C) 2003 Dolphin Project.
|
2008-12-08 05:30:24 +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/
|
|
|
|
|
2011-02-27 23:03:08 +00:00
|
|
|
#include "BreakpointDlg.h"
|
2008-12-08 05:30:24 +00:00
|
|
|
#include "StringUtil.h"
|
2009-07-07 15:12:52 +00:00
|
|
|
#include "PowerPC/PowerPC.h"
|
2009-08-31 21:07:20 +00:00
|
|
|
#include "BreakpointWindow.h"
|
2008-12-08 05:30:24 +00:00
|
|
|
|
2011-02-27 23:03:08 +00:00
|
|
|
BEGIN_EVENT_TABLE(BreakPointDlg, wxDialog)
|
2008-12-08 05:30:24 +00:00
|
|
|
EVT_CLOSE(BreakPointDlg::OnClose)
|
2011-02-27 23:03:08 +00:00
|
|
|
EVT_BUTTON(wxID_OK, BreakPointDlg::OnOK)
|
|
|
|
EVT_BUTTON(wxID_CANCEL, BreakPointDlg::OnCancel)
|
2008-12-08 05:30:24 +00:00
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
2011-02-27 23:03:08 +00:00
|
|
|
BreakPointDlg::BreakPointDlg(CBreakPointWindow *_Parent)
|
|
|
|
: wxDialog(_Parent, wxID_ANY, wxT("BreakPoint"), wxDefaultPosition, wxDefaultSize)
|
|
|
|
, Parent(_Parent)
|
2008-12-08 05:30:24 +00:00
|
|
|
{
|
2011-02-27 23:03:08 +00:00
|
|
|
m_pEditAddress = new wxTextCtrl(this, wxID_ANY, wxT("80000000"));
|
|
|
|
wxButton *m_pButtonOK = new wxButton(this, wxID_OK, wxT("OK"));
|
|
|
|
wxButton *m_pButtonCancel = new wxButton(this, wxID_CANCEL, wxT("Cancel"));
|
|
|
|
|
|
|
|
wxBoxSizer* sButtons = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
sButtons->AddStretchSpacer();
|
|
|
|
sButtons->Add(m_pButtonCancel, 0);
|
|
|
|
sButtons->Add(m_pButtonOK, 0);
|
|
|
|
|
|
|
|
wxBoxSizer *sMainSizer = new wxBoxSizer(wxVERTICAL);
|
|
|
|
sMainSizer->Add(m_pEditAddress, 0, wxEXPAND | wxALL, 5);
|
|
|
|
sMainSizer->Add(sButtons, 0, wxALL, 5);
|
|
|
|
|
|
|
|
SetSizer(sMainSizer);
|
|
|
|
Layout();
|
|
|
|
Fit();
|
2008-12-08 05:30:24 +00:00
|
|
|
}
|
|
|
|
|
2011-02-27 23:03:08 +00:00
|
|
|
void BreakPointDlg::OnClose(wxCloseEvent& WXUNUSED(event))
|
2008-12-08 05:30:24 +00:00
|
|
|
{
|
2011-02-27 23:03:08 +00:00
|
|
|
EndModal(wxID_CLOSE);
|
2008-12-08 05:30:24 +00:00
|
|
|
Destroy();
|
|
|
|
}
|
|
|
|
|
2011-02-27 23:03:08 +00:00
|
|
|
void BreakPointDlg::OnOK(wxCommandEvent& WXUNUSED(event))
|
2008-12-08 05:30:24 +00:00
|
|
|
{
|
|
|
|
wxString AddressString = m_pEditAddress->GetLineText(0);
|
|
|
|
u32 Address = 0;
|
|
|
|
if (AsciiToHex(AddressString.mb_str(), Address))
|
|
|
|
{
|
2009-06-28 11:47:39 +00:00
|
|
|
PowerPC::breakpoints.Add(Address);
|
2009-08-27 11:08:52 +00:00
|
|
|
Parent->NotifyUpdate();
|
2008-12-08 05:30:24 +00:00
|
|
|
Close();
|
|
|
|
}
|
2011-02-27 23:03:08 +00:00
|
|
|
else
|
|
|
|
PanicAlert("The address %s is invalid.", (const char *)AddressString.ToUTF8());
|
2008-12-08 05:30:24 +00:00
|
|
|
}
|
|
|
|
|
2011-02-27 23:03:08 +00:00
|
|
|
void BreakPointDlg::OnCancel(wxCommandEvent& WXUNUSED(event))
|
2008-12-08 05:30:24 +00:00
|
|
|
{
|
|
|
|
Close();
|
|
|
|
}
|