diff options
author | KuroiIeWa5Da <tyuki@adu.me> | 2012-01-23 10:12:07 -0600 |
---|---|---|
committer | KuroiIeWa5Da <tyuki@adu.me> | 2012-01-23 10:12:07 -0600 |
commit | 91caaf136f76780bc9aa1dc177e6e828996c09f3 (patch) | |
tree | a76c496b2e543943c4d43c9efef9c85a344250fa /music/pokeredmusicdisasm/Parser.cpp | |
parent | ae1950503dc9fdafdc688817b5c0b932a83f1fc3 (diff) | |
parent | d152bc24ab0fe2c5342cf6cd3118d3c188c87557 (diff) |
kanzure merge
hg-commit-id: e3c957606729
Diffstat (limited to 'music/pokeredmusicdisasm/Parser.cpp')
-rw-r--r-- | music/pokeredmusicdisasm/Parser.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/music/pokeredmusicdisasm/Parser.cpp b/music/pokeredmusicdisasm/Parser.cpp index a548b015..9fa0af7f 100644 --- a/music/pokeredmusicdisasm/Parser.cpp +++ b/music/pokeredmusicdisasm/Parser.cpp @@ -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;
@@ -103,7 +114,6 @@ void Parser::ParseNext() // Parses the block immidiately following for(unsigned int i = filePos; (i <= fileLength) && (stop == false); i++)
{
// There's a way to make this block shorter but for now it does it's job
- filePos = i;
// Check to see if it's the correct data type and if so then use it
if(tmpCall.IsValid(&rawBytesFixed[i])) // Should have made IsValid static
@@ -192,6 +202,11 @@ void Parser::ParseNext() // Parses the block immidiately following unkCode << "db $" << hex << uppercase << (short)rawBytesFixed[i];
parsedString.push_back(unkCode.str());
}
+
+ filePos = i;
+
+ // 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
|