diff options
author | Bryan Bishop <kanzure@gmail.com> | 2012-05-29 15:04:19 -0500 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2012-05-29 15:04:19 -0500 |
commit | e9547816187c8df17f8da0e7f3c786bc5145708d (patch) | |
tree | 7326d6cc37c2c2723b04a4c7e12ed29d6fa54c9e /extras/comparator.py | |
parent | 0526702a5ee907b47df237f44eaf9fb6a6d56a1b (diff) |
hooray PrintNumber_PrintLeadingZero is also shared
Diffstat (limited to 'extras/comparator.py')
-rw-r--r-- | extras/comparator.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/extras/comparator.py b/extras/comparator.py index b274e6a62..0c9e62a5e 100644 --- a/extras/comparator.py +++ b/extras/comparator.py @@ -110,7 +110,11 @@ class BinaryBlob(object): r += "label=\""+self.label+"\", " r += "start_address="+hex(self.start_address)+", " r += "size="+str(self.end_address - self.start_address)+", " - r += "located="+str(len(self.locations) > 0) + locnum = len(self.locations) + if locnum == 1: + r += "located="+hex(self.locations[0]) + else: + r += "located="+str(locnum) r += ")" return r @@ -170,9 +174,9 @@ def scan_red_asm(bank_stop=3, debug=True): current_bank = 0 current_label = None - latest_label = None + latest_label = "ignore me" current_start_address = None - latest_start_address = None + latest_start_address = 0 latest_line = "" for line in redsrc: @@ -192,8 +196,9 @@ def scan_red_asm(bank_stop=3, debug=True): current_start_address = get_address_from_line_comment(line, \ bank=current_bank) - if current_label != None and current_start_address != None and \ - current_start_address != 0 and current_start_address != latest_start_address: + if current_label != None and current_start_address != None and latest_start_address != None \ + and current_start_address != 0 and current_start_address != latest_start_address \ + and (current_start_address - latest_start_address) > 1: if latest_label != None: if latest_label not in ["Char52", "PokeCenterSignText", "DefaultNamesPlayer", "Unnamed_6a12"]: blob = BinaryBlob(label=latest_label, \ @@ -226,3 +231,5 @@ for blob in found_blobs: print "Found " + str(len(found_blobs)) + " possibly copied functions." +print [hex(x) for x in found_blobs[10].locations] + |