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/
|
|
|
|
|
2013-04-15 20:28:55 +00:00
|
|
|
// Official Git repository and contact information can be found at
|
2008-12-08 05:30:24 +00:00
|
|
|
// 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"
|
2013-02-28 04:37:38 +00:00
|
|
|
#include "../WxUtils.h"
|
2008-12-08 05:30:24 +00:00
|
|
|
|
2011-02-27 23:03:08 +00:00
|
|
|
BEGIN_EVENT_TABLE(BreakPointDlg, wxDialog)
|
|
|
|
EVT_BUTTON(wxID_OK, BreakPointDlg::OnOK)
|
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"));
|
|
|
|
|
|
|
|
wxBoxSizer *sMainSizer = new wxBoxSizer(wxVERTICAL);
|
|
|
|
sMainSizer->Add(m_pEditAddress, 0, wxEXPAND | wxALL, 5);
|
2011-03-17 04:26:01 +00:00
|
|
|
sMainSizer->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxALL, 5);
|
2008-12-08 05:30:24 +00:00
|
|
|
|
2011-03-17 04:26:01 +00:00
|
|
|
SetSizerAndFit(sMainSizer);
|
|
|
|
SetFocus();
|
2008-12-08 05:30:24 +00:00
|
|
|
}
|
|
|
|
|
2011-03-17 04:26:01 +00:00
|
|
|
void BreakPointDlg::OnOK(wxCommandEvent& event)
|
2008-12-08 05:30:24 +00:00
|
|
|
{
|
|
|
|
wxString AddressString = m_pEditAddress->GetLineText(0);
|
|
|
|
u32 Address = 0;
|
2013-02-28 04:37:38 +00:00
|
|
|
if (AsciiToHex(WxStrToStr(AddressString).c_str(), Address))
|
2008-12-08 05:30:24 +00:00
|
|
|
{
|
2009-06-28 11:47:39 +00:00
|
|
|
PowerPC::breakpoints.Add(Address);
|
2009-08-27 11:08:52 +00:00
|
|
|
Parent->NotifyUpdate();
|
2013-04-08 05:16:50 +00:00
|
|
|
Close();
|
2008-12-08 05:30:24 +00:00
|
|
|
}
|
2011-02-27 23:03:08 +00:00
|
|
|
else
|
2013-04-08 05:16:50 +00:00
|
|
|
{
|
2013-02-28 04:37:38 +00:00
|
|
|
PanicAlert("The address %s is invalid.", WxStrToStr(AddressString).c_str());
|
2013-04-08 05:16:50 +00:00
|
|
|
}
|
2008-12-08 05:30:24 +00:00
|
|
|
|
2011-03-17 04:26:01 +00:00
|
|
|
event.Skip();
|
2008-12-08 05:30:24 +00:00
|
|
|
}
|