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
This commit is contained in:
sawakita 2012-10-01 18:59:51 +02:00
parent db0c37557d
commit 19a859ca51
2 changed files with 6 additions and 1 deletions

View file

@ -409,6 +409,9 @@ def scan_for_predefined_labels():
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()

View file

@ -561,7 +561,9 @@ def load_labels(filename="labels.json"):
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):