shithub: pokered

Download patch

ref: f4b8782536cbc5d4d380f7fd4b5c5be8a64e2593
parent: 25df78ecf338b150cb78fbd0409aa8fe47a4a0dd
author: Bryan Bishop <kanzure@gmail.com>
date: Mon Jan 30 08:46:31 EST 2012

tool to sort INCBINs by interval length

hg-commit-id: 3d687a971202


--- a/extras/analyze_incbins.py
+++ b/extras/analyze_incbins.py
@@ -416,6 +416,24 @@
     fh.write(json.dumps(all_labels))
     fh.close()
 
+def analyze_intervals():
+    """find the largest baserom.gbc intervals"""
+    global asm
+    global processed_incbins
+    if asm == None:
+        load_asm()
+    if processed_incbins == {}:
+        isolate_incbins()
+        process_incbins()
+    
+    results = []
+    ordered_keys = sorted(processed_incbins, key=lambda entry: processed_incbins[entry]["interval"])
+    ordered_keys.reverse()
+    for key in ordered_keys:
+        results.append(processed_incbins[key])
+
+    return results
+
 if __name__ == "__main__":
     #load map headers
     load_rom()