diff options
author | Bryan Bishop <kanzure@gmail.com> | 2012-05-16 15:22:39 -0500 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2012-05-16 15:22:39 -0500 |
commit | a53b5ae051d0d1d054da2ff0ee64247ea1663ee2 (patch) | |
tree | 8ac04bd6ed17fa974b3da85f7e16db35a04a1af1 /extras/crystal.py | |
parent | 34c6b38da6026b3a877c68541d0d7bd0ec1373e9 (diff) |
handle dragon shrine recursion (but not others?)
Diffstat (limited to 'extras/crystal.py')
-rw-r--r-- | extras/crystal.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/extras/crystal.py b/extras/crystal.py index c32724cc5..687b8b657 100644 --- a/extras/crystal.py +++ b/extras/crystal.py @@ -30,6 +30,8 @@ if not hasattr(json, "read"): spacing = "\t" +lousy_dragon_shrine_hack = [0x18d079, 0x18d0a9, 0x18d061, 0x18d091] + #table of pointers to map groups #each map group contains some number of map headers map_group_pointer_table = 0x94000 @@ -5775,12 +5777,19 @@ class Asm: # its' probably being injected in some get_dependencies() somewhere print "don't know why ScriptPointerLabelParam is getting to this point?" return - start_address = new_object.address #first some validation if not hasattr(new_object, "address"): print "object needs to have an address property: " + str(new_object) return + + start_address = new_object.address + + # skip this dragon shrine script calling itself + # what about other scripts that call themselves ? + if start_address in lousy_dragon_shrine_hack: + print "skipping 0x18d079 in dragon shrine for a lousy hack" + return if not hasattr(new_object, "label") and hasattr(new_object, "is_valid") and not new_object.is_valid(): return @@ -5847,6 +5856,10 @@ class Asm: self.parts.remove(object) found = True break + elif object.address <= start_address < object.last_address: + print "this is probably a script that is looping back on itself?" + found = True + break #insert before the current object elif object.address > end_address: #insert_before = index of object @@ -6104,6 +6117,10 @@ def get_label_for(address): if type(address) != int: raise Exception, "get_label_for requires an integer address, got: " + str(type(address)) + # lousy hack to get around recursive scripts in dragon shrine + if address in lousy_dragon_shrine_hack: + return None + #the old way for thing in all_labels: if thing["address"] == address: |