shithub: pokered

Download patch

ref: 19a859ca51d847a99f7120f673cda71a2a3434cf
parent: db0c37557d6ce7c0c903ba2ef17fa5d68da9e1cf
author: sawakita <sawakitanoodles@gmail.com>
date: Mon Oct 1 14:59:51 EDT 2012

Improve error checking in the context of issue #27

Link to kanzures' guidelines for that issue:
https://bitbucket.org/iimarckus/pokered/issue/27/analyze_incbinsscan_for_predifined_labels#comment-2068911

--- a/extras/analyze_incbins.py
+++ b/extras/analyze_incbins.py
@@ -409,6 +409,9 @@
     bank_intervals = {}
     all_labels = []
 
+    if asm is None:
+        load_asm()
+
     #figure out line numbers for each bank
     for bank_id in range(0x2d):
         abbreviation = ("%.x" % (bank_id)).upper()
--- a/extras/gbz80disasm.py
+++ b/extras/gbz80disasm.py
@@ -561,7 +561,9 @@
     if os.path.exists(filename):
         all_labels = json.loads(open(filename, "r").read())
     else:
-        print "You must run analyze_incbins.scan_for_predefined_labels() to create \"labels.json\"."
+        print "You must run analyze_incbins.scan_for_predefined_labels() to create \"labels.json\". Trying..."
+        import analyze_incbins
+        analyze_incbins.scan_for_predefined_labels()
 load_labels()
 
 def find_label(local_address, bank_id=0):