summaryrefslogtreecommitdiff
path: root/extras
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
commit0e2ab04353bf5fa3114aa87e77e5366af6aa942c (patch)
tree5471dfac797ba21a64193b29610ed470d50f1b8c /extras
parent381d3e76b73302672c0d568600f78f15f5cd0fcf (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.
Diffstat (limited to 'extras')
-rw-r--r--extras/crystal.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/extras/crystal.py b/extras/crystal.py
index fa5ce8051..398c88241 100644
--- a/extras/crystal.py
+++ b/extras/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):