shithub: pokecrystal

Download patch

ref: 3010a1fbb3cdb7c86803a9f4528557ef8dcac216
parent: 0600437b71b3d3e334487e52707f95ab1b936f9a
author: Sanky <[email protected]>
date: Mon Jan 14 12:28:18 EST 2013

Fix crystal.scan_for_predefined_labels to work with current main.asm

--- a/extras/crystal.py
+++ b/extras/crystal.py
@@ -7872,9 +7872,14 @@
             abbreviation_next = "1"
 
         # calculate the start/stop line numbers for this bank
-        start_line_id = index(asm, lambda line: "\"bank" + abbreviation + "\"" in line)
+        for a in (abbreviation, abbreviation.lower()):
+            start_line_id = index(asm, lambda line: "\"bank" + a + "\"" in line)
+            if start_line_id != None: break
+        
         if bank_id != 0x7F:
-            end_line_id = index(asm, lambda line: "\"bank" + abbreviation_next + "\"" in line)
+            for a in (abbreviation_next, abbreviation_next.lower()):
+                end_line_id = index(asm, lambda line: "\"bank" + a + "\"" in line)
+                if end_line_id != None: break
             end_line_id += 1
         else:
             end_line_id = len(asm) - 1