Added option to specify a range of addresses in MemoryChecks.ini.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@906 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson 2008-10-18 03:01:28 +00:00
parent 7804c2c026
commit b95ea6ceb6

View File

@ -290,13 +290,40 @@ CBreakPointWindow::OnAddMemoryCheckMany(wxCommandEvent& event)
for (std::vector<std::string>::const_iterator iter = lines.begin(); iter != lines.end(); ++iter) for (std::vector<std::string>::const_iterator iter = lines.begin(); iter != lines.end(); ++iter)
{ {
std::string line = StripSpaces(*iter); std::string line = StripSpaces(*iter);
u32 Address = 0; std::vector<std::string> pieces;
if (AsciiToHex(line.c_str(), Address)) SplitString(line, " ", pieces);
{
// settting for the memory check
TMemCheck MemCheck; TMemCheck MemCheck;
MemCheck.StartAddress = Address; u32 sAddress = 0;
MemCheck.EndAddress = Address; u32 eAddress = 0;
bool doCommon = false;
if (
pieces.size() == 1
&& AsciiToHex(pieces[0].c_str(), sAddress)
&& pieces[0].size() == 8
)
{
// address range
MemCheck.StartAddress = sAddress;
MemCheck.EndAddress = sAddress;
doCommon = true;
}
else if(
pieces.size() == 2
&& AsciiToHex(pieces[0].c_str(), sAddress) && AsciiToHex(pieces[1].c_str(), eAddress)
&& pieces[0].size() == 8 && pieces[1].size() == 8
)
{
// address range
MemCheck.StartAddress = sAddress;
MemCheck.EndAddress = eAddress;
doCommon = true;
}
if(doCommon)
{
// settings for the memory check
MemCheck.OnRead = true; MemCheck.OnRead = true;
MemCheck.OnWrite = true; MemCheck.OnWrite = true;
MemCheck.Log = true; MemCheck.Log = true;