diff options
author | Bryan Bishop <kanzure@gmail.com> | 2012-05-11 13:05:02 -0500 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2012-05-11 13:05:02 -0500 |
commit | 55c174d3424cf314cfb0fc278de8b0d12e372329 (patch) | |
tree | d988641b7657a136c8149dc5c4f9ed792e6d242c /extras/crystal.py | |
parent | e7913e7a904649a63961d9c63dee17e5c7ec79a4 (diff) |
fix TextScript bug - to_asm should not modify self.size
Diffstat (limited to 'extras/crystal.py')
-rw-r--r-- | extras/crystal.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/extras/crystal.py b/extras/crystal.py index a26cd1c80..bcff6c228 100644 --- a/extras/crystal.py +++ b/extras/crystal.py @@ -483,17 +483,28 @@ class TextScript: end = cls.end # skip past the command's parameter bytes to go to the next command - current_address += cls.size + #current_address += cls.size + current_address = cls.last_address # last byte belonging to script is last byte of last command, # or the last byte of the last command's last parameter # (actually i think this might be the next byte after??) self.last_address = current_address + if self.debug: + print "cls.address is: " + hex(cls.address) + print "cls.size is: " + hex(cls.size) + print "cls.last_address is: " + hex(cls.last_address) + print "self.last_address is: " + hex(self.last_address) + + assert self.last_address == (cls.address + cls.size), "the last address should equal the last command's (address + size)" + assert self.last_address == cls.last_address, "the last address of the TextScript should be the last_address of its last command" + # just some debugging.. - last_address = self.last_address - print "TextScript last_address == " + hex(last_address) - #assert last_address != 0x5db06, "TextScript.parse somehow has a text with a last_address of 0x5db06 instead of 0x5db07" + if self.debug: + last_address = self.last_address + print "TextScript last_address == " + hex(last_address) + #assert last_address != 0x5db06, "TextScript.parse somehow has a text with a last_address of 0x5db06 instead of 0x5db07" # store the script in the global table/map thing script_parse_table[start_address:current_address] = self @@ -2311,8 +2322,6 @@ class MainText(TextCommand): if output[-1] == "\n": output = output[:-1] - self.size = len(self.bytes) - return output class WriteTextFromRAM(TextCommand): |