diff options
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
|