diff options
| author | Bryan Bishop <kanzure@gmail.com> | 2012-01-23 10:15:06 -0600 |
|---|---|---|
| committer | Bryan Bishop <kanzure@gmail.com> | 2012-01-23 10:15:06 -0600 |
| commit | 177c1dccba84f7010bc404067835c275feb8c983 (patch) | |
| tree | f2670b7502b7fb02b39205531574552a342b3f8c /music/pokeredmusicdisasm/Parser.cpp | |
| parent | $039e -> HandleMidJump (diff) | |
| parent | kanzure merge (diff) | |
| download | pokeyellow-177c1dccba84f7010bc404067835c275feb8c983.tar.gz pokeyellow-177c1dccba84f7010bc404067835c275feb8c983.tar.xz pokeyellow-177c1dccba84f7010bc404067835c275feb8c983.zip | |
merge KuroiIeWa5Da/pokered
hg-commit-id: 18f5e99b6ae1
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
|
