summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2013-02-27 21:38:53 -0600
committerBryan Bishop <kanzure@gmail.com>2013-02-27 21:38:53 -0600
commita1dce154d45909a83f0ec36216e4a821813c0884 (patch)
tree5ed7757a5a5e6b8d54e860dfde6946bba80e9810
parent1230ed649a65b9767f29df3c4227cd328081907a (diff)
update automatic main.asm insertion
This updates the automatic parsing of main.asm to catch cases of INCBINs pulling in files that end in .asm, .lz, .1bpp, and .2bpp. This is necessary because otherwise the parser tries to figure out the start and end addresses expressed on the INCBIN line, details not present on these types of lines in the asm. Asm and Asm.insert_all are now back in working condition. original-commit-id: 0e2ab04353bf5fa3114aa87e77e5366af6aa942c
-rw-r--r--crystal.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/crystal.py b/crystal.py
index fa5ce80..398c882 100644
--- a/crystal.py
+++ b/crystal.py
@@ -6752,7 +6752,7 @@ class Asm:
asm_list = AsmList(asm)
bank = 0
for line in asm_list:
- if line[0:6] == "INCBIN" or line[1:6] == "INCBIN":
+ if (line[0:6] == "INCBIN" or line[1:6] == "INCBIN") and not any([contaminant+"\"" in line for contaminant in [".2bpp", ".1bpp", ".asm", ".lz"]]):
thing = Incbin(line, bank=bank)
elif line[0:7] == "SECTION":
thing = AsmSection(line)
@@ -6817,11 +6817,13 @@ class Asm:
# check if the object is already inserted
if new_object in self.parts:
- print "object was previously inserted ("+str(new_object)+")"
+ print "object was previously inserted ("+str(new_object)+"; " + hex(new_object.address) + ")"
return
# check by label
- if self.is_label_name_in_file(new_object.label.name):
- print "object was previously inserted ("+str(new_object)+") by label: "+new_object.label.name
+ other_obj = self.is_label_name_in_file(new_object.label.name)
+ if other_obj:
+ other_obj = other_obj.object
+ print "object was previously inserted ("+new_object.label.name+" at "+hex(new_object.address)+") by "+other_obj.label.name+" at "+hex(other_obj.address)
return
# check by address
#if self.does_address_have_label(new_object.address):