updated disassembly program to support a custom stop address

hg-commit-id: a2bee0bdb345
This commit is contained in:
KuroiIeWa5Da 2012-01-23 03:59:25 -06:00
parent 7b5159fb06
commit a297c105b5
3 changed files with 53 additions and 5 deletions

View file

@ -9,6 +9,7 @@ Parser::Parser()
fileLength = 0;
filePos = 0;
stop = false;
stopAddress = 0;
}
Parser::Parser(std::string filename)
@ -46,6 +47,16 @@ void Parser::SetFilename(std::string value)
Read();
}
unsigned int Parser::GetStopAddress()
{
return stopAddress;
}
void Parser::SetStopAddress(unsigned int value)
{
stopAddress = value;
}
string Parser::GetParsedAsm()
{
string tmpStr;
@ -192,6 +203,9 @@ void Parser::ParseNext() // Parses the block immidiately following
unkCode << "db $" << hex << uppercase << (short)rawBytesFixed[i];
parsedString.push_back(unkCode.str());
}
// If the stop address parameter is set, break when we get there
if( (stopAddress != 0) && (i >= stopAddress) ) break;
}
// Now record the postion we left off